diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2014-03-07 00:21:25 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2014-03-07 00:21:25 +0400 |
commit | 89e171535563dcdf1eeb309e54abc4da2f5dd539 (patch) | |
tree | 79331d73d127f4226b274e86f476ba1f86c721e9 /mysql-test/r/old-mode.result | |
parent | b95c8ce530cbbd92b232324dc2c4376615bd1b5d (diff) | |
download | mariadb-git-89e171535563dcdf1eeb309e54abc4da2f5dd539.tar.gz |
MDEV-5372 Make "CAST(time_expr AS DATETIME)" compatible with MySQL-5.6 (and the SQL Standard)
Diffstat (limited to 'mysql-test/r/old-mode.result')
-rw-r--r-- | mysql-test/r/old-mode.result | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/mysql-test/r/old-mode.result b/mysql-test/r/old-mode.result index eec08d4d5c8..0b10067c19b 100644 --- a/mysql-test/r/old-mode.result +++ b/mysql-test/r/old-mode.result @@ -19,3 +19,83 @@ drop table t1,t2; SHOW PROCESSLIST; Id User Host db Command Time State Info <Id> root <Host> test Query <Time> <State> SHOW PROCESSLIST +# +# MDEV-5372 Make "CAST(time_expr AS DATETIME)" compatible with the SQL Standard) +# +SELECT CAST(TIME'-10:30:30' AS DATETIME); +CAST(TIME'-10:30:30' AS DATETIME) +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '-10:30:30' +SELECT CAST(TIME'10:20:30' AS DATETIME); +CAST(TIME'10:20:30' AS DATETIME) +0000-00-00 10:20:30 +SELECT CAST(TIME'830:20:30' AS DATETIME); +CAST(TIME'830:20:30' AS DATETIME) +0000-01-03 14:20:30 +CREATE TABLE t1 (a DATETIME); +INSERT INTO t1 VALUES (TIME'-10:20:30'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +INSERT INTO t1 VALUES (TIME'10:20:30'); +INSERT INTO t1 VALUES (TIME'830:20:30'); +SELECT * FROM t1; +a +0000-00-00 00:00:00 +0000-00-00 10:20:30 +0000-01-03 14:20:30 +DROP TABLE t1; +CREATE TABLE t1 (a TIMESTAMP); +INSERT INTO t1 VALUES (TIME'-10:20:30'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +INSERT INTO t1 VALUES (TIME'10:20:30'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +INSERT INTO t1 VALUES (TIME'830:20:30'); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +SELECT * FROM t1; +a +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +DROP TABLE t1; +CREATE TABLE t1 (a TIME); +INSERT INTO t1 VALUES (TIME'-10:20:30'); +INSERT INTO t1 VALUES (TIME'10:20:30'); +INSERT INTO t1 VALUES (TIME'830:20:30'); +SELECT a, CAST(a AS DATETIME), TO_DAYS(a) FROM t1; +a CAST(a AS DATETIME) TO_DAYS(a) +-10:20:30 NULL NULL +10:20:30 0000-00-00 10:20:30 NULL +830:20:30 0000-01-03 14:20:30 NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '-10:20:30' +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1264 Out of range value for column 'a' at row 2 +Warning 1264 Out of range value for column 'a' at row 3 +DROP TABLE t1; +SELECT TO_DAYS(TIME'-10:20:30'); +TO_DAYS(TIME'-10:20:30') +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '-10:20:30' +SELECT TO_DAYS(TIME'10:20:30'); +TO_DAYS(TIME'10:20:30') +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '10:20:30' +SELECT TO_DAYS(TIME'830:20:30'); +TO_DAYS(TIME'830:20:30') +3 +CREATE TABLE t1 (a DATETIME, b TIME); +INSERT INTO t1 VALUES (NULL, '00:20:12'); +INSERT INTO t1 VALUES (NULL, '-00:20:12'); +SELECT IF(1,ADDDATE(IFNULL(a,b),0),1) FROM t1; +IF(1,ADDDATE(IFNULL(a,b),0),1) +0000-00-00 00:20:12 +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '-00:20:12' +DROP TABLE t1; |