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

Corrected casting syntax error in numerology test
Added missing tables and data


diffs (truncated from 404 to 300 lines):

diff --git a/sql/test/pg_regress/Tests/numerology.sql 
b/sql/test/pg_regress/Tests/numerology.sql
--- a/sql/test/pg_regress/Tests/numerology.sql
+++ b/sql/test/pg_regress/Tests/numerology.sql
@@ -9,6 +9,28 @@
 --  so let's try explicit conversions for now - tgl 97/05/07
 --
 
+CREATE TABLE INT2_TBL(f1 smallint);
+INSERT INTO INT2_TBL(f1) VALUES ('0   ');
+INSERT INTO INT2_TBL(f1) VALUES ('  1234 ');
+INSERT INTO INT2_TBL(f1) VALUES ('    -1234');
+INSERT INTO INT2_TBL(f1) VALUES ('32767');
+INSERT INTO INT2_TBL(f1) VALUES ('-32767');
+
+CREATE TABLE INT4_TBL(f1 integer);
+INSERT INTO INT4_TBL(f1) VALUES ('   0  ');
+INSERT INTO INT4_TBL(f1) VALUES ('123456     ');
+INSERT INTO INT4_TBL(f1) VALUES ('    -123456');
+INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
+INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
+
+CREATE TABLE FLOAT8_TBL(f1 double);
+INSERT INTO FLOAT8_TBL(f1) VALUES ('    0.0   ');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30  ');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('   -34.84');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
+
+
 CREATE TABLE TEMP_FLOAT (f1 double);
 
 INSERT INTO TEMP_FLOAT (f1)
@@ -25,11 +47,11 @@ SELECT '' AS ten, f1 FROM TEMP_FLOAT
 CREATE TABLE TEMP_INT4 (f1 integer);
 
 INSERT INTO TEMP_INT4 (f1)
-  SELECT integer(f1) FROM FLOAT8_TBL
+  SELECT cast(f1 as integer) FROM FLOAT8_TBL
   WHERE (f1 > -2147483647) AND (f1 < 2147483647);
 
 INSERT INTO TEMP_INT4 (f1)
-  SELECT integer(f1) FROM INT2_TBL;
+  SELECT cast(f1 as integer) FROM INT2_TBL;
 
 SELECT '' AS nine, f1 FROM TEMP_INT4
   ORDER BY f1;
@@ -39,11 +61,11 @@ SELECT '' AS nine, f1 FROM TEMP_INT4
 CREATE TABLE TEMP_INT2 (f1 smallint);
 
 INSERT INTO TEMP_INT2 (f1)
-  SELECT smallint(f1) FROM FLOAT8_TBL
+  SELECT cast(f1 as smallint) FROM FLOAT8_TBL
   WHERE (f1 >= -32767) AND (f1 <= 32767);
 
 INSERT INTO TEMP_INT2 (f1)
-  SELECT smallint(f1) FROM INT4_TBL
+  SELECT cast(f1 as smallint) FROM INT4_TBL
   WHERE (f1 >= -32767) AND (f1 <= 32767);
 
 SELECT '' AS five, f1 FROM TEMP_INT2
@@ -97,3 +119,7 @@ DROP TABLE TEMP_FLOAT;
 
 DROP TABLE TEMP_GROUP;
 
+
+DROP TABLE FLOAT8_TBL;
+DROP TABLE INT4_TBL;
+DROP TABLE INT2_TBL;
diff --git a/sql/test/pg_regress/Tests/numerology.stable.err 
b/sql/test/pg_regress/Tests/numerology.stable.err
--- a/sql/test/pg_regress/Tests/numerology.stable.err
+++ b/sql/test/pg_regress/Tests/numerology.stable.err
@@ -29,24 +29,8 @@ stderr of test 'numerology` in directory
 # 17:11:19 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-1142" "--port=38959"
 # 17:11:19 >  
 
-#--
-#-- NUMEROLOGY
-#-- Test various combinations of numeric types and functions.
-#--
-#--
-#-- Test implicit type conversions
-#-- This fails for Postgres v6.1 (and earlier?)
-#--  so let's try explicit conversions for now - tgl 97/05/07
-#--
-#-- integer
-#-- smallint
-#--
-#-- Group-by combinations
-#--
-#-- GROUP BY a result column name is not legal per SQL92, but we accept it
-#-- anyway (if the name is not the name of any column exposed by FROM).
 
-# 17:11:19 >  
-# 17:11:19 >  "Done."
-# 17:11:19 >  
+# 17:21:41 >  
+# 17:21:41 >  "Done."
+# 17:21:41 >  
 
diff --git a/sql/test/pg_regress/Tests/numerology.stable.out 
b/sql/test/pg_regress/Tests/numerology.stable.out
--- a/sql/test/pg_regress/Tests/numerology.stable.out
+++ b/sql/test/pg_regress/Tests/numerology.stable.out
@@ -19,161 +19,200 @@ stdout of test 'numerology` in directory
 # MonetDB/SQL module loaded
 
 Ready.
+# SQL catalog created, loading sql scripts once
+# loading sql script: 09_like.sql
+# loading sql script: 10_math.sql
+# loading sql script: 11_times.sql
+# loading sql script: 12_url.sql
+# loading sql script: 13_date.sql
+# loading sql script: 14_inet.sql
+# loading sql script: 15_querylog.sql
+# loading sql script: 16_tracelog.sql
+# loading sql script: 19_cluster.sql
+# loading sql script: 20_vacuum.sql
+# loading sql script: 21_dependency_functions.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 24_zorder.sql
+# loading sql script: 25_debug.sql
+# loading sql script: 26_sysmon.sql
+# loading sql script: 39_analytics.sql
+# loading sql script: 39_analytics_hge.sql
+# loading sql script: 40_geom.sql
+# loading sql script: 40_json.sql
+# loading sql script: 40_json_hge.sql
+# loading sql script: 41_jsonstore.sql
+# loading sql script: 45_uuid.sql
+# loading sql script: 46_gsl.sql
+# loading sql script: 75_storagemodel.sql
+# loading sql script: 80_statistics.sql
+# loading sql script: 80_udf.sql
+# loading sql script: 80_udf_hge.sql
+# loading sql script: 89_generator_hge.sql
+# loading sql script: 90_generator.sql
+# loading sql script: 99_system.sql
 
-# 17:11:19 >  
-# 17:11:19 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-1142" "--port=38959"
-# 17:11:19 >  
+# 17:21:41 >  
+# 17:21:41 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-27184" "--port=30823"
+# 17:21:41 >  
 
-= ! Correct / expected output still needs to be provided / verified / approved 
! =
-
-#--
-#-- NUMEROLOGY
-#-- Test various combinations of numeric types and functions.
-#--
-#--
-#-- Test implicit type conversions
-#-- This fails for Postgres v6.1 (and earlier?)
-#--  so let's try explicit conversions for now - tgl 97/05/07
-#--
+#CREATE TABLE INT2_TBL(f1 smallint);
+#INSERT INTO INT2_TBL(f1) VALUES ('0   ');
+[ 1    ]
+#INSERT INTO INT2_TBL(f1) VALUES ('  1234 ');
+[ 1    ]
+#INSERT INTO INT2_TBL(f1) VALUES ('    -1234');
+[ 1    ]
+#INSERT INTO INT2_TBL(f1) VALUES ('32767');
+[ 1    ]
+#INSERT INTO INT2_TBL(f1) VALUES ('-32767');
+[ 1    ]
+#CREATE TABLE INT4_TBL(f1 integer);
+#INSERT INTO INT4_TBL(f1) VALUES ('   0  ');
+[ 1    ]
+#INSERT INTO INT4_TBL(f1) VALUES ('123456     ');
+[ 1    ]
+#INSERT INTO INT4_TBL(f1) VALUES ('    -123456');
+[ 1    ]
+#INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
+[ 1    ]
+#INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
+[ 1    ]
+#CREATE TABLE FLOAT8_TBL(f1 double);
+#INSERT INTO FLOAT8_TBL(f1) VALUES ('    0.0   ');
+[ 1    ]
+#INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30  ');
+[ 1    ]
+#INSERT INTO FLOAT8_TBL(f1) VALUES ('   -34.84');
+[ 1    ]
+#INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
+[ 1    ]
+#INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
+[ 1    ]
 #CREATE TABLE TEMP_FLOAT (f1 double);
 #INSERT INTO TEMP_FLOAT (f1)
-#  SELECT double(f1) FROM INT4_TBL;
-[ 1 ]
+#  SELECT cast(f1 as double) FROM INT4_TBL;
+[ 5    ]
 #INSERT INTO TEMP_FLOAT (f1)
-#  SELECT double(f1) FROM INT2_TBL;
-[ 1 ]
+#  SELECT cast(f1 as double) FROM INT2_TBL;
+[ 5    ]
 #SELECT '' AS ten, f1 FROM TEMP_FLOAT
 #  ORDER BY f1;
-% sys.L0,      sys.L0 # table_name
+% .L,  sys.temp_float # table_name
 % ten, f1 # name
-% ?,   ? # type
-% ?,   ? # length
-[ "",  -2147483647 ]
-[ "",  -123456 ]
-[ "",  -32767 ]
-[ "",  -1234 ]
-[ "",  0 ]
-[ "",  0 ]
-[ "",  1234 ]
-[ "",  32767 ]
-[ "",  123456 ]
-[ "",  2147483647 ]
-
-#-- integer
+% char,        double # type
+% 0,   24 # length
+[ "",  -2147483647     ]
+[ "",  -123456 ]
+[ "",  -32767  ]
+[ "",  -1234   ]
+[ "",  0       ]
+[ "",  0       ]
+[ "",  1234    ]
+[ "",  32767   ]
+[ "",  123456  ]
+[ "",  2147483647      ]
 #CREATE TABLE TEMP_INT4 (f1 integer);
 #INSERT INTO TEMP_INT4 (f1)
-#  SELECT integer(f1) FROM FLOAT8_TBL
+#  SELECT cast(f1 as integer) FROM FLOAT8_TBL
 #  WHERE (f1 > -2147483647) AND (f1 < 2147483647);
-[ 1 ]
+[ 4    ]
 #INSERT INTO TEMP_INT4 (f1)
-#  SELECT integer(f1) FROM INT2_TBL;
-[ 1 ]
+#  SELECT cast(f1 as integer) FROM INT2_TBL;
+[ 5    ]
 #SELECT '' AS nine, f1 FROM TEMP_INT4
 #  ORDER BY f1;
-% sys.L0,      sys.L0 # table_name
+% .L,  sys.temp_int4 # table_name
 % nine,        f1 # name
-% ?,   ? # type
-% ?,   ? # length
-[ "",  -32767 ]
-[ "",  -1234 ]
-[ "",  -1004 ]
-[ "",  -35 ]
-[ "",  0 ]
-[ "",  0 ]
-[ "",  0 ]
-[ "",  1234 ]
-[ "",  32767 ]
-
-#-- smallint
+% char,        int # type
+% 0,   6 # length
+[ "",  -32767  ]
+[ "",  -1234   ]
+[ "",  -34     ]
+[ "",  0       ]
+[ "",  0       ]
+[ "",  0       ]
+[ "",  1004    ]
+[ "",  1234    ]
+[ "",  32767   ]
 #CREATE TABLE TEMP_INT2 (f1 smallint);
 #INSERT INTO TEMP_INT2 (f1)
-#  SELECT smallint(f1) FROM FLOAT8_TBL
+#  SELECT cast(f1 as smallint) FROM FLOAT8_TBL
 #  WHERE (f1 >= -32767) AND (f1 <= 32767);
-[ 1 ]
+[ 4    ]
 #INSERT INTO TEMP_INT2 (f1)
-#  SELECT smallint(f1) FROM INT4_TBL
+#  SELECT cast(f1 as smallint) FROM INT4_TBL
 #  WHERE (f1 >= -32767) AND (f1 <= 32767);
-[ 1 ]
+[ 1    ]
 #SELECT '' AS five, f1 FROM TEMP_INT2
 #  ORDER BY f1;
-% sys.L0,      sys.L0 # table_name
+% .L,  sys.temp_int2 # table_name
 % five,        f1 # name
-% ?,   ? # type
-% ?,   ? # length
-[ "",  -1004 ]
-[ "",  -35 ]
-[ "",  0 ]
-[ "",  0 ]
-[ "",  0 ]
-
-#--
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to