diff options
Diffstat (limited to 'mysql-test')
90 files changed, 1504 insertions, 952 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index bf79f376a43..664d69f1a93 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -84,7 +84,6 @@ TEST_DIRS = t r include std_data std_data/parts collections \ std_data/funcs_1 \ extra/binlog_tests/ extra/rpl_tests \ suite/binlog suite/binlog/t suite/binlog/r suite/binlog/std_data \ - suite/bugs suite/bugs/data suite/bugs/t suite/bugs/r \ suite/federated \ suite/pbxt/t suite/pbxt/r suite/pbxt \ suite/vcol suite/vcol/t suite/vcol/r suite/vcol/inc \ diff --git a/mysql-test/include/type_hrtime.inc b/mysql-test/include/type_hrtime.inc index 7bde8c609e4..cd631f25632 100644 --- a/mysql-test/include/type_hrtime.inc +++ b/mysql-test/include/type_hrtime.inc @@ -56,9 +56,38 @@ create table t3 like t1; show create table t2; show create table t3; +drop table t2, t3; + +# math, aggregation +insert t1 values ('2010-12-13 14:15:16.222222'); +select a, a+0, a-1, a*1, a/2 from t1; +select max(a), min(a), sum(a), avg(a) from t1; +create table t2 select a, a+0, a-1, a*1, a/2 from t1; +create table t3 select max(a), min(a), sum(a), avg(a) from t1; +show create table t2; +show create table t3; drop table t1, t2, t3; +# insert, alter with conversion +--vertical_results +eval create table t1 (f0_$type $type(0), f1_$type $type(1), f2_$type $type(2), f3_$type $type(3), f4_$type $type(4), f5_$type $type(5), f6_$type $type(6)); +insert t1 values ( '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432'); +select * from t1; +eval select cast(f0_$type as time(4)) time4_f0_$type, cast(f1_$type as datetime(3)) datetime3_f1_$type, cast(f2_$type as date) date_f2_$type, cast(f4_$type as double) double_f3_$type, cast(f4_$type as decimal(40,5)) decimal5_f4_$type, cast(f5_$type as signed) bigint_f5_$type, cast(f6_$type as char(255)) varchar_f6_$type from t1; +eval create table t2 (time4_f0_$type time(4), datetime3_f1_$type datetime(3), date_f2_$type date, double_f3_$type double, decimal5_f4_$type decimal(40,5), bigint_f5_$type bigint, varchar_f6_$type varchar(255)); +insert t2 select * from t1; +select * from t2; +eval alter table t1 change f0_$type time4_f0_$type time(4), change f1_$type datetime3_f1_$type datetime(3), change f2_$type date_f2_$type date, change f3_$type double_f3_$type double, change f4_$type decimal5_f4_$type decimal(40,5), change f5_$type bigint_f5_$type bigint, change f6_$type varchar_f6_$type varchar(255); +select * from t1; +eval alter table t1 modify time4_f0_$type $type(0), modify datetime3_f1_$type $type(1), modify date_f2_$type $type(2), modify double_f3_$type $type(3), modify decimal5_f4_$type $type(4), modify bigint_f5_$type $type(5), modify varchar_f6_$type $type(6); +select * from t1; +delete from t1; +insert t1 select * from t2; +select * from t1; +drop table t1, t2; +--horizontal_results + # # SP # diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 542f1ca9660..e2b2a3c2262 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4397,7 +4397,7 @@ sub extract_warning_lines ($$) { my @patterns = ( - qr/^Warning:|mysqld: Warning|\[Warning\]/, + qr/^Warning|mysqld: Warning|\[Warning\]/, qr/^Error:|\[ERROR\]/, qr/^==\d+==\s+\S/, # valgrind errors qr/InnoDB: Warning|InnoDB: Error/, diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 169108a320d..877a6badc16 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -65,10 +65,10 @@ cast(cast("20:01:01" as time) as datetime) 0000-00-00 20:01:01 select cast(cast("8:46:06.23434" AS time) as decimal(32,10)); cast(cast("8:46:06.23434" AS time) as decimal(32,10)) -84606.2343400000 +84606.0000000000 select cast(cast("2011-04-05 8:46:06.23434" AS datetime) as decimal(32,6)); cast(cast("2011-04-05 8:46:06.23434" AS datetime) as decimal(32,6)) -20110405084606.234340 +20110405084606.000000 # # Check handling of cast with microseconds # @@ -77,7 +77,7 @@ cast(cast(20010203101112.121314 as double) as datetime) 2001-02-03 10:11:12 select cast(cast(010203101112.12 as double) as datetime); cast(cast(010203101112.12 as double) as datetime) -2001-02-03 10:11:12 +0001-02-03 10:11:12 select cast(cast(20010203101112.121314 as decimal(32,6)) as datetime); cast(cast(20010203101112.121314 as decimal(32,6)) as datetime) 2001-02-03 10:11:12 @@ -86,10 +86,10 @@ cast(20010203101112.121314 as datetime) 2001-02-03 10:11:12 select cast(110203101112.121314 as datetime); cast(110203101112.121314 as datetime) -2011-02-03 10:11:12 +0011-02-03 10:11:12 select cast(cast(010203101112.12 as double) as datetime); cast(cast(010203101112.12 as double) as datetime) -2001-02-03 10:11:12 +0001-02-03 10:11:12 select cast("2011-02-03 10:11:12.123456" as datetime); cast("2011-02-03 10:11:12.123456" as datetime) 2011-02-03 10:11:12 @@ -110,7 +110,7 @@ cast(cast(20010203101112.1 as double) as datetime(1)) 2001-02-03 10:11:12.1 select cast(cast(010203101112.12 as double) as datetime(2)); cast(cast(010203101112.12 as double) as datetime(2)) -2001-02-03 10:11:12.12 +0001-02-03 10:11:12.12 select cast(cast(20010203101112.121314 as decimal(32,6)) as datetime(6)); cast(cast(20010203101112.121314 as decimal(32,6)) as datetime(6)) 2001-02-03 10:11:12.121314 @@ -119,10 +119,10 @@ cast(20010203101112.121314 as datetime(6)) 2001-02-03 10:11:12.121314 select cast(110203101112.121314 as datetime(6)); cast(110203101112.121314 as datetime(6)) -2011-02-03 10:11:12.121314 +0011-02-03 10:11:12.121314 select cast(cast(010203101112.12 as double) as datetime(6)); cast(cast(010203101112.12 as double) as datetime(6)) -2001-02-03 10:11:12.120000 +0001-02-03 10:11:12.120000 select cast("2011-02-03 10:11:12.123456" as time); cast("2011-02-03 10:11:12.123456" as time) 10:11:12 @@ -149,7 +149,7 @@ cast(cast("2011-04-05 8:46:06.123456" AS datetime) as time) 08:46:06 select cast(cast("2011-04-05 8:46:06.123456" AS datetime) as time(6)); cast(cast("2011-04-05 8:46:06.123456" AS datetime) as time(6)) -08:46:06.123456 +08:46:06.000000 select cast(cast("2011-04-05 8:46:06.123456" AS datetime(6)) as time); cast(cast("2011-04-05 8:46:06.123456" AS datetime(6)) as time) 08:46:06 @@ -265,9 +265,7 @@ Warnings: Warning 1264 Out of range value for column 'cast(-1000 as double(5,2))' at row 1 select cast(010203101112.121314 as datetime); cast(010203101112.121314 as datetime) -NULL -Warnings: -Warning 1292 Incorrect datetime value: '10203101112.121314' +0001-02-03 10:11:12 select cast(120010203101112.121314 as datetime); cast(120010203101112.121314 as datetime) NULL @@ -328,7 +326,7 @@ cast(cast(120010203101112.121314 as double) as datetime) NULL select cast(cast(1.1 as double) as datetime); cast(cast(1.1 as double) as datetime) -NULL +0000-00-00 00:00:01 select cast(cast(-1.1 as double) as datetime); cast(cast(-1.1 as double) as datetime) NULL diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index fdd26d7e543..eafd16440b0 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -804,6 +804,32 @@ select distinct a from t1 where a = DATE('2010-10-10'); a 2010-10-10 20101010 +explain select distinct a from t1 where a = DATE('2010-10-10'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where; Using temporary +drop table t1; +# date = string +create table t1 (a date); +insert t1 values ('2010-10-10'), ('20101010'); +explain select distinct a from t1 where a = '2010-10-10'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +drop table t1; +# double = string +create table t1 (a double); +insert t1 values (2), (2); +explain select distinct a from t1 where a = '2'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +# double = int +explain select distinct a from t1 where a = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +# string = double +alter table t1 modify a varchar(100); +explain select distinct a from t1 where a = 2e0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where; Using temporary drop table t1; create table t1 (f1 varchar(40)); insert into t1 values ('2010-10-10 00:00:00.0001'),('2010-10-10 00:00:00.0002'),('2010-10-10 00:00:00.0003'); diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index ec1d623f3df..d38660adcc6 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -295,6 +295,9 @@ column_get(column_create(1, "8:46:06.23434" AS time), 1 as int) select column_get(column_create(1, "8:46:06.23434" AS time(6)), 1 as int); column_get(column_create(1, "8:46:06.23434" AS time(6)), 1 as int) 84606 +select column_get(column_create(1, "-808:46:06.23434" AS time(6)), 1 as int); +column_get(column_create(1, "-808:46:06.23434" AS time(6)), 1 as int) +-8084606 select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime(6)), 1 as int); column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime(6)), 1 as int) 20110405084606 @@ -402,6 +405,9 @@ column_get(column_create(1, "8:46:06.23434" AS time(0)), 1 as char charset utf8) select column_get(column_create(1, "8:46:06.23434" AS time(6)), 1 as char charset utf8); column_get(column_create(1, "8:46:06.23434" AS time(6)), 1 as char charset utf8) 08:46:06.234340 +select column_get(column_create(1, "-808:46:06.23434" AS time(6)), 1 as char charset utf8); +column_get(column_create(1, "-808:46:06.23434" AS time(6)), 1 as char charset utf8) +-808:46:06.234340 select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as char charset utf8); column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as char charset utf8) 2011-04-05 08:46:06.234340 @@ -465,6 +471,9 @@ column_get(column_create(1, "8:46:06.23434" AS time), 1 as double) select column_get(column_create(1, "8:46:06.23434" AS time(6)), 1 as double); column_get(column_create(1, "8:46:06.23434" AS time(6)), 1 as double) 84606.23434 +select column_get(column_create(1, "-808:46:06.23434" AS time(6)), 1 as double); +column_get(column_create(1, "-808:46:06.23434" AS time(6)), 1 as double) +-8084606.23434 select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double); column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double) 20110405084606.2 @@ -540,6 +549,9 @@ column_get(column_create(1, "8:46:06.23434" AS time), 1 as decimal(32,6)) select column_get(column_create(1, "8:46:06.23434" AS time(6)), 1 as decimal(32,6)); column_get(column_create(1, "8:46:06.23434" AS time(6)), 1 as decimal(32,6)) 84606.234340 +select column_get(column_create(1, "-808:46:06.23434" AS time(6)), 1 as decimal(32,6)); +column_get(column_create(1, "-808:46:06.23434" AS time(6)), 1 as decimal(32,6)) +-8084606.234340 select column_get(column_create(1, "2011-04-05 8:46:06.123456" AS datetime), 1 as decimal(32,6)); column_get(column_create(1, "2011-04-05 8:46:06.123456" AS datetime), 1 as decimal(32,6)) 20110405084606.123456 @@ -688,6 +700,11 @@ column_get(column_create(1, "2001021"), 1 as datetime) select column_get(column_create(1, "8:46:06.23434" AS time), 1 as datetime); column_get(column_create(1, "8:46:06.23434" AS time), 1 as datetime) 0000-00-00 08:46:06 +select column_get(column_create(1, "-808:46:06.23434" AS time), 1 as datetime); +column_get(column_create(1, "-808:46:06.23434" AS time), 1 as datetime) +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '-808:46:06' set @@sql_mode="allow_invalid_dates"; select column_get(column_create(1, "2011-02-30 18:46:06.23434" AS CHAR), 1 as datetime); column_get(column_create(1, "2011-02-30 18:46:06.23434" AS CHAR), 1 as datetime) @@ -709,17 +726,17 @@ select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as d column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as datetime) NULL Warnings: -Warning 1918 Encountered illegal value '18446744073709551615' when converting to DATE or DATETIME +Warning 1292 Incorrect datetime value: '1.84467440737096e+19' select column_get(column_create(1, 9223372036854775807 AS int), 1 as datetime); column_get(column_create(1, 9223372036854775807 AS int), 1 as datetime) NULL Warnings: -Warning 1918 Encountered illegal value '9223372036854775807' when converting to DATE or DATETIME +Warning 1292 Incorrect datetime value: '9223372036854775807' select column_get(column_create(1, -9223372036854775808 AS int), 1 as datetime); column_get(column_create(1, -9223372036854775808 AS int), 1 as datetime) NULL Warnings: -Warning 1918 Encountered illegal value '-9223372036854775808' when converting to DATE or DATETIME +Warning 1292 Incorrect datetime value: '-9223372036854775808' select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as datetime); column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as datetime) NULL @@ -729,7 +746,7 @@ select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 a column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as datetime) NULL Warnings: -Warning 1292 Truncated incorrect datetime value: '9.99999999999999914332e+28 ' +Warning 1292 Incorrect datetime value: '1e+29' select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as datetime); column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as datetime) NULL @@ -839,17 +856,17 @@ select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as d column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as date) NULL Warnings: -Warning 1918 Encountered illegal value '18446744073709551615' when converting to DATE or DATETIME +Warning 1292 Incorrect datetime value: '1.84467440737096e+19' select column_get(column_create(1, 9223372036854775807 AS int), 1 as date); column_get(column_create(1, 9223372036854775807 AS int), 1 as date) NULL Warnings: -Warning 1918 Encountered illegal value '9223372036854775807' when converting to DATE or DATETIME +Warning 1292 Incorrect datetime value: '9223372036854775807' select column_get(column_create(1, -9223372036854775808 AS int), 1 as date); column_get(column_create(1, -9223372036854775808 AS int), 1 as date) NULL Warnings: -Warning 1918 Encountered illegal value '-9223372036854775808' when converting to DATE or DATETIME +Warning 1292 Incorrect datetime value: '-9223372036854775808' select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as date); column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as date) NULL @@ -859,7 +876,7 @@ select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 a column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as date) NULL Warnings: -Warning 1292 Truncated incorrect datetime value: '9.99999999999999914332e+28 ' +Warning 1292 Incorrect datetime value: '1e+29' select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as date); column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as date) NULL @@ -897,9 +914,15 @@ column_get(column_create(1, 20010203101112.121314 as decimal), 1 as time) select column_get(column_create(1, 20010203101112 as unsigned int), 1 as time); column_get(column_create(1, 20010203101112 as unsigned int), 1 as time) 10:11:12 +select column_get(column_create(1, 8080102 as unsigned int), 1 as time); +column_get(column_create(1, 8080102 as unsigned int), 1 as time) +808:01:02 select column_get(column_create(1, 20010203101112 as int), 1 as time); column_get(column_create(1, 20010203101112 as int), 1 as time) 10:11:12 +select column_get(column_create(1, -8080102 as int), 1 as time); +column_get(column_create(1, -8080102 as int), 1 as time) +-808:01:02 select column_get(column_create(1, "20010203101112" as char), 1 as time); column_get(column_create(1, "20010203101112" as char), 1 as time) 10:11:12 @@ -980,27 +1003,27 @@ select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as t column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as time) NULL Warnings: -Warning 1292 Truncated incorrect time value: '18446744073709551615' +Warning 1292 Incorrect datetime value: '1.84467440737096e+19' select column_get(column_create(1, 9223372036854775807 AS int), 1 as time); column_get(column_create(1, 9223372036854775807 AS int), 1 as time) NULL Warnings: -Warning 1292 Truncated incorrect time value: '9223372036854775807' +Warning 1292 Incorrect datetime value: '9223372036854775807' select column_get(column_create(1, -9223372036854775808 AS int), 1 as time); column_get(column_create(1, -9223372036854775808 AS int), 1 as time) NULL Warnings: -Warning 1292 Truncated incorrect time value: '-9223372036854775808' +Warning 1292 Incorrect datetime value: '-9223372036854775808' select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as time); column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as time) NULL Warnings: -Warning 1292 Truncated incorrect time value: '99999999999999999999999999999' +Warning 1292 Incorrect datetime value: '99999999999999999999999999999' select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as time); column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as time) NULL Warnings: -Warning 1292 Truncated incorrect time value: '1e+29' +Warning 1292 Incorrect datetime value: '1e+29' select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as time); column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as time) NULL diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 462dc0060c7..24e146159ea 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1530,7 +1530,8 @@ insert into t1 values (02,2002,20020101,"2002-01-01 23:59:59"), (60,2060,20600101,"2060-01-01 11:11:11"), (70,1970,19700101,"1970-11-11 22:22:22"), -(NULL,NULL,NULL,NULL); +(NULL,NULL,NULL,NULL), +(71,1971,19710101,"1971-11-11 22:22:22"); select min(f1),max(f1) from t1; min(f1) max(f1) 70 60 @@ -1553,36 +1554,49 @@ a b gt lt eq 60 98 1 0 0 70 98 0 1 0 NULL 98 NULL NULL 0 +71 98 0 1 0 98 00 0 1 0 00 00 0 0 1 02 00 1 0 0 60 00 1 0 0 70 00 0 1 0 NULL 00 NULL NULL 0 +71 00 0 1 0 98 02 0 1 0 00 02 0 1 0 02 02 0 0 1 60 02 1 0 0 70 02 0 1 0 NULL 02 NULL NULL 0 +71 02 0 1 0 98 60 0 1 0 00 60 0 1 0 02 60 0 1 0 60 60 0 0 1 70 60 0 1 0 NULL 60 NULL NULL 0 +71 60 0 1 0 98 70 1 0 0 00 70 1 0 0 02 70 1 0 0 60 70 1 0 0 70 70 0 0 1 NULL 70 NULL NULL 0 +71 70 1 0 0 98 NULL NULL NULL 0 00 NULL NULL NULL 0 02 NULL NULL NULL 0 60 NULL NULL NULL 0 70 NULL NULL NULL 0 NULL NULL NULL NULL 1 +71 NULL NULL NULL 0 +98 71 1 0 0 +00 71 1 0 0 +02 71 1 0 0 +60 71 1 0 0 +70 71 0 1 0 +NULL 71 NULL NULL 0 +71 71 0 0 1 select a.f1 as a, b.f2 as b, a.f1 > b.f2 as gt, a.f1 < b.f2 as lt, a.f1<=>b.f2 as eq from t1 a, t1 b; @@ -1593,36 +1607,49 @@ a b gt lt eq 60 1998 1 0 0 70 1998 0 1 0 NULL 1998 NULL NULL 0 +71 1998 0 1 0 98 2000 0 1 0 00 2000 0 0 1 02 2000 1 0 0 60 2000 1 0 0 70 2000 0 1 0 NULL 2000 NULL NULL 0 +71 2000 0 1 0 98 2002 0 1 0 00 2002 0 1 0 02 2002 0 0 1 60 2002 1 0 0 70 2002 0 1 0 NULL 2002 NULL NULL 0 +71 2002 0 1 0 98 2060 0 1 0 00 2060 0 1 0 02 2060 0 1 0 60 2060 0 0 1 70 2060 0 1 0 NULL 2060 NULL NULL 0 +71 2060 0 1 0 98 1970 1 0 0 00 1970 1 0 0 02 1970 1 0 0 60 1970 1 0 0 70 1970 0 0 1 NULL 1970 NULL NULL 0 +71 1970 1 0 0 98 NULL NULL NULL 0 00 NULL NULL NULL 0 02 NULL NULL NULL 0 60 NULL NULL NULL 0 70 NULL NULL NULL 0 NULL NULL NULL NULL 1 +71 NULL NULL NULL 0 +98 1971 1 0 0 +00 1971 1 0 0 +02 1971 1 0 0 +60 1971 1 0 0 +70 1971 0 1 0 +NULL 1971 NULL NULL 0 +71 1971 0 0 1 select a.f1 as a, b.f3 as b, a.f1 > b.f3 as gt, a.f1 < b.f3 as lt, a.f1<=>b.f3 as eq from t1 a, t1 b; @@ -1633,36 +1660,49 @@ a b gt lt eq 60 1998-01-01 1 0 0 70 1998-01-01 0 1 0 NULL 1998-01-01 NULL NULL 0 +71 1998-01-01 0 1 0 98 2000-01-01 0 1 0 00 2000-01-01 0 1 0 02 2000-01-01 1 0 0 60 2000-01-01 1 0 0 70 2000-01-01 0 1 0 NULL 2000-01-01 NULL NULL 0 +71 2000-01-01 0 1 0 98 2002-01-01 0 1 0 00 2002-01-01 0 1 0 02 2002-01-01 0 1 0 60 2002-01-01 1 0 0 70 2002-01-01 0 1 0 NULL 2002-01-01 NULL NULL 0 +71 2002-01-01 0 1 0 98 2060-01-01 0 1 0 00 2060-01-01 0 1 0 02 2060-01-01 0 1 0 60 2060-01-01 0 1 0 70 2060-01-01 0 1 0 NULL 2060-01-01 NULL NULL 0 +71 2060-01-01 0 1 0 98 1970-01-01 1 0 0 00 1970-01-01 1 0 0 02 1970-01-01 1 0 0 60 1970-01-01 1 0 0 70 1970-01-01 0 1 0 NULL 1970-01-01 NULL NULL 0 +71 1970-01-01 1 0 0 98 NULL NULL NULL 0 00 NULL NULL NULL 0 02 NULL NULL NULL 0 60 NULL NULL NULL 0 70 NULL NULL NULL 0 NULL NULL NULL NULL 1 +71 NULL NULL NULL 0 +98 1971-01-01 1 0 0 +00 1971-01-01 1 0 0 +02 1971-01-01 1 0 0 +60 1971-01-01 1 0 0 +70 1971-01-01 0 1 0 +NULL 1971-01-01 NULL NULL 0 +71 1971-01-01 0 1 0 select a.f1 as a, b.f4 as b, a.f1 > b.f4 as gt, a.f1 < b.f4 as lt, a.f1<=>b.f4 as eq from t1 a, t1 b; @@ -1673,36 +1713,49 @@ a b gt lt eq 60 1998-01-01 00:00:00 1 0 0 70 1998-01-01 00:00:00 0 1 0 NULL 1998-01-01 00:00:00 NULL NULL 0 +71 1998-01-01 00:00:00 0 1 0 98 2000-01-01 00:00:01 0 1 0 00 2000-01-01 00:00:01 0 1 0 02 2000-01-01 00:00:01 1 0 0 60 2000-01-01 00:00:01 1 0 0 70 2000-01-01 00:00:01 0 1 0 NULL 2000-01-01 00:00:01 NULL NULL 0 +71 2000-01-01 00:00:01 0 1 0 98 2002-01-01 23:59:59 0 1 0 00 2002-01-01 23:59:59 0 1 0 02 2002-01-01 23:59:59 0 1 0 60 2002-01-01 23:59:59 1 0 0 70 2002-01-01 23:59:59 0 1 0 NULL 2002-01-01 23:59:59 NULL NULL 0 +71 2002-01-01 23:59:59 0 1 0 98 2060-01-01 11:11:11 0 1 0 00 2060-01-01 11:11:11 0 1 0 02 2060-01-01 11:11:11 0 1 0 60 2060-01-01 11:11:11 0 1 0 70 2060-01-01 11:11:11 0 1 0 NULL 2060-01-01 11:11:11 NULL NULL 0 +71 2060-01-01 11:11:11 0 1 0 98 1970-11-11 22:22:22 1 0 0 00 1970-11-11 22:22:22 1 0 0 02 1970-11-11 22:22:22 1 0 0 60 1970-11-11 22:22:22 1 0 0 70 1970-11-11 22:22:22 0 1 0 NULL 1970-11-11 22:22:22 NULL NULL 0 +71 1970-11-11 22:22:22 1 0 0 98 NULL NULL NULL 0 00 NULL NULL NULL 0 02 NULL NULL NULL 0 60 NULL NULL NULL 0 70 NULL NULL NULL 0 NULL NULL NULL NULL 1 +71 NULL NULL NULL 0 +98 1971-11-11 22:22:22 1 0 0 +00 1971-11-11 22:22:22 1 0 0 +02 1971-11-11 22:22:22 1 0 0 +60 1971-11-11 22:22:22 1 0 0 +70 1971-11-11 22:22:22 0 1 0 +NULL 1971-11-11 22:22:22 NULL NULL 0 +71 1971-11-11 22:22:22 0 1 0 select *, f1 = f2 from t1; f1 f2 f3 f4 f1 = f2 98 1998 1998-01-01 1998-01-01 00:00:00 1 @@ -1711,6 +1764,7 @@ f1 f2 f3 f4 f1 = f2 60 2060 2060-01-01 2060-01-01 11:11:11 1 70 1970 1970-01-01 1970-11-11 22:22:22 1 NULL NULL NULL NULL NULL +71 1971 1971-01-01 1971-11-11 22:22:22 1 drop table t1; # # Bug #54465: assert: field_types == 0 || field_types[field_pos] == diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result index 955a784f04c..5941b4d784a 100644 --- a/mysql-test/r/func_if.result +++ b/mysql-test/r/func_if.result @@ -177,12 +177,19 @@ IF((ROUND(t1.a,2)=1), 2, IF((R DROP TABLE t1; CREATE TABLE t1 (c LONGTEXT); -INSERT INTO t1 VALUES(1), (2), (3), (4), ('12345678901234567890'); +INSERT INTO t1 VALUES(1), (2), (3), (4), ('1234567890123456789'); +SELECT IF(1, CAST(c AS UNSIGNED), 0) FROM t1; +IF(1, CAST(c AS UNSIGNED), 0) +1 +2 +3 +4 +1234567890123456789 SELECT * FROM (SELECT MAX(IF(1, CAST(c AS UNSIGNED), 0)) FROM t1) AS te; MAX(IF(1, CAST(c AS UNSIGNED), 0)) -12345678901234567890 +1234567890123456789 SELECT * FROM (SELECT MAX(IFNULL(CAST(c AS UNSIGNED), 0)) FROM t1) AS te; MAX(IFNULL(CAST(c AS UNSIGNED), 0)) -12345678901234567890 +1234567890123456789 DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index bdaa45374a7..77e6bac09da 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -479,7 +479,7 @@ SELECT * FROM t4 WHERE a IN ('1972-02-06','19772-07-29'); a 1972-02-06 Warnings: -Warning 1292 Incorrect date value: '19772-07-29' for column 'a' at row 1 +Warning 1292 Incorrect datetime value: '19772-07-29' DROP TABLE t1,t2,t3,t4; CREATE TABLE t1 (id int not null); INSERT INTO t1 VALUES (1),(2); diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index ca79f53ff5b..f0c1abd84fe 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -184,8 +184,8 @@ microsecond("1997-12-31 23:59:59.000001") 1 create table t1 select makedate(1997,1) as f1, -addtime(cast("1997-12-31 23:59:59.000001" as datetime), "1 1:1:1.000002") as f2, -addtime(cast("23:59:59.999999" as time) , "1 1:1:1.000002") as f3, +addtime(cast("1997-12-31 23:59:59.000001" as datetime(6)), "1 1:1:1.000002") as f2, +addtime(cast("23:59:59.999999" as time(6)) , "1 1:1:1.000002") as f3, timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002") as f4, timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002") as f5, maketime(10,11,12) as f6, @@ -250,6 +250,8 @@ a select microsecond(19971231235959.01) as a; a 10000 +Warnings: +Warning 1292 Truncated incorrect time value: '19971231235959.01' select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a; a 1997-12-31 00:00:10.090000 diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index b2a47377b05..e511da4588e 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -11,19 +11,33 @@ now()-now() weekday(curdate())-weekday(now()) unix_timestamp()-unix_timestamp(no 0 0 0 select from_unixtime(unix_timestamp("1994-03-02 10:11:12")),from_unixtime(unix_timestamp("1994-03-02 10:11:12"),"%Y-%m-%d %h:%i:%s"),from_unixtime(unix_timestamp("1994-03-02 10:11:12"))+0; from_unixtime(unix_timestamp("1994-03-02 10:11:12")) from_unixtime(unix_timestamp("1994-03-02 10:11:12"),"%Y-%m-%d %h:%i:%s") from_unixtime(unix_timestamp("1994-03-02 10:11:12"))+0 -1994-03-02 10:11:12 1994-03-02 10:11:12 19940302101112 +1994-03-02 10:11:12.000000 1994-03-02 10:11:12 19940302101112.000000 select sec_to_time(9001),sec_to_time(9001)+0,time_to_sec("15:12:22"), sec_to_time(time_to_sec("0:30:47")/6.21); sec_to_time(9001) sec_to_time(9001)+0 time_to_sec("15:12:22") sec_to_time(time_to_sec("0:30:47")/6.21) -02:30:01 23001 54742 00:04:57.423510 +02:30:01 23001 54742.000000 00:04:57.423510 select sec_to_time(9001.1), time_to_sec('15:12:22.123456'), time_to_sec(15.5566778899); sec_to_time(9001.1) time_to_sec('15:12:22.123456') time_to_sec(15.5566778899) 02:30:01.1 54742.123456 15.556677 -Warnings: -Warning 1292 Truncated incorrect time value: '15.5566778899' select sec_to_time(time_to_sec('-838:59:59')); sec_to_time(time_to_sec('-838:59:59')) --838:59:59 +-838:59:59.000000 +select sec_to_time('9001.1'), sec_to_time('1234567890123.123'); +sec_to_time('9001.1') sec_to_time('1234567890123.123') +02:30:01.100000 838:59:59.999999 +Warnings: +Warning 1292 Truncated incorrect time value: '1234567890123.123' +select sec_to_time(90011e-1), sec_to_time(1234567890123e30); +sec_to_time(90011e-1) sec_to_time(1234567890123e30) +02:30:01.100000 838:59:59.999999 +Warnings: +Warning 1292 Truncated incorrect time value: '1.234567890123e+42' +select sec_to_time(1234567890123), sec_to_time('99999999999999999999999999999'); +sec_to_time(1234567890123) sec_to_time('99999999999999999999999999999') +838:59:59 838:59:59.999999 +Warnings: +Warning 1292 Truncated incorrect time value: '1234567890123' +Warning 1292 Truncated incorrect time value: '99999999999999999999999999999' select now()-curdate()*1000000-curtime(); now()-curdate()*1000000-curtime() 0 @@ -145,18 +159,18 @@ Saturday 5 select monthname("1972-03-04"),monthname("1972-03-04")+0; monthname("1972-03-04") monthname("1972-03-04")+0 March 3 -select time_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); -time_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T') -00|12|0|12|00|AM|12:00:00 AM|00|00:00:00 -select time_format(19980131010203,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); -time_format(19980131010203,'%H|%I|%k|%l|%i|%p|%r|%S|%T') -01|01|1|1|02|AM|01:02:03 AM|03|01:02:03 -select time_format(19980131131415,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); -time_format(19980131131415,'%H|%I|%k|%l|%i|%p|%r|%S|%T') -13|01|13|1|14|PM|01:14:15 PM|15|13:14:15 -select time_format(19980131010015,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); -time_format(19980131010015,'%H|%I|%k|%l|%i|%p|%r|%S|%T') -01|01|1|1|00|AM|01:00:15 AM|15|01:00:15 +select time_format(000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T'),date_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); +time_format(000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T') date_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T') +00|12|0|12|00|AM|12:00:00 AM|00|00:00:00 00|12|0|12|00|AM|12:00:00 AM|00|00:00:00 +select time_format(010203,'%H|%I|%k|%l|%i|%p|%r|%S|%T'),date_format(19980131010203,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); +time_format(010203,'%H|%I|%k|%l|%i|%p|%r|%S|%T') date_format(19980131010203,'%H|%I|%k|%l|%i|%p|%r|%S|%T') +01|01|1|1|02|AM|01:02:03 AM|03|01:02:03 01|01|1|1|02|AM|01:02:03 AM|03|01:02:03 +select time_format(131415,'%H|%I|%k|%l|%i|%p|%r|%S|%T'),date_format(19980131131415,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); +time_format(131415,'%H|%I|%k|%l|%i|%p|%r|%S|%T') date_format(19980131131415,'%H|%I|%k|%l|%i|%p|%r|%S|%T') +13|01|13|1|14|PM|01:14:15 PM|15|13:14:15 13|01|13|1|14|PM|01:14:15 PM|15|13:14:15 +select time_format(010015,'%H|%I|%k|%l|%i|%p|%r|%S|%T'),date_format(19980131010015,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); +time_format(010015,'%H|%I|%k|%l|%i|%p|%r|%S|%T') date_format(19980131010015,'%H|%I|%k|%l|%i|%p|%r|%S|%T') +01|01|1|1|00|AM|01:00:15 AM|15|01:00:15 01|01|1|1|00|AM|01:00:15 AM|15|01:00:15 select date_format(concat('19980131',131415),'%H|%I|%k|%l|%i|%p|%r|%S|%T| %M|%W|%D|%Y|%y|%a|%b|%j|%m|%d|%h|%s|%w'); date_format(concat('19980131',131415),'%H|%I|%k|%l|%i|%p|%r|%S|%T| %M|%W|%D|%Y|%y|%a|%b|%j|%m|%d|%h|%s|%w') 13|01|13|1|14|PM|01:14:15 PM|15|13:14:15| January|Saturday|31st|1998|98|Sat|Jan|031|01|31|01|15|6 @@ -551,7 +565,7 @@ select @a:=FROM_UNIXTIME(1); 1970-01-01 03:00:01 select unix_timestamp(@a); unix_timestamp(@a) -1 +1.000000 select unix_timestamp('1969-12-01 19:00:01'); unix_timestamp('1969-12-01 19:00:01') NULL @@ -593,10 +607,10 @@ unix_timestamp('1969-12-30 01:00:00') NULL select unix_timestamp('2038-01-17 12:00:00'); unix_timestamp('2038-01-17 12:00:00') -2147331600 +2147331600.000000 select unix_timestamp('1970-01-01 03:00:01'); unix_timestamp('1970-01-01 03:00:01') -1 +1.000000 select unix_timestamp('2038-01-19 07:14:07'); unix_timestamp('2038-01-19 07:14:07') NULL @@ -947,10 +961,10 @@ sec_to_time(1) + 0, from_unixtime(1) + 0; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `now() - now()` double(17,0) NOT NULL DEFAULT '0', - `curtime() - curtime()` double(17,0) NOT NULL DEFAULT '0', - `sec_to_time(1) + 0` double(17,0) DEFAULT NULL, - `from_unixtime(1) + 0` double(17,0) DEFAULT NULL + `now() - now()` decimal(20,0) NOT NULL DEFAULT '0', + `curtime() - curtime()` decimal(11,0) NOT NULL DEFAULT '0', + `sec_to_time(1) + 0` decimal(11,0) DEFAULT NULL, + `from_unixtime(1) + 0` decimal(20,0) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; SELECT SEC_TO_TIME(3300000); @@ -1041,6 +1055,7 @@ SEC_TO_TIME(CAST(-1 AS UNSIGNED)) 838:59:59 Warnings: Warning 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1105 Cast to unsigned converted negative integer to it's positive complement Warning 1292 Truncated incorrect time value: '18446744073709551615' SET NAMES latin1; SET character_set_results = NULL; @@ -1089,7 +1104,9 @@ NULL select isnull(week(now() + 0)), isnull(week(now() + 0.2)), week(20061108), week(20061108.01), week(20061108085411.000002); isnull(week(now() + 0)) isnull(week(now() + 0.2)) week(20061108) week(20061108.01) week(20061108085411.000002) -0 0 45 45 45 +0 0 45 NULL 45 +Warnings: +Warning 1292 Incorrect datetime value: '20061108.01' End of 4.1 tests explain extended select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a1, timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a2; @@ -1482,6 +1499,16 @@ time('-1 02:03:04') + interval 2 day select time('-1 02:03:04') - interval 2 day; time('-1 02:03:04') - interval 2 day -74:03:04 +select time('10 02:03:04') + interval 30 day; +time('10 02:03:04') + interval 30 day +NULL +Warnings: +Warning 1441 Datetime function: time field overflow +select time('10 02:03:04') + interval 1 year; +time('10 02:03:04') + interval 1 year +NULL +Warnings: +Warning 1441 Datetime function: time field overflow select cast('131415.123e0' as time); cast('131415.123e0' as time) NULL @@ -1524,8 +1551,6 @@ select * from t1 where f1 > time('-23:00:06'); f1 2000-09-12 00:00:00 2007-04-25 05:08:49 -Warnings: -Warning 1292 Incorrect datetime value: '-23:00:06' for column 'f1' at row 1 drop table t1; select maketime(20,61,10)+0; maketime(20,61,10)+0 @@ -1575,7 +1600,7 @@ select least(1, f1) from t1; least(1, f1) 0000-00-00 00:00:00 Warnings: -Warning 1292 Incorrect datetime value: '1' for column 'f1' at row 1 +Warning 1292 Incorrect datetime value: '1' drop table t1; select now() > coalesce(time('21:43:24'), date('2010-05-03')); now() > coalesce(time('21:43:24'), date('2010-05-03')) @@ -1600,6 +1625,8 @@ insert ignore t1 values ('04:38:11','0000-00-00 00:00:00',0,'0000-00-00 00:00:00 select least(greatest(f3, f2, f4), f5) from t1; least(greatest(f3, f2, f4), f5) 0000-00-00 00:00:00 +Warnings: +Warning 1292 Incorrect datetime value: '0' drop table t1; select day(coalesce(null)); day(coalesce(null)) @@ -1622,3 +1649,6 @@ greatest(cast("0-0-0" as date), cast("10:20:05" as time)) = '0000-00-00' select cast(greatest(cast("0-0-0" as date), cast("10:20:05" as time)) as datetime(6)); cast(greatest(cast("0-0-0" as date), cast("10:20:05" as time)) as datetime(6)) 0000-00-00 00:00:00.000000 +select microsecond('12:00:00.123456'), microsecond('2009-12-31 23:59:59.000010'); +microsecond('12:00:00.123456') microsecond('2009-12-31 23:59:59.000010') +123456 10 diff --git a/mysql-test/r/func_time_hires.result b/mysql-test/r/func_time_hires.result index 8a4a9db8da5..73b82a6ac1f 100644 --- a/mysql-test/r/func_time_hires.result +++ b/mysql-test/r/func_time_hires.result @@ -15,10 +15,10 @@ current_time(3) 01:01:01.123 current_timestamp(4) 2011-01-01 01:01:01.1234 localtime(5) 2011-01-01 01:01:01.12345 localtimestamp(6) 2011-01-01 01:01:01.123456 -time_to_sec('12:34:56') 45296 -time_to_sec('12:34:56.789') 45296.789 +time_to_sec('12:34:56') 45296.000000 +time_to_sec('12:34:56.789') 45296.789000 select sec_to_time(time_to_sec('1:2:3')), sec_to_time(time_to_sec('2:3:4.567890')); -sec_to_time(time_to_sec('1:2:3')) 01:02:03 +sec_to_time(time_to_sec('1:2:3')) 01:02:03.000000 sec_to_time(time_to_sec('2:3:4.567890')) 02:03:04.567890 select time_to_sec(sec_to_time(11111)), time_to_sec(sec_to_time(11111.22222)); time_to_sec(sec_to_time(11111)) 11111 @@ -48,7 +48,7 @@ t1 CREATE TABLE `t1` ( `localtime(5)` datetime(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000', `localtimestamp(6)` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', `time_to_sec(123456)` bigint(17) DEFAULT NULL, - `time_to_sec('12:34:56.789')` double DEFAULT NULL + `time_to_sec('12:34:56.789')` decimal(22,6) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t1; sec_to_time(12345) 03:25:45 @@ -63,36 +63,30 @@ current_timestamp(4) 2011-01-01 01:01:01.1234 localtime(5) 2011-01-01 01:01:01.12345 localtimestamp(6) 2011-01-01 01:01:01.123456 time_to_sec(123456) 45296 -time_to_sec('12:34:56.789') 45296.789 +time_to_sec('12:34:56.789') 45296.789000 drop table t1; select unix_timestamp('2011-01-01 01:01:01'), unix_timestamp('2011-01-01 01:01:01.123456'), unix_timestamp(cast('2011-01-01 01:01:01.123456' as datetime(0))), unix_timestamp(cast('2011-01-01 01:01:01.123456' as datetime(4)));; -unix_timestamp('2011-01-01 01:01:01') 1293832861 -unix_timestamp('2011-01-01 01:01:01.123456') 1293832861.12346 +unix_timestamp('2011-01-01 01:01:01') 1293832861.000000 +unix_timestamp('2011-01-01 01:01:01.123456') 1293832861.123456 unix_timestamp(cast('2011-01-01 01:01:01.123456' as datetime(0))) 1293832861 -unix_timestamp(cast('2011-01-01 01:01:01.123456' as datetime(4))) 1293832861.1235 +unix_timestamp(cast('2011-01-01 01:01:01.123456' as datetime(4))) 1293832861.1234 select from_unixtime(unix_timestamp('2011/1/1 1:1:1')), from_unixtime(unix_timestamp('2011/1/1 1:1:1.123456')), from_unixtime(unix_timestamp(cast('2011/1/1 1:1:1.123456' as datetime(0)))), from_unixtime(unix_timestamp(cast('2011/1/1 1:1:1.123456' as datetime(4))));; -from_unixtime(unix_timestamp('2011/1/1 1:1:1')) 2011-01-01 01:01:01 +from_unixtime(unix_timestamp('2011/1/1 1:1:1')) 2011-01-01 01:01:01.000000 from_unixtime(unix_timestamp('2011/1/1 1:1:1.123456')) 2011-01-01 01:01:01.123456 from_unixtime(unix_timestamp(cast('2011/1/1 1:1:1.123456' as datetime(0)))) 2011-01-01 01:01:01 from_unixtime(unix_timestamp(cast('2011/1/1 1:1:1.123456' as datetime(4)))) 2011-01-01 01:01:01.1234 select sec_to_time(3020399.99999), sec_to_time(3020399.999999), sec_to_time(3020399.9999999); sec_to_time(3020399.99999) sec_to_time(3020399.999999) sec_to_time(3020399.9999999) 838:59:59.99999 838:59:59.999999 838:59:59.999999 -Warnings: -Warning 1292 Truncated incorrect time value: '3020399.9999999' select sec_to_time(-3020399.99999), sec_to_time(-3020399.999999), sec_to_time(-3020399.9999999); sec_to_time(-3020399.99999) sec_to_time(-3020399.999999) sec_to_time(-3020399.9999999) -838:59:59.99999 -838:59:59.999999 -838:59:59.999999 -Warnings: -Warning 1292 Truncated incorrect time value: '-3020399.9999999' select 20010101000203.000000004 + interval 1 day; 20010101000203.000000004 + interval 1 day 2001-01-02 00:02:03.000000 -Warnings: -Warning 1292 Truncated incorrect datetime value: '20010101000203.000000004' -select 20010101000203.00004 + interval 1 day; -20010101000203.00004 + interval 1 day -2001-01-02 00:02:03.00004 +select 20010101000203.4 + interval 1 day; +20010101000203.4 + interval 1 day +2001-01-02 00:02:03.4 set @a=cast('2011-01-02 12:13:14' as datetime); select @a + interval 1 minute; @a + interval 1 minute @@ -158,6 +152,14 @@ t4 12:13:14.1234 t5 12:13:14.12345 t6 12:13:14.123456 drop table t1; +explain extended select cast(cast(@a as datetime(4)) as time(0)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select cast(cast((@a) as datetime(4)) as time) AS `cast(cast(@a as datetime(4)) as time(0))` +select cast(cast(@a as time(2)) as time(6)); +cast(cast(@a as time(2)) as time(6)) +12:13:14.120000 select CAST(@a AS DATETIME(7)); ERROR 42000: Too big precision 7 specified for '(@a)'. Maximum is 6. SELECT CONVERT_TZ('2011-01-02 12:00:00', '+00:00', '+03:00'); diff --git a/mysql-test/r/func_timestamp.result b/mysql-test/r/func_timestamp.result index 495fedea9e6..18fcbd947e7 100644 --- a/mysql-test/r/func_timestamp.result +++ b/mysql-test/r/func_timestamp.result @@ -7,7 +7,7 @@ SELECT CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit) AS Date, UNIX_TIMESTAMP(CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit)) AS Unix FROM t1; Date Unix -1998-9-16 09:26:00 905927160 -1998-9-16 09:26:00 905927160 +1998-9-16 09:26:00 905927160.000000 +1998-9-16 09:26:00 905927160.000000 drop table t1; set time_zone= @@global.time_zone; diff --git a/mysql-test/r/lock.result b/mysql-test/r/lock.result index 7ec07fb5273..1828a5f11e0 100644 --- a/mysql-test/r/lock.result +++ b/mysql-test/r/lock.result @@ -194,3 +194,13 @@ ERROR HY000: Table 't2' was locked with a READ lock and can't be updated UNLOCK TABLES; DROP TABLE t1,t2; End of 5.1 tests. +create table t1 (a int) engine=myisam; +lock tables t1 write concurrent, t1 as t2 read; +lock tables t1 read local; +unlock tables; +unlock tables; +lock tables t1 read local; +lock tables t1 write concurrent, t1 as t2 read; +unlock tables; +unlock tables; +drop table t1; diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index 19bd7089c49..fdb020500ee 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -212,7 +212,7 @@ DROP TABLE t1; End of 5.0 tests select cast('01:01:01' as time), cast('01:01:01' as time(2)); Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def cast('01:01:01' as time) 11 9 8 Y 128 0 63 -def cast('01:01:01' as time(2)) 11 12 11 Y 128 2 63 +def cast('01:01:01' as time) 11 10 8 Y 128 0 63 +def cast('01:01:01' as time(2)) 11 13 11 Y 128 2 63 cast('01:01:01' as time) cast('01:01:01' as time(2)) 01:01:01 01:01:01.00 diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index e8522c2e97c..bdb59eed946 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -667,11 +667,11 @@ CREATE TABLE t1 (f1 DATE); INSERT INTO t1 VALUES('2001-01-01'); UPDATE (SELECT 1 FROM t1 WHERE f1 = (SELECT f1() FROM t1)) x, t1 SET f1 = 1; Warnings: -Warning 1292 Truncated incorrect date value: '1' +Warning 1292 Incorrect datetime value: '1' CREATE view v1 as SELECT f1() FROM t1; UPDATE (SELECT 1 FROM t1 WHERE f1 = (select * from v1)) x, t1 SET f1 = 1; Warnings: -Warning 1292 Truncated incorrect date value: '1' +Warning 1292 Incorrect datetime value: '1' DROP VIEW v1; DROP FUNCTION f1; DROP TABLE t1; diff --git a/mysql-test/r/parser_precedence.result b/mysql-test/r/parser_precedence.result index cf301ec677b..979084d0346 100644 --- a/mysql-test/r/parser_precedence.result +++ b/mysql-test/r/parser_precedence.result @@ -1,4 +1,5 @@ drop table if exists t1_30237_bool; +set sql_mode=NO_UNSIGNED_SUBTRACTION; create table t1_30237_bool(A boolean, B boolean, C boolean); insert into t1_30237_bool values (FALSE, FALSE, FALSE), diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 138264fd4e1..0ac7c8e8770 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -2178,3 +2178,21 @@ INSERT INTO t1 VALUES(0); DROP TABLE t1; SET GLOBAL myisam_use_mmap=default; End of 5.1 tests +# +# BUG#598247: partition.test produces valgrind errors in 5.3-based branches +# +CREATE TABLE t1 ( +a INT DEFAULT NULL, +b DOUBLE DEFAULT NULL, +c INT DEFAULT NULL, +KEY idx2(b,a) +) engine=myisam PARTITION BY HASH(c) PARTITIONS 3; +INSERT INTO t1 VALUES (6,8,9); +INSERT INTO t1 VALUES (6,8,10); +SELECT 1 FROM t1 JOIN t1 AS t2 USING (a); +1 +1 +1 +1 +1 +drop table t1; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index b1ecd0d5d2e..e99c5b9942b 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -64,7 +64,7 @@ def test t9 t9 c12 c12 246 10 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 9377 0 63 -def test t9 t9 c16 c16 11 9 8 Y 128 0 63 +def test t9 t9 c16 c16 11 10 8 Y 128 0 63 def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 def test t9 t9 c18 c18 1 4 1 Y 32768 0 63 def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 @@ -1793,8 +1793,8 @@ t5 CREATE TABLE `t5` ( `param08` longtext, `const09` datetime DEFAULT NULL, `param09` longblob, - `const10` double NOT NULL DEFAULT '0', - `param10` double DEFAULT NULL, + `const10` decimal(22,6) NOT NULL DEFAULT '0.000000', + `param10` decimal(65,30) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, @@ -1823,8 +1823,8 @@ def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 -def test t5 t5 const10 const10 5 49 9 N 32769 31 63 -def test t5 t5 param10 param10 5 23 9 Y 32768 31 63 +def test t5 t5 const10 const10 246 24 16 N 1 6 63 +def test t5 t5 param10 param10 246 67 40 Y 0 30 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 @@ -1850,8 +1850,8 @@ const08 1991-08-05 01:01:01 param08 1991-08-05 01:01:01 const09 1991-08-05 01:01:01 param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 +const10 662680861.000000 +param10 662680861.000000000000000000000000000000 const11 1991 param11 1991 const12 NULL @@ -3215,7 +3215,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3225,7 +3225,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt1 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3236,7 +3236,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt2 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3247,7 +3247,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 set @arg00= 1.0e+10 ; insert into t9 @@ -3256,7 +3256,7 @@ values ( 50, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10 ) ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3273,7 +3273,7 @@ values execute stmt1 ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt2 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3282,7 +3282,7 @@ values execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00 ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 set @arg00= 'abc' ; set @arg00= NULL ; @@ -3338,14 +3338,14 @@ c1 c13 c14 c15 c16 c17 31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL 61 NULL NULL 1991-01-01 01:01:01 NULL NULL 62 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index c99d5596ace..6b7434390af 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -64,7 +64,7 @@ def test t9 t9 c12 c12 246 10 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 9377 0 63 -def test t9 t9 c16 c16 11 9 8 Y 128 0 63 +def test t9 t9 c16 c16 11 10 8 Y 128 0 63 def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 def test t9 t9 c18 c18 1 4 1 Y 32768 0 63 def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 @@ -1776,8 +1776,8 @@ t5 CREATE TABLE `t5` ( `param08` longtext, `const09` datetime DEFAULT NULL, `param09` longblob, - `const10` double NOT NULL DEFAULT '0', - `param10` double DEFAULT NULL, + `const10` decimal(22,6) NOT NULL DEFAULT '0.000000', + `param10` decimal(65,30) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, @@ -1806,8 +1806,8 @@ def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 -def test t5 t5 const10 const10 5 49 9 N 32769 31 63 -def test t5 t5 param10 param10 5 23 9 Y 32768 31 63 +def test t5 t5 const10 const10 246 24 16 N 1 6 63 +def test t5 t5 param10 param10 246 67 40 Y 0 30 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 @@ -1833,8 +1833,8 @@ const08 1991-08-05 01:01:01 param08 1991-08-05 01:01:01 const09 1991-08-05 01:01:01 param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 +const10 662680861.000000 +param10 662680861.000000000000000000000000000000 const11 1991 param11 1991 const12 NULL @@ -3198,7 +3198,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3208,7 +3208,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt1 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3219,7 +3219,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt2 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3230,7 +3230,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 set @arg00= 1.0e+10 ; insert into t9 @@ -3239,7 +3239,7 @@ values ( 50, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10 ) ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3256,7 +3256,7 @@ values execute stmt1 ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt2 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3265,7 +3265,7 @@ values execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00 ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 set @arg00= 'abc' ; set @arg00= NULL ; @@ -3321,14 +3321,14 @@ c1 c13 c14 c15 c16 c17 31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL 61 NULL NULL 1991-01-01 01:01:01 NULL NULL 62 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 1f7f981ef64..58acc19124a 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -65,7 +65,7 @@ def test t9 t9 c12 c12 246 10 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 9377 0 63 -def test t9 t9 c16 c16 11 9 8 Y 128 0 63 +def test t9 t9 c16 c16 11 10 8 Y 128 0 63 def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 def test t9 t9 c18 c18 1 4 1 Y 32768 0 63 def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 @@ -1777,8 +1777,8 @@ t5 CREATE TABLE `t5` ( `param08` longtext, `const09` datetime DEFAULT NULL, `param09` longblob, - `const10` double NOT NULL DEFAULT '0', - `param10` double DEFAULT NULL, + `const10` decimal(22,6) NOT NULL DEFAULT '0.000000', + `param10` decimal(65,30) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, @@ -1807,8 +1807,8 @@ def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 -def test t5 t5 const10 const10 5 49 9 N 32769 31 63 -def test t5 t5 param10 param10 5 23 9 Y 32768 31 63 +def test t5 t5 const10 const10 246 24 16 N 1 6 63 +def test t5 t5 param10 param10 246 67 40 Y 0 30 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 @@ -1834,8 +1834,8 @@ const08 1991-08-05 01:01:01 param08 1991-08-05 01:01:01 const09 1991-08-05 01:01:01 param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 +const10 662680861.000000 +param10 662680861.000000000000000000000000000000 const11 1991 param11 1991 const12 NULL @@ -3199,7 +3199,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3209,7 +3209,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt1 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3220,7 +3220,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt2 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3231,7 +3231,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 set @arg00= 1.0e+10 ; insert into t9 @@ -3240,7 +3240,7 @@ values ( 50, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10 ) ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3257,7 +3257,7 @@ values execute stmt1 ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt2 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3266,7 +3266,7 @@ values execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00 ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 set @arg00= 'abc' ; set @arg00= NULL ; @@ -3322,14 +3322,14 @@ c1 c13 c14 c15 c16 c17 31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL 61 NULL NULL 1991-01-01 01:01:01 NULL NULL 62 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index b965f2e968f..654e641deeb 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -107,7 +107,7 @@ def test t9 t9 c12 c12 246 10 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 9377 0 63 -def test t9 t9 c16 c16 11 9 8 Y 128 0 63 +def test t9 t9 c16 c16 11 10 8 Y 128 0 63 def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 def test t9 t9 c18 c18 1 4 1 Y 32768 0 63 def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 @@ -1713,8 +1713,8 @@ t5 CREATE TABLE `t5` ( `param08` longtext, `const09` datetime DEFAULT NULL, `param09` longblob, - `const10` double NOT NULL DEFAULT '0', - `param10` double DEFAULT NULL, + `const10` decimal(22,6) NOT NULL DEFAULT '0.000000', + `param10` decimal(65,30) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, @@ -1743,8 +1743,8 @@ def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 -def test t5 t5 const10 const10 5 49 9 N 32769 31 63 -def test t5 t5 param10 param10 5 23 9 Y 32768 31 63 +def test t5 t5 const10 const10 246 24 16 N 1 6 63 +def test t5 t5 param10 param10 246 67 40 Y 0 30 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 @@ -1770,8 +1770,8 @@ const08 1991-08-05 01:01:01 param08 1991-08-05 01:01:01 const09 1991-08-05 01:01:01 param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 +const10 662680861.000000 +param10 662680861.000000000000000000000000000000 const11 1991 param11 1991 const12 NULL @@ -3135,7 +3135,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3145,7 +3145,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt1 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3156,7 +3156,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt2 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3167,7 +3167,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 set @arg00= 1.0e+10 ; insert into t9 @@ -3176,7 +3176,7 @@ values ( 50, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10 ) ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3193,7 +3193,7 @@ values execute stmt1 ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt2 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3202,7 +3202,7 @@ values execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00 ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 set @arg00= 'abc' ; set @arg00= NULL ; @@ -3258,14 +3258,14 @@ c1 c13 c14 c15 c16 c17 31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL 61 NULL NULL 1991-01-01 01:01:01 NULL NULL 62 NULL NULL 1991-01-01 01:01:01 NULL NULL @@ -3461,7 +3461,7 @@ def test t9 t9 c12 c12 246 10 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 9377 0 63 -def test t9 t9 c16 c16 11 9 8 Y 128 0 63 +def test t9 t9 c16 c16 11 10 8 Y 128 0 63 def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 def test t9 t9 c18 c18 1 4 1 Y 32768 0 63 def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 @@ -5067,8 +5067,8 @@ t5 CREATE TABLE `t5` ( `param08` longtext, `const09` datetime DEFAULT NULL, `param09` longblob, - `const10` double NOT NULL DEFAULT '0', - `param10` double DEFAULT NULL, + `const10` decimal(22,6) NOT NULL DEFAULT '0.000000', + `param10` decimal(65,30) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, @@ -5097,8 +5097,8 @@ def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 -def test t5 t5 const10 const10 5 49 9 N 32769 31 63 -def test t5 t5 param10 param10 5 23 9 Y 32768 31 63 +def test t5 t5 const10 const10 246 24 16 N 1 6 63 +def test t5 t5 param10 param10 246 67 40 Y 0 30 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 @@ -5124,8 +5124,8 @@ const08 1991-08-05 01:01:01 param08 1991-08-05 01:01:01 const09 1991-08-05 01:01:01 param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 +const10 662680861.000000 +param10 662680861.000000000000000000000000000000 const11 1991 param11 1991 const12 NULL @@ -6489,7 +6489,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -6499,7 +6499,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt1 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -6510,7 +6510,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt2 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -6521,7 +6521,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 set @arg00= 1.0e+10 ; insert into t9 @@ -6530,7 +6530,7 @@ values ( 50, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10 ) ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -6547,7 +6547,7 @@ values execute stmt1 ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt2 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -6556,7 +6556,7 @@ values execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00 ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 set @arg00= 'abc' ; set @arg00= NULL ; @@ -6612,14 +6612,14 @@ c1 c13 c14 c15 c16 c17 31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL 61 NULL NULL 1991-01-01 01:01:01 NULL NULL 62 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index a5ca60e1234..f934c5cd732 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -991,20 +991,17 @@ SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid'; COUNT(*) 0 Warnings: -Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1 -Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 0 +Warning 1292 Incorrect datetime value: '20050327 invalid' SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 invalid'; COUNT(*) 0 Warnings: -Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1 -Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 0 +Warning 1292 Incorrect datetime value: '20050328 invalid' SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid'; COUNT(*) 0 Warnings: -Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1 -Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 0 +Warning 1292 Incorrect datetime value: '20050327 invalid' show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index c8242708217..8f9e8dd48c3 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -1104,13 +1104,10 @@ INSERT INTO t1 VALUES EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref PRIMARY PRIMARY 20 const 2 Using index condition -Warnings: -Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1 SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; item started price Warnings: -Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1 -Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 0 +Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00'; item started price A1 2005-11-01 08:00:00 1000.000 @@ -1122,7 +1119,7 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; item started price Warnings: -Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 0 +Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00'; item started price A1 2005-11-01 08:00:00 1000.000 @@ -1572,7 +1569,7 @@ str_to_date('2007-10-00', '%Y-%m-%d') >= '' AND str_to_date('2007-10-00', '%Y-%m-%d') <= '2007/10/20' 1 Warnings: -Warning 1292 Truncated incorrect date value: '' +Warning 1292 Incorrect datetime value: '' SELECT str_to_date('2007-20-00', '%Y-%m-%d') >= '2007/10/20' AND str_to_date('2007-20-00', '%Y-%m-%d') <= ''; str_to_date('2007-20-00', '%Y-%m-%d') >= '2007/10/20' AND @@ -1585,7 +1582,7 @@ SELECT str_to_date('2007-10-00', '%Y-%m-%d') BETWEEN '' AND '2007/10/20'; str_to_date('2007-10-00', '%Y-%m-%d') BETWEEN '' AND '2007/10/20' 1 Warnings: -Warning 1292 Truncated incorrect date value: '' +Warning 1292 Incorrect datetime value: '' SELECT str_to_date('2007-20-00', '%Y-%m-%d') BETWEEN '2007/10/20' AND ''; str_to_date('2007-20-00', '%Y-%m-%d') BETWEEN '2007/10/20' AND '' NULL diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 5161292af76..9a4d521293a 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2115,8 +2115,8 @@ INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12 SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; gvid the_success the_fail the_size the_time Warnings: -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 0 -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 0 +Warning 1292 Incorrect datetime value: 'wrong-date-value' +Warning 1292 Incorrect datetime value: 'wrong-date-value' SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; gvid the_success the_fail the_size the_time DROP TABLE t1,t2; @@ -3265,7 +3265,7 @@ f1 f2 4 2005-10-01 5 2005-12-30 Warnings: -Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +Warning 1292 Truncated incorrect date value: '2005-09-3a' select * from t1 where f2 <= '2005-09-31' order by f2; f1 f2 1 2005-01-01 @@ -3276,7 +3276,7 @@ f1 f2 1 2005-01-01 2 2005-09-01 Warnings: -Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +Warning 1292 Truncated incorrect date value: '2005-09-3a' drop table t1; create table t1 (f1 int, f2 int); insert into t1 values (1, 30), (2, 20), (3, 10); @@ -3753,15 +3753,11 @@ AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 1 SIMPLE t1 range ts ts 4 NULL 1 Using index condition; Using where; Rowid-ordered scan -Warnings: -Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 AND t1.ts BETWEEN t2.dt1 AND t2.dt2 AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; a ts a dt1 dt2 30 2006-01-03 23:00:00 30 2006-01-01 00:00:00 2999-12-31 00:00:00 -Warnings: -Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 DROP TABLE t1,t2; create table t1 (a bigint unsigned); insert into t1 values @@ -4092,28 +4088,28 @@ str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' and '2007/10/20 00:00:00 GMT' 1 Warnings: -Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT' -Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT' +Warning 1292 Truncated incorrect datetime value: '2007/10/01 00:00:00 GMT' +Warning 1292 Truncated incorrect datetime value: '2007/10/20 00:00:00 GMT' select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'; str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6' 1 Warnings: -Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6' +Warning 1292 Truncated incorrect datetime value: '2007/10/01 00:00:00 GMT-6' select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/20 00:00:00 GMT-6'; str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/20 00:00:00 GMT-6' 1 Warnings: -Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT-6' +Warning 1292 Truncated incorrect datetime value: '2007/10/20 00:00:00 GMT-6' select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'; str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6' 0 Warnings: -Warning 1292 Truncated incorrect date value: '2007/10/2000:00:00 GMT-6' +Warning 1292 Incorrect datetime value: '2007/10/2000:00:00 GMT-6' select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'; str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6' 1 Warnings: -Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6' +Warning 1292 Truncated incorrect datetime value: '2007-10-1 00:00:00 GMT-6' select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'; str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6' 1 @@ -4133,7 +4129,7 @@ select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6' 1 Warnings: -Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6' +Warning 1292 Truncated incorrect date value: '2007-10-01 x12:34:56 GMT-6' select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' 1 @@ -4189,7 +4185,7 @@ select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'; str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20' 1 Warnings: -Warning 1292 Truncated incorrect date value: '' +Warning 1292 Incorrect datetime value: '' select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'; str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20' 0 @@ -4203,22 +4199,22 @@ select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''; str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '' 0 Warnings: -Warning 1292 Truncated incorrect datetime value: '' +Warning 1292 Incorrect datetime value: '' select str_to_date('1','%Y-%m-%d') = '1'; str_to_date('1','%Y-%m-%d') = '1' 0 Warnings: -Warning 1292 Truncated incorrect date value: '1' +Warning 1292 Incorrect datetime value: '1' select str_to_date('1','%Y-%m-%d') = '1'; str_to_date('1','%Y-%m-%d') = '1' 0 Warnings: -Warning 1292 Truncated incorrect date value: '1' +Warning 1292 Incorrect datetime value: '1' select str_to_date('','%Y-%m-%d') = ''; str_to_date('','%Y-%m-%d') = '' 1 Warnings: -Warning 1292 Truncated incorrect date value: '' +Warning 1292 Incorrect datetime value: '' select str_to_date('2000-01-01','%Y-%m-%d') between '1000-01-01' and '2001-01-01'; str_to_date('2000-01-01','%Y-%m-%d') between '1000-01-01' and '2001-01-01' 1 diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result index 9b0e2fa01fa..0f591570a99 100644 --- a/mysql-test/r/select_jcl6.result +++ b/mysql-test/r/select_jcl6.result @@ -2122,8 +2122,8 @@ INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12 SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; gvid the_success the_fail the_size the_time Warnings: -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 0 -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 0 +Warning 1292 Incorrect datetime value: 'wrong-date-value' +Warning 1292 Incorrect datetime value: 'wrong-date-value' SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; gvid the_success the_fail the_size the_time DROP TABLE t1,t2; @@ -3272,7 +3272,7 @@ f1 f2 4 2005-10-01 5 2005-12-30 Warnings: -Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +Warning 1292 Truncated incorrect date value: '2005-09-3a' select * from t1 where f2 <= '2005-09-31' order by f2; f1 f2 1 2005-01-01 @@ -3283,7 +3283,7 @@ f1 f2 1 2005-01-01 2 2005-09-01 Warnings: -Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +Warning 1292 Truncated incorrect date value: '2005-09-3a' drop table t1; create table t1 (f1 int, f2 int); insert into t1 values (1, 30), (2, 20), (3, 10); @@ -3760,15 +3760,11 @@ AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 1 SIMPLE t1 range ts ts 4 NULL 1 Using index condition; Using where; Rowid-ordered scan -Warnings: -Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 AND t1.ts BETWEEN t2.dt1 AND t2.dt2 AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; a ts a dt1 dt2 30 2006-01-03 23:00:00 30 2006-01-01 00:00:00 2999-12-31 00:00:00 -Warnings: -Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 DROP TABLE t1,t2; create table t1 (a bigint unsigned); insert into t1 values @@ -4099,28 +4095,28 @@ str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' and '2007/10/20 00:00:00 GMT' 1 Warnings: -Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT' -Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT' +Warning 1292 Truncated incorrect datetime value: '2007/10/01 00:00:00 GMT' +Warning 1292 Truncated incorrect datetime value: '2007/10/20 00:00:00 GMT' select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'; str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6' 1 Warnings: -Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6' +Warning 1292 Truncated incorrect datetime value: '2007/10/01 00:00:00 GMT-6' select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/20 00:00:00 GMT-6'; str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/20 00:00:00 GMT-6' 1 Warnings: -Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT-6' +Warning 1292 Truncated incorrect datetime value: '2007/10/20 00:00:00 GMT-6' select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'; str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6' 0 Warnings: -Warning 1292 Truncated incorrect date value: '2007/10/2000:00:00 GMT-6' +Warning 1292 Incorrect datetime value: '2007/10/2000:00:00 GMT-6' select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'; str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6' 1 Warnings: -Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6' +Warning 1292 Truncated incorrect datetime value: '2007-10-1 00:00:00 GMT-6' select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'; str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6' 1 @@ -4140,7 +4136,7 @@ select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6' 1 Warnings: -Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6' +Warning 1292 Truncated incorrect date value: '2007-10-01 x12:34:56 GMT-6' select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' 1 @@ -4196,7 +4192,7 @@ select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'; str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20' 1 Warnings: -Warning 1292 Truncated incorrect date value: '' +Warning 1292 Incorrect datetime value: '' select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'; str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20' 0 @@ -4210,22 +4206,22 @@ select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''; str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '' 0 Warnings: -Warning 1292 Truncated incorrect datetime value: '' +Warning 1292 Incorrect datetime value: '' select str_to_date('1','%Y-%m-%d') = '1'; str_to_date('1','%Y-%m-%d') = '1' 0 Warnings: -Warning 1292 Truncated incorrect date value: '1' +Warning 1292 Incorrect datetime value: '1' select str_to_date('1','%Y-%m-%d') = '1'; str_to_date('1','%Y-%m-%d') = '1' 0 Warnings: -Warning 1292 Truncated incorrect date value: '1' +Warning 1292 Incorrect datetime value: '1' select str_to_date('','%Y-%m-%d') = ''; str_to_date('','%Y-%m-%d') = '' 1 Warnings: -Warning 1292 Truncated incorrect date value: '' +Warning 1292 Incorrect datetime value: '' select str_to_date('2000-01-01','%Y-%m-%d') between '1000-01-01' and '2001-01-01'; str_to_date('2000-01-01','%Y-%m-%d') between '1000-01-01' and '2001-01-01' 1 diff --git a/mysql-test/r/select_pkeycache.result b/mysql-test/r/select_pkeycache.result index 5161292af76..9a4d521293a 100644 --- a/mysql-test/r/select_pkeycache.result +++ b/mysql-test/r/select_pkeycache.result @@ -2115,8 +2115,8 @@ INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12 SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; gvid the_success the_fail the_size the_time Warnings: -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 0 -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 0 +Warning 1292 Incorrect datetime value: 'wrong-date-value' +Warning 1292 Incorrect datetime value: 'wrong-date-value' SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; gvid the_success the_fail the_size the_time DROP TABLE t1,t2; @@ -3265,7 +3265,7 @@ f1 f2 4 2005-10-01 5 2005-12-30 Warnings: -Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +Warning 1292 Truncated incorrect date value: '2005-09-3a' select * from t1 where f2 <= '2005-09-31' order by f2; f1 f2 1 2005-01-01 @@ -3276,7 +3276,7 @@ f1 f2 1 2005-01-01 2 2005-09-01 Warnings: -Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +Warning 1292 Truncated incorrect date value: '2005-09-3a' drop table t1; create table t1 (f1 int, f2 int); insert into t1 values (1, 30), (2, 20), (3, 10); @@ -3753,15 +3753,11 @@ AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 1 SIMPLE t1 range ts ts 4 NULL 1 Using index condition; Using where; Rowid-ordered scan -Warnings: -Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 AND t1.ts BETWEEN t2.dt1 AND t2.dt2 AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; a ts a dt1 dt2 30 2006-01-03 23:00:00 30 2006-01-01 00:00:00 2999-12-31 00:00:00 -Warnings: -Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 DROP TABLE t1,t2; create table t1 (a bigint unsigned); insert into t1 values @@ -4092,28 +4088,28 @@ str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' and '2007/10/20 00:00:00 GMT' 1 Warnings: -Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT' -Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT' +Warning 1292 Truncated incorrect datetime value: '2007/10/01 00:00:00 GMT' +Warning 1292 Truncated incorrect datetime value: '2007/10/20 00:00:00 GMT' select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'; str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6' 1 Warnings: -Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6' +Warning 1292 Truncated incorrect datetime value: '2007/10/01 00:00:00 GMT-6' select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/20 00:00:00 GMT-6'; str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/20 00:00:00 GMT-6' 1 Warnings: -Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT-6' +Warning 1292 Truncated incorrect datetime value: '2007/10/20 00:00:00 GMT-6' select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'; str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6' 0 Warnings: -Warning 1292 Truncated incorrect date value: '2007/10/2000:00:00 GMT-6' +Warning 1292 Incorrect datetime value: '2007/10/2000:00:00 GMT-6' select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'; str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6' 1 Warnings: -Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6' +Warning 1292 Truncated incorrect datetime value: '2007-10-1 00:00:00 GMT-6' select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'; str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6' 1 @@ -4133,7 +4129,7 @@ select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6' 1 Warnings: -Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6' +Warning 1292 Truncated incorrect date value: '2007-10-01 x12:34:56 GMT-6' select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' 1 @@ -4189,7 +4185,7 @@ select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'; str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20' 1 Warnings: -Warning 1292 Truncated incorrect date value: '' +Warning 1292 Incorrect datetime value: '' select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'; str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20' 0 @@ -4203,22 +4199,22 @@ select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''; str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '' 0 Warnings: -Warning 1292 Truncated incorrect datetime value: '' +Warning 1292 Incorrect datetime value: '' select str_to_date('1','%Y-%m-%d') = '1'; str_to_date('1','%Y-%m-%d') = '1' 0 Warnings: -Warning 1292 Truncated incorrect date value: '1' +Warning 1292 Incorrect datetime value: '1' select str_to_date('1','%Y-%m-%d') = '1'; str_to_date('1','%Y-%m-%d') = '1' 0 Warnings: -Warning 1292 Truncated incorrect date value: '1' +Warning 1292 Incorrect datetime value: '1' select str_to_date('','%Y-%m-%d') = ''; str_to_date('','%Y-%m-%d') = '' 1 Warnings: -Warning 1292 Truncated incorrect date value: '' +Warning 1292 Incorrect datetime value: '' select str_to_date('2000-01-01','%Y-%m-%d') between '1000-01-01' and '2001-01-01'; str_to_date('2000-01-01','%Y-%m-%d') between '1000-01-01' and '2001-01-01' 1 diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result index 4298bd8abcb..f93d22648bc 100644 --- a/mysql-test/r/subselect_sj.result +++ b/mysql-test/r/subselect_sj.result @@ -1266,4 +1266,43 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY C ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) 1 PRIMARY D ALL NULL NULL NULL NULL 3 Using where; End temporary; Using join buffer (flat, BNL join) drop table t1, t2; +# +# BUG#784441: Abort on semijoin with a view as the inner table +# +CREATE TABLE t1 (a int) ; +INSERT INTO t1 VALUES (1), (1); +CREATE TABLE t2 (a int) ; +INSERT INTO t2 VALUES (1), (1); +CREATE VIEW v1 AS SELECT 1; +EXPLAIN +SELECT * FROM t1 INNER JOIN t2 ON t2.a != 0 AND t2.a IN (SELECT * FROM v1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived3> system NULL NULL NULL NULL 1 +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used +SELECT * FROM t1 INNER JOIN t2 ON t2.a != 0 AND t2.a IN (SELECT * FROM v1); +a a +1 1 +1 1 +1 1 +1 1 +DROP VIEW v1; +DROP TABLE t1,t2; +# +# BUG#751439 Assertion `!table->file || table->file->inited == handler::NONE' failed with subquery +# +CREATE TABLE t1 ( f10 int, f11 int) ; +INSERT IGNORE INTO t1 VALUES (0,0),(0,0); +CREATE TABLE t2 ( f11 int); +INSERT IGNORE INTO t2 VALUES (0),(0); +CREATE TABLE t3 ( f11 int) ; +INSERT IGNORE INTO t3 VALUES (0); +SELECT alias1.f11 AS field2 +FROM ( t3 AS alias2 JOIN t1 AS alias3 ON alias3.f10 = 1) +LEFT JOIN ( t2 AS alias1 ) ON alias3.f11 = 1 +WHERE alias2.f11 IN ( SELECT f11 FROM t2 ) +GROUP BY field2 ; +field2 +drop table t1, t2, t3; set @@optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result index e4bf6488d5e..45dd12a6b77 100644 --- a/mysql-test/r/subselect_sj2.result +++ b/mysql-test/r/subselect_sj2.result @@ -721,3 +721,26 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where 1 PRIMARY t3 ALL NULL NULL NULL NULL 2 FirstMatch(t2) drop table t2, t3; +# +# BUG#761598: InnoDB: Error: row_search_for_mysql() is called without ha_innobase::external_lock() in maria-5.3 +# +CREATE TABLE t1 ( f1 int NOT NULL , f10 int) ; +INSERT IGNORE INTO t1 VALUES (25,0),(29,0); +CREATE TABLE t2 ( f10 int) ENGINE=InnoDB; +CREATE TABLE t3 ( f11 int) ; +INSERT IGNORE INTO t3 VALUES (0); +SELECT alias1.f10 AS field2 +FROM t2 AS alias1 +JOIN ( +t3 AS alias2 +JOIN t1 AS alias3 +ON alias3.f10 +) ON alias3.f1 +WHERE alias2.f11 IN ( +SELECT SQ4_alias1.f10 +FROM t1 AS SQ4_alias1 +LEFT JOIN t2 AS SQ4_alias3 ON SQ4_alias3.f10 +) +GROUP BY field2; +field2 +drop table t1, t2, t3; diff --git a/mysql-test/r/subselect_sj2_jcl6.result b/mysql-test/r/subselect_sj2_jcl6.result index d3101e1dc80..45cce630a22 100644 --- a/mysql-test/r/subselect_sj2_jcl6.result +++ b/mysql-test/r/subselect_sj2_jcl6.result @@ -730,6 +730,29 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join) 1 PRIMARY t3 ALL NULL NULL NULL NULL 2 FirstMatch(t2); Using join buffer (incremental, BNL join) drop table t2, t3; +# +# BUG#761598: InnoDB: Error: row_search_for_mysql() is called without ha_innobase::external_lock() in maria-5.3 +# +CREATE TABLE t1 ( f1 int NOT NULL , f10 int) ; +INSERT IGNORE INTO t1 VALUES (25,0),(29,0); +CREATE TABLE t2 ( f10 int) ENGINE=InnoDB; +CREATE TABLE t3 ( f11 int) ; +INSERT IGNORE INTO t3 VALUES (0); +SELECT alias1.f10 AS field2 +FROM t2 AS alias1 +JOIN ( +t3 AS alias2 +JOIN t1 AS alias3 +ON alias3.f10 +) ON alias3.f1 +WHERE alias2.f11 IN ( +SELECT SQ4_alias1.f10 +FROM t1 AS SQ4_alias1 +LEFT JOIN t2 AS SQ4_alias3 ON SQ4_alias3.f10 +) +GROUP BY field2; +field2 +drop table t1, t2, t3; set join_cache_level=default; show variables like 'join_cache_level'; Variable_name Value diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result index 884e186743b..0919e8701e2 100644 --- a/mysql-test/r/subselect_sj2_mat.result +++ b/mysql-test/r/subselect_sj2_mat.result @@ -732,6 +732,29 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where 1 PRIMARY t3 ALL NULL NULL NULL NULL 2 FirstMatch(t2) drop table t2, t3; +# +# BUG#761598: InnoDB: Error: row_search_for_mysql() is called without ha_innobase::external_lock() in maria-5.3 +# +CREATE TABLE t1 ( f1 int NOT NULL , f10 int) ; +INSERT IGNORE INTO t1 VALUES (25,0),(29,0); +CREATE TABLE t2 ( f10 int) ENGINE=InnoDB; +CREATE TABLE t3 ( f11 int) ; +INSERT IGNORE INTO t3 VALUES (0); +SELECT alias1.f10 AS field2 +FROM t2 AS alias1 +JOIN ( +t3 AS alias2 +JOIN t1 AS alias3 +ON alias3.f10 +) ON alias3.f1 +WHERE alias2.f11 IN ( +SELECT SQ4_alias1.f10 +FROM t1 AS SQ4_alias1 +LEFT JOIN t2 AS SQ4_alias3 ON SQ4_alias3.f10 +) +GROUP BY field2; +field2 +drop table t1, t2, t3; set optimizer_switch=default; select @@optimizer_switch like '%materialization=on%'; @@optimizer_switch like '%materialization=on%' diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result index cded78e4b04..1dc7a51e9bb 100644 --- a/mysql-test/r/subselect_sj_jcl6.result +++ b/mysql-test/r/subselect_sj_jcl6.result @@ -1274,6 +1274,45 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY C ALL NULL NULL NULL NULL 3 Using where; Using join buffer (incremental, BNL join) 1 PRIMARY D ALL NULL NULL NULL NULL 3 Using where; End temporary; Using join buffer (incremental, BNL join) drop table t1, t2; +# +# BUG#784441: Abort on semijoin with a view as the inner table +# +CREATE TABLE t1 (a int) ; +INSERT INTO t1 VALUES (1), (1); +CREATE TABLE t2 (a int) ; +INSERT INTO t2 VALUES (1), (1); +CREATE VIEW v1 AS SELECT 1; +EXPLAIN +SELECT * FROM t1 INNER JOIN t2 ON t2.a != 0 AND t2.a IN (SELECT * FROM v1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived3> system NULL NULL NULL NULL 1 +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used +SELECT * FROM t1 INNER JOIN t2 ON t2.a != 0 AND t2.a IN (SELECT * FROM v1); +a a +1 1 +1 1 +1 1 +1 1 +DROP VIEW v1; +DROP TABLE t1,t2; +# +# BUG#751439 Assertion `!table->file || table->file->inited == handler::NONE' failed with subquery +# +CREATE TABLE t1 ( f10 int, f11 int) ; +INSERT IGNORE INTO t1 VALUES (0,0),(0,0); +CREATE TABLE t2 ( f11 int); +INSERT IGNORE INTO t2 VALUES (0),(0); +CREATE TABLE t3 ( f11 int) ; +INSERT IGNORE INTO t3 VALUES (0); +SELECT alias1.f11 AS field2 +FROM ( t3 AS alias2 JOIN t1 AS alias3 ON alias3.f10 = 1) +LEFT JOIN ( t2 AS alias1 ) ON alias3.f11 = 1 +WHERE alias2.f11 IN ( SELECT f11 FROM t2 ) +GROUP BY field2 ; +field2 +drop table t1, t2, t3; set @@optimizer_switch=@save_optimizer_switch; # # BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off diff --git a/mysql-test/r/subselect_sj_nonmerged.result b/mysql-test/r/subselect_sj_nonmerged.result index 2fb12ba258b..9304c26ece6 100644 --- a/mysql-test/r/subselect_sj_nonmerged.result +++ b/mysql-test/r/subselect_sj_nonmerged.result @@ -100,4 +100,19 @@ GROUP BY 1 ); f1 DROP TABLE t1, t2; +# +# BUG#727183: WL#90 does not trigger with non-comma joins +# +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1(a int, key(a)); +insert into t1 select A.a + 10*B.a + 100*C.a from t0 A, t0 B, t0 C; +# The following must use non-merged SJ-Materialization: +explain select * from t1 X join t0 Y on X.a < Y.a where X.a in (select max(a) from t0); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 1 Using where +1 PRIMARY X ref a a 5 <subquery2>.max(a) 1 Using index +1 PRIMARY Y ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) +2 SUBQUERY t0 ALL NULL NULL NULL NULL 10 +drop table t0, t1; set optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/r/timezone.result b/mysql-test/r/timezone.result index d84fe54ba8c..5ae7e6f8117 100644 --- a/mysql-test/r/timezone.result +++ b/mysql-test/r/timezone.result @@ -7,7 +7,7 @@ select @a:=FROM_UNIXTIME(1); 1970-01-01 01:00:01 select unix_timestamp(@a); unix_timestamp(@a) -1 +1.000000 CREATE TABLE t1 (ts int); INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 01:00')); INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 02:00')); @@ -44,7 +44,7 @@ unix_timestamp('1970-01-01 01:00:01'), unix_timestamp('2038-01-19 04:14:07'), unix_timestamp('2038-01-19 04:14:08'); unix_timestamp('1970-01-01 01:00:00') unix_timestamp('1970-01-01 01:00:01') unix_timestamp('2038-01-19 04:14:07') unix_timestamp('2038-01-19 04:14:08') -0 1 2147483647 NULL +0.000000 1.000000 2147483647.000000 NULL select unix_timestamp('1969-12-31 23:59:59'), unix_timestamp('1970-01-01 00:00:00'), unix_timestamp('1970-01-01 00:59:59'); unix_timestamp('1969-12-31 23:59:59') unix_timestamp('1970-01-01 00:00:00') unix_timestamp('1970-01-01 00:59:59') NULL NULL NULL diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result index 8c2cd4cb88d..e2e337628ce 100644 --- a/mysql-test/r/timezone2.result +++ b/mysql-test/r/timezone2.result @@ -119,6 +119,7 @@ insert into t1 values ('0000-00-00 00:00:00'),('1969-12-31 23:59:59'), ('2038-01-19 03:14:07'),('2038-01-19 03:14:08'); Warnings: Warning 1264 Out of range value for column 'ts' at row 2 +Warning 1264 Out of range value for column 'ts' at row 3 Warning 1264 Out of range value for column 'ts' at row 6 select * from t1; ts @@ -135,6 +136,7 @@ insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 00:30:00'), ('2038-01-19 04:14:07'),('2038-01-19 04:14:08'); Warnings: Warning 1264 Out of range value for column 'ts' at row 2 +Warning 1264 Out of range value for column 'ts' at row 3 Warning 1264 Out of range value for column 'ts' at row 6 select * from t1; ts @@ -151,6 +153,7 @@ insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 01:00:00'), ('2038-01-19 04:44:07'),('2038-01-19 04:44:08'); Warnings: Warning 1264 Out of range value for column 'ts' at row 2 +Warning 1264 Out of range value for column 'ts' at row 3 Warning 1264 Out of range value for column 'ts' at row 6 select * from t1; ts diff --git a/mysql-test/r/timezone4.result b/mysql-test/r/timezone4.result index 28028bea657..ad0672890a2 100644 --- a/mysql-test/r/timezone4.result +++ b/mysql-test/r/timezone4.result @@ -3,4 +3,4 @@ from_unixtime(0) 1969-12-31 14:00:00 select unix_timestamp('1969-12-31 14:00:01'); unix_timestamp('1969-12-31 14:00:01') -1 +1.000000 diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 5e9a0435450..092be494302 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -185,14 +185,14 @@ DROP TABLE t1; SELECT CAST(CAST('2006-08-10' AS DATE) AS DECIMAL(20,6)); CAST(CAST('2006-08-10' AS DATE) AS DECIMAL(20,6)) 20060810.000000 -SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) AS DECIMAL(20,6)); -CAST(CAST('2006-08-10 10:11:12' AS DATETIME) AS DECIMAL(20,6)) +SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME(6)) AS DECIMAL(20,6)); +CAST(CAST('2006-08-10 10:11:12' AS DATETIME(6)) AS DECIMAL(20,6)) 20060810101112.000000 -SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) + INTERVAL 14 MICROSECOND AS DECIMAL(20,6)); -CAST(CAST('2006-08-10 10:11:12' AS DATETIME) + INTERVAL 14 MICROSECOND AS DECIMAL(20,6)) +SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME(6)) + INTERVAL 14 MICROSECOND AS DECIMAL(20,6)); +CAST(CAST('2006-08-10 10:11:12' AS DATETIME(6)) + INTERVAL 14 MICROSECOND AS DECIMAL(20,6)) 20060810101112.000014 -SELECT CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6)); -CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6)) +SELECT CAST(CAST('10:11:12.098700' AS TIME(6)) AS DECIMAL(20,6)); +CAST(CAST('10:11:12.098700' AS TIME(6)) AS DECIMAL(20,6)) 101112.098700 set @org_mode=@@sql_mode; create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03'); @@ -361,7 +361,7 @@ greatest(cast('01-01-01' as date), '01-01-02') + 0 20010102 select least(cast('01-01-01' as datetime), '01-01-02') + 0; least(cast('01-01-01' as datetime), '01-01-02') + 0 -20010101000000 +20010101000000.000000 select cast(least(cast('01-01-01' as datetime), '01-01-02') as signed); cast(least(cast('01-01-01' as datetime), '01-01-02') as signed) 20010101000000 @@ -399,7 +399,7 @@ if(@bug28261 = f1, '', @bug28261:= f1) 2001-01-01 2002-02-02 Warnings: -Warning 1292 Incorrect date value: '' for column 'f1' at row 1 +Warning 1292 Incorrect datetime value: '' select if(@bug28261 = f1, '', @bug28261:= f1) from t1; if(@bug28261 = f1, '', @bug28261:= f1) 2001-01-01 @@ -423,11 +423,11 @@ f1 2001-01-01 00:00:00 2002-02-02 00:00:00 Warnings: -Warning 1292 Incorrect datetime value: '2002010' for column 'f1' at row 0 +Warning 1292 Incorrect datetime value: '2002010' select * from t1 where f1 between 20020101 and 2007010100000; f1 Warnings: -Warning 1292 Incorrect datetime value: '2007010100000' for column 'f1' at row 0 +Warning 1292 Incorrect datetime value: '2007010100000' drop table t1; # # Bug#27216: functions with parameters of different date types may @@ -495,10 +495,10 @@ insert into t1 set f1 = '45:44:44'; insert into t1 set f1 = '15:44:44'; select * from t1 where (convert(f1,datetime)) != 1; f1 +45:44:44 15:44:44 Warnings: -Warning 1292 Truncated incorrect datetime value: '45:44:44' -Warning 1292 Truncated incorrect datetime value: '1' +Warning 1292 Incorrect datetime value: '1' drop table t1; create table t1 (a tinyint); insert into t1 values (), (), (); @@ -618,21 +618,21 @@ ERROR 42000: Invalid default value for 'da' create table t1 (t time default '916:00:00 a'); ERROR 42000: Invalid default value for 't' set @@sql_mode= @org_mode; -SELECT CAST(CAST('2006-08-10 10:11:12.0123450' AS DATETIME) AS DECIMAL(30,7)); -CAST(CAST('2006-08-10 10:11:12.0123450' AS DATETIME) AS DECIMAL(30,7)) +SELECT CAST(CAST('2006-08-10 10:11:12.0123450' AS DATETIME(6)) AS DECIMAL(30,7)); +CAST(CAST('2006-08-10 10:11:12.0123450' AS DATETIME(6)) AS DECIMAL(30,7)) 20060810101112.0123450 Warnings: Warning 1292 Truncated incorrect datetime value: '2006-08-10 10:11:12.0123450' -SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.0123450' AS DATETIME) AS DECIMAL(30,7)); -CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.0123450' AS DATETIME) AS DECIMAL(30,7)) +SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.0123450' AS DATETIME(6)) AS DECIMAL(30,7)); +CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.0123450' AS DATETIME(6)) AS DECIMAL(30,7)) 20060810101112.0123450 Warnings: Warning 1292 Truncated incorrect datetime value: '00000002006-000008-0000010 000010:0000011:00000012.0123450' -SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS DATETIME) AS DECIMAL(30,7)); -CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS DATETIME) AS DECIMAL(30,7)) +SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS DATETIME(6)) AS DECIMAL(30,7)); +CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS DATETIME(6)) AS DECIMAL(30,7)) 20060810101112.0123450 -SELECT CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7)); -CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7)) +SELECT CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime(6)) AS DECIMAL(30,7)); +CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime(6)) AS DECIMAL(30,7)) 20080729104251.1234560 Warnings: Warning 1292 Truncated incorrect datetime value: '2008-07-29T10:42:51.1234567' diff --git a/mysql-test/r/type_datetime_hires.result b/mysql-test/r/type_datetime_hires.result index b0ea2e871fb..583030bf0da 100644 --- a/mysql-test/r/type_datetime_hires.result +++ b/mysql-test/r/type_datetime_hires.result @@ -115,7 +115,106 @@ Table Create Table t3 CREATE TABLE `t3` ( `a` datetime(4) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2, t3; +insert t1 values ('2010-12-13 14:15:16.222222'); +select a, a+0, a-1, a*1, a/2 from t1; +a a+0 a-1 a*1 a/2 +2012-12-11 01:02:13.3332 20121211010213.3332 20121211010212.3332 20121211010213.3332 10060605505106.66660000 +2010-12-13 14:15:16.2222 20101213141516.2222 20101213141515.2222 20101213141516.2222 10050606570758.11110000 +select max(a), min(a), sum(a), avg(a) from t1; +max(a) min(a) sum(a) avg(a) +2012-12-11 01:02:13.3332 2010-12-13 14:15:16.2222 40222424151729.5554 20111212075864.77770000 +create table t2 select a, a+0, a-1, a*1, a/2 from t1; +create table t3 select max(a), min(a), sum(a), avg(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` datetime(4) DEFAULT NULL, + `a+0` decimal(25,4) DEFAULT NULL, + `a-1` decimal(25,4) DEFAULT NULL, + `a*1` decimal(25,4) DEFAULT NULL, + `a/2` decimal(28,8) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `max(a)` datetime(4) DEFAULT NULL, + `min(a)` datetime(4) DEFAULT NULL, + `sum(a)` decimal(46,4) DEFAULT NULL, + `avg(a)` decimal(28,8) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2, t3; +create table t1 (f0_datetime datetime(0), f1_datetime datetime(1), f2_datetime datetime(2), f3_datetime datetime(3), f4_datetime datetime(4), f5_datetime datetime(5), f6_datetime datetime(6)); +insert t1 values ( '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432'); +select * from t1; +f0_datetime 2010-11-12 11:14:17 +f1_datetime 2010-11-12 11:14:17.7 +f2_datetime 2010-11-12 11:14:17.76 +f3_datetime 2010-11-12 11:14:17.765 +f4_datetime 2010-11-12 11:14:17.7654 +f5_datetime 2010-11-12 11:14:17.76543 +f6_datetime 2010-11-12 11:14:17.765432 +select cast(f0_datetime as time(4)) time4_f0_datetime, cast(f1_datetime as datetime(3)) datetime3_f1_datetime, cast(f2_datetime as date) date_f2_datetime, cast(f4_datetime as double) double_f3_datetime, cast(f4_datetime as decimal(40,5)) decimal5_f4_datetime, cast(f5_datetime as signed) bigint_f5_datetime, cast(f6_datetime as char(255)) varchar_f6_datetime from t1; +time4_f0_datetime 11:14:17.0000 +datetime3_f1_datetime 2010-11-12 11:14:17.700 +date_f2_datetime 2010-11-12 +double_f3_datetime 20101112111417.8 +decimal5_f4_datetime 20101112111417.76540 +bigint_f5_datetime 20101112111417 +varchar_f6_datetime 2010-11-12 11:14:17.765432 +create table t2 (time4_f0_datetime time(4), datetime3_f1_datetime datetime(3), date_f2_datetime date, double_f3_datetime double, decimal5_f4_datetime decimal(40,5), bigint_f5_datetime bigint, varchar_f6_datetime varchar(255)); +insert t2 select * from t1; +Warnings: +Level Note +Code 1265 +Message Data truncated for column 'time4_f0_datetime' at row 1 +Level Note +Code 1265 +Message Data truncated for column 'date_f2_datetime' at row 1 +select * from t2; +time4_f0_datetime 11:14:17.0000 +datetime3_f1_datetime 2010-11-12 11:14:17.700 +date_f2_datetime 2010-11-12 +double_f3_datetime 20101112111417.8 +decimal5_f4_datetime 20101112111417.76540 +bigint_f5_datetime 20101112111417 +varchar_f6_datetime 2010-11-12 11:14:17.765432 +alter table t1 change f0_datetime time4_f0_datetime time(4), change f1_datetime datetime3_f1_datetime datetime(3), change f2_datetime date_f2_datetime date, change f3_datetime double_f3_datetime double, change f4_datetime decimal5_f4_datetime decimal(40,5), change f5_datetime bigint_f5_datetime bigint, change f6_datetime varchar_f6_datetime varchar(255); +Warnings: +Level Note +Code 1265 +Message Data truncated for column 'time4_f0_datetime' at row 1 +Level Note +Code 1265 +Message Data truncated for column 'date_f2_datetime' at row 1 +select * from t1; +time4_f0_datetime 11:14:17.0000 +datetime3_f1_datetime 2010-11-12 11:14:17.700 +date_f2_datetime 2010-11-12 +double_f3_datetime 20101112111417.8 +decimal5_f4_datetime 20101112111417.76540 +bigint_f5_datetime 20101112111417 +varchar_f6_datetime 2010-11-12 11:14:17.765432 +alter table t1 modify time4_f0_datetime datetime(0), modify datetime3_f1_datetime datetime(1), modify date_f2_datetime datetime(2), modify double_f3_datetime datetime(3), modify decimal5_f4_datetime datetime(4), modify bigint_f5_datetime datetime(5), modify varchar_f6_datetime datetime(6); +select * from t1; +time4_f0_datetime 0000-00-00 11:14:17 +datetime3_f1_datetime 2010-11-12 11:14:17.7 +date_f2_datetime 2010-11-12 00:00:00.00 +double_f3_datetime 2010-11-12 11:14:17.800 +decimal5_f4_datetime 2010-11-12 11:14:17.7654 +bigint_f5_datetime 2010-11-12 11:14:17.00000 +varchar_f6_datetime 2010-11-12 11:14:17.765432 +delete from t1; +insert t1 select * from t2; +select * from t1; +time4_f0_datetime 0000-00-00 11:14:17 +datetime3_f1_datetime 2010-11-12 11:14:17.7 +date_f2_datetime 2010-11-12 00:00:00.00 +double_f3_datetime 2010-11-12 11:14:17.765 +decimal5_f4_datetime 2010-11-12 11:14:17.7654 +bigint_f5_datetime 2010-11-12 11:14:17.00000 +varchar_f6_datetime 2010-11-12 11:14:17.765432 +drop table t1, t2; create table t1 (a datetime(6), b datetime(6)); create procedure foo(x datetime, y datetime(4)) insert into t1 values (x, y); call foo('2010-02-03 4:5:6.789123', '2010-02-03 4:5:6.789123'); @@ -228,136 +327,14 @@ t2 p01 RANGE extract(microsecond from taken) 123000 3 t2 p02 RANGE extract(microsecond from taken) 500000 4 t2 p03 RANGE extract(microsecond from taken) MAXVALUE 3 drop table t1, t2; -create table t1 ( -q_date date, -q_time time, -q_time5 time(5), -q_datetime datetime, -q_datetime1 datetime(1), -q_datetime3 datetime(3), -q_datetime5 datetime(5), -q_timestamp timestamp, -q_timestamp2 timestamp(2), -q_timestamp4 timestamp(4), -q_timestamp6 timestamp(6), -q_varchar50 varchar(50), -q_varchar60 varchar(60), -q_varchar70 varchar(70), -q_varchar80 varchar(80)); -create table t2 ( -date_datetime datetime, -time_datetime datetime, -time5_varchar100 varchar(100), -datetime_time time, -datetime1_date date, -datetime3_timestamp timestamp, -datetime5_varchar100 varchar(100), -timestamp_datetime datetime, -timestamp2_date date, -timestamp4_time time, -timestamp6_varchar100 varchar(100), -varchar50_date date, -varchar60_datetime datetime, -varchar70_time time, -varchar80_timestamp timestamp); -insert t1 values ('2010-11-12 11:14:17.765432', -'2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', -'2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', -'2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', -'2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', -'2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', -'2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', -'2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432'); -Warnings: -Note 1265 Data truncated for column 'q_date' at row 1 -Note 1265 Data truncated for column 'q_time' at row 1 -Note 1265 Data truncated for column 'q_time5' at row 1 -select * from t1;; -q_date 2010-11-12 -q_time 11:14:17 -q_time5 11:14:17.76543 -q_datetime 2010-11-12 11:14:17 -q_datetime1 2010-11-12 11:14:17.7 -q_datetime3 2010-11-12 11:14:17.765 -q_datetime5 2010-11-12 11:14:17.76543 -q_timestamp 2010-11-12 11:14:17 -q_timestamp2 2010-11-12 11:14:17.76 -q_timestamp4 2010-11-12 11:14:17.7654 -q_timestamp6 2010-11-12 11:14:17.765432 -q_varchar50 2010-11-12 11:14:17.765432 -q_varchar60 2010-11-12 11:14:17.765432 -q_varchar70 2010-11-12 11:14:17.765432 -q_varchar80 2010-11-12 11:14:17.765432 -insert t2 select * from t1; -Warnings: -Warning 1265 Data truncated for column 'time_datetime' at row 1 -Note 1265 Data truncated for column 'datetime_time' at row 1 -Note 1265 Data truncated for column 'datetime1_date' at row 1 -Note 1265 Data truncated for column 'timestamp2_date' at row 1 -Note 1265 Data truncated for column 'timestamp4_time' at row 1 -Note 1265 Data truncated for column 'varchar50_date' at row 1 -Note 1265 Data truncated for column 'varchar70_time' at row 1 -select * from t2;; -date_datetime 2010-11-12 00:00:00 -time_datetime 0000-00-00 00:00:00 -time5_varchar100 11:14:17.76543 -datetime_time 11:14:17 -datetime1_date 2010-11-12 -datetime3_timestamp 2010-11-12 11:14:17 -datetime5_varchar100 2010-11-12 11:14:17.76543 -timestamp_datetime 2010-11-12 11:14:17 -timestamp2_date 2010-11-12 -timestamp4_time 11:14:17 -timestamp6_varchar100 2010-11-12 11:14:17.765432 -varchar50_date 2010-11-12 -varchar60_datetime 2010-11-12 11:14:17 -varchar70_time 11:14:17 -varchar80_timestamp 2010-11-12 11:14:17 -alter table t1 -change q_date date_datetime datetime, -change q_time time_datetime datetime, -change q_time5 time5_varchar100 varchar(100), -change q_datetime datetime_time time, -change q_datetime1 datetime1_date date, -change q_datetime3 datetime3_timestamp timestamp, -change q_datetime5 datetime5_varchar100 varchar(100), -change q_timestamp timestamp_datetime datetime, -change q_timestamp2 timestamp2_date date, -change q_timestamp4 timestamp4_time time, -change q_timestamp6 timestamp6_varchar100 varchar(100), -change q_varchar50 varchar50_date date, -change q_varchar60 varchar60_datetime datetime, -change q_varchar70 varchar70_time time, -change q_varchar80 varchar80_timestamp timestamp; -Warnings: -Warning 1265 Data truncated for column 'time_datetime' at row 1 -Note 1265 Data truncated for column 'datetime_time' at row 1 -Note 1265 Data truncated for column 'datetime1_date' at row 1 -Note 1265 Data truncated for column 'timestamp2_date' at row 1 -Note 1265 Data truncated for column 'timestamp4_time' at row 1 -Note 1265 Data truncated for column 'varchar50_date' at row 1 -Note 1265 Data truncated for column 'varchar70_time' at row 1 -select * from t1;; -date_datetime 2010-11-12 00:00:00 -time_datetime 0000-00-00 00:00:00 -time5_varchar100 11:14:17.76543 -datetime_time 11:14:17 -datetime1_date 2010-11-12 -datetime3_timestamp 2010-11-12 11:14:17 -datetime5_varchar100 2010-11-12 11:14:17.76543 -timestamp_datetime 2010-11-12 11:14:17 -timestamp2_date 2010-11-12 -timestamp4_time 11:14:17 -timestamp6_varchar100 2010-11-12 11:14:17.765432 -varchar50_date 2010-11-12 -varchar60_datetime 2010-11-12 11:14:17 -varchar70_time 11:14:17 -varchar80_timestamp 2010-11-12 11:14:17 -drop table t1, t2; create table t1 (a datetime, b datetime(6)); insert t1 values ('2010-01-02 03:04:05.678912', '2010-01-02 03:04:05.678912'); update t1 set b=a; select * from t1; a b 2010-01-02 03:04:05 2010-01-02 03:04:05.000000 +alter table t1 modify b datetime, modify a datetime(6); +select * from t1; +a b +2010-01-02 03:04:05.000000 2010-01-02 03:04:05 drop table t1; diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index 86153cbb05d..f2464465d60 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -29,8 +29,8 @@ insert into t1 values("10.22.22"),(1234567),(123456789),(123456789.10),("10 22:2 Warnings: Warning 1265 Data truncated for column 't' at row 1 Warning 1265 Data truncated for column 't' at row 2 -Warning 1264 Out of range value for column 't' at row 3 -Warning 1264 Out of range value for column 't' at row 4 +Warning 1265 Data truncated for column 't' at row 3 +Warning 1265 Data truncated for column 't' at row 4 Warning 1265 Data truncated for column 't' at row 6 select * from t1; t @@ -55,8 +55,8 @@ t 36:30:31 00:00:10 00:00:00 -838:59:59 -838:59:59 +00:00:00 +00:00:00 262:22:00 00:00:12 drop table t1; diff --git a/mysql-test/r/type_time_hires.result b/mysql-test/r/type_time_hires.result index e5a32cc6b1c..bf54434a04c 100644 --- a/mysql-test/r/type_time_hires.result +++ b/mysql-test/r/type_time_hires.result @@ -10,52 +10,52 @@ Warnings: Note 1265 Data truncated for column 'a' at row 1 insert t1 values (20101211010203.45678); Warnings: -Warning 1264 Out of range value for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 1 insert t1 values (20101211030405.789e0); Warnings: -Warning 1264 Out of range value for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 1 insert t1 values (99991231235959e1); Warnings: -Warning 1264 Out of range value for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 1 select * from t1; a +00:00:00.000 00:20:03.123 +01:02:03.456 +03:04:05.789 15:47:11.123 -838:59:59.999 -838:59:59.999 -838:59:59.999 select truncate(a, 6) from t1; truncate(a, 6) +0.000000 2003.123000 +10203.456000 +30405.789062 154711.123000 -8385959.999000 -8385959.999000 -8385959.999000 select a DIV 1 from t1; a DIV 1 +0 2003 +10203 +30405 154711 -8385959 -8385959 -8385959 select group_concat(distinct a) from t1; group_concat(distinct a) -00:20:03.123,15:47:11.123,838:59:59.999 +00:00:00.000,00:20:03.123,01:02:03.456,03:04:05.789,15:47:11.123 alter table t1 engine=innodb; select * from t1 order by a; a +00:00:00.000 00:20:03.123 +01:02:03.456 +03:04:05.789 15:47:11.123 -838:59:59.999 -838:59:59.999 -838:59:59.999 select * from t1 order by a+0; a +00:00:00.000 00:20:03.123 +01:02:03.456 +03:04:05.789 15:47:11.123 -838:59:59.999 -838:59:59.999 -838:59:59.999 drop table t1; create table t1 (a time(4)) engine=innodb; insert t1 values ('2010-12-11 01:02:03.456789'); @@ -101,17 +101,21 @@ a 01:02:13.3332 select a, a + interval 2 year from t1; a a + interval 2 year -01:02:13.3332 0002-00-00 01:02:13.3332 +01:02:13.3332 NULL +Warnings: +Warning 1441 Datetime function: time field overflow insert t1 select a + interval 2 year from t1; Warnings: -Warning 1265 Data truncated for column 'a' at row 1 +Warning 1441 Datetime function: time field overflow select * from t1; a 01:02:13.3332 -00:00:00.0000 +NULL delete from t1 where a < 20110101; select * from t1; a +01:02:13.3332 +NULL create table t2 select * from t1; create table t3 like t1; show create table t2; @@ -124,7 +128,125 @@ Table Create Table t3 CREATE TABLE `t3` ( `a` time(4) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2, t3; +insert t1 values ('2010-12-13 14:15:16.222222'); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +select a, a+0, a-1, a*1, a/2 from t1; +a a+0 a-1 a*1 a/2 +01:02:13.3332 10213.3332 10212.3332 10213.3332 5106.66660000 +NULL NULL NULL NULL NULL +14:15:16.2222 141516.2222 141515.2222 141516.2222 70758.11110000 +select max(a), min(a), sum(a), avg(a) from t1; +max(a) min(a) sum(a) avg(a) +14:15:16.2222 01:02:13.3332 151729.5554 75864.77770000 +create table t2 select a, a+0, a-1, a*1, a/2 from t1; +create table t3 select max(a), min(a), sum(a), avg(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` time(4) DEFAULT NULL, + `a+0` decimal(16,4) DEFAULT NULL, + `a-1` decimal(16,4) DEFAULT NULL, + `a*1` decimal(16,4) DEFAULT NULL, + `a/2` decimal(19,8) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `max(a)` time(4) DEFAULT NULL, + `min(a)` time(4) DEFAULT NULL, + `sum(a)` decimal(37,4) DEFAULT NULL, + `avg(a)` decimal(19,8) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2, t3; +create table t1 (f0_time time(0), f1_time time(1), f2_time time(2), f3_time time(3), f4_time time(4), f5_time time(5), f6_time time(6)); +insert t1 values ( '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432'); +Warnings: +Level Note +Code 1265 +Message Data truncated for column 'f0_time' at row 1 +Level Note +Code 1265 +Message Data truncated for column 'f1_time' at row 1 +Level Note +Code 1265 +Message Data truncated for column 'f2_time' at row 1 +Level Note +Code 1265 +Message Data truncated for column 'f3_time' at row 1 +Level Note +Code 1265 +Message Data truncated for column 'f4_time' at row 1 +Level Note +Code 1265 +Message Data truncated for column 'f5_time' at row 1 +Level Note +Code 1265 +Message Data truncated for column 'f6_time' at row 1 +select * from t1; +f0_time 11:14:17 +f1_time 11:14:17.7 +f2_time 11:14:17.76 +f3_time 11:14:17.765 +f4_time 11:14:17.7654 +f5_time 11:14:17.76543 +f6_time 11:14:17.765432 +select cast(f0_time as time(4)) time4_f0_time, cast(f1_time as datetime(3)) datetime3_f1_time, cast(f2_time as date) date_f2_time, cast(f4_time as double) double_f3_time, cast(f4_time as decimal(40,5)) decimal5_f4_time, cast(f5_time as signed) bigint_f5_time, cast(f6_time as char(255)) varchar_f6_time from t1; +time4_f0_time 11:14:17.0000 +datetime3_f1_time 0000-00-00 11:14:17.700 +date_f2_time 0000-00-00 +double_f3_time 111417.7654 +decimal5_f4_time 111417.76540 +bigint_f5_time 111417 +varchar_f6_time 11:14:17.765432 +create table t2 (time4_f0_time time(4), datetime3_f1_time datetime(3), date_f2_time date, double_f3_time double, decimal5_f4_time decimal(40,5), bigint_f5_time bigint, varchar_f6_time varchar(255)); +insert t2 select * from t1; +Warnings: +Level Note +Code 1265 +Message Data truncated for column 'date_f2_time' at row 1 +select * from t2; +time4_f0_time 11:14:17.0000 +datetime3_f1_time 0000-00-00 11:14:17.700 +date_f2_time 0000-00-00 +double_f3_time 111417.765 +decimal5_f4_time 111417.76540 +bigint_f5_time 111417 +varchar_f6_time 11:14:17.765432 +alter table t1 change f0_time time4_f0_time time(4), change f1_time datetime3_f1_time datetime(3), change f2_time date_f2_time date, change f3_time double_f3_time double, change f4_time decimal5_f4_time decimal(40,5), change f5_time bigint_f5_time bigint, change f6_time varchar_f6_time varchar(255); +Warnings: +Level Note +Code 1265 +Message Data truncated for column 'date_f2_time' at row 1 +select * from t1; +time4_f0_time 11:14:17.0000 +datetime3_f1_time 0000-00-00 11:14:17.700 +date_f2_time 0000-00-00 +double_f3_time 111417.765 +decimal5_f4_time 111417.76540 +bigint_f5_time 111417 +varchar_f6_time 11:14:17.765432 +alter table t1 modify time4_f0_time time(0), modify datetime3_f1_time time(1), modify date_f2_time time(2), modify double_f3_time time(3), modify decimal5_f4_time time(4), modify bigint_f5_time time(5), modify varchar_f6_time time(6); +select * from t1; +time4_f0_time 11:14:17 +datetime3_f1_time 11:14:17.7 +date_f2_time 00:00:00.00 +double_f3_time 11:14:17.765 +decimal5_f4_time 11:14:17.7654 +bigint_f5_time 11:14:17.00000 +varchar_f6_time 11:14:17.765432 +delete from t1; +insert t1 select * from t2; +select * from t1; +time4_f0_time 11:14:17 +datetime3_f1_time 11:14:17.7 +date_f2_time 00:00:00.00 +double_f3_time 11:14:17.764 +decimal5_f4_time 11:14:17.7654 +bigint_f5_time 11:14:17.00000 +varchar_f6_time 11:14:17.765432 +drop table t1, t2; create table t1 (a time(6), b time(6)); create procedure foo(x time, y time(4)) insert into t1 values (x, y); call foo('2010-02-03 4:5:6.789123', '2010-02-03 4:5:6.789123'); @@ -179,18 +301,40 @@ a b 04:05:06.000000 04:05:06.789100 drop view v1; drop table t1, t2; -create table t1 (a time(4) not null); -insert into t1 values ('-00:00:00.6'),('-00:00:00.7'),('-00:00:00.8'),('-00:00:00.9'),('-00:00:01.0'),('-00:00:01.1'),('-00:00:01.000000'),('-00:00:01.100001'),('-00:00:01.000002'),('-00:00:01.090000'); -select * from t1; +create table t1 (a time(4) not null, key(a)); +insert into t1 values ('1:2:3.001'),('1:2:3'), ('-00:00:00.6'),('-00:00:00.7'),('-00:00:00.8'),('-00:00:00.9'),('-00:00:01.0'),('-00:00:01.1'),('-00:00:01.000000'),('-00:00:01.100001'),('-00:00:01.000002'),('-00:00:01.090000'); +select * from t1 order by a; a +-00:00:01.1000 +-00:00:01.1000 +-00:00:01.0900 +-00:00:01.0000 +-00:00:01.0000 +-00:00:01.0000 +-00:00:00.9000 +-00:00:00.8000 +-00:00:00.7000 +-00:00:00.6000 +01:02:03.0000 +01:02:03.0010 +select * from t1 order by a desc; +a +01:02:03.0010 +01:02:03.0000 -00:00:00.6000 -00:00:00.7000 -00:00:00.8000 -00:00:00.9000 -00:00:01.0000 --00:00:01.1000 -00:00:01.0000 --00:00:01.1000 -00:00:01.0000 -00:00:01.0900 +-00:00:01.1000 +-00:00:01.1000 +select min(a - interval 1 hour), max(a - interval 1 hour) from t1 where a < 0; +min(a - interval 1 hour) max(a - interval 1 hour) +-01:00:01.1000 -01:00:00.6000 drop table t1; +select cast(1e-6 as time(6)); +cast(1e-6 as time(6)) +00:00:00.000001 diff --git a/mysql-test/r/type_timestamp_hires.result b/mysql-test/r/type_timestamp_hires.result index 5bb980a3ba7..b19542f90e7 100644 --- a/mysql-test/r/type_timestamp_hires.result +++ b/mysql-test/r/type_timestamp_hires.result @@ -115,7 +115,114 @@ Table Create Table t3 CREATE TABLE `t3` ( `a` timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2, t3; +insert t1 values ('2010-12-13 14:15:16.222222'); +select a, a+0, a-1, a*1, a/2 from t1; +a a+0 a-1 a*1 a/2 +2012-12-11 01:02:13.3332 20121211010213.3332 20121211010212.3332 20121211010213.3332 10060605505106.66660000 +2010-12-13 14:15:16.2222 20101213141516.2222 20101213141515.2222 20101213141516.2222 10050606570758.11110000 +select max(a), min(a), sum(a), avg(a) from t1; +max(a) min(a) sum(a) avg(a) +2012-12-11 01:02:13.3332 2010-12-13 14:15:16.2222 40222424151729.5554 20111212075864.77770000 +create table t2 select a, a+0, a-1, a*1, a/2 from t1; +create table t3 select max(a), min(a), sum(a), avg(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` timestamp(4) NOT NULL DEFAULT '0000-00-00 00:00:00.0000', + `a+0` decimal(25,4) NOT NULL DEFAULT '0.0000', + `a-1` decimal(25,4) NOT NULL DEFAULT '0.0000', + `a*1` decimal(25,4) NOT NULL DEFAULT '0.0000', + `a/2` decimal(28,8) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `max(a)` timestamp(4) NULL DEFAULT NULL, + `min(a)` timestamp(4) NULL DEFAULT NULL, + `sum(a)` decimal(46,4) DEFAULT NULL, + `avg(a)` decimal(28,8) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2, t3; +create table t1 (f0_timestamp timestamp(0), f1_timestamp timestamp(1), f2_timestamp timestamp(2), f3_timestamp timestamp(3), f4_timestamp timestamp(4), f5_timestamp timestamp(5), f6_timestamp timestamp(6)); +insert t1 values ( '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432'); +select * from t1; +f0_timestamp 2010-11-12 11:14:17 +f1_timestamp 2010-11-12 11:14:17.7 +f2_timestamp 2010-11-12 11:14:17.76 +f3_timestamp 2010-11-12 11:14:17.765 +f4_timestamp 2010-11-12 11:14:17.7654 +f5_timestamp 2010-11-12 11:14:17.76543 +f6_timestamp 2010-11-12 11:14:17.765432 +select cast(f0_timestamp as time(4)) time4_f0_timestamp, cast(f1_timestamp as datetime(3)) datetime3_f1_timestamp, cast(f2_timestamp as date) date_f2_timestamp, cast(f4_timestamp as double) double_f3_timestamp, cast(f4_timestamp as decimal(40,5)) decimal5_f4_timestamp, cast(f5_timestamp as signed) bigint_f5_timestamp, cast(f6_timestamp as char(255)) varchar_f6_timestamp from t1; +time4_f0_timestamp 11:14:17.0000 +datetime3_f1_timestamp 2010-11-12 11:14:17.700 +date_f2_timestamp 2010-11-12 +double_f3_timestamp 20101112111417.8 +decimal5_f4_timestamp 20101112111417.76540 +bigint_f5_timestamp 20101112111417 +varchar_f6_timestamp 2010-11-12 11:14:17.765432 +create table t2 (time4_f0_timestamp time(4), datetime3_f1_timestamp datetime(3), date_f2_timestamp date, double_f3_timestamp double, decimal5_f4_timestamp decimal(40,5), bigint_f5_timestamp bigint, varchar_f6_timestamp varchar(255)); +insert t2 select * from t1; +Warnings: +Level Note +Code 1265 +Message Data truncated for column 'time4_f0_timestamp' at row 1 +Level Note +Code 1265 +Message Data truncated for column 'date_f2_timestamp' at row 1 +select * from t2; +time4_f0_timestamp 11:14:17.0000 +datetime3_f1_timestamp 2010-11-12 11:14:17.700 +date_f2_timestamp 2010-11-12 +double_f3_timestamp 20101112111417.8 +decimal5_f4_timestamp 20101112111417.76540 +bigint_f5_timestamp 20101112111417 +varchar_f6_timestamp 2010-11-12 11:14:17.765432 +alter table t1 change f0_timestamp time4_f0_timestamp time(4), change f1_timestamp datetime3_f1_timestamp datetime(3), change f2_timestamp date_f2_timestamp date, change f3_timestamp double_f3_timestamp double, change f4_timestamp decimal5_f4_timestamp decimal(40,5), change f5_timestamp bigint_f5_timestamp bigint, change f6_timestamp varchar_f6_timestamp varchar(255); +Warnings: +Level Note +Code 1265 +Message Data truncated for column 'time4_f0_timestamp' at row 1 +Level Note +Code 1265 +Message Data truncated for column 'date_f2_timestamp' at row 1 +select * from t1; +time4_f0_timestamp 11:14:17.0000 +datetime3_f1_timestamp 2010-11-12 11:14:17.700 +date_f2_timestamp 2010-11-12 +double_f3_timestamp 20101112111417.8 +decimal5_f4_timestamp 20101112111417.76540 +bigint_f5_timestamp 20101112111417 +varchar_f6_timestamp 2010-11-12 11:14:17.765432 +alter table t1 modify time4_f0_timestamp timestamp(0), modify datetime3_f1_timestamp timestamp(1), modify date_f2_timestamp timestamp(2), modify double_f3_timestamp timestamp(3), modify decimal5_f4_timestamp timestamp(4), modify bigint_f5_timestamp timestamp(5), modify varchar_f6_timestamp timestamp(6); +Warnings: +Level Warning +Code 1265 +Message Data truncated for column 'time4_f0_timestamp' at row 1 +select * from t1; +time4_f0_timestamp 0000-00-00 00:00:00 +datetime3_f1_timestamp 2010-11-12 11:14:17.7 +date_f2_timestamp 2010-11-12 00:00:00.00 +double_f3_timestamp 2010-11-12 11:14:17.800 +decimal5_f4_timestamp 2010-11-12 11:14:17.7654 +bigint_f5_timestamp 2010-11-12 11:14:17.00000 +varchar_f6_timestamp 2010-11-12 11:14:17.765432 +delete from t1; +insert t1 select * from t2; +Warnings: +Level Warning +Code 1265 +Message Data truncated for column 'time4_f0_timestamp' at row 1 +select * from t1; +time4_f0_timestamp 0000-00-00 00:00:00 +datetime3_f1_timestamp 2010-11-12 11:14:17.7 +date_f2_timestamp 2010-11-12 00:00:00.00 +double_f3_timestamp 2010-11-12 11:14:17.765 +decimal5_f4_timestamp 2010-11-12 11:14:17.7654 +bigint_f5_timestamp 2010-11-12 11:14:17.00000 +varchar_f6_timestamp 2010-11-12 11:14:17.765432 +drop table t1, t2; create table t1 (a timestamp(6), b timestamp(6)); create procedure foo(x timestamp, y timestamp(4)) insert into t1 values (x, y); call foo('2010-02-03 4:5:6.789123', '2010-02-03 4:5:6.789123'); diff --git a/mysql-test/suite/funcs_1/r/innodb_func_view.result b/mysql-test/suite/funcs_1/r/innodb_func_view.result index ca1b0cf82f3..0d514e7b8e6 100644 --- a/mysql-test/suite/funcs_1/r/innodb_func_view.result +++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result @@ -3540,10 +3540,10 @@ my_year, id FROM t1_values WHERE select_id = 58 OR select_id IS NULL order by id; CAST(my_year AS TIME) my_year id NULL NULL 1 -00:19:01 1901 2 -00:21:55 2155 3 -00:20:00 2000 4 -00:20:05 2005 5 +00:00:00 1901 2 +00:00:00 2155 3 +00:00:00 2000 4 +00:00:00 2005 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as time) AS `CAST(my_year AS TIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3552,10 +3552,10 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 58 OR select_id IS NULL) order by id; CAST(my_year AS TIME) my_year id NULL NULL 1 -00:19:01 1901 2 -00:21:55 2155 3 -00:20:00 2000 4 -00:20:05 2005 5 +00:00:00 1901 2 +00:00:00 2155 3 +00:00:00 2000 4 +00:00:00 2005 5 DROP VIEW v1; @@ -3676,8 +3676,8 @@ NULL 1.7976931348623e+308 3 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 2 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 3 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3692,8 +3692,8 @@ NULL 1.7976931348623e+308 3 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 1 DROP VIEW v1; @@ -3886,15 +3886,10 @@ my_year, id FROM t1_values WHERE select_id = 47 OR select_id IS NULL order by id; CAST(my_year AS DATETIME) my_year id NULL NULL 1 -NULL 1901 2 -NULL 2155 3 -NULL 2000 4 -NULL 2005 5 -Warnings: -Warning 1292 Incorrect datetime value: '1901' -Warning 1292 Incorrect datetime value: '2155' -Warning 1292 Incorrect datetime value: '2000' -Warning 1292 Incorrect datetime value: '2005' +1901-00-00 00:00:00 1901 2 +2155-00-00 00:00:00 2155 3 +2000-00-00 00:00:00 2000 4 +2005-00-00 00:00:00 2005 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as datetime) AS `CAST(my_year AS DATETIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3903,15 +3898,10 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 47 OR select_id IS NULL) order by id; CAST(my_year AS DATETIME) my_year id NULL NULL 1 -NULL 1901 2 -NULL 2155 3 -NULL 2000 4 -NULL 2005 5 -Warnings: -Warning 1292 Incorrect datetime value: '1901' -Warning 1292 Incorrect datetime value: '2155' -Warning 1292 Incorrect datetime value: '2000' -Warning 1292 Incorrect datetime value: '2005' +1901-00-00 00:00:00 1901 2 +2155-00-00 00:00:00 2155 3 +2000-00-00 00:00:00 2000 4 +2005-00-00 00:00:00 2005 5 DROP VIEW v1; @@ -3923,12 +3913,11 @@ WHERE select_id = 46 OR select_id IS NULL order by id; CAST(my_time AS DATETIME) my_time id NULL NULL 1 NULL -838:59:59 2 -NULL 838:59:59 3 +0000-01-03 22:59:59 838:59:59 3 0000-00-00 13:00:00 13:00:00 4 0000-00-00 10:00:00 10:00:00 5 Warnings: Warning 1292 Truncated incorrect datetime value: '-838:59:59' -Warning 1292 Truncated incorrect datetime value: '838:59:59' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3938,12 +3927,11 @@ WHERE select_id = 46 OR select_id IS NULL) order by id; CAST(my_time AS DATETIME) my_time id NULL NULL 1 NULL -838:59:59 2 -NULL 838:59:59 3 +0000-01-03 22:59:59 838:59:59 3 0000-00-00 13:00:00 13:00:00 4 0000-00-00 10:00:00 10:00:00 5 Warnings: Warning 1292 Truncated incorrect datetime value: '-838:59:59' -Warning 1292 Truncated incorrect datetime value: '838:59:59' DROP VIEW v1; @@ -4034,15 +4022,14 @@ CAST(my_double AS DATETIME) my_double id NULL NULL 1 NULL -1.7976931348623e+308 2 NULL 1.7976931348623e+308 3 -NULL 0 4 +0000-00-00 00:00:00 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '0' -Warning 1292 Incorrect datetime value: '-1' -Warning 1292 Incorrect datetime value: '200506271758' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 2 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 3 +Warning 1292 Incorrect datetime value: '-1' for column 'my_double' at row 5 +Warning 1292 Incorrect datetime value: '200506271758' for column 'my_double' at row 19 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as datetime) AS `CAST(my_double AS DATETIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -4053,15 +4040,14 @@ CAST(my_double AS DATETIME) my_double id NULL NULL 1 NULL -1.7976931348623e+308 2 NULL 1.7976931348623e+308 3 -NULL 0 4 +0000-00-00 00:00:00 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '0' -Warning 1292 Incorrect datetime value: '-1' -Warning 1292 Incorrect datetime value: '200506271758' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '-1' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '200506271758' for column 'my_double' at row 1 DROP VIEW v1; @@ -4266,15 +4252,10 @@ my_year, id FROM t1_values WHERE select_id = 36 OR select_id IS NULL order by id; CAST(my_year AS DATE) my_year id NULL NULL 1 -NULL 1901 2 -NULL 2155 3 -NULL 2000 4 -NULL 2005 5 -Warnings: -Warning 1292 Incorrect datetime value: '1901' -Warning 1292 Incorrect datetime value: '2155' -Warning 1292 Incorrect datetime value: '2000' -Warning 1292 Incorrect datetime value: '2005' +1901-00-00 1901 2 +2155-00-00 2155 3 +2000-00-00 2000 4 +2005-00-00 2005 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as date) AS `CAST(my_year AS DATE)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -4283,15 +4264,10 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 36 OR select_id IS NULL) order by id; CAST(my_year AS DATE) my_year id NULL NULL 1 -NULL 1901 2 -NULL 2155 3 -NULL 2000 4 -NULL 2005 5 -Warnings: -Warning 1292 Incorrect datetime value: '1901' -Warning 1292 Incorrect datetime value: '2155' -Warning 1292 Incorrect datetime value: '2000' -Warning 1292 Incorrect datetime value: '2005' +1901-00-00 1901 2 +2155-00-00 2155 3 +2000-00-00 2000 4 +2005-00-00 2005 5 DROP VIEW v1; @@ -4408,14 +4384,13 @@ CAST(my_double AS DATE) my_double id NULL NULL 1 NULL -1.7976931348623e+308 2 NULL 1.7976931348623e+308 3 -NULL 0 4 +0000-00-00 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '0' -Warning 1292 Incorrect datetime value: '-1' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 2 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 3 +Warning 1292 Incorrect datetime value: '-1' for column 'my_double' at row 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as date) AS `CAST(my_double AS DATE)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -4426,14 +4401,13 @@ CAST(my_double AS DATE) my_double id NULL NULL 1 NULL -1.7976931348623e+308 2 NULL 1.7976931348623e+308 3 -NULL 0 4 +0000-00-00 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '0' -Warning 1292 Incorrect datetime value: '-1' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '-1' for column 'my_double' at row 1 DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/memory_func_view.result b/mysql-test/suite/funcs_1/r/memory_func_view.result index bcef7bae827..61b375fbc1e 100644 --- a/mysql-test/suite/funcs_1/r/memory_func_view.result +++ b/mysql-test/suite/funcs_1/r/memory_func_view.result @@ -3541,10 +3541,10 @@ my_year, id FROM t1_values WHERE select_id = 58 OR select_id IS NULL order by id; CAST(my_year AS TIME) my_year id NULL NULL 1 -00:19:01 1901 2 -00:21:55 2155 3 -00:20:00 2000 4 -00:20:05 2005 5 +00:00:00 1901 2 +00:00:00 2155 3 +00:00:00 2000 4 +00:00:00 2005 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as time) AS `CAST(my_year AS TIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3553,10 +3553,10 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 58 OR select_id IS NULL) order by id; CAST(my_year AS TIME) my_year id NULL NULL 1 -00:19:01 1901 2 -00:21:55 2155 3 -00:20:00 2000 4 -00:20:05 2005 5 +00:00:00 1901 2 +00:00:00 2155 3 +00:00:00 2000 4 +00:00:00 2005 5 DROP VIEW v1; @@ -3677,8 +3677,8 @@ NULL 1.7976931348623e+308 3 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 2 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 3 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3693,8 +3693,8 @@ NULL 1.7976931348623e+308 3 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 1 DROP VIEW v1; @@ -3887,15 +3887,10 @@ my_year, id FROM t1_values WHERE select_id = 47 OR select_id IS NULL order by id; CAST(my_year AS DATETIME) my_year id NULL NULL 1 -NULL 1901 2 -NULL 2155 3 -NULL 2000 4 -NULL 2005 5 -Warnings: -Warning 1292 Incorrect datetime value: '1901' -Warning 1292 Incorrect datetime value: '2155' -Warning 1292 Incorrect datetime value: '2000' -Warning 1292 Incorrect datetime value: '2005' +1901-00-00 00:00:00 1901 2 +2155-00-00 00:00:00 2155 3 +2000-00-00 00:00:00 2000 4 +2005-00-00 00:00:00 2005 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as datetime) AS `CAST(my_year AS DATETIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3904,15 +3899,10 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 47 OR select_id IS NULL) order by id; CAST(my_year AS DATETIME) my_year id NULL NULL 1 -NULL 1901 2 -NULL 2155 3 -NULL 2000 4 -NULL 2005 5 -Warnings: -Warning 1292 Incorrect datetime value: '1901' -Warning 1292 Incorrect datetime value: '2155' -Warning 1292 Incorrect datetime value: '2000' -Warning 1292 Incorrect datetime value: '2005' +1901-00-00 00:00:00 1901 2 +2155-00-00 00:00:00 2155 3 +2000-00-00 00:00:00 2000 4 +2005-00-00 00:00:00 2005 5 DROP VIEW v1; @@ -3924,12 +3914,11 @@ WHERE select_id = 46 OR select_id IS NULL order by id; CAST(my_time AS DATETIME) my_time id NULL NULL 1 NULL -838:59:59 2 -NULL 838:59:59 3 +0000-01-03 22:59:59 838:59:59 3 0000-00-00 13:00:00 13:00:00 4 0000-00-00 10:00:00 10:00:00 5 Warnings: Warning 1292 Truncated incorrect datetime value: '-838:59:59' -Warning 1292 Truncated incorrect datetime value: '838:59:59' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3939,12 +3928,11 @@ WHERE select_id = 46 OR select_id IS NULL) order by id; CAST(my_time AS DATETIME) my_time id NULL NULL 1 NULL -838:59:59 2 -NULL 838:59:59 3 +0000-01-03 22:59:59 838:59:59 3 0000-00-00 13:00:00 13:00:00 4 0000-00-00 10:00:00 10:00:00 5 Warnings: Warning 1292 Truncated incorrect datetime value: '-838:59:59' -Warning 1292 Truncated incorrect datetime value: '838:59:59' DROP VIEW v1; @@ -4035,15 +4023,14 @@ CAST(my_double AS DATETIME) my_double id NULL NULL 1 NULL -1.7976931348623e+308 2 NULL 1.7976931348623e+308 3 -NULL 0 4 +0000-00-00 00:00:00 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '0' -Warning 1292 Incorrect datetime value: '-1' -Warning 1292 Incorrect datetime value: '200506271758' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 2 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 3 +Warning 1292 Incorrect datetime value: '-1' for column 'my_double' at row 5 +Warning 1292 Incorrect datetime value: '200506271758' for column 'my_double' at row 6 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as datetime) AS `CAST(my_double AS DATETIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -4054,15 +4041,14 @@ CAST(my_double AS DATETIME) my_double id NULL NULL 1 NULL -1.7976931348623e+308 2 NULL 1.7976931348623e+308 3 -NULL 0 4 +0000-00-00 00:00:00 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '0' -Warning 1292 Incorrect datetime value: '-1' -Warning 1292 Incorrect datetime value: '200506271758' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '-1' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '200506271758' for column 'my_double' at row 1 DROP VIEW v1; @@ -4267,15 +4253,10 @@ my_year, id FROM t1_values WHERE select_id = 36 OR select_id IS NULL order by id; CAST(my_year AS DATE) my_year id NULL NULL 1 -NULL 1901 2 -NULL 2155 3 -NULL 2000 4 -NULL 2005 5 -Warnings: -Warning 1292 Incorrect datetime value: '1901' -Warning 1292 Incorrect datetime value: '2155' -Warning 1292 Incorrect datetime value: '2000' -Warning 1292 Incorrect datetime value: '2005' +1901-00-00 1901 2 +2155-00-00 2155 3 +2000-00-00 2000 4 +2005-00-00 2005 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as date) AS `CAST(my_year AS DATE)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -4284,15 +4265,10 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 36 OR select_id IS NULL) order by id; CAST(my_year AS DATE) my_year id NULL NULL 1 -NULL 1901 2 -NULL 2155 3 -NULL 2000 4 -NULL 2005 5 -Warnings: -Warning 1292 Incorrect datetime value: '1901' -Warning 1292 Incorrect datetime value: '2155' -Warning 1292 Incorrect datetime value: '2000' -Warning 1292 Incorrect datetime value: '2005' +1901-00-00 1901 2 +2155-00-00 2155 3 +2000-00-00 2000 4 +2005-00-00 2005 5 DROP VIEW v1; @@ -4409,14 +4385,13 @@ CAST(my_double AS DATE) my_double id NULL NULL 1 NULL -1.7976931348623e+308 2 NULL 1.7976931348623e+308 3 -NULL 0 4 +0000-00-00 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '0' -Warning 1292 Incorrect datetime value: '-1' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 2 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 3 +Warning 1292 Incorrect datetime value: '-1' for column 'my_double' at row 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as date) AS `CAST(my_double AS DATE)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -4427,14 +4402,13 @@ CAST(my_double AS DATE) my_double id NULL NULL 1 NULL -1.7976931348623e+308 2 NULL 1.7976931348623e+308 3 -NULL 0 4 +0000-00-00 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '0' -Warning 1292 Incorrect datetime value: '-1' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '-1' for column 'my_double' at row 1 DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/myisam_func_view.result b/mysql-test/suite/funcs_1/r/myisam_func_view.result index bcef7bae827..61b375fbc1e 100644 --- a/mysql-test/suite/funcs_1/r/myisam_func_view.result +++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result @@ -3541,10 +3541,10 @@ my_year, id FROM t1_values WHERE select_id = 58 OR select_id IS NULL order by id; CAST(my_year AS TIME) my_year id NULL NULL 1 -00:19:01 1901 2 -00:21:55 2155 3 -00:20:00 2000 4 -00:20:05 2005 5 +00:00:00 1901 2 +00:00:00 2155 3 +00:00:00 2000 4 +00:00:00 2005 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as time) AS `CAST(my_year AS TIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3553,10 +3553,10 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 58 OR select_id IS NULL) order by id; CAST(my_year AS TIME) my_year id NULL NULL 1 -00:19:01 1901 2 -00:21:55 2155 3 -00:20:00 2000 4 -00:20:05 2005 5 +00:00:00 1901 2 +00:00:00 2155 3 +00:00:00 2000 4 +00:00:00 2005 5 DROP VIEW v1; @@ -3677,8 +3677,8 @@ NULL 1.7976931348623e+308 3 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 2 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 3 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as time) AS `CAST(my_double AS TIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3693,8 +3693,8 @@ NULL 1.7976931348623e+308 3 -00:00:01 -1 5 00:17:58 1758 25 Warnings: -Warning 1292 Truncated incorrect time value: '-1.7976931348623e+308' -Warning 1292 Truncated incorrect time value: '1.7976931348623e+308' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 1 DROP VIEW v1; @@ -3887,15 +3887,10 @@ my_year, id FROM t1_values WHERE select_id = 47 OR select_id IS NULL order by id; CAST(my_year AS DATETIME) my_year id NULL NULL 1 -NULL 1901 2 -NULL 2155 3 -NULL 2000 4 -NULL 2005 5 -Warnings: -Warning 1292 Incorrect datetime value: '1901' -Warning 1292 Incorrect datetime value: '2155' -Warning 1292 Incorrect datetime value: '2000' -Warning 1292 Incorrect datetime value: '2005' +1901-00-00 00:00:00 1901 2 +2155-00-00 00:00:00 2155 3 +2000-00-00 00:00:00 2000 4 +2005-00-00 00:00:00 2005 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as datetime) AS `CAST(my_year AS DATETIME)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3904,15 +3899,10 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 47 OR select_id IS NULL) order by id; CAST(my_year AS DATETIME) my_year id NULL NULL 1 -NULL 1901 2 -NULL 2155 3 -NULL 2000 4 -NULL 2005 5 -Warnings: -Warning 1292 Incorrect datetime value: '1901' -Warning 1292 Incorrect datetime value: '2155' -Warning 1292 Incorrect datetime value: '2000' -Warning 1292 Incorrect datetime value: '2005' +1901-00-00 00:00:00 1901 2 +2155-00-00 00:00:00 2155 3 +2000-00-00 00:00:00 2000 4 +2005-00-00 00:00:00 2005 5 DROP VIEW v1; @@ -3924,12 +3914,11 @@ WHERE select_id = 46 OR select_id IS NULL order by id; CAST(my_time AS DATETIME) my_time id NULL NULL 1 NULL -838:59:59 2 -NULL 838:59:59 3 +0000-01-03 22:59:59 838:59:59 3 0000-00-00 13:00:00 13:00:00 4 0000-00-00 10:00:00 10:00:00 5 Warnings: Warning 1292 Truncated incorrect datetime value: '-838:59:59' -Warning 1292 Truncated incorrect datetime value: '838:59:59' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_time` as datetime) AS `CAST(my_time AS DATETIME)`,`t1_values`.`my_time` AS `my_time`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -3939,12 +3928,11 @@ WHERE select_id = 46 OR select_id IS NULL) order by id; CAST(my_time AS DATETIME) my_time id NULL NULL 1 NULL -838:59:59 2 -NULL 838:59:59 3 +0000-01-03 22:59:59 838:59:59 3 0000-00-00 13:00:00 13:00:00 4 0000-00-00 10:00:00 10:00:00 5 Warnings: Warning 1292 Truncated incorrect datetime value: '-838:59:59' -Warning 1292 Truncated incorrect datetime value: '838:59:59' DROP VIEW v1; @@ -4035,15 +4023,14 @@ CAST(my_double AS DATETIME) my_double id NULL NULL 1 NULL -1.7976931348623e+308 2 NULL 1.7976931348623e+308 3 -NULL 0 4 +0000-00-00 00:00:00 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '0' -Warning 1292 Incorrect datetime value: '-1' -Warning 1292 Incorrect datetime value: '200506271758' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 2 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 3 +Warning 1292 Incorrect datetime value: '-1' for column 'my_double' at row 5 +Warning 1292 Incorrect datetime value: '200506271758' for column 'my_double' at row 6 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as datetime) AS `CAST(my_double AS DATETIME)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -4054,15 +4041,14 @@ CAST(my_double AS DATETIME) my_double id NULL NULL 1 NULL -1.7976931348623e+308 2 NULL 1.7976931348623e+308 3 -NULL 0 4 +0000-00-00 00:00:00 0 4 NULL -1 5 NULL 200506271758 19 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '0' -Warning 1292 Incorrect datetime value: '-1' -Warning 1292 Incorrect datetime value: '200506271758' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '-1' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '200506271758' for column 'my_double' at row 1 DROP VIEW v1; @@ -4267,15 +4253,10 @@ my_year, id FROM t1_values WHERE select_id = 36 OR select_id IS NULL order by id; CAST(my_year AS DATE) my_year id NULL NULL 1 -NULL 1901 2 -NULL 2155 3 -NULL 2000 4 -NULL 2005 5 -Warnings: -Warning 1292 Incorrect datetime value: '1901' -Warning 1292 Incorrect datetime value: '2155' -Warning 1292 Incorrect datetime value: '2000' -Warning 1292 Incorrect datetime value: '2005' +1901-00-00 1901 2 +2155-00-00 2155 3 +2000-00-00 2000 4 +2005-00-00 2005 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_year` as date) AS `CAST(my_year AS DATE)`,`t1_values`.`my_year` AS `my_year`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -4284,15 +4265,10 @@ WHERE v1.id IN (SELECT id FROM t1_values WHERE select_id = 36 OR select_id IS NULL) order by id; CAST(my_year AS DATE) my_year id NULL NULL 1 -NULL 1901 2 -NULL 2155 3 -NULL 2000 4 -NULL 2005 5 -Warnings: -Warning 1292 Incorrect datetime value: '1901' -Warning 1292 Incorrect datetime value: '2155' -Warning 1292 Incorrect datetime value: '2000' -Warning 1292 Incorrect datetime value: '2005' +1901-00-00 1901 2 +2155-00-00 2155 3 +2000-00-00 2000 4 +2005-00-00 2005 5 DROP VIEW v1; @@ -4409,14 +4385,13 @@ CAST(my_double AS DATE) my_double id NULL NULL 1 NULL -1.7976931348623e+308 2 NULL 1.7976931348623e+308 3 -NULL 0 4 +0000-00-00 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '0' -Warning 1292 Incorrect datetime value: '-1' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 2 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 3 +Warning 1292 Incorrect datetime value: '-1' for column 'my_double' at row 5 SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as date) AS `CAST(my_double AS DATE)`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci @@ -4427,14 +4402,13 @@ CAST(my_double AS DATE) my_double id NULL NULL 1 NULL -1.7976931348623e+308 2 NULL 1.7976931348623e+308 3 -NULL 0 4 +0000-00-00 0 4 NULL -1 5 2005-06-27 20050627 13 Warnings: -Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '1.7976931348623e+308' -Warning 1292 Incorrect datetime value: '0' -Warning 1292 Incorrect datetime value: '-1' +Warning 1292 Incorrect datetime value: '-1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '1.7976931348623e+308' for column 'my_double' at row 1 +Warning 1292 Incorrect datetime value: '-1' for column 'my_double' at row 1 DROP VIEW v1; diff --git a/mysql-test/suite/innodb/r/innodb_bug54044.result b/mysql-test/suite/innodb/r/innodb_bug54044.result index 90ab812f2ae..3f607e20ddf 100644 --- a/mysql-test/suite/innodb/r/innodb_bug54044.result +++ b/mysql-test/suite/innodb/r/innodb_bug54044.result @@ -1,3 +1,2 @@ CREATE TEMPORARY TABLE table_54044 ENGINE = INNODB AS SELECT IF(NULL IS NOT NULL, NULL, NULL); -ERROR HY000: Can't create table 'test.table_54044' (errno: -1) diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result index 3063c8001e2..9acc1f424d4 100644 --- a/mysql-test/suite/innodb/r/innodb_mysql.result +++ b/mysql-test/suite/innodb/r/innodb_mysql.result @@ -2535,7 +2535,7 @@ INSERT INTO t1 VALUES (0); SET SQL_MODE='STRICT_ALL_TABLES'; CREATE TABLE t2 SELECT LEAST((SELECT '' FROM t1),NOW()) FROM `t1`; -ERROR 22007: Truncated incorrect datetime value: '' +ERROR 22007: Incorrect datetime value: '' DROP TABLE t1; SET SQL_MODE=DEFAULT; # diff --git a/mysql-test/suite/innodb/t/innodb_bug54044.test b/mysql-test/suite/innodb/t/innodb_bug54044.test index 4d64ad7e7ef..32a4ca0e116 100644 --- a/mysql-test/suite/innodb/t/innodb_bug54044.test +++ b/mysql-test/suite/innodb/t/innodb_bug54044.test @@ -1,10 +1,4 @@ -# This is the test for bug #54044. Special handle MYSQL_TYPE_NULL type -# during create table, so it will not trigger assertion failure. - --source include/have_innodb.inc -# This 'create table' operation should fail because of -# using NULL datatype ---error ER_CANT_CREATE_TABLE CREATE TEMPORARY TABLE table_54044 ENGINE = INNODB AS SELECT IF(NULL IS NOT NULL, NULL, NULL); diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug54044.result b/mysql-test/suite/innodb_plugin/r/innodb_bug54044.result index 90ab812f2ae..3f607e20ddf 100644 --- a/mysql-test/suite/innodb_plugin/r/innodb_bug54044.result +++ b/mysql-test/suite/innodb_plugin/r/innodb_bug54044.result @@ -1,3 +1,2 @@ CREATE TEMPORARY TABLE table_54044 ENGINE = INNODB AS SELECT IF(NULL IS NOT NULL, NULL, NULL); -ERROR HY000: Can't create table 'test.table_54044' (errno: -1) diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug54044.test b/mysql-test/suite/innodb_plugin/t/innodb_bug54044.test index 98af06cbd27..10a18dff5ce 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug54044.test +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug54044.test @@ -1,10 +1,4 @@ -# This is the test for bug #54044. Special handle MYSQL_TYPE_NULL type -# during create table, so it will not trigger assertion failure. - --source include/have_innodb_plugin.inc -# This 'create table' operation should fail because of -# using NULL datatype ---error ER_CANT_CREATE_TABLE CREATE TEMPORARY TABLE table_54044 ENGINE = INNODB AS SELECT IF(NULL IS NOT NULL, NULL, NULL); diff --git a/mysql-test/suite/maria/r/compat_aliases.result b/mysql-test/suite/maria/r/compat_aliases.result deleted file mode 100644 index bcc9ece0986..00000000000 --- a/mysql-test/suite/maria/r/compat_aliases.result +++ /dev/null @@ -1,58 +0,0 @@ -select * from information_schema.plugins where plugin_name like '%aria'; -PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE PLUGIN_MATURITY PLUGIN_AUTH_VERSION -Maria 1.5 ACTIVE DAEMON # NULL NULL Monty Program Ab Compatibility aliases for the Aria engine GPL Gamma 1.5 -Aria 1.5 ACTIVE STORAGE ENGINE # NULL NULL Monty Program Ab Crash-safe tables with MyISAM heritage GPL Gamma 1.5 -select maria_vars.variable_name, aria_vars.variable_name from -information_schema.session_variables as maria_vars left join -information_schema.session_variables as aria_vars -on (maria_vars.variable_name = concat('m', aria_vars.variable_name)) -where maria_vars.variable_name like 'maria_%' - and not (maria_vars.variable_value <=> aria_vars.variable_value); -variable_name variable_name -select maria_vars.variable_name, aria_vars.variable_name from -information_schema.session_status as maria_vars left join -information_schema.session_status as aria_vars -on (maria_vars.variable_name = concat('m', aria_vars.variable_name)) -where maria_vars.variable_name like 'maria_%' - and not (maria_vars.variable_value <=> aria_vars.variable_value); -variable_name variable_name -select maria_vars.variable_name, aria_vars.variable_name from -information_schema.session_variables as aria_vars left join -information_schema.session_variables as maria_vars -on (maria_vars.variable_name = concat('m', aria_vars.variable_name)) -where aria_vars.variable_name like 'aria_%' - and not (maria_vars.variable_value <=> aria_vars.variable_value); -variable_name variable_name -select maria_vars.variable_name, aria_vars.variable_name from -information_schema.session_status as aria_vars left join -information_schema.session_status as maria_vars -on (maria_vars.variable_name = concat('m', aria_vars.variable_name)) -where aria_vars.variable_name like 'aria_%' - and not (maria_vars.variable_value <=> aria_vars.variable_value); -variable_name variable_name -set @old_checkpoint_interval=@@global.aria_checkpoint_interval; -set global maria_checkpoint_interval=10; -select @@global.aria_checkpoint_interval; -@@global.aria_checkpoint_interval -10 -set global maria_checkpoint_interval=@old_checkpoint_interval; -set @old_sort_buffer_size=@@global.maria_sort_buffer_size; -set global aria_sort_buffer_size=1024; -select @@global.maria_sort_buffer_size; -@@global.maria_sort_buffer_size -1024 -set global aria_sort_buffer_size=@old_sort_buffer_size; -set @old_sort_buffer_size=@@session.maria_sort_buffer_size; -set session aria_sort_buffer_size=2048; -select @@session.maria_sort_buffer_size; -@@session.maria_sort_buffer_size -2048 -set session aria_sort_buffer_size=@old_sort_buffer_size; -set @old_max_sort_file_size=@@global.maria_max_sort_file_size, -@old_repair_threads=@@global.aria_repair_threads; -set @@global.maria_max_sort_file_size=default, @@global.aria_repair_threads=default; -select @@global.maria_max_sort_file_size, @@global.aria_repair_threads; -@@global.maria_max_sort_file_size @@global.aria_repair_threads -9223372036853727232 1 -set @@global.aria_max_sort_file_size=@old_max_sort_file_size, -@@global.maria_repair_threads=@old_repair_threads; diff --git a/mysql-test/suite/maria/r/maria-recover.result b/mysql-test/suite/maria/r/maria-recover.result index 128467a278c..9b84c47720a 100644 --- a/mysql-test/suite/maria/r/maria-recover.result +++ b/mysql-test/suite/maria/r/maria-recover.result @@ -20,7 +20,7 @@ create table t1 (a varchar(1000), index(a)) engine=aria; insert into t1 values("ThursdayMorningsMarket"); flush table t1; insert into t1 select concat(a,'b') from t1 limit 1; -set global maria_checkpoint_interval=1000; +set global aria_checkpoint_interval=1000; select * from t_corrupted2; a ThursdayMorningsMarket diff --git a/mysql-test/suite/maria/r/maria3.result b/mysql-test/suite/maria/r/maria3.result index 490059587ad..056147c69c0 100644 --- a/mysql-test/suite/maria/r/maria3.result +++ b/mysql-test/suite/maria/r/maria3.result @@ -312,7 +312,7 @@ aria_log_file_size 4294959104 aria_log_purge_type immediate aria_max_sort_file_size 9223372036853727232 aria_pagecache_age_threshold 300 -aria_pagecache_buffer_size 134213632 +aria_pagecache_buffer_size 134217720 aria_pagecache_division_limit 100 aria_page_checksum OFF aria_recover NORMAL diff --git a/mysql-test/suite/maria/r/ps_maria.result b/mysql-test/suite/maria/r/ps_maria.result index ef3ccfc3483..8ac0fee6f50 100644 --- a/mysql-test/suite/maria/r/ps_maria.result +++ b/mysql-test/suite/maria/r/ps_maria.result @@ -64,7 +64,7 @@ def test t9 t9 c12 c12 246 10 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 9377 0 63 -def test t9 t9 c16 c16 11 9 8 Y 128 0 63 +def test t9 t9 c16 c16 11 10 8 Y 128 0 63 def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 def test t9 t9 c18 c18 1 4 1 Y 32768 0 63 def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 @@ -1793,8 +1793,8 @@ t5 CREATE TABLE `t5` ( `param08` longtext, `const09` datetime DEFAULT NULL, `param09` longblob, - `const10` double NOT NULL DEFAULT '0', - `param10` double DEFAULT NULL, + `const10` decimal(22,6) NOT NULL DEFAULT '0.000000', + `param10` decimal(65,30) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, @@ -1823,8 +1823,8 @@ def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 -def test t5 t5 const10 const10 5 49 9 N 32769 31 63 -def test t5 t5 param10 param10 5 23 9 Y 32768 31 63 +def test t5 t5 const10 const10 246 24 16 N 1 6 63 +def test t5 t5 param10 param10 246 67 40 Y 0 30 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 @@ -1850,8 +1850,8 @@ const08 1991-08-05 01:01:01 param08 1991-08-05 01:01:01 const09 1991-08-05 01:01:01 param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 +const10 662680861.000000 +param10 662680861.000000000000000000000000000000 const11 1991 param11 1991 const12 NULL @@ -3215,7 +3215,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3225,7 +3225,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt1 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3236,7 +3236,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt2 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3247,7 +3247,7 @@ Warnings: Warning 1265 Data truncated for column 'c13' at row 1 Warning 1265 Data truncated for column 'c14' at row 1 Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 set @arg00= 1.0e+10 ; insert into t9 @@ -3256,7 +3256,7 @@ values ( 50, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10 ) ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3273,7 +3273,7 @@ values execute stmt1 ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 prepare stmt2 from "insert into t9 ( c1, c13, c14, c15, c16, c17 ) @@ -3282,7 +3282,7 @@ values execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00 ; Warnings: Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Out of range value for column 'c16' at row 1 +Warning 1265 Data truncated for column 'c16' at row 1 Warning 1264 Out of range value for column 'c17' at row 1 set @arg00= 'abc' ; set @arg00= NULL ; @@ -3338,14 +3338,14 @@ c1 c13 c14 c15 c16 c17 31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL 61 NULL NULL 1991-01-01 01:01:01 NULL NULL 62 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/suite/maria/t/compat_aliases-master.opt b/mysql-test/suite/maria/t/compat_aliases-master.opt deleted file mode 100644 index 73f18586361..00000000000 --- a/mysql-test/suite/maria/t/compat_aliases-master.opt +++ /dev/null @@ -1 +0,0 @@ ---maria-max-sort-file-size=100M --aria-repair-threads=10000 diff --git a/mysql-test/suite/maria/t/compat_aliases.test b/mysql-test/suite/maria/t/compat_aliases.test deleted file mode 100644 index 7b94d24e643..00000000000 --- a/mysql-test/suite/maria/t/compat_aliases.test +++ /dev/null @@ -1,59 +0,0 @@ -# -# test for maria* aliases (system variables, status variables, -# command-line options). They should match aria* variables. -# - ---replace_column 5 # -select * from information_schema.plugins where plugin_name like '%aria'; - -select maria_vars.variable_name, aria_vars.variable_name from - information_schema.session_variables as maria_vars left join - information_schema.session_variables as aria_vars - on (maria_vars.variable_name = concat('m', aria_vars.variable_name)) - where maria_vars.variable_name like 'maria_%' - and not (maria_vars.variable_value <=> aria_vars.variable_value); - -select maria_vars.variable_name, aria_vars.variable_name from - information_schema.session_status as maria_vars left join - information_schema.session_status as aria_vars - on (maria_vars.variable_name = concat('m', aria_vars.variable_name)) - where maria_vars.variable_name like 'maria_%' - and not (maria_vars.variable_value <=> aria_vars.variable_value); - -select maria_vars.variable_name, aria_vars.variable_name from - information_schema.session_variables as aria_vars left join - information_schema.session_variables as maria_vars - on (maria_vars.variable_name = concat('m', aria_vars.variable_name)) - where aria_vars.variable_name like 'aria_%' - and not (maria_vars.variable_value <=> aria_vars.variable_value); - -select maria_vars.variable_name, aria_vars.variable_name from - information_schema.session_status as aria_vars left join - information_schema.session_status as maria_vars - on (maria_vars.variable_name = concat('m', aria_vars.variable_name)) - where aria_vars.variable_name like 'aria_%' - and not (maria_vars.variable_value <=> aria_vars.variable_value); - -set @old_checkpoint_interval=@@global.aria_checkpoint_interval; -set global maria_checkpoint_interval=10; -select @@global.aria_checkpoint_interval; -set global maria_checkpoint_interval=@old_checkpoint_interval; - -set @old_sort_buffer_size=@@global.maria_sort_buffer_size; -set global aria_sort_buffer_size=1024; -select @@global.maria_sort_buffer_size; -set global aria_sort_buffer_size=@old_sort_buffer_size; - -set @old_sort_buffer_size=@@session.maria_sort_buffer_size; -set session aria_sort_buffer_size=2048; -select @@session.maria_sort_buffer_size; -set session aria_sort_buffer_size=@old_sort_buffer_size; - -set @old_max_sort_file_size=@@global.maria_max_sort_file_size, - @old_repair_threads=@@global.aria_repair_threads; -set @@global.maria_max_sort_file_size=default, @@global.aria_repair_threads=default; ---replace_result 4293918720 9223372036853727232 -select @@global.maria_max_sort_file_size, @@global.aria_repair_threads; -set @@global.aria_max_sort_file_size=@old_max_sort_file_size, - @@global.maria_repair_threads=@old_repair_threads; - diff --git a/mysql-test/suite/maria/t/maria-recover.test b/mysql-test/suite/maria/t/maria-recover.test index 29b05879967..56259ad9a31 100644 --- a/mysql-test/suite/maria/t/maria-recover.test +++ b/mysql-test/suite/maria/t/maria-recover.test @@ -10,7 +10,7 @@ call mtr.add_suppression("Recovering table: '\\..mysqltest.t_corrupted2'"); call mtr.add_suppression("Table '\\..mysqltest.t_corrupted2' is marked as crashed and should be repaired"); call mtr.add_suppression("Table 't_corrupted2' is marked as crashed and should be repaired"); -let $def_checkinterval=`select @@global.maria_checkpoint_interval`; +let $def_checkinterval=`select @@global.aria_checkpoint_interval`; --enable_query_log @@ -39,7 +39,7 @@ insert into t1 values("ThursdayMorningsMarket"); flush table t1; # put index page on disk insert into t1 select concat(a,'b') from t1 limit 1; # force a checkpoint to get the open count > 0 -set global maria_checkpoint_interval=1000; +set global aria_checkpoint_interval=1000; # Wait for checkpoint to happen --sleep 1 # now t1 has its open_count>0 and so will t2_corrupted. diff --git a/mysql-test/suite/maria/t/maria3.test b/mysql-test/suite/maria/t/maria3.test index b73b75ecfce..bc1dc47337f 100644 --- a/mysql-test/suite/maria/t/maria3.test +++ b/mysql-test/suite/maria/t/maria3.test @@ -260,7 +260,7 @@ check table t1 extended; drop table t1; # Fix if we are using safemalloc ---replace_result 8388572 8388600 +--replace_result 8388572 8388600 134217692 134217720 select lower(variable_name) as Variable_name, Variable_value as Value from information_schema.session_variables where variable_name like "aria%" and variable_name not like "aria_used_for_temp_tables" order by 1; --replace_column 2 # show status like 'aria%'; diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug43618.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug43618.result index 4350c912a31..35cbe35bc7e 100644 --- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug43618.result +++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug43618.result @@ -43,15 +43,9 @@ SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' ORDER B c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 -Warnings: -Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 -Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2010-10-00 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 -Warnings: -Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 DROP TABLE t1; set time_zone= @save_time_zone; diff --git a/mysql-test/suite/pbxt/r/func_sapdb.result b/mysql-test/suite/pbxt/r/func_sapdb.result index 4c3769cb52e..9e8775c876a 100644 --- a/mysql-test/suite/pbxt/r/func_sapdb.result +++ b/mysql-test/suite/pbxt/r/func_sapdb.result @@ -196,7 +196,7 @@ f8 date YES NULL f9 time(6) YES NULL select * from t1; f1 f2 f3 f4 f5 f6 f7 f8 f9 -1997-01-01 1998-01-02 01:01:00.000003 49:01:01.000001 46:58:57.999999 -24:00:00.000001 10:11:12 2001-12-01 01:01:01.000000 1997-12-31 23:59:59.000001 +1997-01-01 1998-01-02 01:01:00.000002 49:01:00.000002 46:58:57.999999 -24:00:00.000001 10:11:12 2001-12-01 01:01:01.000000 1997-12-31 23:59:59.000001 create table test(t1 datetime, t2 time, t3 time, t4 datetime); insert into test values ('2001-01-01 01:01:01', '01:01:01', null, '2001-02-01 01:01:01'), @@ -241,6 +241,8 @@ a select microsecond(19971231235959.01) as a; a 10000 +Warnings: +Warning 1292 Truncated incorrect time value: '19971231235959.01' select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a; a 1997-12-31 00:00:10.090000 diff --git a/mysql-test/suite/pbxt/r/func_timestamp.result b/mysql-test/suite/pbxt/r/func_timestamp.result index 495fedea9e6..18fcbd947e7 100644 --- a/mysql-test/suite/pbxt/r/func_timestamp.result +++ b/mysql-test/suite/pbxt/r/func_timestamp.result @@ -7,7 +7,7 @@ SELECT CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit) AS Date, UNIX_TIMESTAMP(CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit)) AS Unix FROM t1; Date Unix -1998-9-16 09:26:00 905927160 -1998-9-16 09:26:00 905927160 +1998-9-16 09:26:00 905927160.000000 +1998-9-16 09:26:00 905927160.000000 drop table t1; set time_zone= @@global.time_zone; diff --git a/mysql-test/suite/pbxt/r/range.result b/mysql-test/suite/pbxt/r/range.result index 142ea2a0d70..7d2d17bdc1e 100644 --- a/mysql-test/suite/pbxt/r/range.result +++ b/mysql-test/suite/pbxt/r/range.result @@ -923,13 +923,10 @@ INSERT INTO t1 VALUES EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref PRIMARY PRIMARY 20 const 2 Using index condition -Warnings: -Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1 SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; item started price Warnings: -Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1 -Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 0 +Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00'; item started price A1 2005-11-01 08:00:00 1000.000 @@ -941,7 +938,7 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; item started price Warnings: -Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 0 +Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00'; item started price A1 2005-11-01 08:00:00 1000.000 diff --git a/mysql-test/suite/pbxt/r/select.result b/mysql-test/suite/pbxt/r/select.result index 06c84f8a224..51e5d95edea 100644 --- a/mysql-test/suite/pbxt/r/select.result +++ b/mysql-test/suite/pbxt/r/select.result @@ -2121,8 +2121,8 @@ INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12 SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; gvid the_success the_fail the_size the_time Warnings: -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 0 -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 0 +Warning 1292 Incorrect datetime value: 'wrong-date-value' +Warning 1292 Incorrect datetime value: 'wrong-date-value' SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; gvid the_success the_fail the_size the_time DROP TABLE t1,t2; @@ -3265,7 +3265,7 @@ f1 f2 4 2005-10-01 5 2005-12-30 Warnings: -Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 0 +Warning 1292 Truncated incorrect date value: '2005-09-3a' select * from t1 where f2 <= '2005-09-31'; f1 f2 1 2005-01-01 @@ -3276,7 +3276,7 @@ f1 f2 1 2005-01-01 2 2005-09-01 Warnings: -Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 0 +Warning 1292 Truncated incorrect date value: '2005-09-3a' drop table t1; create table t1 (f1 int, f2 int); insert into t1 values (1, 30), (2, 20), (3, 10); diff --git a/mysql-test/suite/pbxt/r/type_datetime.result b/mysql-test/suite/pbxt/r/type_datetime.result index 65cd0e2b13b..255e8c33735 100644 --- a/mysql-test/suite/pbxt/r/type_datetime.result +++ b/mysql-test/suite/pbxt/r/type_datetime.result @@ -191,4 +191,4 @@ CAST(CAST('2006-08-10 10:11:12' AS DATETIME) + INTERVAL 14 MICROSECOND AS DECIMA 20060810101112.000014 SELECT CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6)); CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6)) -101112.098700 +101112.000000 diff --git a/mysql-test/suite/pbxt/r/type_time.result b/mysql-test/suite/pbxt/r/type_time.result index 90b9c7ddc58..86aef8683ce 100644 --- a/mysql-test/suite/pbxt/r/type_time.result +++ b/mysql-test/suite/pbxt/r/type_time.result @@ -29,8 +29,8 @@ insert into t1 values("10.22.22"),(1234567),(123456789),(123456789.10),("10 22:2 Warnings: Warning 1265 Data truncated for column 't' at row 1 Warning 1265 Data truncated for column 't' at row 2 -Warning 1264 Out of range value for column 't' at row 3 -Warning 1264 Out of range value for column 't' at row 4 +Warning 1265 Data truncated for column 't' at row 3 +Warning 1265 Data truncated for column 't' at row 4 Warning 1265 Data truncated for column 't' at row 6 select * from t1; t @@ -55,8 +55,8 @@ t 36:30:31 00:00:10 00:00:00 -838:59:59 -838:59:59 +00:00:00 +00:00:00 262:22:00 00:00:12 drop table t1; diff --git a/mysql-test/suite/pbxt/t/grant_cache.test b/mysql-test/suite/pbxt/t/grant_cache.test index f3faa579035..ce53a88ac0c 100644 --- a/mysql-test/suite/pbxt/t/grant_cache.test +++ b/mysql-test/suite/pbxt/t/grant_cache.test @@ -5,6 +5,17 @@ --source include/add_anonymous_users.inc # +# some statements have different results in ps-mode +# +let $actual1=4; +let $actual2=5; +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) +{ + let $actual1=3; + let $actual2=4; +} + +# # Test grants with query cache # --disable_warnings @@ -112,6 +123,7 @@ select * from t2; select mysqltest.t1.c from test.t1,mysqltest.t1; show status like "Qcache_queries_in_cache"; show status like "Qcache_hits"; +--replace_result $actual1 4 show status like "Qcache_not_cached"; # Connect without a database @@ -128,6 +140,7 @@ select a from mysqltest.t1; select a from mysqltest.t1; show status like "Qcache_queries_in_cache"; show status like "Qcache_hits"; +--replace_result $actual2 5 show status like "Qcache_not_cached"; # Cleanup diff --git a/mysql-test/suite/pbxt/t/mysqlshow.test b/mysql-test/suite/pbxt/t/mysqlshow.test index d8f5c20afcd..41505cc0b10 100644 --- a/mysql-test/suite/pbxt/t/mysqlshow.test +++ b/mysql-test/suite/pbxt/t/mysqlshow.test @@ -1,5 +1,6 @@ # Can't run test of external client with embedded server -- source include/not_embedded.inc +-- source include/have_innodb.inc --disable_warnings DROP TABLE IF EXISTS t1,t2,test1,test2; diff --git a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result index 126661fcff4..b88071391c5 100644 --- a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result +++ b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result @@ -136,7 +136,7 @@ create table t3 select 1 union select UUID(); create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3); create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3); Warnings: -Warning 1292 Truncated incorrect date value: '3' +Warning 1292 Incorrect datetime value: '3' insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4); create procedure foo() begin diff --git a/mysql-test/suite/rpl/t/rpl_corruption.test b/mysql-test/suite/rpl/t/rpl_corruption.test index f43df8c5348..a46325bf1f4 100644 --- a/mysql-test/suite/rpl/t/rpl_corruption.test +++ b/mysql-test/suite/rpl/t/rpl_corruption.test @@ -85,6 +85,17 @@ SET GLOBAL debug="-d,corrupt_read_log_event_char"; # that the slave has disconnected, we will inject the corrupt event on # the wrong connection, and the test will fail # (+d,corrupt_read_log_event2 corrupts only one event). +# So kill any lingering dump thread (we need to kill; otherwise dump thread +# could manage to send all events down the socket before seeing it close, and +# hang forever waiting for new binlog events to be created). +let $id= `select id from information_schema.processlist where command = "Binlog Dump"`; +if ($id) +{ + --disable_query_log + --error 0,1094 + eval kill $id; + --enable_query_log +} let $wait_condition= SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE command = 'Binlog Dump'; --source include/wait_condition.inc diff --git a/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result b/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result index b1f96f8f4d9..db16d25000a 100644 --- a/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result @@ -114,7 +114,7 @@ t1 CREATE TABLE `t1` ( describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL PERSISTENT insert into t1 (a) values (1); select * from t1; a b diff --git a/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result b/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result index 9fde339cb06..1b4a5060e40 100644 --- a/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result @@ -114,7 +114,7 @@ t1 CREATE TABLE `t1` ( describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL PERSISTENT insert into t1 (a) values (1); select * from t1; a b diff --git a/mysql-test/suite/vcol/r/vcol_keys_innodb.result b/mysql-test/suite/vcol/r/vcol_keys_innodb.result index 857dcb8423f..5070981f08f 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_keys_innodb.result @@ -19,7 +19,7 @@ t1 CREATE TABLE `t1` ( describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL VIRTUAL +b int(11) YES UNI NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2), unique key (b)); ERROR HY000: Key/Index cannot be defined on a non-stored computed column @@ -34,7 +34,7 @@ t1 CREATE TABLE `t1` ( describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL VIRTUAL +b int(11) YES UNI NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2)); alter table t1 add unique key (b); @@ -64,7 +64,7 @@ t1 CREATE TABLE `t1` ( describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES MUL NULL VIRTUAL +b int(11) YES MUL NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2) persistent, index (a,b)); show create table t1; @@ -77,7 +77,7 @@ t1 CREATE TABLE `t1` ( describe t1; Field Type Null Key Default Extra a int(11) YES MUL NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2)); alter table t1 add index (b); diff --git a/mysql-test/suite/vcol/r/vcol_keys_myisam.result b/mysql-test/suite/vcol/r/vcol_keys_myisam.result index af0935affbc..71d74a6c977 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_keys_myisam.result @@ -19,7 +19,7 @@ t1 CREATE TABLE `t1` ( describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL VIRTUAL +b int(11) YES UNI NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2), unique key (b)); ERROR HY000: Key/Index cannot be defined on a non-stored computed column @@ -34,7 +34,7 @@ t1 CREATE TABLE `t1` ( describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES UNI NULL VIRTUAL +b int(11) YES UNI NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2)); alter table t1 add unique key (b); @@ -64,7 +64,7 @@ t1 CREATE TABLE `t1` ( describe t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES MUL NULL VIRTUAL +b int(11) YES MUL NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2) persistent, index (a,b)); show create table t1; @@ -77,7 +77,7 @@ t1 CREATE TABLE `t1` ( describe t1; Field Type Null Key Default Extra a int(11) YES MUL NULL -b int(11) YES NULL VIRTUAL +b int(11) YES NULL PERSISTENT drop table t1; create table t1 (a int, b int as (a*2)); alter table t1 add index (b); diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index da4306e8088..de4d4dcbb93 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -203,3 +203,42 @@ a b 1 1 3 0 drop table t1; +CREATE TABLE `t1` ( +`a` int(11) NOT NULL, +`b` varchar(32) DEFAULT NULL, +`c` int(11) AS (a MOD 10) VIRTUAL, +`d` varchar(5) AS (LEFT(b,5)) PERSISTENT +) ENGINE=MyISAM; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` varchar(32) DEFAULT NULL, + `c` int(11) AS (a MOD 10) VIRTUAL, + `d` varchar(5) AS (LEFT(b,5)) PERSISTENT +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show columns from t1; +Field Type Null Key Default Extra +a int(11) NO NULL +b varchar(32) YES NULL +c int(11) YES NULL VIRTUAL +d varchar(5) YES NULL PERSISTENT +show full columns from t1; +Field Type Collation Null Key Default Extra Privileges Comment +a int(11) NULL NO NULL # +b varchar(32) latin1_swedish_ci YES NULL # +c int(11) NULL YES NULL VIRTUAL # +d varchar(5) latin1_swedish_ci YES NULL PERSISTENT # +INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,NULL); +UPDATE `test`.`t1` SET `d`='b' WHERE `a`='1' AND `b`='a' AND `c`='1' AND `d`='a'; +Warnings: +Warning 1906 The value specified for computed column 'd' in table 't1' ignored +INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,'a'); +Warnings: +Warning 1906 The value specified for computed column 'd' in table 't1' ignored +set sql_mode='strict_all_tables'; +UPDATE `test`.`t1` SET `d`='b' WHERE `a`='1' AND `b`='a' AND `c`='1' AND `d`='a'; +ERROR HY000: The value specified for computed column 'd' in table 't1' ignored +INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,'a'); +ERROR HY000: The value specified for computed column 'd' in table 't1' ignored +drop table t1; diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test index eb8c5791f54..a0616d187da 100644 --- a/mysql-test/suite/vcol/t/vcol_misc.test +++ b/mysql-test/suite/vcol/t/vcol_misc.test @@ -182,3 +182,27 @@ insert into t1 (a) values (1),(3); select * from t1; select * from t1; drop table t1; + +# +# Test output of show columns +# + +CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` varchar(32) DEFAULT NULL, + `c` int(11) AS (a MOD 10) VIRTUAL, + `d` varchar(5) AS (LEFT(b,5)) PERSISTENT +) ENGINE=MyISAM; +show create table t1; +show columns from t1; +--replace_column 8 # +show full columns from t1; +INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,NULL); +UPDATE `test`.`t1` SET `d`='b' WHERE `a`='1' AND `b`='a' AND `c`='1' AND `d`='a'; +INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,'a'); +set sql_mode='strict_all_tables'; +--error ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN +UPDATE `test`.`t1` SET `d`='b' WHERE `a`='1' AND `b`='a' AND `c`='1' AND `d`='a'; +--error ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN +INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,'a'); +drop table t1; diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test index 89d3f85a38d..796732fa097 100644 --- a/mysql-test/t/distinct.test +++ b/mysql-test/t/distinct.test @@ -622,6 +622,25 @@ create table t1 (a varchar(100)); insert t1 values ('2010-10-10'), ('20101010'); select * from t1 where a = DATE('2010-10-10'); select distinct a from t1 where a = DATE('2010-10-10'); +explain select distinct a from t1 where a = DATE('2010-10-10'); +drop table t1; +# +# test_if_equality_guarantees_uniqueness() and different type combinations +# +--echo # date = string +create table t1 (a date); +insert t1 values ('2010-10-10'), ('20101010'); +explain select distinct a from t1 where a = '2010-10-10'; +drop table t1; +--echo # double = string +create table t1 (a double); +insert t1 values (2), (2); +explain select distinct a from t1 where a = '2'; +--echo # double = int +explain select distinct a from t1 where a = 2; +--echo # string = double +alter table t1 modify a varchar(100); +explain select distinct a from t1 where a = 2e0; drop table t1; # diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test index 51609d56686..1901a998732 100644 --- a/mysql-test/t/dyncol.test +++ b/mysql-test/t/dyncol.test @@ -87,7 +87,7 @@ select column_get(column_create(1, -1212 AS int), 1 as unsigned int); select column_get(column_create(1, 99999999999999999999999999999 AS decimal), 1 as unsigned int); select column_get(column_create(1, 999.9999999999999999 AS decimal), 1 as unsigned int); select column_get(column_create(1, -1 AS decimal), 1 as unsigned int); ---replace_result 1e+029 1e+29 +--replace_result e+029 e+29 select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as unsigned int); select column_get(column_create(1, 999.9 AS double), 1 as unsigned int); select column_get(column_create(1, -1 AS double), 1 as unsigned int); @@ -110,6 +110,7 @@ select column_get(column_create(1, "-1212" AS char), 1 as int); select column_get(column_create(1, "2011-04-05" AS date), 1 as int); select column_get(column_create(1, "8:46:06.23434" AS time), 1 as int); select column_get(column_create(1, "8:46:06.23434" AS time(6)), 1 as int); +select column_get(column_create(1, "-808:46:06.23434" AS time(6)), 1 as int); select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime(6)), 1 as int); select column_get(column_create(1, NULL AS int), 1 as int); --echo #column gett truncation & warnings @@ -118,7 +119,7 @@ select column_get(column_create(1, 99999999999999999999999999999 AS decimal), 1 select column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1 as int); select column_get(column_create(1, 999.9999999999999999 AS decimal), 1 as int); select column_get(column_create(1, 999.9 AS double), 1 as int); ---replace_result 1e+029 1e+29 +--replace_result e+029 e+29 select column_get(column_create(1, -99999999999999999999999999999 AS double), 1 as int); select column_get(column_create(1, "-1212III" AS char), 1 as int); select column_get(column_create(1, "1212III" AS char), 1 as int); @@ -145,6 +146,7 @@ select column_get(column_create(1, "2011-04-05" AS date), 1 as char charset utf8 select column_get(column_create(1, "8:46:06.23434" AS time), 1 as char charset utf8); select column_get(column_create(1, "8:46:06.23434" AS time(0)), 1 as char charset utf8); select column_get(column_create(1, "8:46:06.23434" AS time(6)), 1 as char charset utf8); +select column_get(column_create(1, "-808:46:06.23434" AS time(6)), 1 as char charset utf8); select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as char charset utf8); select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime(0)), 1 as char charset utf8); select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime(6)), 1 as char charset utf8); @@ -169,6 +171,7 @@ select column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1 select column_get(column_create(1, "2011-04-05" AS date), 1 as double); select column_get(column_create(1, "8:46:06.23434" AS time), 1 as double); select column_get(column_create(1, "8:46:06.23434" AS time(6)), 1 as double); +select column_get(column_create(1, "-808:46:06.23434" AS time(6)), 1 as double); select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double); select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime(6)), 1 as double); # The replace result is needed for windows. @@ -197,6 +200,7 @@ select column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1 select column_get(column_create(1, "2011-04-05" AS date), 1 as decimal(32,6)); select column_get(column_create(1, "8:46:06.23434" AS time), 1 as decimal(32,6)); select column_get(column_create(1, "8:46:06.23434" AS time(6)), 1 as decimal(32,6)); +select column_get(column_create(1, "-808:46:06.23434" AS time(6)), 1 as decimal(32,6)); select column_get(column_create(1, "2011-04-05 8:46:06.123456" AS datetime), 1 as decimal(32,6)); select column_get(column_create(1, "2011-04-05 8:46:06.123456" AS datetime(6)), 1 as decimal(32,6)); select column_get(column_create(1, "2011-04-05 8:46:06.12345678" AS datetime(6)), 1 as decimal(32,8)); @@ -245,6 +249,7 @@ select column_get(column_create(1, 0), 1 as datetime); select column_get(column_create(1, "2001021"), 1 as datetime); select column_get(column_create(1, "8:46:06.23434" AS time), 1 as datetime); +select column_get(column_create(1, "-808:46:06.23434" AS time), 1 as datetime); set @@sql_mode="allow_invalid_dates"; select column_get(column_create(1, "2011-02-30 18:46:06.23434" AS CHAR), 1 as datetime); @@ -254,11 +259,12 @@ set @@sql_mode=""; -- echo # column get datetime truncation & warnings select column_get(column_create(1, "1223.5aa" AS char), 1 as datetime); +--replace_result e+019 e+19 select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as datetime); select column_get(column_create(1, 9223372036854775807 AS int), 1 as datetime); select column_get(column_create(1, -9223372036854775808 AS int), 1 as datetime); select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as datetime); ---replace_regex /9.9999999999999991e\+028 /9.99999999999999914332e+28/ +--replace_result e+029 e+29 select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as datetime); select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as datetime); select column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as datetime); @@ -300,11 +306,12 @@ set @@sql_mode=""; -- echo # column get date truncation & warnings select column_get(column_create(1, "1223.5aa" AS char), 1 as date); +--replace_result e+019 e+19 select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as date); select column_get(column_create(1, 9223372036854775807 AS int), 1 as date); select column_get(column_create(1, -9223372036854775808 AS int), 1 as date); select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as date); ---replace_regex /9.9999999999999991e\+028 /9.99999999999999914332e+28/ +--replace_result e+029 e+29 select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as date); select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as date); select column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as date); @@ -318,7 +325,9 @@ select column_get(column_create(1, "0" AS CHAR), 1 as date); select column_get(column_create(1, 20010203101112.121314 as double), 1 as time); select column_get(column_create(1, 20010203101112.121314 as decimal), 1 as time); select column_get(column_create(1, 20010203101112 as unsigned int), 1 as time); +select column_get(column_create(1, 8080102 as unsigned int), 1 as time); select column_get(column_create(1, 20010203101112 as int), 1 as time); +select column_get(column_create(1, -8080102 as int), 1 as time); select column_get(column_create(1, "20010203101112" as char), 1 as time); select column_get(column_create(1, "2001-02-03 10:11:12" as char), 1 as time); select column_get(column_create(1, "2001-02-03 10:11:12.121314" as char), 1 as time); @@ -348,11 +357,12 @@ set @@sql_mode=""; -- echo # column get date truncation & warnings select column_get(column_create(1, "1223.5aa" AS char), 1 as time); select column_get(column_create(1, "1223.5aa" AS char), 1 as time(3)); +--replace_result e+019 e+19 select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as time); select column_get(column_create(1, 9223372036854775807 AS int), 1 as time); select column_get(column_create(1, -9223372036854775808 AS int), 1 as time); select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as time); ---replace_result 1e+029 1e+29 +--replace_result e+029 e+29 select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as time); select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as time); select column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as time); diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 19f87fae3d2..742b0955dca 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -1063,7 +1063,8 @@ insert into t1 values (02,2002,20020101,"2002-01-01 23:59:59"), (60,2060,20600101,"2060-01-01 11:11:11"), (70,1970,19700101,"1970-11-11 22:22:22"), - (NULL,NULL,NULL,NULL); + (NULL,NULL,NULL,NULL), + (71,1971,19710101,"1971-11-11 22:22:22"); select min(f1),max(f1) from t1; select min(f2),max(f2) from t1; select min(f3),max(f3) from t1; diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test index 8142f57c0de..bbe9958685a 100644 --- a/mysql-test/t/func_if.test +++ b/mysql-test/t/func_if.test @@ -161,8 +161,9 @@ DROP TABLE t1; # CREATE TABLE t1 (c LONGTEXT); -INSERT INTO t1 VALUES(1), (2), (3), (4), ('12345678901234567890'); +INSERT INTO t1 VALUES(1), (2), (3), (4), ('1234567890123456789'); +SELECT IF(1, CAST(c AS UNSIGNED), 0) FROM t1; SELECT * FROM (SELECT MAX(IF(1, CAST(c AS UNSIGNED), 0)) FROM t1) AS te; SELECT * FROM (SELECT MAX(IFNULL(CAST(c AS UNSIGNED), 0)) FROM t1) AS te; diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index 1292c475732..5c31cee403a 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -91,8 +91,8 @@ select microsecond("1997-12-31 23:59:59.000001"); create table t1 select makedate(1997,1) as f1, - addtime(cast("1997-12-31 23:59:59.000001" as datetime), "1 1:1:1.000002") as f2, - addtime(cast("23:59:59.999999" as time) , "1 1:1:1.000002") as f3, + addtime(cast("1997-12-31 23:59:59.000001" as datetime(6)), "1 1:1:1.000002") as f2, + addtime(cast("23:59:59.999999" as time(6)) , "1 1:1:1.000002") as f3, timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002") as f4, timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002") as f5, maketime(10,11,12) as f6, diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 2fe61ac5529..2d84202c6aa 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -17,6 +17,10 @@ select sec_to_time(9001),sec_to_time(9001)+0,time_to_sec("15:12:22"), sec_to_time(time_to_sec("0:30:47")/6.21); select sec_to_time(9001.1), time_to_sec('15:12:22.123456'), time_to_sec(15.5566778899); select sec_to_time(time_to_sec('-838:59:59')); +select sec_to_time('9001.1'), sec_to_time('1234567890123.123'); +--replace_result e+042 e+42 +select sec_to_time(90011e-1), sec_to_time(1234567890123e30); +select sec_to_time(1234567890123), sec_to_time('99999999999999999999999999999'); select now()-curdate()*1000000-curtime(); select strcmp(current_timestamp(),concat(current_date()," ",current_time())); select strcmp(localtime(),concat(current_date()," ",current_time())); @@ -68,10 +72,10 @@ select date_format('1999-12-31','%x-%v'),date_format('2000-01-01','%x-%v'); select dayname("1962-03-03"),dayname("1962-03-03")+0; select monthname("1972-03-04"),monthname("1972-03-04")+0; -select time_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); -select time_format(19980131010203,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); -select time_format(19980131131415,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); -select time_format(19980131010015,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); +select time_format(000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T'),date_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); +select time_format(010203,'%H|%I|%k|%l|%i|%p|%r|%S|%T'),date_format(19980131010203,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); +select time_format(131415,'%H|%I|%k|%l|%i|%p|%r|%S|%T'),date_format(19980131131415,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); +select time_format(010015,'%H|%I|%k|%l|%i|%p|%r|%S|%T'),date_format(19980131010015,'%H|%I|%k|%l|%i|%p|%r|%S|%T'); select date_format(concat('19980131',131415),'%H|%I|%k|%l|%i|%p|%r|%S|%T| %M|%W|%D|%Y|%y|%a|%b|%j|%m|%d|%h|%s|%w'); select date_format(19980021000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T| %M|%W|%D|%Y|%y|%a|%b|%j|%m|%d|%h|%s|%w'); select date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND); @@ -948,6 +952,9 @@ select time(' 1 02:03:04') - interval 2 day; select time('-1 02:03:04') + interval 2 day; select time('-1 02:03:04') - interval 2 day; +select time('10 02:03:04') + interval 30 day; +select time('10 02:03:04') + interval 1 year; + # specially constructed queries to reach obscure places in the code # not touched by the more "normal" queries (and to increase the coverage) select cast('131415.123e0' as time); @@ -1057,3 +1064,5 @@ select greatest(cast("0-0-0" as date), cast("10:20:05" as time)); select greatest(cast("0-0-0" as date), cast("10:20:05" as time)) = '0000-00-00'; select cast(greatest(cast("0-0-0" as date), cast("10:20:05" as time)) as datetime(6)); +select microsecond('12:00:00.123456'), microsecond('2009-12-31 23:59:59.000010'); + diff --git a/mysql-test/t/func_time_hires.test b/mysql-test/t/func_time_hires.test index ae185aef0b7..4dcd51a85ba 100644 --- a/mysql-test/t/func_time_hires.test +++ b/mysql-test/t/func_time_hires.test @@ -36,7 +36,7 @@ drop table t1; select sec_to_time(3020399.99999), sec_to_time(3020399.999999), sec_to_time(3020399.9999999); select sec_to_time(-3020399.99999), sec_to_time(-3020399.999999), sec_to_time(-3020399.9999999); select 20010101000203.000000004 + interval 1 day; -select 20010101000203.00004 + interval 1 day; +select 20010101000203.4 + interval 1 day; # # precision of expressions # @@ -68,6 +68,8 @@ create table t1 select CAST(@a AS DATETIME) as dauto, show create table t1; --query_vertical select * from t1 drop table t1; +explain extended select cast(cast(@a as datetime(4)) as time(0)); +select cast(cast(@a as time(2)) as time(6)); --error ER_TOO_BIG_PRECISION select CAST(@a AS DATETIME(7)); diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test index 30f4d4d6c61..fdacb9c57d4 100644 --- a/mysql-test/t/lock.test +++ b/mysql-test/t/lock.test @@ -245,3 +245,28 @@ UNLOCK TABLES; DROP TABLE t1,t2; --echo End of 5.1 tests. + +# +# Test concurrent lock and read locks +# This gave a warning: +# Warning at 'read lock with old write lock' for lock: 5: +# Found lock of type 8 that is write and read locked. Read_no_write_count: 1 +# +create table t1 (a int) engine=myisam; +lock tables t1 write concurrent, t1 as t2 read; +connect (con1,localhost,root,,); +connection con1; +lock tables t1 read local; +unlock tables; +connection default; +unlock tables; +connection con1; +lock tables t1 read local; +connection default; +lock tables t1 write concurrent, t1 as t2 read; +unlock tables; +connection con1; +unlock tables; +disconnect con1; +connection default; +drop table t1; diff --git a/mysql-test/t/parser_precedence.test b/mysql-test/t/parser_precedence.test index 484c8759779..7b69bc9c6da 100644 --- a/mysql-test/t/parser_precedence.test +++ b/mysql-test/t/parser_precedence.test @@ -3,6 +3,8 @@ drop table if exists t1_30237_bool; --enable_warnings +set sql_mode=NO_UNSIGNED_SUBTRACTION; + create table t1_30237_bool(A boolean, B boolean, C boolean); insert into t1_30237_bool values diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index c4c17a6d2f1..3c3810b5296 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -2192,3 +2192,22 @@ DROP TABLE t1; SET GLOBAL myisam_use_mmap=default; --echo End of 5.1 tests + + +--echo # +--echo # BUG#598247: partition.test produces valgrind errors in 5.3-based branches +--echo # +CREATE TABLE t1 ( + a INT DEFAULT NULL, + b DOUBLE DEFAULT NULL, + c INT DEFAULT NULL, + KEY idx2(b,a) +) engine=myisam PARTITION BY HASH(c) PARTITIONS 3; + +INSERT INTO t1 VALUES (6,8,9); +INSERT INTO t1 VALUES (6,8,10); + +SELECT 1 FROM t1 JOIN t1 AS t2 USING (a); + +drop table t1; + diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test index 91185f78aac..221cd6bca33 100644 --- a/mysql-test/t/subselect_sj.test +++ b/mysql-test/t/subselect_sj.test @@ -1150,5 +1150,44 @@ select * from t1 A, t1 B where A.a = B.a and A.a in (select a from t2 C) and B.a in (select a from t2 D); drop table t1, t2; +--echo # +--echo # BUG#784441: Abort on semijoin with a view as the inner table +--echo # + +CREATE TABLE t1 (a int) ; +INSERT INTO t1 VALUES (1), (1); + +CREATE TABLE t2 (a int) ; +INSERT INTO t2 VALUES (1), (1); + +CREATE VIEW v1 AS SELECT 1; + +EXPLAIN +SELECT * FROM t1 INNER JOIN t2 ON t2.a != 0 AND t2.a IN (SELECT * FROM v1); +SELECT * FROM t1 INNER JOIN t2 ON t2.a != 0 AND t2.a IN (SELECT * FROM v1); + +DROP VIEW v1; +DROP TABLE t1,t2; + +--echo # +--echo # BUG#751439 Assertion `!table->file || table->file->inited == handler::NONE' failed with subquery +--echo # +CREATE TABLE t1 ( f10 int, f11 int) ; +INSERT IGNORE INTO t1 VALUES (0,0),(0,0); + +CREATE TABLE t2 ( f11 int); +INSERT IGNORE INTO t2 VALUES (0),(0); + +CREATE TABLE t3 ( f11 int) ; +INSERT IGNORE INTO t3 VALUES (0); + +SELECT alias1.f11 AS field2 +FROM ( t3 AS alias2 JOIN t1 AS alias3 ON alias3.f10 = 1) +LEFT JOIN ( t2 AS alias1 ) ON alias3.f11 = 1 +WHERE alias2.f11 IN ( SELECT f11 FROM t2 ) +GROUP BY field2 ; + +drop table t1, t2, t3; + # The following command must be the last one the file set @@optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/t/subselect_sj2.test b/mysql-test/t/subselect_sj2.test index 274e7b42c6f..f4573a94407 100644 --- a/mysql-test/t/subselect_sj2.test +++ b/mysql-test/t/subselect_sj2.test @@ -912,3 +912,30 @@ explain select 1 from t2 where c1 in (select convert(c6,char(1)) from t2); drop table t2, t3; + +--echo # +--echo # BUG#761598: InnoDB: Error: row_search_for_mysql() is called without ha_innobase::external_lock() in maria-5.3 +--echo # + +CREATE TABLE t1 ( f1 int NOT NULL , f10 int) ; +INSERT IGNORE INTO t1 VALUES (25,0),(29,0); + +CREATE TABLE t2 ( f10 int) ENGINE=InnoDB; + +CREATE TABLE t3 ( f11 int) ; +INSERT IGNORE INTO t3 VALUES (0); + +SELECT alias1.f10 AS field2 +FROM t2 AS alias1 +JOIN ( + t3 AS alias2 + JOIN t1 AS alias3 + ON alias3.f10 +) ON alias3.f1 +WHERE alias2.f11 IN ( + SELECT SQ4_alias1.f10 + FROM t1 AS SQ4_alias1 + LEFT JOIN t2 AS SQ4_alias3 ON SQ4_alias3.f10 +) +GROUP BY field2; +drop table t1, t2, t3; diff --git a/mysql-test/t/subselect_sj_nonmerged.test b/mysql-test/t/subselect_sj_nonmerged.test index c73bd79777f..5c8fb6db424 100644 --- a/mysql-test/t/subselect_sj_nonmerged.test +++ b/mysql-test/t/subselect_sj_nonmerged.test @@ -95,5 +95,20 @@ WHERE ( f1 ) IN ( ); DROP TABLE t1, t2; + +--echo # +--echo # BUG#727183: WL#90 does not trigger with non-comma joins +--echo # +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t1(a int, key(a)); +insert into t1 select A.a + 10*B.a + 100*C.a from t0 A, t0 B, t0 C; + +--echo # The following must use non-merged SJ-Materialization: +explain select * from t1 X join t0 Y on X.a < Y.a where X.a in (select max(a) from t0); + +drop table t0, t1; + set optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 43dafc371dc..4e091e14b30 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -137,9 +137,9 @@ DROP TABLE t1; # Bug 19491 (CAST DATE AS DECIMAL returns incorrect result # SELECT CAST(CAST('2006-08-10' AS DATE) AS DECIMAL(20,6)); -SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) AS DECIMAL(20,6)); -SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME) + INTERVAL 14 MICROSECOND AS DECIMAL(20,6)); -SELECT CAST(CAST('10:11:12.098700' AS TIME) AS DECIMAL(20,6)); +SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME(6)) AS DECIMAL(20,6)); +SELECT CAST(CAST('2006-08-10 10:11:12' AS DATETIME(6)) + INTERVAL 14 MICROSECOND AS DECIMAL(20,6)); +SELECT CAST(CAST('10:11:12.098700' AS TIME(6)) AS DECIMAL(20,6)); # @@ -432,18 +432,18 @@ set @@sql_mode= @org_mode; # Bug #42146 - DATETIME fractional seconds parse error # # show we trucate microseconds from the right -- special case: leftmost is 0 -SELECT CAST(CAST('2006-08-10 10:11:12.0123450' AS DATETIME) AS DECIMAL(30,7)); +SELECT CAST(CAST('2006-08-10 10:11:12.0123450' AS DATETIME(6)) AS DECIMAL(30,7)); # show that we ignore leading zeroes for all other fields -SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.0123450' AS DATETIME) AS DECIMAL(30,7)); +SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.0123450' AS DATETIME(6)) AS DECIMAL(30,7)); # once more with feeling (but no warnings) -SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS DATETIME) AS DECIMAL(30,7)); +SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS DATETIME(6)) AS DECIMAL(30,7)); # # Bug #38435 - LONG Microseconds cause MySQL to fail a CAST to DATETIME or DATE # # show we truncate microseconds from the right -SELECT CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7)); +SELECT CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime(6)) AS DECIMAL(30,7)); --echo # --echo # Bug#59173: Failure to handle DATE(TIME) values where Year, Month or diff --git a/mysql-test/t/type_datetime_hires.test b/mysql-test/t/type_datetime_hires.test index d4ed0e342e6..74f686d4157 100644 --- a/mysql-test/t/type_datetime_hires.test +++ b/mysql-test/t/type_datetime_hires.test @@ -61,77 +61,11 @@ select table_name,partition_name,partition_method,partition_expression,partition drop table t1, t2; -# -# insert ... select with conversion -# -create table t1 ( - q_date date, - q_time time, - q_time5 time(5), - q_datetime datetime, - q_datetime1 datetime(1), - q_datetime3 datetime(3), - q_datetime5 datetime(5), - q_timestamp timestamp, - q_timestamp2 timestamp(2), - q_timestamp4 timestamp(4), - q_timestamp6 timestamp(6), - q_varchar50 varchar(50), - q_varchar60 varchar(60), - q_varchar70 varchar(70), - q_varchar80 varchar(80)); - -create table t2 ( - date_datetime datetime, - time_datetime datetime, - time5_varchar100 varchar(100), - datetime_time time, - datetime1_date date, - datetime3_timestamp timestamp, - datetime5_varchar100 varchar(100), - timestamp_datetime datetime, - timestamp2_date date, - timestamp4_time time, - timestamp6_varchar100 varchar(100), - varchar50_date date, - varchar60_datetime datetime, - varchar70_time time, - varchar80_timestamp timestamp); - -insert t1 values ('2010-11-12 11:14:17.765432', - '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', - '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', - '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', - '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', - '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', - '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432', - '2010-11-12 11:14:17.765432', '2010-11-12 11:14:17.765432'); ---query_vertical select * from t1; -insert t2 select * from t1; ---query_vertical select * from t2; -alter table t1 - change q_date date_datetime datetime, - change q_time time_datetime datetime, - change q_time5 time5_varchar100 varchar(100), - change q_datetime datetime_time time, - change q_datetime1 datetime1_date date, - change q_datetime3 datetime3_timestamp timestamp, - change q_datetime5 datetime5_varchar100 varchar(100), - change q_timestamp timestamp_datetime datetime, - change q_timestamp2 timestamp2_date date, - change q_timestamp4 timestamp4_time time, - change q_timestamp6 timestamp6_varchar100 varchar(100), - change q_varchar50 varchar50_date date, - change q_varchar60 varchar60_datetime datetime, - change q_varchar70 varchar70_time time, - change q_varchar80 varchar80_timestamp timestamp; ---query_vertical select * from t1; - -drop table t1, t2; - create table t1 (a datetime, b datetime(6)); insert t1 values ('2010-01-02 03:04:05.678912', '2010-01-02 03:04:05.678912'); update t1 set b=a; select * from t1; +alter table t1 modify b datetime, modify a datetime(6); +select * from t1; drop table t1; diff --git a/mysql-test/t/type_time_hires.test b/mysql-test/t/type_time_hires.test index c9939289e43..3785a23f1eb 100644 --- a/mysql-test/t/type_time_hires.test +++ b/mysql-test/t/type_time_hires.test @@ -2,7 +2,11 @@ let type=time; --source include/type_hrtime.inc -create table t1 (a time(4) not null); -insert into t1 values ('-00:00:00.6'),('-00:00:00.7'),('-00:00:00.8'),('-00:00:00.9'),('-00:00:01.0'),('-00:00:01.1'),('-00:00:01.000000'),('-00:00:01.100001'),('-00:00:01.000002'),('-00:00:01.090000'); -select * from t1; +create table t1 (a time(4) not null, key(a)); +insert into t1 values ('1:2:3.001'),('1:2:3'), ('-00:00:00.6'),('-00:00:00.7'),('-00:00:00.8'),('-00:00:00.9'),('-00:00:01.0'),('-00:00:01.1'),('-00:00:01.000000'),('-00:00:01.100001'),('-00:00:01.000002'),('-00:00:01.090000'); +select * from t1 order by a; +select * from t1 order by a desc; +select min(a - interval 1 hour), max(a - interval 1 hour) from t1 where a < 0; drop table t1; + +select cast(1e-6 as time(6)); |