Changeset: 4253efec25db for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4253efec25db
Modified Files:
        sql/test/miscellaneous/Tests/simple_selects.sql
        sql/test/miscellaneous/Tests/simple_selects.stable.err
Branch: default
Log Message:

Confused how are going to deal conversions between floating-points and 
intervals. I'm going to leave the test, so we can later decide how are going to 
fix the MAL error


diffs (80 lines):

diff --git a/sql/test/miscellaneous/Tests/simple_selects.sql 
b/sql/test/miscellaneous/Tests/simple_selects.sql
--- a/sql/test/miscellaneous/Tests/simple_selects.sql
+++ b/sql/test/miscellaneous/Tests/simple_selects.sql
@@ -21,26 +21,45 @@ insert into x values (1, 1);
 select cast(x as date) from x; --error, cannot cast
 select cast(x as time) from x;
 select cast(x as timestamp) from x; --error, cannot cast
+select cast(x as real) from x;
+select cast(x as double) from x;
+select cast(x as decimal) from x;
 select cast(y as date) from x; --error, cannot cast
 select cast(y as time) from x; --We throw error, but PostgreSQL doesn't
 select cast(y as timestamp) from x; --error, cannot cast
+select cast(y as real) from x;
+select cast(y as double) from x;
+select cast(y as decimal) from x;
+
 insert into x values (null, null);
 select cast(x as date) from x; --error, cannot cast
 select cast(x as time) from x;
 select cast(x as timestamp) from x; --error, cannot cast
+select cast(x as real) from x;
+select cast(x as double) from x;
+select cast(x as decimal) from x;
 select cast(y as date) from x; --error, cannot cast
 select cast(y as time) from x; --We throw error, but PostgreSQL doesn't
 select cast(y as timestamp) from x; --error, cannot cast
+select cast(y as real) from x;
+select cast(y as double) from x;
+select cast(y as decimal) from x;
 drop table x;
 
-create table x (x time, y date, z timestamp);
-insert into x values (null, null, null);
+create table x (x time, y date, z timestamp, w real, a double, b decimal);
+insert into x values (null, null, null, null, null, null);
 select cast(x as interval second) from x; --We throw error, but PostgreSQL 
doesn't
 select cast(x as interval month) from x; --We throw error, but PostgreSQL 
doesn't
 select cast(y as interval second) from x; --error, cannot cast
 select cast(y as interval month) from x; --error, cannot cast
 select cast(z as interval second) from x; --error, cannot cast
 select cast(z as interval month) from x; --error, cannot cast
+select cast(w as interval second) from x;
+select cast(w as interval month) from x;
+select cast(a as interval second) from x;
+select cast(a as interval month) from x;
+select cast(b as interval second) from x;
+select cast(b as interval month) from x;
 drop table x;
 
 select difference('foobar', 'oobar'), difference(NULL, 'oobar'), 
difference('foobar', NULL), difference(NULL, NULL),
@@ -65,6 +84,8 @@ select "idontexist"."idontexist"(1) over
 
 select cast(true as interval second); --error, not possible
 select cast(true as interval month); --error, not possible
+select cast(cast(1 as interval second) as boolean); --error, not possible
+select cast(cast(1 as interval month) as boolean); --error, not possible
 
 select substring('abc' from 1 for null);
 select substring('abc' from null for 2);
diff --git a/sql/test/miscellaneous/Tests/simple_selects.stable.err 
b/sql/test/miscellaneous/Tests/simple_selects.stable.err
--- a/sql/test/miscellaneous/Tests/simple_selects.stable.err
+++ b/sql/test/miscellaneous/Tests/simple_selects.stable.err
@@ -117,7 +117,15 @@ MAPI  = (monetdb) /var/tmp/mtest-316445/
 QUERY = select cast(true as interval month); --error, not possible
 ERROR = !types boolean(1,0) and month_interval(3,0) are not equal
 CODE  = 42000
-MAPI  = (monetdb) /var/tmp/mtest-416559/.s.monetdb.32222
+MAPI  = (monetdb) /var/tmp/mtest-108640/.s.monetdb.34144
+QUERY = select cast(cast(1 as interval second) as boolean); --error, not 
possible
+ERROR = !types sec_interval(13,0) and boolean(1,0) are not equal
+CODE  = 42000
+MAPI  = (monetdb) /var/tmp/mtest-108640/.s.monetdb.34144
+QUERY = select cast(cast(1 as interval month) as boolean); --error, not 
possible
+ERROR = !types month_interval(3,0) and boolean(1,0) are not equal
+CODE  = 42000
+MAPI  = (monetdb) /var/tmp/mtest-108640/.s.monetdb.34144
 QUERY = CREATE FUNCTION count(input INT) RETURNS INT BEGIN RETURN SELECT 1; 
END; --error, ambiguous, there's an aggregate named count with the same 
parameters
 ERROR = !CREATE FUNCTION: there's an aggregate with the name 'count' and the 
same parameters, which causes ambiguous calls
 CODE  = 42000
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to