diff options
author | unknown <monty@mysql.com> | 2005-08-09 00:13:49 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-08-09 00:13:49 +0300 |
commit | 62011d165379111d478ccfca6da15210dad23784 (patch) | |
tree | f29a98a0f6052dc852c1bf2c088567e6a0bb7f6d /mysql-test | |
parent | fd033c9a001efad781b8d57ff7d9c41e101ba4f7 (diff) | |
download | mariadb-git-62011d165379111d478ccfca6da15210dad23784.tar.gz |
Review of new pushed code
- Fixed some error condtion when handling dates with 'T'
- Added extra test for bug #11867 (Wrong result with "... WHERE ROW( a, b ) IN ( SELECT DISTINCT a, b WHERE ...)" to show it's not yet fixed
- Safety fixes and cleanups
mysql-test/r/subselect.result:
Added extra test case to test case for bug #11867
(Result shows that current code is not yet right and needs to be fixed)
mysql-test/r/type_datetime.result:
More tests for dates of type CCYYMMDDTHHMMSS
mysql-test/t/subselect.test:
Added extra test case to test case for bug #11867
mysql-test/t/type_datetime.test:
More tests for dates of type CCYYMMDDTHHMMSS
sql-common/my_time.c:
Fixed handling of dates of type CCYYMMDDTHHMMSS
(Old code couldn't handle 2003-0304 or 2003-0003-02)
sql/slave.cc:
Indentation cleanup
sql/sql_parse.cc:
Added test of return value of get_system_var()
sql/sql_select.cc:
Removed unnecessary call to field->table->maybe_null
sql/sql_union.cc:
Indentation fixes
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/subselect.result | 15 | ||||
-rw-r--r-- | mysql-test/r/type_datetime.result | 23 | ||||
-rw-r--r-- | mysql-test/t/subselect.test | 4 | ||||
-rw-r--r-- | mysql-test/t/type_datetime.test | 21 |
4 files changed, 43 insertions, 20 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 25d9a39705d..863a250c670 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2741,4 +2741,19 @@ WHERE ROW(one,two) IN (SELECT DISTINCT one,two FROM t1 WHERE flag = 'N'); one two flag 5 6 N 7 8 N +insert into t2 values (null,null,'N'); +SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N') as 'test' from t1; +one two test +1 2 0 +2 3 0 +3 4 0 +5 6 1 +7 8 1 +SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N' group by one,two) as 'test' from t1; +one two test +1 2 NULL +2 3 NULL +3 4 NULL +5 6 1 +7 8 1 DROP TABLE t1,t2; diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 8d28504d790..f313a6b934b 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -26,6 +26,8 @@ Table Op Msg_type Msg_text test.t1 check status OK delete from t1; insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000"); +insert into t1 values ("2003-003-03"); +insert into t1 values ("20030102T131415"),("2001-01-01T01:01:01"), ("2001-1-1T1:01:01"); select * from t1; t 2000-01-01 00:00:00 @@ -43,6 +45,17 @@ t 9999-12-31 23:59:59 2003-01-00 00:00:00 2003-00-00 00:00:00 +2003-03-03 00:00:00 +2003-01-02 13:14:15 +2001-01-01 01:01:01 +2001-01-01 01:01:01 +truncate table t1; +insert into t1 values("2003-0303 12:13:14"); +Warnings: +Warning 1264 Data truncated; out of range for column 't' at row 1 +select * from t1; +t +0000-00-00 00:00:00 drop table t1; CREATE TABLE t1 (a timestamp, b date, c time, d datetime); insert into t1 (b,c,d) values(now(),curtime(),now()); @@ -153,13 +166,3 @@ dt 0000-00-00 00:00:00 0000-00-00 00:00:00 drop table t1; -create table t1 (dt datetime); -insert into t1 values ("20010101T010101"); -insert into t1 values ("2001-01-01T01:01:01"); -insert into t1 values ("2001-1-1T1:01:01"); -select * from t1; -dt -2001-01-01 01:01:01 -2001-01-01 01:01:01 -2001-01-01 01:01:01 -drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 0b4791b0023..ecd553ee8f8 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1768,6 +1768,10 @@ SELECT * FROM t1 SELECT * FROM t1 WHERE ROW(one,two) IN (SELECT DISTINCT one,two FROM t1 WHERE flag = 'N'); +insert into t2 values (null,null,'N'); +SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N') as 'test' from t1; +SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N' group by one,two) as 'test' from t1; + DROP TABLE t1,t2; # End of 4.1 tests diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index ca70e35d3cd..4b6741b4242 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -14,6 +14,17 @@ optimize table t1; check table t1; delete from t1; insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000"); + +# Strange dates +insert into t1 values ("2003-003-03"); + +# Bug #7308: ISO-8601 date format not handled correctly +insert into t1 values ("20030102T131415"),("2001-01-01T01:01:01"), ("2001-1-1T1:01:01"); +select * from t1; + +# Test some wrong dates +truncate table t1; +insert into t1 values("2003-0303 12:13:14"); select * from t1; drop table t1; @@ -102,14 +113,4 @@ insert into t1 values ("00-00-00"), ("00-00-00 00:00:00"); select * from t1; drop table t1; -# -# Bug #7308: ISO-8601 date format not handled correctly -# -create table t1 (dt datetime); -insert into t1 values ("20010101T010101"); -insert into t1 values ("2001-01-01T01:01:01"); -insert into t1 values ("2001-1-1T1:01:01"); -select * from t1; -drop table t1; - # End of 4.1 tests |