summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-03-07 21:05:28 +0100
committerSergei Golubchik <sergii@pisem.net>2014-03-07 21:05:28 +0100
commit12f54d7de0c641c16299808d7835ad34192cd601 (patch)
tree13ffd5ca13a64abedc6b4fce3a0e587adaf0620d /mysql-test
parent68916bcab383a25a8f9eb2ae60bb8435b52e5094 (diff)
downloadmariadb-git-12f54d7de0c641c16299808d7835ad34192cd601.tar.gz
@@old_mode=zero_date_time_cast
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/old-mode.result1
-rw-r--r--mysql-test/suite/sys_vars/r/old_mode_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/t/old_mode_basic.test5
-rw-r--r--mysql-test/t/old-mode.test6
4 files changed, 14 insertions, 6 deletions
diff --git a/mysql-test/r/old-mode.result b/mysql-test/r/old-mode.result
index 0b10067c19b..b7e1ee26391 100644
--- a/mysql-test/r/old-mode.result
+++ b/mysql-test/r/old-mode.result
@@ -22,6 +22,7 @@ Id User Host db Command Time State Info
#
# MDEV-5372 Make "CAST(time_expr AS DATETIME)" compatible with the SQL Standard)
#
+set @@old_mode=zero_date_time_cast;
SELECT CAST(TIME'-10:30:30' AS DATETIME);
CAST(TIME'-10:30:30' AS DATETIME)
NULL
diff --git a/mysql-test/suite/sys_vars/r/old_mode_basic.result b/mysql-test/suite/sys_vars/r/old_mode_basic.result
index c9a650e7b15..052221d796e 100644
--- a/mysql-test/suite/sys_vars/r/old_mode_basic.result
+++ b/mysql-test/suite/sys_vars/r/old_mode_basic.result
@@ -111,10 +111,14 @@ SELECT @@global.old_mode;
@@global.old_mode
NO_PROGRESS_INFO
SET @@global.old_mode = 4;
-ERROR 42000: Variable 'old_mode' can't be set to the value of '4'
SELECT @@global.old_mode;
@@global.old_mode
-NO_PROGRESS_INFO
+ZERO_DATE_TIME_CAST
+SET @@global.old_mode = 8;
+ERROR 42000: Variable 'old_mode' can't be set to the value of '8'
+SELECT @@global.old_mode;
+@@global.old_mode
+ZERO_DATE_TIME_CAST
SET @@global.old_mode = 0.4;
ERROR 42000: Incorrect argument type to variable 'old_mode'
'#---------------------FN_DYNVARS_152_08----------------------#'
diff --git a/mysql-test/suite/sys_vars/t/old_mode_basic.test b/mysql-test/suite/sys_vars/t/old_mode_basic.test
index 6770219887d..93a93960836 100644
--- a/mysql-test/suite/sys_vars/t/old_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/old_mode_basic.test
@@ -168,10 +168,13 @@ SELECT @@global.old_mode;
SET @@global.old_mode = 2;
SELECT @@global.old_mode;
---Error ER_WRONG_VALUE_FOR_VAR
SET @@global.old_mode = 4;
SELECT @@global.old_mode;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.old_mode = 8;
+SELECT @@global.old_mode;
+
# use of decimal values
--Error ER_WRONG_TYPE_FOR_VAR
diff --git a/mysql-test/t/old-mode.test b/mysql-test/t/old-mode.test
index 56916aefd77..483549886db 100644
--- a/mysql-test/t/old-mode.test
+++ b/mysql-test/t/old-mode.test
@@ -29,7 +29,7 @@ SHOW PROCESSLIST;
--echo #
--echo # MDEV-5372 Make "CAST(time_expr AS DATETIME)" compatible with the SQL Standard)
--echo #
-# Checking that "mysqld --old" exposes the 5.5 conversion behaviour
+set @@old_mode=zero_date_time_cast;
SELECT CAST(TIME'-10:30:30' AS DATETIME);
SELECT CAST(TIME'10:20:30' AS DATETIME);
SELECT CAST(TIME'830:20:30' AS DATETIME);
@@ -53,12 +53,12 @@ SELECT a, CAST(a AS DATETIME), TO_DAYS(a) FROM t1;
DROP TABLE t1;
# Note, it was actually a bug that TO_DAYS('830:20:30') returned NULL
# for a column, while 3 for an expression. We won't fix this,
-# it's "mysqld --old" anyway.
+# it's "old_mode" anyway.
SELECT TO_DAYS(TIME'-10:20:30');
SELECT TO_DAYS(TIME'10:20:30');
SELECT TO_DAYS(TIME'830:20:30');
-# This is to cover Item_temporal_hybrid_func::fix_temporal_type in --old mode:
+# This is to cover Item_temporal_hybrid_func::fix_temporal_type in old_mode:
CREATE TABLE t1 (a DATETIME, b TIME);
INSERT INTO t1 VALUES (NULL, '00:20:12');
INSERT INTO t1 VALUES (NULL, '-00:20:12');