[prev in list] [next in list] [prev in thread] [next in thread] 

List:       monetdb-checkins
Subject:    MonetDB: default - Updated inet.sql and inet.stable.*
From:       Martin van Dinther <commits () monetdb ! org>
Date:       2014-08-29 16:43:57
Message-ID: hg.6434dc618398.1409330637.6315528441665844383 () monetdb2 ! cwi-incubator ! nl
[Download RAW message or body]

Changeset: 6434dc618398 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6434dc618398
Modified Files:
	sql/test/pg_regress/Tests/inet.sql
	sql/test/pg_regress/Tests/inet.stable.err
	sql/test/pg_regress/Tests/inet.stable.out
	sql/test/pg_regress/postgresql2sql99.sh
Branch: default
Log Message:

Updated inet.sql and inet.stable.*
Added substitution rules to postgress2sql99.sh


diffs (truncated from 488 to 300 lines):

diff --git a/sql/test/pg_regress/Tests/inet.sql b/sql/test/pg_regress/Tests/inet.sql
--- a/sql/test/pg_regress/Tests/inet.sql
+++ b/sql/test/pg_regress/Tests/inet.sql
@@ -4,8 +4,7 @@
 
 -- prepare the table...
 
-DROP TABLE INET_TBL;
-CREATE TABLE INET_TBL (c cidr, i inet);
+CREATE TABLE INET_TBL (c inet, i inet);
 INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.226/24');
 INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.0/26', '192.168.1.226');
 INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.0/24');
@@ -27,8 +26,8 @@ INSERT INTO INET_TBL (c, i) VALUES ('::f
 INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.2/30', '192.168.1.226');
 INSERT INTO INET_TBL (c, i) VALUES ('1234::1234::1234', '::1.2.3.4');
 -- check that CIDR rejects invalid input when converting from text:
-INSERT INTO INET_TBL (c, i) VALUES (cidr('192.168.1.2/30'), '192.168.1.226');
-INSERT INTO INET_TBL (c, i) VALUES (cidr('ffff:ffff:ffff:ffff::/24'), '::192.168.1.226');
+INSERT INTO INET_TBL (c, i) VALUES (cast('192.168.1.2/30' as inet), '192.168.1.226');
+INSERT INTO INET_TBL (c, i) VALUES (cast('ffff:ffff:ffff:ffff::/24' as inet), '::192.168.1.226');
 SELECT '' AS ten, c AS cidr, i AS inet FROM INET_TBL;
 
 -- now test some support functions
@@ -49,19 +48,20 @@ SELECT '' AS six, c AS cidr, i AS inet F
   WHERE c = i;
 
 SELECT '' AS ten, i, c,
-  i < c AS lt, i <= c AS le, i = c AS eq, 
-  i >= c AS ge, i > c AS gt, i <> c AS ne,
-  i << c AS sb, i <<= c AS sbe,
-  i >> c AS sup, i >>= c AS spe
+  i < c AS lt, i <= c AS le, i = c AS eq
+  , i >= c AS ge, i > c AS gt, i <> c AS ne
+--  i << c AS sb, i <<= c AS sbe,
+--  i >> c AS sup, i >>= c AS spe
   FROM INET_TBL;
 
 -- check the conversion to/from text and set_netmask
 SELECT '' AS ten, set_masklen(inet(text(i)), 24) FROM INET_TBL;
 -- check that index works correctly
 CREATE INDEX inet_idx1 ON inet_tbl(i);
-SET enable_seqscan TO off;
-SELECT * FROM inet_tbl WHERE i<<'192.168.1.0/24'::cidr;
-SELECT * FROM inet_tbl WHERE i<<='192.168.1.0/24'::cidr;
-SET enable_seqscan TO on;
+/* SET enable_seqscan TO off; */
+SELECT * FROM inet_tbl WHERE i<<cast('192.168.1.0/24' as inet);
+SELECT * FROM inet_tbl WHERE i<<=cast('192.168.1.0/24' as inet);
+/* SET enable_seqscan TO on; */
 DROP INDEX inet_idx1;
 
+DROP TABLE INET_TBL;
diff --git a/sql/test/pg_regress/Tests/inet.stable.err b/sql/test/pg_regress/Tests/inet.stable.err
--- a/sql/test/pg_regress/Tests/inet.stable.err
+++ b/sql/test/pg_regress/Tests/inet.stable.err
@@ -29,35 +29,34 @@ stderr of test 'inet` in directory 'sql/
 # 17:11:19 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-1142" "--port=38959"
 # 17:11:19 >  
 
-#--
-#-- INET
-#--
-#-- prepare the table...
-MAPI = (monetdb) /var/tmp/mtest-12345/.s.monetdb.54321
-QUERY = DROP TABLE INET_TBL;
-ERROR = table "inet_tbl" does not exist
-#-- check that CIDR rejects invalid input:
-MAPI = (monetdb) /var/tmp/mtest-12345/.s.monetdb.54321
-QUERY = INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.2/30', '192.168.1.226');
-ERROR = invalid cidr value: "192.168.1.2/30"
-DETAIL:  Value has bits set to right of mask.
-MAPI = (monetdb) /var/tmp/mtest-12345/.s.monetdb.54321
-QUERY = INSERT INTO INET_TBL (c, i) VALUES ('1234::1234::1234', '::1.2.3.4');
-ERROR = invalid input syntax for type cidr: "1234::1234::1234"
-#-- check that CIDR rejects invalid input when converting from text:
-MAPI = (monetdb) /var/tmp/mtest-12345/.s.monetdb.54321
-QUERY = INSERT INTO INET_TBL (c, i) VALUES (cidr('192.168.1.2/30'), '192.168.1.226');
-ERROR = invalid cidr value: "192.168.1.2/30"
-DETAIL:  Value has bits set to right of mask.
-MAPI = (monetdb) /var/tmp/mtest-12345/.s.monetdb.54321
-QUERY = INSERT INTO INET_TBL (c, i) VALUES (cidr('ffff:ffff:ffff:ffff::/24'), '::192.168.1.226');
-ERROR = invalid cidr value: "ffff:ffff:ffff:ffff::/24"
-DETAIL:  Value has bits set to right of mask.
-#-- now test some support functions
-#-- check the conversion to/from text and set_netmask
-#-- check that index works correctly
+MAPI  = (monetdb) /var/tmp/mtest-2370/.s.monetdb.36728
+QUERY = SELECT '' AS ten, i AS inet, host(i), text(i), family(i) FROM INET_TBL;
 
-# 17:11:19 >  
-# 17:11:19 >  "Done."
-# 17:11:19 >  
+MAPI  = (monetdb) /var/tmp/mtest-2370/.s.monetdb.36728
+QUERY = SELECT '' AS six, c AS cidr, i AS inet FROM INET_TBL
+          WHERE c = i;
 
+        !program contains errors
+MAPI  = (monetdb) /var/tmp/mtest-2370/.s.monetdb.36728
+QUERY = SELECT '' AS ten, i, c,
+          i < c AS lt, i <= c AS le, i = c AS eq
+          , i >= c AS ge, i > c AS gt, i <> c AS ne
+        --  i << c AS sb, i <<= c AS sbe,
+        --  i >> c AS sup, i >>= c AS spe
+          FROM INET_TBL;
+
+        !program contains errors
+MAPI  = (monetdb) /var/tmp/mtest-2370/.s.monetdb.36728
+QUERY = SELECT '' AS ten, set_masklen(inet(text(i)), 24) FROM INET_TBL;
+
+MAPI  = (monetdb) /var/tmp/mtest-2370/.s.monetdb.36728
+QUERY = SELECT * FROM inet_tbl WHERE i<<cast('192.168.1.0/24' as inet);
+
+MAPI  = (monetdb) /var/tmp/mtest-2370/.s.monetdb.36728
+QUERY = SELECT * FROM inet_tbl WHERE i<<=cast('192.168.1.0/24' as inet);
+
+
+# 18:41:25 >  
+# 18:41:25 >  "Done."
+# 18:41:25 >  
+
diff --git a/sql/test/pg_regress/Tests/inet.stable.out b/sql/test/pg_regress/Tests/inet.stable.out
--- a/sql/test/pg_regress/Tests/inet.stable.out
+++ b/sql/test/pg_regress/Tests/inet.stable.out
@@ -31,7 +31,7 @@ Ready.
 #--
 #-- prepare the table...
 #
-#CREATE TABLE INET_TBL (c cidr, i inet);
+#CREATE TABLE INET_TBL (c inet, i inet);
 #INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.226/24');
 [ 1 ]
 #INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.0/26', '192.168.1.226');
@@ -66,226 +66,129 @@ Ready.
 [ 1 ]
 #INSERT INTO INET_TBL (c, i) VALUES ('::ffff:1.2.3.4', '::4.3.2.1/24');
 [ 1 ]
-#-- check that CIDR rejects invalid input:
-#
-#-- check that CIDR rejects invalid input when converting from text:
+#INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.2/30', '192.168.1.226');
+[ 1	]
+#INSERT INTO INET_TBL (c, i) VALUES ('1234::1234::1234', '::1.2.3.4');
+[ 1	]
+#INSERT INTO INET_TBL (c, i) VALUES (cast('192.168.1.2/30' as inet), '192.168.1.226');
+[ 1	]
+#INSERT INTO INET_TBL (c, i) VALUES (cast('ffff:ffff:ffff:ffff::/24' as inet), '::192.168.1.226');
+[ 1	]
 #SELECT '' AS ten, c AS cidr, i AS inet FROM INET_TBL;
-% sys.L0,	sys.L0,	sys.L0 # table_name
+% .L,	sys.L,	sys.L # table_name
 % ten,	cidr,	inet # name
-% ?,	?,	? # type
-% ?,	?,	? # length
-[ "",	"192.168.1.0/24",	"192.168.1.226/24" ]
-[ "",	"192.168.1.0/26",	"192.168.1.226" ]
-[ "",	"192.168.1.0/24",	"192.168.1.0/24" ]
-[ "",	"192.168.1.0/24",	"192.168.1.0/25" ]
-[ "",	"192.168.1.0/24",	"192.168.1.255/24" ]
-[ "",	"192.168.1.0/24",	"192.168.1.255/25" ]
-[ "",	"10.0.0.0/8",	"10.1.2.3/8" ]
-[ "",	"10.0.0.0/32",	"10.1.2.3/8" ]
-[ "",	"10.1.2.3/32",	"10.1.2.3" ]
-[ "",	"10.1.2.0/24",	"10.1.2.3/24" ]
-[ "",	"10.1.0.0/16",	"10.1.2.3/16" ]
-[ "",	"10.0.0.0/8",	"10.1.2.3/8" ]
-[ "",	"10.0.0.0/8",	"11.1.2.3/8" ]
-[ "",	"10.0.0.0/8",	"9.1.2.3/8" ]
-[ "",	"10:23::f1/128",	"10:23::f1/64" ]
-[ "",	"10:23::8000/113",	"10:23::ffff" ]
-[ "",	"::ffff:1.2.3.4/128",	"::4.3.2.1/24" ]
-
-#-- now test some support functions
-#SELECT '' AS ten, i AS inet, host(i), text(i), family(i) FROM INET_TBL;
-% sys.L0,	sys.L0,	sys.L0,	sys.L0,	sys.L0 # table_name
-% ten,	inet,	host,	text,	family # name
-% ?,	?,	?,	?,	? # type
-% ?,	?,	?,	?,	? # length
-[ "",	"192.168.1.226/24",	"192.168.1.226",	"192.168.1.226/24",	4 ]
-[ "",	"192.168.1.226",	"192.168.1.226",	"192.168.1.226/32",	4 ]
-[ "",	"192.168.1.0/24",	"192.168.1.0",	"192.168.1.0/24",	4 ]
-[ "",	"192.168.1.0/25",	"192.168.1.0",	"192.168.1.0/25",	4 ]
-[ "",	"192.168.1.255/24",	"192.168.1.255",	"192.168.1.255/24",	4 ]
-[ "",	"192.168.1.255/25",	"192.168.1.255",	"192.168.1.255/25",	4 ]
-[ "",	"10.1.2.3/8",	"10.1.2.3",	"10.1.2.3/8",	4 ]
-[ "",	"10.1.2.3/8",	"10.1.2.3",	"10.1.2.3/8",	4 ]
-[ "",	"10.1.2.3",	"10.1.2.3",	"10.1.2.3/32",	4 ]
-[ "",	"10.1.2.3/24",	"10.1.2.3",	"10.1.2.3/24",	4 ]
-[ "",	"10.1.2.3/16",	"10.1.2.3",	"10.1.2.3/16",	4 ]
-[ "",	"10.1.2.3/8",	"10.1.2.3",	"10.1.2.3/8",	4 ]
-[ "",	"11.1.2.3/8",	"11.1.2.3",	"11.1.2.3/8",	4 ]
-[ "",	"9.1.2.3/8",	"9.1.2.3",	"9.1.2.3/8",	4 ]
-[ "",	"10:23::f1/64",	"10:23::f1",	"10:23::f1/64",	6 ]
-[ "",	"10:23::ffff",	"10:23::ffff",	"10:23::ffff/128",	6 ]
-[ "",	"::4.3.2.1/24",	"::4.3.2.1",	"::4.3.2.1/24",	6 ]
-
+% char,	inet,	inet # type
+% 0,	0,	0 # length
+[ "",	(nil),	192.168.1.226/24	]
+[ "",	192.168.1.0/26,	192.168.1.226	]
+[ "",	(nil),	192.168.1.0/24	]
+[ "",	(nil),	192.168.1.0/25	]
+[ "",	(nil),	192.168.1.255/24	]
+[ "",	(nil),	192.168.1.255/25	]
+[ "",	(nil),	10.1.2.3/8	]
+[ "",	10.0.0.0,	10.1.2.3/8	]
+[ "",	10.1.2.3,	10.1.2.3	]
+[ "",	(nil),	10.1.2.3/24	]
+[ "",	(nil),	10.1.2.3/16	]
+[ "",	(nil),	10.1.2.3/8	]
+[ "",	(nil),	11.1.2.3/8	]
+[ "",	(nil),	9.1.2.3/8	]
+[ "",	(nil),	(nil)	]
+[ "",	(nil),	(nil)	]
+[ "",	(nil),	(nil)	]
+[ "",	192.168.1.2/30,	192.168.1.226	]
+[ "",	(nil),	(nil)	]
+[ "",	192.168.1.2/30,	192.168.1.226	]
+[ "",	(nil),	(nil)	]
 #SELECT '' AS ten, c AS cidr, broadcast(c),
 #  i AS inet, broadcast(i) FROM INET_TBL;
-% sys.L0,	sys.L0,	sys.L0,	sys.L0,	sys.L0 # table_name
-% ten,	cidr,	broadcast,	inet,	broadcast # name
-% ?,	?,	?,	?,	? # type
-% ?,	?,	?,	?,	? # length
-[ "",	"192.168.1.0/24",	"192.168.1.255/24",	"192.168.1.226/24",	"192.168.1.255/24" ]
-[ "",	"192.168.1.0/26",	"192.168.1.63/26",	"192.168.1.226",	"192.168.1.226" ]
-[ "",	"192.168.1.0/24",	"192.168.1.255/24",	"192.168.1.0/24",	"192.168.1.255/24" ]
-[ "",	"192.168.1.0/24",	"192.168.1.255/24",	"192.168.1.0/25",	"192.168.1.127/25" ]
-[ "",	"192.168.1.0/24",	"192.168.1.255/24",	"192.168.1.255/24",	"192.168.1.255/24" ]
-[ "",	"192.168.1.0/24",	"192.168.1.255/24",	"192.168.1.255/25",	"192.168.1.255/25" ]
-[ "",	"10.0.0.0/8",	"10.255.255.255/8",	"10.1.2.3/8",	"10.255.255.255/8" ]
-[ "",	"10.0.0.0/32",	"10.0.0.0",	"10.1.2.3/8",	"10.255.255.255/8" ]
-[ "",	"10.1.2.3/32",	"10.1.2.3",	"10.1.2.3",	"10.1.2.3" ]
-[ "",	"10.1.2.0/24",	"10.1.2.255/24",	"10.1.2.3/24",	"10.1.2.255/24" ]
-[ "",	"10.1.0.0/16",	"10.1.255.255/16",	"10.1.2.3/16",	"10.1.255.255/16" ]
-[ "",	"10.0.0.0/8",	"10.255.255.255/8",	"10.1.2.3/8",	"10.255.255.255/8" ]
-[ "",	"10.0.0.0/8",	"10.255.255.255/8",	"11.1.2.3/8",	"11.255.255.255/8" ]
-[ "",	"10.0.0.0/8",	"10.255.255.255/8",	"9.1.2.3/8",	"9.255.255.255/8" ]
-[ "",	"10:23::f1/128",	"10:23::f1",	"10:23::f1/64",	"10:23::ffff:ffff:ffff:ffff/64" ]
-[ "",	"10:23::8000/113",	"10:23::ffff/113",	"10:23::ffff",	"10:23::ffff" ]
-[ "",	"::ffff:1.2.3.4/128",	"::ffff:1.2.3.4",	"::4.3.2.1/24",	"0:ff:ffff:ffff:ffff:ffff:ffff:ffff/24" ]
-
+% .L,	sys.L,	sys.L1,	sys.L1,	sys.L1 # table_name
+% ten,	cidr,	L1,	inet,	broadcast_i # name
+% char,	inet,	inet,	inet,	inet # type
+% 0,	0,	0,	0,	0 # length
+[ "",	(nil),	(nil),	192.168.1.226/24,	192.168.1.255/24	]
+[ "",	192.168.1.0/26,	192.168.1.63/26,	192.168.1.226,	192.168.1.226	]
+[ "",	(nil),	(nil),	192.168.1.0/24,	192.168.1.255/24	]
+[ "",	(nil),	(nil),	192.168.1.0/25,	192.168.1.127/25	]
+[ "",	(nil),	(nil),	192.168.1.255/24,	192.168.1.255/24	]
+[ "",	(nil),	(nil),	192.168.1.255/25,	192.168.1.255/25	]
+[ "",	(nil),	(nil),	10.1.2.3/8,	10.255.255.255/8	]
+[ "",	10.0.0.0,	10.0.0.0,	10.1.2.3/8,	10.255.255.255/8	]
+[ "",	10.1.2.3,	10.1.2.3,	10.1.2.3,	10.1.2.3	]
+[ "",	(nil),	(nil),	10.1.2.3/24,	10.1.2.255/24	]
+[ "",	(nil),	(nil),	10.1.2.3/16,	10.1.255.255/16	]
+[ "",	(nil),	(nil),	10.1.2.3/8,	10.255.255.255/8	]
+[ "",	(nil),	(nil),	11.1.2.3/8,	11.255.255.255/8	]
+[ "",	(nil),	(nil),	9.1.2.3/8,	9.255.255.255/8	]
+[ "",	(nil),	(nil),	(nil),	(nil)	]
+[ "",	(nil),	(nil),	(nil),	(nil)	]
+[ "",	(nil),	(nil),	(nil),	(nil)	]
+[ "",	192.168.1.2/30,	192.168.1.3/30,	192.168.1.226,	192.168.1.226	]
+[ "",	(nil),	(nil),	(nil),	(nil)	]
+[ "",	192.168.1.2/30,	192.168.1.3/30,	192.168.1.226,	192.168.1.226	]
+[ "",	(nil),	(nil),	(nil),	(nil)	]
 #SELECT '' AS ten, c AS cidr, network(c) AS "network(cidr)",
 #  i AS inet, network(i) AS "network(inet)" FROM INET_TBL;
-% sys.L0,	sys.L0,	sys.L0,	sys.L0,	sys.L0 # table_name
+% .L,	sys.L,	sys.L,	sys.L,	sys.L # table_name
 % ten,	cidr,	network(cidr),	inet,	network(inet) # name
-% ?,	?,	?,	?,	? # type
-% ?,	?,	?,	?,	? # length
-[ "",	"192.168.1.0/24",	"192.168.1.0/24",	"192.168.1.226/24",	"192.168.1.0/24" ]
-[ "",	"192.168.1.0/26",	"192.168.1.0/26",	"192.168.1.226",	"192.168.1.226/32" ]
-[ "",	"192.168.1.0/24",	"192.168.1.0/24",	"192.168.1.0/24",	"192.168.1.0/24" ]
-[ "",	"192.168.1.0/24",	"192.168.1.0/24",	"192.168.1.0/25",	"192.168.1.0/25" ]
-[ "",	"192.168.1.0/24",	"192.168.1.0/24",	"192.168.1.255/24",	"192.168.1.0/24" ]
-[ "",	"192.168.1.0/24",	"192.168.1.0/24",	"192.168.1.255/25",	"192.168.1.128/25" ]
-[ "",	"10.0.0.0/8",	"10.0.0.0/8",	"10.1.2.3/8",	"10.0.0.0/8" ]
-[ "",	"10.0.0.0/32",	"10.0.0.0/32",	"10.1.2.3/8",	"10.0.0.0/8" ]
-[ "",	"10.1.2.3/32",	"10.1.2.3/32",	"10.1.2.3",	"10.1.2.3/32" ]
-[ "",	"10.1.2.0/24",	"10.1.2.0/24",	"10.1.2.3/24",	"10.1.2.0/24" ]
-[ "",	"10.1.0.0/16",	"10.1.0.0/16",	"10.1.2.3/16",	"10.1.0.0/16" ]
-[ "",	"10.0.0.0/8",	"10.0.0.0/8",	"10.1.2.3/8",	"10.0.0.0/8" ]
-[ "",	"10.0.0.0/8",	"10.0.0.0/8",	"11.1.2.3/8",	"11.0.0.0/8" ]
-[ "",	"10.0.0.0/8",	"10.0.0.0/8",	"9.1.2.3/8",	"9.0.0.0/8" ]
-[ "",	"10:23::f1/128",	"10:23::f1/128",	"10:23::f1/64",	"10:23::/64" ]
-[ "",	"10:23::8000/113",	"10:23::8000/113",	"10:23::ffff",	"10:23::ffff/128" ]
-[ "",	"::ffff:1.2.3.4/128",	"::ffff:1.2.3.4/128",	"::4.3.2.1/24",	"::/24" ]
-
+% char,	inet,	inet,	inet,	inet # type
+% 0,	0,	0,	0,	0 # length
+[ "",	(nil),	(nil),	192.168.1.226/24,	192.168.1.0/24	]
+[ "",	192.168.1.0/26,	192.168.1.0/26,	192.168.1.226,	192.168.1.226	]
+[ "",	(nil),	(nil),	192.168.1.0/24,	192.168.1.0/24	]
+[ "",	(nil),	(nil),	192.168.1.0/25,	192.168.1.0/25	]
+[ "",	(nil),	(nil),	192.168.1.255/24,	192.168.1.0/24	]
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic