summaryrefslogtreecommitdiff
path: root/mysql-test/t/cast.test
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-11-24 15:47:19 +0200
committerunknown <monty@mashka.mysql.fi>2002-11-24 15:47:19 +0200
commit72da2e4c9463aeb80083fd53cc0e6f5091b5f4f7 (patch)
treeed4766483373d3e3ccd10186eea178ace4e50ae4 /mysql-test/t/cast.test
parent70a17cd5a7aab52697b494cd8379fb78db15eeea (diff)
downloadmariadb-git-72da2e4c9463aeb80083fd53cc0e6f5091b5f4f7.tar.gz
Added new ANSI functions LOCALTIME, LOCALTIMESTAMP and CURRENT_USER
Added CEIL as an alias for CEILING Cleaned up CHECK constraint handling. (We don't anymore require braces after CHECK) Added casting to CHAR. mysql-test/r/bigint.result: Moved casting test to cast.test mysql-test/r/func_time.result: Test of new functions mysql-test/t/bigint.test: Moved casting test to cast.test mysql-test/t/func_time.test: Test of new functions sql/item_create.cc: Added casting to CHAR sql/item_func.h: Added casting to CHAR sql/item_timefunc.h: Added casting to CHAR sql/lex.h: Added new ANSI functions LOCALTIME, LOCALTIMESTAMP and CURRENT_USER Added CEIL as an alias for CEILING sql/sql_yacc.yy: Cleaned up CHECK constraint handling.
Diffstat (limited to 'mysql-test/t/cast.test')
-rw-r--r--mysql-test/t/cast.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
new file mode 100644
index 00000000000..7a120ef5005
--- /dev/null
+++ b/mysql-test/t/cast.test
@@ -0,0 +1,22 @@
+#
+# Test of cast function
+#
+
+select CAST(1-2 AS UNSIGNED);
+select CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER);
+select CONVERT('-1',UNSIGNED);
+select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1;
+select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1;
+select ~5, cast(~5 as signed);
+select cast(5 as unsigned) -6.0;
+select cast("A" as binary) = "a", cast(BINARY "a" as CHAR) = "A";
+select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME);
+select cast("1:2:3" as TIME);
+
+#
+# The following should be fixed in 4.1
+#
+
+select cast("2001-1-1" as date) = "2001-01-01";
+select cast("2001-1-1" as datetime) = "2001-01-01 00:00:00";
+select cast("1:2:3" as TIME) = "1:02:03";