diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-08-22 16:45:25 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-08-22 16:45:25 +0200 |
commit | f72a7659976089dc6f727bb31e8a91306199cf57 (patch) | |
tree | 0199cd1bf1c16b01b358ab88e5dce5b038349872 /mysql-test | |
parent | ed06ba3492d55c9e9dde231b55352f854e5e4b50 (diff) | |
parent | 1fd8150a5b5e3f56aa3c253225929a07ee9a4026 (diff) | |
download | mariadb-git-f72a7659976089dc6f727bb31e8a91306199cf57.tar.gz |
5.2 merge.
two tests still fail:
main.innodb_icp and main.range_vs_index_merge_innodb
call records_in_range() with both range ends being open
(which triggers an assert)
Diffstat (limited to 'mysql-test')
60 files changed, 1340 insertions, 269 deletions
diff --git a/mysql-test/include/mysqlbinlog_have_debug.inc b/mysql-test/include/mysqlbinlog_have_debug.inc new file mode 100644 index 00000000000..14da1379ecd --- /dev/null +++ b/mysql-test/include/mysqlbinlog_have_debug.inc @@ -0,0 +1,34 @@ +############################################# +# checks if mysqlbinlog is debug compiled +# this "cannot" be done simply by using +# have_debug.inc +############################################# + +--disable_query_log +--let $temp_out_help_file=$MYSQL_TMP_DIR/mysqlbinlog_help.tmp +--exec $MYSQL_BINLOG --help>$temp_out_help_file +let log_tmp=$temp_out_help_file; +--let $temp_inc=$MYSQL_TMP_DIR/temp.inc +let inc_tmp=$temp_inc; + +--perl +use strict; +my $tmp_file= $ENV{'log_tmp'} or die "log_tmp not set"; +open(FILE, "$tmp_file") or die("Unable to open $tmp_file: $!\n"); +my $count = () = grep(/Output debug log/g,<FILE>); +close FILE; + +my $temp_inc= $ENV{'inc_tmp'} or die "temp_inc not set"; +open(FILE_INC,">", "$temp_inc") or die("can't open file \"$temp_inc\": $!"); +print FILE_INC '--let $is_debug= '.$count; +close FILE_INC; +EOF +--source $temp_inc + +if (!$is_debug) +{ + --skip mysqlbinlog needs to be debug compiled +} +--remove_file $temp_out_help_file +--remove_file $temp_inc +--enable_query_log diff --git a/mysql-test/lib/My/Find.pm b/mysql-test/lib/My/Find.pm index 5dea0537bc6..a636b0e88f7 100644 --- a/mysql-test/lib/My/Find.pm +++ b/mysql-test/lib/My/Find.pm @@ -126,9 +126,9 @@ sub my_find_file { # # sub my_find_dir { - my ($base, $paths, $dirs, $required)= @_; - croak "usage: my_find_dir(<base>, <paths>[, <dirs>])" - unless (@_ == 3 or @_ == 2); + my ($base, $paths, $dirs, $optional)= @_; + croak "usage: my_find_dir(<base>, <paths>[, <dirs>[, <optional>]])" + unless (@_ == 3 or @_ == 2 or @_ == 4); # ------------------------------------------------------- # Find and return the first directory @@ -136,6 +136,7 @@ sub my_find_dir { foreach my $path (my_find_paths($base, $paths, $dirs)) { return $path if ( -d $path ); } + return "" if $optional; find_error($base, $paths, $dirs); } diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index 46e9bd806df..153f35e3411 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -128,6 +128,7 @@ sub collect_test_cases ($$$) { { push(@$cases, collect_one_suite($suite, $opt_cases)); last if $some_test_found; + push(@$cases, collect_one_suite("i_".$suite, $opt_cases)); } } @@ -281,10 +282,10 @@ sub collect_one_suite $suitedir= my_find_dir($suitedir, ["suite", ".", - # Look in storage engine specific suite dirs - "../storage/*/mysql-test-suites" + "../internal/mysql-test/suite" ], - [$suite]); + [$suite], ($suite =~ /^i_/)); + return unless $suitedir; } mtr_verbose("suitedir: $suitedir"); } diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index 103883deb15..ef92c7dcc88 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -218,6 +218,10 @@ a d 3 11120436154190595086 drop table t1, t2; End of 5.0 tests +CREATE TABLE t1(a YEAR); +SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END; +1 +DROP TABLE t1; create table t1 (f1 time); insert t1 values ('00:00:00'),('00:01:00'); select case t1.f1 when '00:00:00' then 1 end from t1; diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result index 75a6a38fadc..fe3a27ea0a3 100644 --- a/mysql-test/r/compare.result +++ b/mysql-test/r/compare.result @@ -96,3 +96,7 @@ SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00'; a DROP TABLE t1; End of 5.0 tests +CREATE TABLE t1(a INT ZEROFILL); +SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2; +1 +DROP TABLE t1; diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 9c15af41799..93fffbdf816 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1527,6 +1527,8 @@ DROP TABLE t1; # Bug#43668: Wrong comparison and MIN/MAX for YEAR(2) # create table t1 (f1 year(2), f2 year(4), f3 date, f4 datetime); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (98,1998,19980101,"1998-01-01 00:00:00"), (00,2000,20000101,"2000-01-01 00:00:01"), diff --git a/mysql-test/r/func_group_innodb.result b/mysql-test/r/func_group_innodb.result index c69bbe58953..b61f12e82a4 100644 --- a/mysql-test/r/func_group_innodb.result +++ b/mysql-test/r/func_group_innodb.result @@ -146,6 +146,46 @@ count(*) min(7) max(7) 0 NULL NULL drop table t1m, t1i, t2m, t2i; # +# Bug#12713907: STRANGE OPTIMIZE & WRONG RESULT UNDER ORDER BY +# COUNT(*) LIMIT. +# +CREATE TABLE t1 ( +id BIGINT(20) , +member_id_to INT(11) , +r_date DATE , +PRIMARY KEY (id,r_date), +KEY r_date_idx (r_date), +KEY t1_idx01 (member_id_to) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(107924526,518491,'2011-05-01'), +(107924527,518491,'2011-05-01'), +(107924528,518491,'2011-05-01'), +(107924529,518491,'2011-05-01'), +(107924530,518491,'2011-05-01'), +(107924531,518491,'2011-05-01'), +(107924532,518491,'2011-05-01'), +(107924534,518491,'2011-06-21'), +(107924535,518491,'2011-06-21'), +(107924536,518491,'2011-06-21'), +(107924537,518491,'2011-06-21'), +(107924538,518491,'2011-06-21'), +(107924542,1601319,'2011-06-21'), +(107924543,1601319,'2011-06-21'), +(107924544,1601319,'2011-06-21'), +(107924545,1601319,'2011-06-21'), +(107924546,1601319,'2011-06-21'), +(107924547,1601319,'2011-06-21'), +(107924548,1601319,'2011-06-21'), +(107924549,1601319,'2011-06-21'), +(107924550,1601319,'2011-06-21'); +SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date = +'2011-06-21' GROUP BY member_id_to ORDER BY 2 LIMIT 1; +member_id_to COUNT(*) +518491 5 +DROP TABLE t1; +# End of test BUG#12713907 +# # Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN # CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT, diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 1d68edef171..02251cc8c7c 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -5152,5 +5152,47 @@ RETURN CONCAT(']]]]><![CDATA[>, ', s, '!') DROP DATABASE BUG52792; USE test; # +# Bug#45740 MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY CAUSES RESTORE PROBLEM +# +SET @old_log_output_state= @@global.log_output; +SET @old_general_log_state= @@global.general_log; +SET @old_slow_query_log_state= @@global.slow_query_log; +call mtr.add_suppression("Failed to write to mysql.general_log"); +SET @@global.log_output="TABLE"; +SET @@global.general_log='ON'; +SET @@global.slow_query_log='ON'; +DROP DATABASE mysql; +Warnings: +Error 1146 Table 'mysql.proc' doesn't exist +Error 1146 Table 'mysql.event' doesn't exist +SHOW CREATE TABLE mysql.general_log; +Table Create Table +general_log CREATE TABLE `general_log` ( + `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `user_host` mediumtext NOT NULL, + `thread_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, + `command_type` varchar(64) NOT NULL, + `argument` mediumtext NOT NULL +) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' +SHOW CREATE TABLE mysql.slow_log; +Table Create Table +slow_log CREATE TABLE `slow_log` ( + `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `user_host` mediumtext NOT NULL, + `query_time` time(6) NOT NULL, + `lock_time` time(6) NOT NULL, + `rows_sent` int(11) NOT NULL, + `rows_examined` int(11) NOT NULL, + `db` varchar(512) NOT NULL, + `last_insert_id` int(11) NOT NULL, + `insert_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, + `sql_text` mediumtext NOT NULL +) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' +SET @@global.log_output= @old_log_output_state; +SET @@global.slow_query_log= @old_slow_query_log_state; +SET @@global.general_log= @old_general_log_state; +# # End of 5.1 tests # diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 0da031c4686..75aef40b529 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -3049,6 +3049,109 @@ id select_type table type possible_keys key key_len ref rows Extra DEALLOCATE PREPARE stmt; DROP TABLE t1; End of 5.1 tests. + +# Bug#13805127: Stored program cache produces wrong result in same THD + +PREPARE s1 FROM +" +SELECT c1, t2.c2, count(c3) +FROM + ( + SELECT 3 as c2 FROM dual WHERE @x = 1 + UNION + SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 + ) AS t1, + ( + SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual + UNION + SELECT '2012-03-01 02:00:00', 3, 2 FROM dual + UNION + SELECT '2012-03-01 01:00:00', 2, 1 FROM dual + ) AS t2 +WHERE t2.c2 = t1.c2 +GROUP BY c1, c2 +"; + +SET @x = 1; +SELECT c1, t2.c2, count(c3) +FROM +( +SELECT 3 as c2 FROM dual WHERE @x = 1 +UNION +SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 +) AS t1, +( +SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual +UNION +SELECT '2012-03-01 02:00:00', 3, 2 FROM dual +UNION +SELECT '2012-03-01 01:00:00', 2, 1 FROM dual +) AS t2 +WHERE t2.c2 = t1.c2 +GROUP BY c1, c2; +c1 c2 count(c3) +2012-03-01 01:00:00 2 1 +2012-03-01 01:00:00 3 1 +2012-03-01 02:00:00 3 1 + +EXECUTE s1; +c1 c2 count(c3) +2012-03-01 01:00:00 2 1 +2012-03-01 01:00:00 3 1 +2012-03-01 02:00:00 3 1 + +SET @x = 2; +SELECT c1, t2.c2, count(c3) +FROM +( +SELECT 3 as c2 FROM dual WHERE @x = 1 +UNION +SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 +) AS t1, +( +SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual +UNION +SELECT '2012-03-01 02:00:00', 3, 2 FROM dual +UNION +SELECT '2012-03-01 01:00:00', 2, 1 FROM dual +) AS t2 +WHERE t2.c2 = t1.c2 +GROUP BY c1, c2; +c1 c2 count(c3) +2012-03-01 01:00:00 2 1 + +EXECUTE s1; +c1 c2 count(c3) +2012-03-01 01:00:00 2 1 + +SET @x = 1; +SELECT c1, t2.c2, count(c3) +FROM +( +SELECT 3 as c2 FROM dual WHERE @x = 1 +UNION +SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 +) AS t1, +( +SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual +UNION +SELECT '2012-03-01 02:00:00', 3, 2 FROM dual +UNION +SELECT '2012-03-01 01:00:00', 2, 1 FROM dual +) AS t2 +WHERE t2.c2 = t1.c2 +GROUP BY c1, c2; +c1 c2 count(c3) +2012-03-01 01:00:00 2 1 +2012-03-01 01:00:00 3 1 +2012-03-01 02:00:00 3 1 + +EXECUTE s1; +c1 c2 count(c3) +2012-03-01 01:00:00 2 1 +2012-03-01 01:00:00 3 1 +2012-03-01 02:00:00 3 1 +DEALLOCATE PREPARE s1; # # LP bug#1001500 Crash on the second execution of the PS for # a query with degenerated conjunctive condition @@ -3181,108 +3284,4 @@ Handler_read_rnd_deleted 0 Handler_read_rnd_next 0 deallocate prepare st; drop table t1; -# -# LP bug#993459 Execution of PS for a query with GROUP BY -# returns wrong result (see also mysql bug#13805127) -# -PREPARE s1 FROM -" -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:00:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2 -"; - -SET @x = 1; -SELECT c1, t2.c2, count(c3) -FROM -( -SELECT 3 as c2 FROM dual WHERE @x = 1 -UNION -SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 -) AS t1, -( -SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual -UNION -SELECT '2012-03-01 02:00:00', 3, 2 FROM dual -UNION -SELECT '2012-03-01 01:99345900:00', 2, 1 FROM dual -) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; -c1 c2 count(c3) -2012-03-01 01:00:00 3 1 -2012-03-01 01:99345900:00 2 1 -2012-03-01 02:00:00 3 1 - -EXECUTE s1; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 -2012-03-01 01:00:00 3 1 -2012-03-01 02:00:00 3 1 - -SET @x = 2; -SELECT c1, t2.c2, count(c3) -FROM -( -SELECT 3 as c2 FROM dual WHERE @x = 1 -UNION -SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 -) AS t1, -( -SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual -UNION -SELECT '2012-03-01 02:00:00', 3, 2 FROM dual -UNION -SELECT '2012-03-01 01:00:00', 2, 1 FROM dual -) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 - -EXECUTE s1; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 - -SET @x = 1; -SELECT c1, t2.c2, count(c3) -FROM -( -SELECT 3 as c2 FROM dual WHERE @x = 1 -UNION -SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 -) AS t1, -( -SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual -UNION -SELECT '2012-03-01 02:00:00', 3, 2 FROM dual -UNION -SELECT '2012-03-01 01:00:00', 2, 1 FROM dual -) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 -2012-03-01 01:00:00 3 1 -2012-03-01 02:00:00 3 1 - -EXECUTE s1; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 -2012-03-01 01:00:00 3 1 -2012-03-01 02:00:00 3 1 -DEALLOCATE PREPARE s1; # End of 5.3 tests diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 3e7e0b5cd0c..454be15a1ad 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -7108,10 +7108,9 @@ DROP FUNCTION f1; # ------------------------------------------------------------------ # -- End of 5.1 tests # ------------------------------------------------------------------ -# -# LP bug#993459 Execution of PS for a query with GROUP BY -# returns wrong result (see also mysql bug#13805127) -# + +# Bug#13805127: Stored program cache produces wrong result in same THD + CREATE PROCEDURE p1(x INT UNSIGNED) BEGIN SELECT c1, t2.c2, count(c3) diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 7736fc4350a..f999506d77a 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -878,6 +878,8 @@ ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT CREATE TABLE b15776 (a char(4294967296)); ERROR 42000: Display width out of range for 'a' (max = 4294967295) CREATE TABLE b15776 (a year(4294967295)); +Warnings: +Note 1287 'YEAR(4294967295)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO b15776 VALUES (42); SELECT * FROM b15776; a @@ -886,6 +888,8 @@ DROP TABLE b15776; CREATE TABLE b15776 (a year(4294967296)); ERROR 42000: Display width out of range for 'a' (max = 4294967295) CREATE TABLE b15776 (a year(0)); +Warnings: +Note 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead DROP TABLE b15776; CREATE TABLE b15776 (a year(-2)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-2))' at line 1 diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result index 20cab45c4f7..e2c93962e0e 100644 --- a/mysql-test/r/type_year.result +++ b/mysql-test/r/type_year.result @@ -1,5 +1,7 @@ drop table if exists t1; create table t1 (y year,y2 year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69); select * from t1; y y2 @@ -50,6 +52,8 @@ End of 5.0 tests # Bug #49480: WHERE using YEAR columns returns unexpected results # CREATE TABLE t2(yy YEAR(2), c2 CHAR(4)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t4(yyyy YEAR(4), c4 CHAR(4)); INSERT INTO t2 (c2) VALUES (NULL),(1970),(1999),(2000),(2001),(2069); INSERT INTO t4 (c4) SELECT c2 FROM t2; @@ -358,9 +362,22 @@ total_rows min_value MAX(c1+0) 3 0 2155 DROP TABLE t1; # +# WL#6219: Deprecate and remove YEAR(2) type +# +CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +DROP TABLE t1; +# End of 5.1 tests create function y2k() returns int deterministic return 2000; create table t1 (a year(2), b int); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert t1 values (0,2000); select a from t1 where a=2000; a diff --git a/mysql-test/suite/binlog/r/binlog_grant.result b/mysql-test/suite/binlog/r/binlog_grant.result index 21ebb891103..38442349d3b 100644 --- a/mysql-test/suite/binlog/r/binlog_grant.result +++ b/mysql-test/suite/binlog/r/binlog_grant.result @@ -26,3 +26,7 @@ ERROR 42000: Access denied; you need the SUPER privilege for this operation **** Clean up **** set global binlog_format = @saved_binlog_format; drop user mysqltest_1@localhost; +GRANT REPLICATION CLIENT ON *.* TO 'mysqltest_1'@'localhost'; +SHOW MASTER LOGS; +SHOW BINARY LOGS; +DROP USER 'mysqltest_1'@'localhost'; diff --git a/mysql-test/suite/binlog/t/binlog_grant.test b/mysql-test/suite/binlog/t/binlog_grant.test index d36dcce4cc3..bbf57b075af 100644 --- a/mysql-test/suite/binlog/t/binlog_grant.test +++ b/mysql-test/suite/binlog/t/binlog_grant.test @@ -58,3 +58,22 @@ disconnect root; connection default; set global binlog_format = @saved_binlog_format; drop user mysqltest_1@localhost; + + +# Testing if REPLICATION CLIENT privilege is enough to execute +# SHOW MASTER LOGS and SHOW BINARY. +GRANT REPLICATION CLIENT ON *.* TO 'mysqltest_1'@'localhost'; +--connect(rpl,localhost,mysqltest_1,,) + +--connection rpl +# We are only interested if the following commands succeed and not on +# their output. +--disable_result_log +SHOW MASTER LOGS; +SHOW BINARY LOGS; +--enable_result_log + +# clean up +--disconnect rpl +connection default; +DROP USER 'mysqltest_1'@'localhost'; diff --git a/mysql-test/suite/engines/iuds/r/delete_year.result b/mysql-test/suite/engines/iuds/r/delete_year.result index 02cbe24ecc9..c82f0dae7d9 100644 --- a/mysql-test/suite/engines/iuds/r/delete_year.result +++ b/mysql-test/suite/engines/iuds/r/delete_year.result @@ -2,7 +2,13 @@ DROP TABLE IF EXISTS t1,t2,t3,t4; CREATE TABLE t1(c1 YEAR NOT NULL,c2 YEAR, PRIMARY KEY(c1)); CREATE TABLE t2(c1 YEAR NOT NULL, c2 YEAR, UNIQUE INDEX idx(c1,c2)); CREATE TABLE t3(c1 YEAR(2) NOT NULL,c2 YEAR(2), PRIMARY KEY(c1)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t4(c1 YEAR(2), c2 YEAR(2), UNIQUE INDEX idx(c1,c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO t1 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t2 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t3 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); diff --git a/mysql-test/suite/engines/iuds/r/insert_year.result b/mysql-test/suite/engines/iuds/r/insert_year.result index 386c8090434..b9618ba4e2d 100644 --- a/mysql-test/suite/engines/iuds/r/insert_year.result +++ b/mysql-test/suite/engines/iuds/r/insert_year.result @@ -3235,9 +3235,21 @@ c1 c2 c3 c4 1999 1999 1998-12-30 1998-12-30 11:30:45 DROP TABLE t1,t2,t3,t4; CREATE TABLE t1(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1), UNIQUE INDEX(c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t2(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1,c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t3(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, UNIQUE INDEX idx(c1,c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t4(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO t1 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45'); INSERT INTO t2 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45'); INSERT INTO t3 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45'); diff --git a/mysql-test/suite/engines/iuds/r/update_year.result b/mysql-test/suite/engines/iuds/r/update_year.result index 1b0ead45314..c762d70a276 100644 --- a/mysql-test/suite/engines/iuds/r/update_year.result +++ b/mysql-test/suite/engines/iuds/r/update_year.result @@ -2,7 +2,13 @@ DROP TABLE IF EXISTS t1,t2,t3,t4; CREATE TABLE t1(c1 YEAR NOT NULL,c2 YEAR, PRIMARY KEY(c1)); CREATE TABLE t2(c1 YEAR NOT NULL, c2 YEAR, UNIQUE INDEX idx(c1,c2)); CREATE TABLE t3(c1 YEAR(2) NOT NULL,c2 YEAR(2), PRIMARY KEY(c1)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t4(c1 YEAR(2), c2 YEAR(2), UNIQUE INDEX idx(c1,c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO t1 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t2 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t3 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result index c5c4b01e014..e97ce704db8 100644 --- a/mysql-test/suite/funcs_1/r/innodb_views.result +++ b/mysql-test/suite/funcs_1/r/innodb_views.result @@ -53,6 +53,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; DROP DATABASE IF EXISTS test1; @@ -112,6 +114,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/is_columns_innodb.result b/mysql-test/suite/funcs_1/r/is_columns_innodb.result index c86437474d8..0db8955fb10 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_innodb.result +++ b/mysql-test/suite/funcs_1/r/is_columns_innodb.result @@ -132,6 +132,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; drop table if exists tb3 ; @@ -262,6 +264,8 @@ f239 varchar(20000) binary, f240 varchar(2000), f241 char(100) ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb4.txt' into table tb4; USE test1; @@ -319,6 +323,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/is_columns_memory.result b/mysql-test/suite/funcs_1/r/is_columns_memory.result index 680210df1de..fb6c8fd728a 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_memory.result +++ b/mysql-test/suite/funcs_1/r/is_columns_memory.result @@ -128,6 +128,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; drop table if exists tb3; @@ -251,6 +253,8 @@ f238 varchar(25000) binary, f239 varbinary(0), f240 varchar(1200) ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb4.txt' into table tb4; USE test1; @@ -308,6 +312,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; USE test; diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam.result b/mysql-test/suite/funcs_1/r/is_columns_myisam.result index 3e65adbcf02..d0c409798dc 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_myisam.result +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam.result @@ -144,6 +144,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; drop table if exists tb3 ; @@ -283,6 +285,8 @@ f240 varchar(120), f241 char(100), f242 bit(30) ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt' into table tb4; USE test1; @@ -348,6 +352,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result index 48b4bfa9d50..9242ce1cb53 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result @@ -144,6 +144,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; drop table if exists tb3 ; @@ -283,6 +285,8 @@ f240 varchar(120), f241 char(100), f242 bit(30) ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt' into table tb4; USE test1; @@ -348,6 +352,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result index 27eacf8ee12..5af10d822a6 100644 --- a/mysql-test/suite/funcs_1/r/memory_views.result +++ b/mysql-test/suite/funcs_1/r/memory_views.result @@ -54,6 +54,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; DROP DATABASE IF EXISTS test1; @@ -113,6 +115,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; USE test; diff --git a/mysql-test/suite/funcs_1/r/myisam_views-big.result b/mysql-test/suite/funcs_1/r/myisam_views-big.result index 83363502b26..cfd15293b7b 100644 --- a/mysql-test/suite/funcs_1/r/myisam_views-big.result +++ b/mysql-test/suite/funcs_1/r/myisam_views-big.result @@ -62,6 +62,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; DROP DATABASE IF EXISTS test1; @@ -129,6 +131,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/ndb_views.result b/mysql-test/suite/funcs_1/r/ndb_views.result index b75f4955986..17eaedce56b 100644 --- a/mysql-test/suite/funcs_1/r/ndb_views.result +++ b/mysql-test/suite/funcs_1/r/ndb_views.result @@ -53,6 +53,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = ndb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/ndb_tb2.txt' into table tb2 ; DROP DATABASE IF EXISTS test1; @@ -112,6 +114,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = ndb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/ndb_tb2.txt' into table tb2 ; USE test; diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result index 31008736389..57cb2cfb5ae 100644 --- a/mysql-test/suite/funcs_1/r/storedproc.result +++ b/mysql-test/suite/funcs_1/r/storedproc.result @@ -7528,9 +7528,13 @@ BEGIN declare x, y, z year(3) default 2005; SELECT x, y, z; END// +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CALL sp1(); x y z 2005 2005 2005 +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead DROP PROCEDURE IF EXISTS sp1; CREATE PROCEDURE sp1( ) BEGIN diff --git a/mysql-test/suite/innodb/r/innodb_bug14007649.result b/mysql-test/suite/innodb/r/innodb_bug14007649.result new file mode 100644 index 00000000000..1f802dcd146 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug14007649.result @@ -0,0 +1,56 @@ +create table t1 ( +rowid int, +f1 int, +f2 int, +key i1 (f1, f2), +key i2 (f2)) engine=innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `rowid` int(11) DEFAULT NULL, + `f1` int(11) DEFAULT NULL, + `f2` int(11) DEFAULT NULL, + KEY `i1` (`f1`,`f2`), + KEY `i2` (`f2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into `t1` (rowid, f1, f2) values (1, 1, 10), (2, 1, NULL); +start transaction with consistent snapshot; +start transaction; +update t1 set f2 = 4 where f1 = 1 and f2 is null; +(b) Number of rows updated: +select row_count(); +row_count() +1 +insert into t1 values (3, 1, null); +(b) After update and insert query. +select rowid, f1, f2 from t1; +rowid f1 f2 +1 1 10 +2 1 4 +3 1 NULL +commit; +(a) Before the update statement is executed. +select rowid, f1, f2 from t1; +rowid f1 f2 +1 1 10 +2 1 NULL +SET SESSION debug="+d,bug14007649"; +update t1 set f2 = 6 where f1 = 1 and f2 is null; +(a) Number of rows updated: +select row_count(); +row_count() +1 +(a) After the update statement is executed. +select rowid, f1, f2 from t1; +rowid f1 f2 +1 1 10 +2 1 NULL +3 1 6 +commit; +"The trx with consistent snapshot ended." +select rowid, f1, f2 from t1; +rowid f1 f2 +1 1 10 +2 1 4 +3 1 6 +drop table t1; diff --git a/mysql-test/suite/innodb/t/innodb-lock.test b/mysql-test/suite/innodb/t/innodb-lock.test index 9952603f372..8e4dd80e07e 100644 --- a/mysql-test/suite/innodb/t/innodb-lock.test +++ b/mysql-test/suite/innodb/t/innodb-lock.test @@ -1,10 +1,5 @@ -- source include/have_innodb.inc -if (`select plugin_auth_version <= "1.0.17-13.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB 1.0.17-13.0 or earlier -} - # # Check and select innodb lock type # diff --git a/mysql-test/suite/innodb/t/innodb_bug13635833.test b/mysql-test/suite/innodb/t/innodb_bug13635833.test index 5695e0c1f26..b66b99b7681 100644 --- a/mysql-test/suite/innodb/t/innodb_bug13635833.test +++ b/mysql-test/suite/innodb/t/innodb_bug13635833.test @@ -2,11 +2,6 @@ --source include/have_debug_sync.inc --source include/not_embedded.inc -if (`select plugin_auth_version <= "1.0.17-13.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB 1.0.17-13.0 or earlier -} - SET DEBUG_SYNC='reset'; # Save the initial number of concurrent sessions diff --git a/mysql-test/suite/innodb/t/innodb_bug14007649.test b/mysql-test/suite/innodb/t/innodb_bug14007649.test new file mode 100644 index 00000000000..88c5cf6781e --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug14007649.test @@ -0,0 +1,63 @@ +--source include/have_innodb.inc +--source include/have_debug.inc + +if (`select plugin_auth_version <= "1.0.17-13.01" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in XtraDB 1.0.17-13.01 or earlier +} + +create table t1 ( + rowid int, + f1 int, + f2 int, + key i1 (f1, f2), + key i2 (f2)) engine=innodb; + +show create table t1; +insert into `t1` (rowid, f1, f2) values (1, 1, 10), (2, 1, NULL); + +connect (a,localhost,root,,); +connect (b,localhost,root,,); + +connection a; +start transaction with consistent snapshot; + +connection b; +start transaction; +update t1 set f2 = 4 where f1 = 1 and f2 is null; + +-- echo (b) Number of rows updated: +select row_count(); + +insert into t1 values (3, 1, null); + +-- echo (b) After update and insert query. +select rowid, f1, f2 from t1; + +commit; + +connection a; + +-- echo (a) Before the update statement is executed. +select rowid, f1, f2 from t1; + +SET SESSION debug="+d,bug14007649"; +update t1 set f2 = 6 where f1 = 1 and f2 is null; + +-- echo (a) Number of rows updated: +select row_count(); + +-- echo (a) After the update statement is executed. +select rowid, f1, f2 from t1; + +commit; + +--echo "The trx with consistent snapshot ended." + +select rowid, f1, f2 from t1; + +connection default; +disconnect a; +disconnect b; + +drop table t1; diff --git a/mysql-test/suite/innodb/t/innodb_replace.test b/mysql-test/suite/innodb/t/innodb_replace.test index 30e47042d92..a35f423c85e 100644 --- a/mysql-test/suite/innodb/t/innodb_replace.test +++ b/mysql-test/suite/innodb/t/innodb_replace.test @@ -1,11 +1,6 @@ --source include/have_innodb.inc --source include/have_debug_sync.inc -if (`select plugin_auth_version <= "1.0.17-13.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB 1.0.17-13.0 or earlier -} - --echo # --echo #Bug#11759688 52020: InnoDB can still deadlock --echo #on just INSERT...ON DUPLICATE KEY diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug14007649.result b/mysql-test/suite/innodb_plugin/r/innodb_bug14007649.result new file mode 100644 index 00000000000..1f802dcd146 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/r/innodb_bug14007649.result @@ -0,0 +1,56 @@ +create table t1 ( +rowid int, +f1 int, +f2 int, +key i1 (f1, f2), +key i2 (f2)) engine=innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `rowid` int(11) DEFAULT NULL, + `f1` int(11) DEFAULT NULL, + `f2` int(11) DEFAULT NULL, + KEY `i1` (`f1`,`f2`), + KEY `i2` (`f2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into `t1` (rowid, f1, f2) values (1, 1, 10), (2, 1, NULL); +start transaction with consistent snapshot; +start transaction; +update t1 set f2 = 4 where f1 = 1 and f2 is null; +(b) Number of rows updated: +select row_count(); +row_count() +1 +insert into t1 values (3, 1, null); +(b) After update and insert query. +select rowid, f1, f2 from t1; +rowid f1 f2 +1 1 10 +2 1 4 +3 1 NULL +commit; +(a) Before the update statement is executed. +select rowid, f1, f2 from t1; +rowid f1 f2 +1 1 10 +2 1 NULL +SET SESSION debug="+d,bug14007649"; +update t1 set f2 = 6 where f1 = 1 and f2 is null; +(a) Number of rows updated: +select row_count(); +row_count() +1 +(a) After the update statement is executed. +select rowid, f1, f2 from t1; +rowid f1 f2 +1 1 10 +2 1 NULL +3 1 6 +commit; +"The trx with consistent snapshot ended." +select rowid, f1, f2 from t1; +rowid f1 f2 +1 1 10 +2 1 4 +3 1 6 +drop table t1; diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug52745.result b/mysql-test/suite/innodb_plugin/r/innodb_bug52745.result index 74db8b0c20a..927ba0e0e53 100644 --- a/mysql-test/suite/innodb_plugin/r/innodb_bug52745.result +++ b/mysql-test/suite/innodb_plugin/r/innodb_bug52745.result @@ -58,6 +58,7 @@ col89 float unsigned zerofill DEFAULT NULL, col90 tinyblob ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead Note 1291 Column 'col82' has duplicated value '' in ENUM Note 1291 Column 'col82' has duplicated value '' in ENUM INSERT INTO bug52745 SET diff --git a/mysql-test/suite/innodb_plugin/t/disabled.def b/mysql-test/suite/innodb_plugin/t/disabled.def index 1b87b85b060..fcb4a700f7b 100644 --- a/mysql-test/suite/innodb_plugin/t/disabled.def +++ b/mysql-test/suite/innodb_plugin/t/disabled.def @@ -15,3 +15,4 @@ # add --skip inside if() into the test file itself # +innodb_bug52745: Disabled as this has valgrind failures (also in MySQL 5.1.50) diff --git a/mysql-test/suite/innodb_plugin/t/innodb-blob.test b/mysql-test/suite/innodb_plugin/t/innodb-blob.test index 01c0a843c2d..7d2968c720d 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb-blob.test +++ b/mysql-test/suite/innodb_plugin/t/innodb-blob.test @@ -4,11 +4,6 @@ --source include/have_innodb_plugin.inc -if (`select plugin_auth_version <= "1.0.17-13.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB 1.0.17-13.0 or earlier -} - # DEBUG_SYNC must be compiled in. --source include/have_debug_sync.inc diff --git a/mysql-test/suite/innodb_plugin/t/innodb-index.test b/mysql-test/suite/innodb_plugin/t/innodb-index.test index a0a525f2765..d4310093bfd 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb-index.test +++ b/mysql-test/suite/innodb_plugin/t/innodb-index.test @@ -1,10 +1,5 @@ -- source include/have_innodb_plugin.inc -if (`select plugin_auth_version <= "1.0.17-13.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB 1.0.17-13.0 or earlier -} - let $MYSQLD_DATADIR= `select @@datadir`; let $per_table=`select @@innodb_file_per_table`; diff --git a/mysql-test/suite/innodb_plugin/t/innodb-lock.test b/mysql-test/suite/innodb_plugin/t/innodb-lock.test index 4ce7c95b6c5..2198c02efb0 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb-lock.test +++ b/mysql-test/suite/innodb_plugin/t/innodb-lock.test @@ -1,10 +1,5 @@ -- source include/have_innodb_plugin.inc -if (`select plugin_auth_version <= "1.0.17-13.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB 1.0.17-13.0 or earlier -} - # # Check and select innodb lock type # diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug13635833.test b/mysql-test/suite/innodb_plugin/t/innodb_bug13635833.test index adaf59644ba..5db7a41e201 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug13635833.test +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug13635833.test @@ -4,11 +4,6 @@ # InnoDB Plugin cannot use DEBUG_SYNC on Windows --source include/not_windows.inc -if (`select plugin_auth_version <= "1.0.17-13.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB 1.0.17-13.0 or earlier -} - SET DEBUG_SYNC='reset'; # Save the initial number of concurrent sessions diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug14007649.test b/mysql-test/suite/innodb_plugin/t/innodb_bug14007649.test new file mode 100644 index 00000000000..960695665f5 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug14007649.test @@ -0,0 +1,63 @@ +--source include/have_innodb_plugin.inc +--source include/have_debug.inc + +if (`select plugin_auth_version <= "1.0.17-13.01" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in XtraDB 1.0.17-13.01 or earlier +} + +create table t1 ( + rowid int, + f1 int, + f2 int, + key i1 (f1, f2), + key i2 (f2)) engine=innodb; + +show create table t1; +insert into `t1` (rowid, f1, f2) values (1, 1, 10), (2, 1, NULL); + +connect (a,localhost,root,,); +connect (b,localhost,root,,); + +connection a; +start transaction with consistent snapshot; + +connection b; +start transaction; +update t1 set f2 = 4 where f1 = 1 and f2 is null; + +-- echo (b) Number of rows updated: +select row_count(); + +insert into t1 values (3, 1, null); + +-- echo (b) After update and insert query. +select rowid, f1, f2 from t1; + +commit; + +connection a; + +-- echo (a) Before the update statement is executed. +select rowid, f1, f2 from t1; + +SET SESSION debug="+d,bug14007649"; +update t1 set f2 = 6 where f1 = 1 and f2 is null; + +-- echo (a) Number of rows updated: +select row_count(); + +-- echo (a) After the update statement is executed. +select rowid, f1, f2 from t1; + +commit; + +--echo "The trx with consistent snapshot ended." + +select rowid, f1, f2 from t1; + +connection default; +disconnect a; +disconnect b; + +drop table t1; diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug52745.test b/mysql-test/suite/innodb_plugin/t/innodb_bug52745.test index 455f0522684..d118dfd6b93 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug52745.test +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug52745.test @@ -2,11 +2,6 @@ let collation=utf8_persian_ci; --source include/have_collation.inc -if (`select plugin_auth_version <= "1.0.17-13.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB 1.0.17-13.0 or earlier -} - let $file_format=`select @@innodb_file_format`; let $file_per_table=`select @@innodb_file_per_table`; SET GLOBAL innodb_file_format='Barracuda'; diff --git a/mysql-test/suite/innodb_plugin/t/innodb_replace.test b/mysql-test/suite/innodb_plugin/t/innodb_replace.test index 797e85a2b85..f052edd1d24 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_replace.test +++ b/mysql-test/suite/innodb_plugin/t/innodb_replace.test @@ -1,11 +1,6 @@ --source include/have_innodb_plugin.inc --source include/have_debug_sync.inc -if (`select plugin_auth_version <= "1.0.17-13.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB 1.0.17-13.0 or earlier -} - --echo # --echo #Bug#11759688 52020: InnoDB can still deadlock --echo #on just INSERT...ON DUPLICATE KEY diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment_bug45679.result b/mysql-test/suite/rpl/r/rpl_auto_increment_bug45679.result new file mode 100644 index 00000000000..e2b3206eb02 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_auto_increment_bug45679.result @@ -0,0 +1,36 @@ +include/master-slave.inc +[connection master] +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); +create table tm (b int auto_increment, a int, primary key (a,b)) engine= myisam; +create table ti (b int auto_increment, a int, primary key (a,b)) engine= innodb; +ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key +create table ti (b int auto_increment, a int, primary key (b,a)) engine= innodb; +set @@binlog_format=statement; +*** autoincrement field is not the first in PK warning must be there: *** +insert into tm set b=null, a=1; +Warnings: +Note 1592 Statement may not be safe to log in statement format. +show warnings; +Level Code Message +Note 1592 Statement may not be safe to log in statement format. +*** no warning when autoincrement is the first in PK +insert into ti set b=null, a=1; +show warnings; +Level Code Message +create function multi_part_pk_with_autoinc (arg int) +returns int +begin +insert into tm set b=null, a=arg; +return arg; +end// +select multi_part_pk_with_autoinc (3); +multi_part_pk_with_autoinc (3) +3 +*** No warnings in 5.1 because of Bug11749859-39934 *** +show warnings; +Level Code Message +set @@binlog_format=mixed; +insert into tm set b=null, a=2; +drop table tm, ti; +drop function multi_part_pk_with_autoinc; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result index c88dcee9dbc..baf0cf81cec 100644 --- a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result +++ b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result @@ -114,4 +114,24 @@ id c 3 3 [on master] drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); +CREATE TABLE test.t1 (a INT); +INSERT INTO test.t1 VALUES(1); +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); +CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW +INSERT INTO test.t_slave VALUES(NULL, RAND(), @c); +SET INSERT_ID=2; +SET @c=2; +SET @@rand_seed1=10000000, @@rand_seed2=1000000; +INSERT INTO t5 VALUES (NULL, RAND(), @c); +SELECT b into @b FROM test.t5; +UPDATE test.t1 SET a=2; +SELECT a AS 'ONE' into @a FROM test.t_slave; +SELECT c AS 'NULL' into @c FROM test.t_slave; +SELECT b into @b FROM test.t_slave; +include/assert.inc [Random values from master and slave must be different] +drop table test.t5; +drop table test.t1; +drop table test.t_slave; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index 58d0e202110..f07eaac94e9 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -11,7 +11,7 @@ include/stop_slave.inc change master to master_log_pos=MASTER_LOG_POS; start slave; include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event'' include/stop_slave_sql.inc show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index 7a7f8141ac8..6d68a094594 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -1,7 +1,7 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153"); -call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:"); +call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153"); +call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet"); drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; SET @@global.max_allowed_packet=1024; @@ -30,14 +30,14 @@ include/start_slave.inc CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM; INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048'); include/wait_for_slave_io_error.inc [errno=1153] -Last_IO_Error = 'Got a packet bigger than 'max_allowed_packet' bytes' +Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes' include/stop_slave_sql.inc include/rpl_reset.inc DROP TABLE t1; CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); -include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master'' +include/wait_for_slave_io_error.inc [errno=1153] +Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes' STOP SLAVE; RESET SLAVE; RESET MASTER; @@ -52,6 +52,7 @@ SET @@global.max_allowed_packet= 1024; Warnings: Warning 1105 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SET @@global.net_buffer_length= 1024; +SET @@global.slave_max_allowed_packet= 1073741824; DROP TABLE t1; RESET SLAVE; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel_show_binlog_events_purge_logs.result b/mysql-test/suite/rpl/r/rpl_parallel_show_binlog_events_purge_logs.result new file mode 100644 index 00000000000..b69deb17c4c --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_parallel_show_binlog_events_purge_logs.result @@ -0,0 +1,13 @@ +include/master-slave.inc +[connection master] +[connection slave] +SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end'; +SHOW BINLOG EVENTS; +[connection slave1] +SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events'; +FLUSH LOGS; +SET DEBUG_SYNC= 'now SIGNAL end'; +SET DEBUG_SYNC= 'RESET'; +[connection slave] +SET DEBUG_SYNC= 'RESET'; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment_bug45679.test b/mysql-test/suite/rpl/t/rpl_auto_increment_bug45679.test new file mode 100644 index 00000000000..0df086ddbfa --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_auto_increment_bug45679.test @@ -0,0 +1,62 @@ +# Test of auto-increment. +# +# BUG#11754117-45670 +# Multipart primary key with the autoincrement part not first in it +# is replication unsafe. +# + +source include/master-slave.inc; +source include/have_binlog_format_mixed.inc; +source include/have_innodb.inc; + +call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); + +--connection master +create table tm (b int auto_increment, a int, primary key (a,b)) engine= myisam; +--error ER_WRONG_AUTO_KEY +create table ti (b int auto_increment, a int, primary key (a,b)) engine= innodb; +create table ti (b int auto_increment, a int, primary key (b,a)) engine= innodb; + +set @@binlog_format=statement; +--echo *** autoincrement field is not the first in PK warning must be there: *** +insert into tm set b=null, a=1; +show warnings; +--echo *** no warning when autoincrement is the first in PK +insert into ti set b=null, a=1; +show warnings; + +delimiter //; +create function multi_part_pk_with_autoinc (arg int) +returns int +begin + insert into tm set b=null, a=arg; + return arg; +end// +delimiter ;// + +select multi_part_pk_with_autoinc (3); +--echo *** No warnings in 5.1 because of Bug11749859-39934 *** +show warnings; + +set @@binlog_format=mixed; +insert into tm set b=null, a=2; + +sync_slave_with_master; + +if (`select count(*) <> 3 from tm`) +{ + --echo Wrong result from SELECT on the slave side. + select * from tm; + --die +} + +# cleanup + +--connection master + +drop table tm, ti; +drop function multi_part_pk_with_autoinc; + +sync_slave_with_master; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test index 13c66f9f64b..3572dd53ea7 100644 --- a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test +++ b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test @@ -206,4 +206,65 @@ SELECT * FROM t3; connection master; echo [on master]; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; + +--sync_slave_with_master + +# +# BUG#11754117 - 45670: INTVAR_EVENTS FOR FILTERED-OUT QUERY_LOG_EVENTS ARE EXECUTED +# Int-, Rand- and User- var events accompaning a filtered out Query-log-event should +# be filtered as well. +# +connection master; +# Although RAND() is from 0 to 1.0, DECIMAL(M,D), requires that M must be >= D. +CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); # ignored on slave +CREATE TABLE test.t1 (a INT); # accepted on slave +INSERT INTO test.t1 VALUES(1); + +--sync_slave_with_master +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +# Although RAND() is from 0 to 1.0, DECIMAL(M,D), requires that M must be >= D. +CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); +CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW + INSERT INTO test.t_slave VALUES(NULL, RAND(), @c); + +connection master; +SET INSERT_ID=2; +SET @c=2; +SET @@rand_seed1=10000000, @@rand_seed2=1000000; +INSERT INTO t5 VALUES (NULL, RAND(), @c); # to be ignored +SELECT b into @b FROM test.t5; +--let $b_master=`select @b` +UPDATE test.t1 SET a=2; # to run trigger on slave + +--sync_slave_with_master + +# The proof: +SELECT a AS 'ONE' into @a FROM test.t_slave; +SELECT c AS 'NULL' into @c FROM test.t_slave; + +let $count= 1; +let $table= test.t_slave; +source include/wait_until_rows_count.inc; + +if (`SELECT @a != 2 and @c != NULL`) +{ + SELECT * FROM test.t_slave; + --die Intvar or user var from replication events unexpetedly escaped out to screw a following query applying context. +} + +SELECT b into @b FROM test.t_slave; +--let $b_slave=`select @b` + +--let $assert_text= Random values from master and slave must be different +--let $assert_cond= $b_master != $b_slave +--source include/assert.inc + +# cleanup BUG#11754117 +connection master; +drop table test.t5; +drop table test.t1; + +--sync_slave_with_master +drop table test.t_slave; + --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_packet-slave.opt b/mysql-test/suite/rpl/t/rpl_packet-slave.opt index 42d4f94c999..e0a7a203f99 100644 --- a/mysql-test/suite/rpl/t/rpl_packet-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_packet-slave.opt @@ -1 +1 @@ --O max_allowed_packet=1024 -O net_buffer_length=1024 +-O max_allowed_packet=1024 -O net_buffer_length=1024 -O slave_max_allowed_packet=1024 diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index 3197b6160cd..7fbea87f71e 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -11,9 +11,8 @@ # max-out size db name source include/master-slave.inc; source include/have_binlog_format_row.inc; -call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153"); -call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:"); - +call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153"); +call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet"); let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; disable_warnings; eval drop database if exists $db; @@ -23,6 +22,7 @@ eval create database $db; connection master; let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`; let $old_net_buffer_length= `SELECT @@global.net_buffer_length`; +let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`; SET @@global.max_allowed_packet=1024; SET @@global.net_buffer_length=1024; @@ -124,8 +124,8 @@ INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), R connection slave; # The slave I/O thread must stop after receiving -# 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master. ---let $slave_io_errno= 1236 +# 1153 = ER_NET_PACKET_TOO_LARGE +--let $slave_io_errno= 1153 --let $show_slave_io_error= 1 --source include/wait_for_slave_io_error.inc @@ -166,6 +166,7 @@ connection master; DROP TABLE t1; eval SET @@global.max_allowed_packet= $old_max_allowed_packet; eval SET @@global.net_buffer_length= $old_net_buffer_length; +eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet; # slave is stopped connection slave; DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test b/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test new file mode 100644 index 00000000000..16d986268c9 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test @@ -0,0 +1,35 @@ +# BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER +# +# The function mysql_show_binlog_events has a local stack variable +# 'LOG_INFO linfo;', which is assigned to thd->current_linfo, however +# this variable goes out of scope and is destroyed before clean +# thd->current_linfo. +# +# This test case runs SHOW BINLOG EVENTS and FLUSH LOGS to make sure +# that with the fix local variable linfo is valid along all +# mysql_show_binlog_events function scope. +# +--source include/have_debug_sync.inc +--source include/master-slave.inc + +--echo [connection slave] +--connection slave +SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end'; +--send SHOW BINLOG EVENTS + +--connection slave1 +--echo [connection slave1] +SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events'; +FLUSH LOGS; +SET DEBUG_SYNC= 'now SIGNAL end'; +SET DEBUG_SYNC= 'RESET'; + +--echo [connection slave] +--connection slave +--disable_result_log +--reap +--enable_result_log +SET DEBUG_SYNC= 'RESET'; + +--connection master +--source include/rpl_end.inc diff --git a/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result b/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result new file mode 100644 index 00000000000..4a7849c0337 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result @@ -0,0 +1,139 @@ +SET @start_value = @@global.slave_max_allowed_packet; +SELECT @start_value; +@start_value +1073741824 +'#--------------------FN_DYNVARS_072_01------------------------#' +SET @@global.slave_max_allowed_packet = 5000; +SET @@global.slave_max_allowed_packet = DEFAULT; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +'#---------------------FN_DYNVARS_072_02-------------------------#' +SET @@global.slave_max_allowed_packet = @start_value; +SELECT @@global.slave_max_allowed_packet = 1073741824; +@@global.slave_max_allowed_packet = 1073741824 +1 +'Bug# 34876: Incorrect Default Value is assigned to variable'; +'#--------------------FN_DYNVARS_072_03------------------------#' +SET @@global.slave_max_allowed_packet = 1024; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 1073741824; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = 1073741824; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = 1025; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 65535; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +64512 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_072_04-------------------------#' +SET @@global.slave_max_allowed_packet = -1; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '-1' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 100000000000; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '100000000000' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = 10000.01; +ERROR 42000: Incorrect argument type to variable 'slave_max_allowed_packet' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = -1024; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '-1024' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 4294967296; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '4294967296' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = 1023; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '1023' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.slave_max_allowed_packet = ON; +ERROR 42000: Incorrect argument type to variable 'slave_max_allowed_packet' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 'test'; +ERROR 42000: Incorrect argument type to variable 'slave_max_allowed_packet' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +'#-------------------FN_DYNVARS_072_05----------------------------#' +SET @@session.slave_max_allowed_packet = 4096; +ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.slave_max_allowed_packet; +ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable +'#----------------------FN_DYNVARS_072_06------------------------#' +SELECT @@global.slave_max_allowed_packet = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='slave_max_allowed_packet'; +@@global.slave_max_allowed_packet = VARIABLE_VALUE +1 +SELECT @@slave_max_allowed_packet = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='slave_max_allowed_packet'; +@@slave_max_allowed_packet = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_072_07----------------------#' +SET @@global.slave_max_allowed_packet = TRUE; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '1' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = FALSE; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '0' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +'#---------------------FN_DYNVARS_072_08----------------------#' +SET @@global.slave_max_allowed_packet = 5000; +SELECT @@slave_max_allowed_packet = @@global.slave_max_allowed_packet; +@@slave_max_allowed_packet = @@global.slave_max_allowed_packet +1 +'#---------------------FN_DYNVARS_072_09----------------------#' +SET slave_max_allowed_packet = 6000; +ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@slave_max_allowed_packet; +@@slave_max_allowed_packet +4096 +SET local.slave_max_allowed_packet = 7000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'slave_max_allowed_packet = 7000' at line 1 +SELECT local.slave_max_allowed_packet; +ERROR 42S02: Unknown table 'local' in field list +SET global.slave_max_allowed_packet = 8000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'slave_max_allowed_packet = 8000' at line 1 +SELECT global.slave_max_allowed_packet; +ERROR 42S02: Unknown table 'global' in field list +SELECT slave_max_allowed_packet = @@session.slave_max_allowed_packet; +ERROR 42S22: Unknown column 'slave_max_allowed_packet' in 'field list' +SET @@global.slave_max_allowed_packet = @start_value; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 diff --git a/mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test b/mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test new file mode 100644 index 00000000000..4caaae84906 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test @@ -0,0 +1,177 @@ +############## mysql-test\t\slave_max_allowed_packet_basic.test ################## +# # +# Variable Name: slave_max_allowed_packet # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value:1073741824 # +# Range: 1024 - 1073741824 # +# # +# # +# # +# Description: Test Cases of Dynamic System Variable slave_max_allowed_packet # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +############################################################################### + +--source include/load_sysvars.inc + +######################################################################## +# START OF slave_max_allowed_packet TESTS # +######################################################################## + + +########################################################################### +# Saving initial value of slave_max_allowed_packet in a temporary variable# +########################################################################### + +SET @start_value = @@global.slave_max_allowed_packet; +SELECT @start_value; + + +--echo '#--------------------FN_DYNVARS_072_01------------------------#' +######################################################################## +# Display the DEFAULT value of slave_max_allowed_packet # +######################################################################## + +SET @@global.slave_max_allowed_packet = 5000; +SET @@global.slave_max_allowed_packet = DEFAULT; +SELECT @@global.slave_max_allowed_packet; + + +--echo '#---------------------FN_DYNVARS_072_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.slave_max_allowed_packet = @start_value; +SELECT @@global.slave_max_allowed_packet = 1073741824; +--echo 'Bug# 34876: Incorrect Default Value is assigned to variable'; + +--echo '#--------------------FN_DYNVARS_072_03------------------------#' +######################################################################## +# Change the value of slave_max_allowed_packet to a valid value # +######################################################################## + +SET @@global.slave_max_allowed_packet = 1024; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 1073741824; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 1073741824; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 1025; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 65535; +SELECT @@global.slave_max_allowed_packet; +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + + +--echo '#--------------------FN_DYNVARS_072_04-------------------------#' +########################################################################### +# Change the value of slave_max_allowed_packet to invalid value # +########################################################################### + +SET @@global.slave_max_allowed_packet = -1; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 100000000000; +SELECT @@global.slave_max_allowed_packet; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_max_allowed_packet = 10000.01; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = -1024; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 4294967296; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 1023; +SELECT @@global.slave_max_allowed_packet; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_max_allowed_packet = ON; +SELECT @@global.slave_max_allowed_packet; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_max_allowed_packet = 'test'; +SELECT @@global.slave_max_allowed_packet; + + +--echo '#-------------------FN_DYNVARS_072_05----------------------------#' +########################################################################### +# Test if accessing session slave_max_allowed_packet gives error # +########################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.slave_max_allowed_packet = 4096; +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@session.slave_max_allowed_packet; + + +--echo '#----------------------FN_DYNVARS_072_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.slave_max_allowed_packet = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='slave_max_allowed_packet'; + +SELECT @@slave_max_allowed_packet = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='slave_max_allowed_packet'; + + +--echo '#---------------------FN_DYNVARS_072_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.slave_max_allowed_packet = TRUE; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = FALSE; +SELECT @@global.slave_max_allowed_packet; + + +--echo '#---------------------FN_DYNVARS_072_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.slave_max_allowed_packet = 5000; +SELECT @@slave_max_allowed_packet = @@global.slave_max_allowed_packet; + + +--echo '#---------------------FN_DYNVARS_072_09----------------------#' +################################################################################ +# Check if slave_max_allowed_packet can be accessed with and without @@ sign # +################################################################################ + +--Error ER_GLOBAL_VARIABLE +SET slave_max_allowed_packet = 6000; +SELECT @@slave_max_allowed_packet; +--Error ER_PARSE_ERROR +SET local.slave_max_allowed_packet = 7000; +--Error ER_UNKNOWN_TABLE +SELECT local.slave_max_allowed_packet; +--Error ER_PARSE_ERROR +SET global.slave_max_allowed_packet = 8000; +--Error ER_UNKNOWN_TABLE +SELECT global.slave_max_allowed_packet; +--Error ER_BAD_FIELD_ERROR +SELECT slave_max_allowed_packet = @@session.slave_max_allowed_packet; + + +############################## +# Restore initial value # +############################## + +SET @@global.slave_max_allowed_packet = @start_value; +SELECT @@global.slave_max_allowed_packet; + + +######################################################################## +# END OF slave_max_allowed_packet TESTS # +######################################################################## diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test index 4b775bc761f..cb197aba89f 100644 --- a/mysql-test/t/case.test +++ b/mysql-test/t/case.test @@ -172,6 +172,16 @@ drop table t1, t2; --echo End of 5.0 tests # +# lp:1001510 +# Bug #11764313 57135: CRASH IN ITEM_FUNC_CASE::FIND_ITEM WITH CASE WHEN +# ELSE CLAUSE +# + +CREATE TABLE t1(a YEAR); +SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END; +DROP TABLE t1; + +# # lp:839387 Assertion `(Item_result)i != TIME_RESULT' failed with CASE + datetime # @@ -179,3 +189,4 @@ create table t1 (f1 time); insert t1 values ('00:00:00'),('00:01:00'); select case t1.f1 when '00:00:00' then 1 end from t1; drop table t1; + diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test index 103244eb2f7..d2b2a7e5523 100644 --- a/mysql-test/t/compare.test +++ b/mysql-test/t/compare.test @@ -86,3 +86,11 @@ SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00'; DROP TABLE t1; --echo End of 5.0 tests + +# +# Bug #11764818 57692: Crash in item_func_in::val_int() with ZEROFILL +# + +CREATE TABLE t1(a INT ZEROFILL); +SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2; +DROP TABLE t1; diff --git a/mysql-test/t/func_group_innodb.test b/mysql-test/t/func_group_innodb.test index 9e88894de58..b6752556a0a 100644 --- a/mysql-test/t/func_group_innodb.test +++ b/mysql-test/t/func_group_innodb.test @@ -84,6 +84,49 @@ select count(*), min(7), max(7) from t2m, t1i; drop table t1m, t1i, t2m, t2i; +--echo # +--echo # Bug#12713907: STRANGE OPTIMIZE & WRONG RESULT UNDER ORDER BY +--echo # COUNT(*) LIMIT. +--echo # + +CREATE TABLE t1 ( +id BIGINT(20) , +member_id_to INT(11) , +r_date DATE , +PRIMARY KEY (id,r_date), +KEY r_date_idx (r_date), +KEY t1_idx01 (member_id_to) +) ENGINE=InnoDB; + +INSERT INTO t1 VALUES +(107924526,518491,'2011-05-01'), +(107924527,518491,'2011-05-01'), +(107924528,518491,'2011-05-01'), +(107924529,518491,'2011-05-01'), +(107924530,518491,'2011-05-01'), +(107924531,518491,'2011-05-01'), +(107924532,518491,'2011-05-01'), +(107924534,518491,'2011-06-21'), +(107924535,518491,'2011-06-21'), +(107924536,518491,'2011-06-21'), +(107924537,518491,'2011-06-21'), +(107924538,518491,'2011-06-21'), +(107924542,1601319,'2011-06-21'), +(107924543,1601319,'2011-06-21'), +(107924544,1601319,'2011-06-21'), +(107924545,1601319,'2011-06-21'), +(107924546,1601319,'2011-06-21'), +(107924547,1601319,'2011-06-21'), +(107924548,1601319,'2011-06-21'), +(107924549,1601319,'2011-06-21'), +(107924550,1601319,'2011-06-21'); + +SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date = + '2011-06-21' GROUP BY member_id_to ORDER BY 2 LIMIT 1; + +DROP TABLE t1; + +--echo # End of test BUG#12713907 --echo # --echo # Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index cb713218d61..76a17987fb6 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2319,9 +2319,32 @@ DROP DATABASE BUG52792; USE test; +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc + --echo # ---echo # End of 5.1 tests +--echo # Bug#45740 MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY CAUSES RESTORE PROBLEM --echo # +SET @old_log_output_state= @@global.log_output; +SET @old_general_log_state= @@global.general_log; +SET @old_slow_query_log_state= @@global.slow_query_log; -# Wait till we reached the initial number of concurrent sessions ---source include/wait_until_count_sessions.inc +call mtr.add_suppression("Failed to write to mysql.general_log"); +--exec $MYSQL_DUMP -uroot --all-databases > $MYSQLTEST_VARDIR/tmp/bug45740.sql +# Make log_output as table and enable general_log and slow_log +SET @@global.log_output="TABLE"; +SET @@global.general_log='ON'; +SET @@global.slow_query_log='ON'; +DROP DATABASE mysql; +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug45740.sql +SHOW CREATE TABLE mysql.general_log; +SHOW CREATE TABLE mysql.slow_log; +--remove_file $MYSQLTEST_VARDIR/tmp/bug45740.sql + +SET @@global.log_output= @old_log_output_state; +SET @@global.slow_query_log= @old_slow_query_log_state; +SET @@global.general_log= @old_general_log_state; + +--echo # +--echo # End of 5.1 tests +--echo # diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 89b9f4642e9..f1941337874 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -3117,6 +3117,95 @@ DROP TABLE t1; --echo End of 5.1 tests. +--echo +--echo # Bug#13805127: Stored program cache produces wrong result in same THD +--echo + +PREPARE s1 FROM +" +SELECT c1, t2.c2, count(c3) +FROM + ( + SELECT 3 as c2 FROM dual WHERE @x = 1 + UNION + SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 + ) AS t1, + ( + SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual + UNION + SELECT '2012-03-01 02:00:00', 3, 2 FROM dual + UNION + SELECT '2012-03-01 01:00:00', 2, 1 FROM dual + ) AS t2 +WHERE t2.c2 = t1.c2 +GROUP BY c1, c2 +"; + +--echo +SET @x = 1; +SELECT c1, t2.c2, count(c3) +FROM + ( + SELECT 3 as c2 FROM dual WHERE @x = 1 + UNION + SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 + ) AS t1, + ( + SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual + UNION + SELECT '2012-03-01 02:00:00', 3, 2 FROM dual + UNION + SELECT '2012-03-01 01:00:00', 2, 1 FROM dual + ) AS t2 +WHERE t2.c2 = t1.c2 +GROUP BY c1, c2; +--echo +EXECUTE s1; + +--echo +SET @x = 2; +SELECT c1, t2.c2, count(c3) +FROM + ( + SELECT 3 as c2 FROM dual WHERE @x = 1 + UNION + SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 + ) AS t1, + ( + SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual + UNION + SELECT '2012-03-01 02:00:00', 3, 2 FROM dual + UNION + SELECT '2012-03-01 01:00:00', 2, 1 FROM dual + ) AS t2 +WHERE t2.c2 = t1.c2 +GROUP BY c1, c2; +--echo +EXECUTE s1; + +--echo +SET @x = 1; +SELECT c1, t2.c2, count(c3) +FROM + ( + SELECT 3 as c2 FROM dual WHERE @x = 1 + UNION + SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 + ) AS t1, + ( + SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual + UNION + SELECT '2012-03-01 02:00:00', 3, 2 FROM dual + UNION + SELECT '2012-03-01 01:00:00', 2, 1 FROM dual + ) AS t2 +WHERE t2.c2 = t1.c2 +GROUP BY c1, c2; +--echo +EXECUTE s1; + +DEALLOCATE PREPARE s1; + --echo # --echo # LP bug#1001500 Crash on the second execution of the PS for --echo # a query with degenerated conjunctive condition @@ -3219,94 +3308,4 @@ show status like '%Handler_read%'; deallocate prepare st; drop table t1; ---echo # ---echo # LP bug#993459 Execution of PS for a query with GROUP BY ---echo # returns wrong result (see also mysql bug#13805127) ---echo # - -PREPARE s1 FROM -" -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:00:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2 -"; - ---echo -SET @x = 1; -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:99345900:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; ---echo -EXECUTE s1; - ---echo -SET @x = 2; -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:00:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; ---echo -EXECUTE s1; - ---echo -SET @x = 1; -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:00:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; ---echo -EXECUTE s1; - -DEALLOCATE PREPARE s1; - --echo # End of 5.3 tests diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index d403e94ebbb..dcfbe127f8a 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -8442,10 +8442,10 @@ DROP FUNCTION f1; --echo # -- End of 5.1 tests --echo # ------------------------------------------------------------------ ---echo # ---echo # LP bug#993459 Execution of PS for a query with GROUP BY ---echo # returns wrong result (see also mysql bug#13805127) ---echo # +--echo +--echo # Bug#13805127: Stored program cache produces wrong result in same THD +--echo + delimiter |; CREATE PROCEDURE p1(x INT UNSIGNED) @@ -8476,4 +8476,5 @@ CALL p1(1); CALL p1(2); CALL p1(1); -DROP PROCEDURE p1; +DROP PROCEDURE p1; + diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test index 53cfd3a7c30..d542bfaebfa 100644 --- a/mysql-test/t/type_year.test +++ b/mysql-test/t/type_year.test @@ -161,6 +161,14 @@ SELECT COUNT(*) AS total_rows, MIN(c1+0) AS min_value, MAX(c1+0) FROM t1; DROP TABLE t1; --echo # +--echo # WL#6219: Deprecate and remove YEAR(2) type +--echo # + +CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4)); +ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2); +DROP TABLE t1; + +--echo # --echo End of 5.1 tests # |