Changeset: 7b1fd1606a60 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7b1fd1606a60
Modified Files:
        sql/test/pg_regress/Tests/oid.sql
        sql/test/pg_regress/Tests/oid.stable.err
        sql/test/pg_regress/Tests/oid.stable.out
Branch: default
Log Message:

Extended oid tests and approved output


diffs (truncated from 385 to 300 lines):

diff --git a/sql/test/pg_regress/Tests/oid.sql 
b/sql/test/pg_regress/Tests/oid.sql
--- a/sql/test/pg_regress/Tests/oid.sql
+++ b/sql/test/pg_regress/Tests/oid.sql
@@ -5,42 +5,54 @@
 CREATE TABLE OID_TBL(f1 oid);
 
 INSERT INTO OID_TBL(f1) VALUES ('1234');
-INSERT INTO OID_TBL(f1) VALUES ('1235');
+INSERT INTO OID_TBL(f1) VALUES (1235);
 INSERT INTO OID_TBL(f1) VALUES ('987');
-INSERT INTO OID_TBL(f1) VALUES ('-1040');   -- negative oids are not allowed 
in MonetDB, so this should fail
-INSERT INTO OID_TBL(f1) VALUES ('99999999');
+INSERT INTO OID_TBL(f1) VALUES (12345678901);
+INSERT INTO OID_TBL(f1) VALUES ('000');
+INSERT INTO OID_TBL(f1) VALUES ('    ');  -- in MonetDB this one is accepted
+-- leading/trailing hard tab is also allowed
 INSERT INTO OID_TBL(f1) VALUES ('5     ');
 INSERT INTO OID_TBL(f1) VALUES ('   10  ');
--- leading/trailing hard tab is also allowed
 INSERT INTO OID_TBL(f1) VALUES ('        15      ');
+INSERT INTO OID_TBL(f1) VALUES (null);
 
-SELECT '' AS seven, OID_TBL.* FROM OID_TBL;
+SELECT '' AS nine, OID_TBL.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL;
 
--- bad inputs 
-
+-- bad inputs
 INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
 INSERT INTO OID_TBL(f1) VALUES ('99asdfasd');
 INSERT INTO OID_TBL(f1) VALUES ('5    d');
 INSERT INTO OID_TBL(f1) VALUES ('    5d');
 INSERT INTO OID_TBL(f1) VALUES ('5    5');
-INSERT INTO OID_TBL(f1) VALUES ('    ');  -- in MonetDB this one is accepted
+INSERT INTO OID_TBL(f1) VALUES (-1040);   -- negative oids are not allowed in 
MonetDB, so this should fail
+INSERT INTO OID_TBL(f1) VALUES ('-1040');   -- negative oids are not allowed 
in MonetDB, so this should fail
 INSERT INTO OID_TBL(f1) VALUES (' - 500');
+INSERT INTO OID_TBL(f1) VALUES (12345678901);
 INSERT INTO OID_TBL(f1) VALUES ('32958209582039852935');
+INSERT INTO OID_TBL(f1) VALUES (32958209582039852935);
 INSERT INTO OID_TBL(f1) VALUES ('-23582358720398502385');
+INSERT INTO OID_TBL(f1) VALUES (-23582358720398502385);
 
-DELETE FROM OID_TBL WHERE f1 = '    ';
-SELECT '' AS seven, OID_TBL.* FROM OID_TBL;
+SELECT '' AS nine, OID_TBL.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL 
ORDER BY f1;
 
-SELECT '' AS one, o.* FROM OID_TBL o WHERE o.f1 = 1234;
+DELETE FROM OID_TBL WHERE f1 = -1040;
 
-SELECT '' AS six, o.* FROM OID_TBL o WHERE o.f1 <> '1234';
+SELECT '' AS one, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o WHERE 
o.f1 = 1234;
+SELECT '' AS one, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o WHERE 
o.f1 = '1234';
 
-SELECT '' AS five, o.* FROM OID_TBL o WHERE o.f1 <= '1234';
+SELECT '' AS seven, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o 
WHERE o.f1 <> 1234;
+SELECT '' AS seven, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o 
WHERE o.f1 <> '1234';
 
-SELECT '' AS four, o.* FROM OID_TBL o WHERE o.f1 < '1234';
+SELECT '' AS six, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o WHERE 
o.f1 <= 1234;
+SELECT '' AS six, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o WHERE 
o.f1 <= '1234';
 
-SELECT '' AS three, o.* FROM OID_TBL o WHERE o.f1 >= '1234';
+SELECT '' AS five, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o 
WHERE o.f1 < 1234;
+SELECT '' AS five, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o 
WHERE o.f1 < '1234';
 
-SELECT '' AS two, o.* FROM OID_TBL o WHERE o.f1 > '1234';
+SELECT '' AS three, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o 
WHERE o.f1 >= 1234;
+SELECT '' AS three, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o 
WHERE o.f1 >= '1234';
+
+SELECT '' AS two, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o WHERE 
o.f1 > 1234;
+SELECT '' AS two, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o WHERE 
o.f1 > '1234';
 
 DROP TABLE OID_TBL;
diff --git a/sql/test/pg_regress/Tests/oid.stable.err 
b/sql/test/pg_regress/Tests/oid.stable.err
--- a/sql/test/pg_regress/Tests/oid.stable.err
+++ b/sql/test/pg_regress/Tests/oid.stable.err
@@ -25,46 +25,50 @@ stderr of test 'oid` in directory 'sql/t
 # cmdline opt  mal_listing = 0
 # cmdline opt  gdk_debug = 536870922
 
-# 11:47:28 >  
-# 11:47:28 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-25307" "--port=34790"
-# 11:47:28 >  
+# 15:18:43 >  
+# 15:18:43 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-7372" "--port=31804"
+# 15:18:43 >  
 
-MAPI  = (monetdb) /var/tmp/mtest-29915/.s.monetdb.37487
+MAPI  = (monetdb) /var/tmp/mtest-7617/.s.monetdb.39655
+QUERY = INSERT INTO OID_TBL(f1) VALUES (12345678901);
+ERROR = !EXEC: wrong type for argument 1 of prepared statement: bigint, 
expected oid
+MAPI  = (monetdb) /var/tmp/mtest-7617/.s.monetdb.39655
+QUERY = INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
+ERROR = !conversion of string 'asdfasd' to type oid failed.
+MAPI  = (monetdb) /var/tmp/mtest-7617/.s.monetdb.39655
+QUERY = INSERT INTO OID_TBL(f1) VALUES ('99asdfasd');
+ERROR = !conversion of string '99asdfasd' to type oid failed.
+MAPI  = (monetdb) /var/tmp/mtest-7617/.s.monetdb.39655
+QUERY = INSERT INTO OID_TBL(f1) VALUES ('5    d');
+ERROR = !conversion of string '5    d' to type oid failed.
+MAPI  = (monetdb) /var/tmp/mtest-7617/.s.monetdb.39655
+QUERY = INSERT INTO OID_TBL(f1) VALUES ('    5d');
+ERROR = !conversion of string '    5d' to type oid failed.
+MAPI  = (monetdb) /var/tmp/mtest-7617/.s.monetdb.39655
+QUERY = INSERT INTO OID_TBL(f1) VALUES ('5    5');
+ERROR = !conversion of string '5    5' to type oid failed.
+MAPI  = (monetdb) /var/tmp/mtest-7617/.s.monetdb.39655
 QUERY = INSERT INTO OID_TBL(f1) VALUES ('-1040');   -- negative oids are not 
allowed in MonetDB, so this should fail
 ERROR = !conversion of string '-1040' to type oid failed.
-MAPI  = (monetdb) /var/tmp/mtest-29915/.s.monetdb.37487
-QUERY = INSERT INTO OID_TBL(f1) VALUES ('asdfasd');
-ERROR = !conversion of string 'asdfasd' to type oid failed.
-MAPI  = (monetdb) /var/tmp/mtest-29915/.s.monetdb.37487
-QUERY = INSERT INTO OID_TBL(f1) VALUES ('99asdfasd');
-ERROR = !conversion of string '99asdfasd' to type oid failed.
-MAPI  = (monetdb) /var/tmp/mtest-29915/.s.monetdb.37487
-QUERY = INSERT INTO OID_TBL(f1) VALUES ('5    d');
-ERROR = !conversion of string '5    d' to type oid failed.
-MAPI  = (monetdb) /var/tmp/mtest-29915/.s.monetdb.37487
-QUERY = INSERT INTO OID_TBL(f1) VALUES ('    5d');
-ERROR = !conversion of string '    5d' to type oid failed.
-MAPI  = (monetdb) /var/tmp/mtest-29915/.s.monetdb.37487
-QUERY = INSERT INTO OID_TBL(f1) VALUES ('5    5');
-ERROR = !conversion of string '5    5' to type oid failed.
-MAPI  = (monetdb) /var/tmp/mtest-29915/.s.monetdb.37487
+MAPI  = (monetdb) /var/tmp/mtest-7617/.s.monetdb.39655
 QUERY = INSERT INTO OID_TBL(f1) VALUES (' - 500');
 ERROR = !conversion of string ' - 500' to type oid failed.
-MAPI  = (monetdb) /var/tmp/mtest-29915/.s.monetdb.37487
+MAPI  = (monetdb) /var/tmp/mtest-7617/.s.monetdb.39655
 QUERY = INSERT INTO OID_TBL(f1) VALUES ('32958209582039852935');
 ERROR = !conversion of string '32958209582039852935' to type oid failed.
-MAPI  = (monetdb) /var/tmp/mtest-29915/.s.monetdb.37487
+MAPI  = (monetdb) /var/tmp/mtest-7617/.s.monetdb.39655
+QUERY = INSERT INTO OID_TBL(f1) VALUES (32958209582039852935);
+ERROR = !overflow in conversion of 32958209582039851008 to lng.
+MAPI  = (monetdb) /var/tmp/mtest-7617/.s.monetdb.39655
 QUERY = INSERT INTO OID_TBL(f1) VALUES ('-23582358720398502385');
 ERROR = !conversion of string '-23582358720398502385' to type oid failed.
+MAPI  = (monetdb) /var/tmp/mtest-7617/.s.monetdb.39655
+QUERY = INSERT INTO OID_TBL(f1) VALUES (-23582358720398502385);
+ERROR = !overflow in conversion of -23582358720398503936 to lng.
 
 
 
+# 15:18:43 >  
+# 15:18:43 >  "Done."
+# 15:18:43 >  
 
-
-
-
-
-# 17:11:19 >  
-# 17:11:19 >  "Done."
-# 17:11:19 >  
-
diff --git a/sql/test/pg_regress/Tests/oid.stable.out 
b/sql/test/pg_regress/Tests/oid.stable.out
--- a/sql/test/pg_regress/Tests/oid.stable.out
+++ b/sql/test/pg_regress/Tests/oid.stable.out
@@ -34,7 +34,9 @@ Ready.
 [ 1 ]
 #INSERT INTO OID_TBL(f1) VALUES ('987');
 [ 1 ]
-#INSERT INTO OID_TBL(f1) VALUES ('99999999');
+#INSERT INTO OID_TBL(f1) VALUES ('000');
+[ 1    ]
+#INSERT INTO OID_TBL(f1) VALUES ('    ');  -- in MonetDB this one is accepted
 [ 1 ]
 #INSERT INTO OID_TBL(f1) VALUES ('5     ');
 [ 1 ]
@@ -42,85 +44,134 @@ Ready.
 [ 1    ]
 #INSERT INTO OID_TBL(f1) VALUES ('       15      ');
 [ 1    ]
-#SELECT '' AS seven, OID_TBL.* FROM OID_TBL;
-% .L,  sys.oid_tbl # table_name
-% seven,       f1 # name
-% char,        oid # type
-% 0,   10 # length
-[ "",  1234@0  ]
-[ "",  1235@0  ]
-[ "",  987@0   ]
-[ "",  99999999@0      ]
-[ "",  5@0     ]
-[ "",  10@0    ]
-[ "",  15@0    ]
-#INSERT INTO OID_TBL(f1) VALUES ('    ');  -- in MonetDB this one is accepted
+#INSERT INTO OID_TBL(f1) VALUES (null);
+[ 1 ]
+#SELECT '' AS nine, OID_TBL.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL;
+% .L,  sys.oid_tbl,    sys.L1 # table_name
+% nine,        f1,     oid2str # name
+% char,        oid,    varchar # type
+% 0,   6,      6 # length
+[ "",  1234@0, "1234@0"        ]
+[ "",  1235@0, "1235@0"        ]
+[ "",  987@0,  "987@0" ]
+[ "",  0@0,    "0@0"   ]
+[ "",  NULL,   NULL    ]
+[ "",  5@0,    "5@0"   ]
+[ "",  10@0,   "10@0"  ]
+[ "",  15@0,   "15@0"  ]
+[ "",  NULL,   NULL    ]
+#INSERT INTO OID_TBL(f1) VALUES (-1040);   -- negative oids are not allowed in 
MonetDB, so this should fail
 [ 1    ]
-#DELETE FROM OID_TBL WHERE f1 = '    ';
-[ 1 ]
-#SELECT '' AS six, OID_TBL.* FROM OID_TBL;
-% .L,  sys.oid_tbl # table_name
-% seven,       f1 # name
-% char,        oid # type
-% 0,   10 # length
-[ "",  1234@0  ]
-[ "",  1235@0  ]
-[ "",  987@0   ]
-[ "",  99999999@0      ]
-[ "",  5@0     ]
-[ "",  10@0    ]
-[ "",  15@0    ]
-#SELECT '' AS one, o.* FROM OID_TBL o WHERE o.f1 = 1234;
-% .L,  sys.o # table_name
-% one, f1 # name
-% char,        oid # type
-% 0,   6 # length
-[ "",  1234@0  ]
-#SELECT '' AS five, o.* FROM OID_TBL o WHERE o.f1 <> '1234';
-% .L,  sys.o # table_name
-% six, f1 # name
-% char,        oid # type
-% 0,   10 # length
-[ "",  1235@0  ]
-[ "",  987@0   ]
-[ "",  99999999@0      ]
-[ "",  5@0     ]
-[ "",  10@0    ]
-[ "",  15@0    ]
-#SELECT '' AS three, o.* FROM OID_TBL o WHERE o.f1 <= '1234';
-% .L,  sys.o # table_name
-% five,        f1 # name
-% char,        oid # type
-% 0,   6 # length
-[ "",  1234@0  ]
-[ "",  987@0   ]
-[ "",  5@0     ]
-[ "",  10@0    ]
-[ "",  15@0    ]
-#SELECT '' AS two, o.* FROM OID_TBL o WHERE o.f1 < '1234';
-% .L,  sys.o # table_name
-% four,        f1 # name
-% char,        oid # type
-% 0,   5 # length
-[ "",  987@0   ]
-[ "",  5@0     ]
-[ "",  10@0    ]
-[ "",  15@0    ]
-#SELECT '' AS four, o.* FROM OID_TBL o WHERE o.f1 >= '1234';
-% .L,  sys.o # table_name
-% three,       f1 # name
-% char,        oid # type
-% 0,   10 # length
-[ "",  1234@0  ]
-[ "",  1235@0  ]
-[ "",  99999999@0      ]
-#SELECT '' AS three, o.* FROM OID_TBL o WHERE o.f1 > '1234';
-% .L,  sys.o # table_name
-% two, f1 # name
-% char,        oid # type
-% 0,   10 # length
-[ "",  1235@0  ]
-[ "",  99999999@0      ]
+#INSERT INTO OID_TBL(f1) VALUES (12345678901);
+[ 1    ]
+#SELECT '' AS nine, OID_TBL.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL 
ORDER BY        f1;
+% .L,  sys.oid_tbl,    sys.L1 # table_name
+% nine,        f1,     oid2str # name
+% char,        oid,    varchar # type
+% 0,   13,     22 # length
+[ "",  NULL,   NULL    ]
+[ "",  NULL,   NULL    ]
+[ "",  18446744073709550576@0, "18446744073709550576@0"        ]
+[ "",  0@0,    "0@0"   ]
+[ "",  5@0,    "5@0"   ]
+[ "",  10@0,   "10@0"  ]
+[ "",  15@0,   "15@0"  ]
+[ "",  987@0,  "987@0" ]
+[ "",  1234@0, "1234@0"        ]
+[ "",  1235@0, "1235@0"        ]
+[ "",  12345678901@0,  "12345678901@0" ]
+#DELETE FROM OID_TBL WHERE f1 = -1040;
+[ 1    ]
+#SELECT '' AS one, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o 
WHERE o.f1 = 1234;
+% .L,  sys.o,  sys.L1 # table_name
+% one, f1,     oid2str # name
+% char,        oid,    varchar # type
+% 0,   6,      6 # length
+[ "",  1234@0, "1234@0"        ]
+#SELECT '' AS one, o.*, cast(f1 as varchar(30)) as oid2str FROM OID_TBL o 
WHERE o.f1 = '1234';
+% .L,  sys.o,  sys.L1 # table_name
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to