diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-10-20 19:51:14 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-10-20 19:51:14 +0400 |
commit | f6a20205148853f4cd352a21de3b77f2372ad50d (patch) | |
tree | db68549ebba514202189fcd970ebf0c4333feb73 /mysql-test/main/func_time.test | |
parent | 0e5a4ac2532c64a545796c787354dc41d61d0e62 (diff) | |
download | mariadb-git-f6a20205148853f4cd352a21de3b77f2372ad50d.tar.gz |
MDEV-17477 Wrong result for TIME('-2001-01-01 10:20:30') and numerous other str-to-time conversion problems
MDEV-17478 Wrong result for TIME('+100:20:30')
Diffstat (limited to 'mysql-test/main/func_time.test')
-rw-r--r-- | mysql-test/main/func_time.test | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/main/func_time.test b/mysql-test/main/func_time.test index 8fc0977a496..4c9315629f1 100644 --- a/mysql-test/main/func_time.test +++ b/mysql-test/main/func_time.test @@ -3056,3 +3056,41 @@ FROM t1; SHOW CREATE TABLE t2; DROP TABLE t2; DROP TABLE t1; + + +--echo # +--echo # MDEV-17478 Wrong result for TIME('+100:20:30') +--echo # + +SELECT TIME('+100:20:30'); + +--echo # +--echo # MDEV-17477 Wrong result for TIME('-2001-01-01 10:20:30') +--echo # + +SELECT TIME('-2001-01-01 10:20:30'); +SELECT TIME('2001-01-01') AS c1, TIME('2001-01-01 ') AS c2; +SELECT TIME('0001:01:01 '), TIME('0001:01:01 '); +SELECT TIME('1 2'), TIME('1 2 '); + +SELECT TIME('2001-01-01T'), TIME('2001-01-01T '); +SELECT TIME('901-01-01T1'), TIME('901-01-01T10'); +SELECT TIME('091-01-01T1'), TIME('091-01-01T10'); + +SELECT TIME('0001:01:01x'), TIME('0001:01:01xx'); +SELECT TIME('0001:01:01.'), TIME('0001:01:01..'); +SELECT TIME('0001:01:01-'), TIME('0001:01:01--'); +SELECT TIME('0001:01:01-'), TIME('0001:01:01--'); + +SELECT TIME('-xxx'), TIME('-xxxxxxxxxxxxxxxxxxxx'); +SELECT TIME('- '), TIME('- '); +SELECT TIME('-'), TIME('-'); +SELECT TIME('1-1-1 1:1:1'), TIME('1-1-1 1:1:1.0'); +SELECT TIME('1-1-1 1:2:3'), TIME('1-1-1 1:2:3.0'); + +SELECT + CAST('20050326112233 garbage' as datetime), + CAST('20050326 garbage' as date), + CAST('50326 garbage' as time); + +SELECT TIME('- 01:00:00'), TIME('- 1 01:00:00'); |