diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-12-17 15:05:50 +0200 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-12-17 15:05:50 +0200 |
commit | 2969956def0cec89d2e498083dc88ecb5b94291b (patch) | |
tree | cf85dbae9b4ee145b5311bbaac487c5fd4b66087 /mysql-test | |
parent | 3cdd4ba388310f49d0e57089b9923f33dbdd1606 (diff) | |
parent | 13c6af0eab384632e3cb954e5ba7d7c51d537d4f (diff) | |
download | mariadb-git-2969956def0cec89d2e498083dc88ecb5b94291b.tar.gz |
merge
Diffstat (limited to 'mysql-test')
67 files changed, 2293 insertions, 279 deletions
diff --git a/mysql-test/collections/default.weekly b/mysql-test/collections/default.weekly index 5865864f4cd..92750cca166 100644 --- a/mysql-test/collections/default.weekly +++ b/mysql-test/collections/default.weekly @@ -1,2 +1,2 @@ perl mysql-test-run.pl --timer --force --comment=1st --experimental=collections/default.experimental 1st -perl mysql-test-run.pl --timer --force --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 parts.partition_alter1_2_ndb parts.part_supported_sql_func_innodb parts.partition_alter1_2_innodb parts.partition_alter4_innodb parts.partition_alter1_1_2_ndb parts.partition_alter1_1_2_innodb parts.partition_alter1_1_ndb large_tests.alter_table rpl_ndb.rpl_truncate_7ndb_2 main.archive-big main.sum_distinct-big main.mysqlbinlog_row_big main.alter_table-big main.variables-big main.type_newdecimal-big main.read_many_rows_innodb main.log_tables-big main.count_distinct3 main.events_time_zone main.merge-big main.create-big main.events_stress main.ssl-big +perl mysql-test-run.pl --timer --force --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 parts.partition_alter1_2_ndb parts.part_supported_sql_func_innodb parts.partition_alter1_2_innodb parts.partition_alter4_innodb parts.partition_alter1_1_2_ndb parts.partition_alter1_1_2_innodb parts.partition_alter1_1_ndb rpl_ndb.rpl_truncate_7ndb_2 main.archive-big main.sum_distinct-big main.mysqlbinlog_row_big main.alter_table-big main.variables-big main.type_newdecimal-big main.read_many_rows_innodb main.log_tables-big main.count_distinct3 main.events_time_zone main.merge-big main.create-big main.events_stress main.ssl-big diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index 7f48341077e..fd6ba1c17fa 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -302,5 +302,58 @@ BINLOG ' SHOW BINLOG EVENTS; DROP TABLE t1; + +--echo +--echo # BUG#54903 BINLOG statement toggles session variables +--echo # ---------------------------------------------------------------------- +--echo # This test verify that BINLOG statement doesn't change current session's +--echo # variables foreign_key_checks and unique_checks. +--echo +CREATE TABLE t1 (c1 INT KEY); + +SET @@SESSION.foreign_key_checks= ON; +SET @@SESSION.unique_checks= ON; + +--echo # INSERT INTO t1 VALUES (1) +--echo # foreign_key_checks=0 and unique_checks=0 +BINLOG ' +dfLtTBMBAAAAKQAAANcAAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA== +'; + +SELECT * FROM t1; +--echo # Their values should be ON +SHOW SESSION VARIABLES LIKE "%_checks"; + +--echo +SET @@SESSION.foreign_key_checks= OFF; +SET @@SESSION.unique_checks= OFF; + +--echo # INSERT INTO t1 VALUES(2) +--echo # foreign_key_checks=1 and unique_checks=1 +BINLOG ' +dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== +'; + +SELECT * FROM t1; +--echo # Their values should be OFF +SHOW SESSION VARIABLES LIKE "%_checks"; + +--echo # INSERT INTO t1 VALUES(2) +--echo # foreign_key_checks=1 and unique_checks=1 +--echo # It should not change current session's variables, even error happens +--error 1062 +BINLOG ' +dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== +'; + +SELECT * FROM t1; +--echo # Their values should be OFF +SHOW SESSION VARIABLES LIKE "%_checks"; + +DROP TABLE t1; + disconnect fresh; diff --git a/mysql-test/extra/binlog_tests/binlog_failure_mixing_engines.test b/mysql-test/extra/binlog_tests/binlog_failure_mixing_engines.test index 54f3c538c79..d537e29c1a8 100644 --- a/mysql-test/extra/binlog_tests/binlog_failure_mixing_engines.test +++ b/mysql-test/extra/binlog_tests/binlog_failure_mixing_engines.test @@ -60,6 +60,7 @@ # Please, remove this test case after pushing WL#2687. ################################################################################ +RESET MASTER; --echo ################################################################################### --echo # CONFIGURATION diff --git a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test index 40e155bc314..c7e3d1abc03 100644 --- a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test +++ b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test @@ -53,9 +53,7 @@ source include/wait_for_slave_to_start.inc; connection master; # Write file to make mysql-test-run.pl expect the "crash", but don't start # it until it's told to ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait -EOF +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect # Send shutdown to the connected server and give # it 10 seconds to die before zapping it @@ -85,9 +83,7 @@ source include/wait_for_slave_io_error.inc; eval set @@global.debug = "-d,$dbug_sync_point"; # Write file to make mysql-test-run.pl start up the server again ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart -EOF +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect connection master; # Turn on reconnect diff --git a/mysql-test/include/ctype_8bit.inc b/mysql-test/include/ctype_8bit.inc new file mode 100644 index 00000000000..7259db54d05 --- /dev/null +++ b/mysql-test/include/ctype_8bit.inc @@ -0,0 +1,46 @@ +# +# Test Unicode conversion, upper, lower +# +SELECT @@collation_connection; +CREATE TABLE t1 AS SELECT ' ' AS a LIMIT 0; +INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07); +INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17); +INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27); +INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37); +INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47); +INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57); +INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67); +INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77); +INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87); +INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F); +INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97); +INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F); +INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7); +INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF); +INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7); +INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF); +INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7); +INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF); +INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7); +INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF); +INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7); +INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF); +INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7); +INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF); +SELECT + HEX(a) AS chr, + HEX(LOWER(a)) AS upper, + HEX(LOWER(a)) AS lower, + HEX(@utf8:=CONVERT(a USING utf8)) AS utf8, + HEX(@roundtrip:=CAST(@utf8 AS CHAR)) AS roundtrip, + if(a=BINARY @roundtrip,'','Round trip unsafe') AS issafe +FROM t1 ORDER BY chr; +DROP TABLE t1; diff --git a/mysql-test/include/io_thd_fault_injection.inc b/mysql-test/include/io_thd_fault_injection.inc new file mode 100644 index 00000000000..a76e46d772a --- /dev/null +++ b/mysql-test/include/io_thd_fault_injection.inc @@ -0,0 +1,21 @@ +# +# Takes the flag as an argument: +# -- let $io_thd_injection_fault_flag=+d,fault_injection_new_file_rotate_event +# -- source include/io_thd_fault_injection.inc +# + +SET @old_debug=@@global.debug; +-- disable_warnings +-- source include/stop_slave.inc +-- enable_warnings +-- eval SET GLOBAL debug="+d,$io_thd_injection_fault_flag" + +START SLAVE io_thread; +-- source include/wait_for_slave_io_to_stop.inc +-- source include/wait_for_slave_io_error.inc + +-- eval SET GLOBAL debug="-d,$io_thd_injection_fault_flag" +SET GLOBAL debug=@old_debug; + +# restart because slave is in bad shape +-- source include/restart_mysqld.inc diff --git a/mysql-test/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc index 0f363ff1ee3..f750385e300 100644 --- a/mysql-test/include/restart_mysqld.inc +++ b/mysql-test/include/restart_mysqld.inc @@ -1,18 +1,16 @@ # Write file to make mysql-test-run.pl expect the "crash", but don't start # it until it's told to ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait -EOF +--let $_server_id= `SELECT @@server_id` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--exec echo "wait" > $_expect_file_name # Send shutdown to the connected server and give # it 10 seconds to die before zapping it shutdown_server 10; # Write file to make mysql-test-run.pl start up the server again ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart -EOF +--exec echo "restart" > $_expect_file_name # Turn on reconnect --enable_reconnect diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index d57ddb17622..0c31d25b81b 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -143,7 +143,7 @@ sub collect_test_cases ($$$) { { last unless $opt_reorder; # test->{name} is always in suite.name format - if ( $test->{name} =~ /.*\.$tname/ ) + if ( $test->{name} =~ /^$sname.*\.$tname$/ ) { $found= 1; last; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 1348d0f991b..7c4713bf78f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -569,7 +569,10 @@ sub run_test_server ($$$) { if ( !$opt_force ) { # Test has failed, force is off push(@$completed, $result); - return $completed; + return $completed unless $result->{'dont_kill_server'}; + # Prevent kill of server, to get valgrind report + print $sock "BYE\n"; + next; } elsif ($opt_max_test_fail > 0 and $num_failed_test >= $opt_max_test_fail) { @@ -809,13 +812,14 @@ sub run_worker ($) { elsif ($line eq 'BYE'){ mtr_report("Server said BYE"); stop_all_servers($opt_shutdown_timeout); + my $valgrind_reports= 0; if ($opt_valgrind_mysqld) { - valgrind_exit_reports(); + $valgrind_reports= valgrind_exit_reports(); } if ( $opt_gprof ) { gprof_collect (find_mysqld($basedir), keys %gprof_dirs); } - exit(0); + exit($valgrind_reports); } else { mtr_error("Could not understand server, '$line'"); @@ -860,7 +864,7 @@ sub command_line_setup { my $opt_list_options; # Read the command line options - # Note: Keep list, and the order, in sync with usage at end of this file + # Note: Keep list in sync with usage at end of this file Getopt::Long::Configure("pass_through"); my %options=( # Control what engine/variation to run @@ -896,6 +900,7 @@ sub command_line_setup { 'combination=s' => \@opt_combinations, 'skip-combinations' => \&collect_option, 'experimental=s' => \@opt_experimentals, + # skip-im is deprecated and silently ignored 'skip-im' => \&ignore_option, # Specify ports @@ -988,6 +993,7 @@ sub command_line_setup { 'max-connections=i' => \$opt_max_connections, 'help|h' => \$opt_usage, + # list-options is internal, not listed in help 'list-options' => \$opt_list_options, ); @@ -3690,7 +3696,6 @@ sub run_testcase ($) { # ---------------------------------------------------- # Check if it was an expected crash # ---------------------------------------------------- - SRVDIED: my $check_crash = check_expected_crash_and_restart($proc); if ($check_crash) { @@ -3700,6 +3705,7 @@ sub run_testcase ($) { next; } + SRVDIED: # ---------------------------------------------------- # Stop the test case timer # ---------------------------------------------------- @@ -4249,7 +4255,12 @@ sub after_failure ($) { sub report_failure_and_restart ($) { my $tinfo= shift; - stop_all_servers(); + if ($opt_valgrind_mysqld && ($tinfo->{'warnings'} || $tinfo->{'timeout'})) { + # In these cases we may want valgrind report from normal termination + $tinfo->{'dont_kill_server'}= 1; + } + # Shotdown properly if not to be killed (for valgrind) + stop_all_servers($tinfo->{'dont_kill_server'} ? $opt_shutdown_timeout : 0); $tinfo->{'result'}= 'MTR_RES_FAILED'; @@ -5376,6 +5387,8 @@ sub valgrind_arguments { # sub valgrind_exit_reports() { + my $found_err= 0; + foreach my $log_file (keys %mysqld_logs) { my @culprits= (); @@ -5411,7 +5424,7 @@ sub valgrind_exit_reports() { next; } # This line marks the start of a valgrind report - $found_report= 1 if $line =~ /ERROR SUMMARY:/; + $found_report= 1 if $line =~ /^==\d+== .* SUMMARY:/; if ($found_report) { $line=~ s/^==\d+== //; @@ -5428,8 +5441,11 @@ sub valgrind_exit_reports() { mtr_print ("Valgrind report from $log_file after tests:\n", @culprits); mtr_print_line(); print ("$valgrind_rep\n"); + $found_err= 1; } } + + return $found_err; } # @@ -5463,7 +5479,7 @@ Options to control what engine/variation to run defaults-file=<config template> Use fixed config template for all tests - defaults_extra_file=<config template> Extra config template to add to + defaults-extra-file=<config template> Extra config template to add to all generated configs combination=<opt> Use at least twice to run tests with specified options to mysqld @@ -5554,7 +5570,7 @@ Options for debugging the product test(s) manual-ddd Let user manually start mysqld in ddd, before running test(s) - strace-client=[path] Create strace output for mysqltest client, optionally + strace-client[=path] Create strace output for mysqltest client, optionally specifying name and path to the trace program to use. Example: $0 --strace-client=ktrace max-save-core Limit the number of core files saved (to avoid filling @@ -5587,7 +5603,7 @@ Options for valgrind Misc options user=USER User for connecting to mysqld(default: $opt_user) comment=STR Write STR to the output - notimer Don't show test case execution time + timer Show test case execution time. verbose More verbose output(use multiple times for even more) verbose-restart Write when and why servers are restarted start Only initialize and start the servers, using the @@ -5627,6 +5643,7 @@ Misc options actions. Disable facility with NUM=0. gcov Collect coverage information after the test. The result is a gcov file per source and header file. + gprof Collect profiling information using gprof. experimental=<file> Refer to list of tests considered experimental; failures will be marked exp-fail instead of fail. report-features First run a "test" that reports mysql features @@ -5635,6 +5652,10 @@ Misc options *previous* test started max-connections=N Max number of open connection to server in mysqltest +Some options that control enabling a feature for normal test runs, +can be turned off by prepending 'no' to the option, e.g. --notimer. +This applies to reorder, timer, check-testcases and warnings. + HERE exit(1); diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 4a2e108f8c6..5fae14e2c07 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -476,3 +476,24 @@ SELECT a FROM t2; a 2 DROP TABLE t1, t2; +# +# Bug#39828 autoinc wraps around when offset and increment > 1 +# +CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) engine=MyISAM; +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES (18446744073709551601); +SET @@SESSION.AUTO_INCREMENT_INCREMENT=10; +SELECT @@SESSION.AUTO_INCREMENT_OFFSET; +@@SESSION.AUTO_INCREMENT_OFFSET +1 +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +ERROR 22003: Out of range value for column 't1' at row 167 +SELECT * FROM t1; +c1 +1 +18446744073709551601 +18446744073709551611 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=default; +SET @@SESSION.AUTO_INCREMENT_OFFSET=default; +DROP TABLE t1; +End of 5.1 tests diff --git a/mysql-test/r/change_user.result b/mysql-test/r/change_user.result index f8d5d900a80..1ed7fcbb8fa 100644 --- a/mysql-test/r/change_user.result +++ b/mysql-test/r/change_user.result @@ -18,7 +18,7 @@ change_user SELECT @@session.sql_big_selects; @@session.sql_big_selects 0 -SET @@global.max_join_size = -1; +SET @@global.max_join_size = 18446744073709551615; SET @@session.max_join_size = default; change_user SELECT @@session.sql_big_selects; diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index 5e6c013bb38..381ae8b2562 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -215,6 +215,17 @@ SET GLOBAL event_scheduler = OFF; # -- End of Bug#35074. +# +# -- Bug#49752: 2469.126.2 unintentionally breaks authentication +# against MySQL 5.1 server +# +GRANT ALL ON test.* TO 'Azundris12345678'@'localhost' IDENTIFIED BY 'test123'; +FLUSH PRIVILEGES; +DROP USER 'Azundris12345678'@'localhost'; +FLUSH PRIVILEGES; +# +# -- End of Bug#49752 +# # ------------------------------------------------------------------ # -- End of 5.1 tests # ------------------------------------------------------------------ diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 47797af3cbe..dc12f9ceb03 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -70,3 +70,311 @@ we_ivo NULL we_martin NULL we_toshko NULL drop table t1; +# +# Start of 5.1 tests +# +SELECT @@collation_connection; +@@collation_connection +cp1251_general_ci +CREATE TABLE t1 AS SELECT ' ' AS a LIMIT 0; +INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07); +INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17); +INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27); +INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37); +INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47); +INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57); +INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67); +INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77); +INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87); +INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F); +INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97); +INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F); +INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7); +INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF); +INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7); +INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF); +INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7); +INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF); +INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7); +INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF); +INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7); +INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF); +INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7); +INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF); +SELECT +HEX(a) AS chr, +HEX(LOWER(a)) AS upper, +HEX(LOWER(a)) AS lower, +HEX(@utf8:=CONVERT(a USING utf8)) AS utf8, +HEX(@roundtrip:=CAST(@utf8 AS CHAR)) AS roundtrip, +if(a=BINARY @roundtrip,'','Round trip unsafe') AS issafe +FROM t1 ORDER BY chr; +chr upper lower utf8 roundtrip issafe +00 00 00 00 00 +01 01 01 01 01 +02 02 02 02 02 +03 03 03 03 03 +04 04 04 04 04 +05 05 05 05 05 +06 06 06 06 06 +07 07 07 07 07 +08 08 08 08 08 +09 09 09 09 09 +0A 0A 0A 0A 0A +0B 0B 0B 0B 0B +0C 0C 0C 0C 0C +0D 0D 0D 0D 0D +0E 0E 0E 0E 0E +0F 0F 0F 0F 0F +10 10 10 10 10 +11 11 11 11 11 +12 12 12 12 12 +13 13 13 13 13 +14 14 14 14 14 +15 15 15 15 15 +16 16 16 16 16 +17 17 17 17 17 +18 18 18 18 18 +19 19 19 19 19 +1A 1A 1A 1A 1A +1B 1B 1B 1B 1B +1C 1C 1C 1C 1C +1D 1D 1D 1D 1D +1E 1E 1E 1E 1E +1F 1F 1F 1F 1F +20 20 20 20 20 +21 21 21 21 21 +22 22 22 22 22 +23 23 23 23 23 +24 24 24 24 24 +25 25 25 25 25 +26 26 26 26 26 +27 27 27 27 27 +28 28 28 28 28 +29 29 29 29 29 +2A 2A 2A 2A 2A +2B 2B 2B 2B 2B +2C 2C 2C 2C 2C +2D 2D 2D 2D 2D +2E 2E 2E 2E 2E +2F 2F 2F 2F 2F +30 30 30 30 30 +31 31 31 31 31 +32 32 32 32 32 +33 33 33 33 33 +34 34 34 34 34 +35 35 35 35 35 +36 36 36 36 36 +37 37 37 37 37 +38 38 38 38 38 +39 39 39 39 39 +3A 3A 3A 3A 3A +3B 3B 3B 3B 3B +3C 3C 3C 3C 3C +3D 3D 3D 3D 3D +3E 3E 3E 3E 3E +3F 3F 3F 3F 3F +40 40 40 40 40 +41 61 61 41 41 +42 62 62 42 42 +43 63 63 43 43 +44 64 64 44 44 +45 65 65 45 45 +46 66 66 46 46 +47 67 67 47 47 +48 68 68 48 48 +49 69 69 49 49 +4A 6A 6A 4A 4A +4B 6B 6B 4B 4B +4C 6C 6C 4C 4C +4D 6D 6D 4D 4D +4E 6E 6E 4E 4E +4F 6F 6F 4F 4F +50 70 70 50 50 +51 71 71 51 51 +52 72 72 52 52 +53 73 73 53 53 +54 74 74 54 54 +55 75 75 55 55 +56 76 76 56 56 +57 77 77 57 57 +58 78 78 58 58 +59 79 79 59 59 +5A 7A 7A 5A 5A +5B 5B 5B 5B 5B +5C 5C 5C 5C 5C +5D 5D 5D 5D 5D +5E 5E 5E 5E 5E +5F 5F 5F 5F 5F +60 60 60 60 60 +61 61 61 61 61 +62 62 62 62 62 +63 63 63 63 63 +64 64 64 64 64 +65 65 65 65 65 +66 66 66 66 66 +67 67 67 67 67 +68 68 68 68 68 +69 69 69 69 69 +6A 6A 6A 6A 6A +6B 6B 6B 6B 6B +6C 6C 6C 6C 6C +6D 6D 6D 6D 6D +6E 6E 6E 6E 6E +6F 6F 6F 6F 6F +70 70 70 70 70 +71 71 71 71 71 +72 72 72 72 72 +73 73 73 73 73 +74 74 74 74 74 +75 75 75 75 75 +76 76 76 76 76 +77 77 77 77 77 +78 78 78 78 78 +79 79 79 79 79 +7A 7A 7A 7A 7A +7B 7B 7B 7B 7B +7C 7C 7C 7C 7C +7D 7D 7D 7D 7D +7E 7E 7E 7E 7E +7F 7F 7F 7F 7F +80 90 90 D082 80 +81 83 83 D083 81 +82 82 82 E2809A 82 +83 83 83 D193 83 +84 84 84 E2809E 84 +85 85 85 E280A6 85 +86 86 86 E280A0 86 +87 87 87 E280A1 87 +88 88 88 E282AC 88 +89 89 89 E280B0 89 +8A 9A 9A D089 8A +8B 8B 8B E280B9 8B +8C 9C 9C D08A 8C +8D 9D 9D D08C 8D +8E 9E 9E D08B 8E +8F 9F 9F D08F 8F +90 90 90 D192 90 +91 91 91 E28098 91 +92 92 92 E28099 92 +93 93 93 E2809C 93 +94 94 94 E2809D 94 +95 95 95 E280A2 95 +96 96 96 E28093 96 +97 97 97 E28094 97 +98 98 98 3F 3F Round trip unsafe +99 99 99 E284A2 99 +9A 9A 9A D199 9A +9B 9B 9B E280BA 9B +9C 9C 9C D19A 9C +9D 9D 9D D19C 9D +9E 9E 9E D19B 9E +9F 9F 9F D19F 9F +A0 A0 A0 C2A0 A0 +A1 A2 A2 D08E A1 +A2 A2 A2 D19E A2 +A3 BC BC D088 A3 +A4 A4 A4 C2A4 A4 +A5 B4 B4 D290 A5 +A6 A6 A6 C2A6 A6 +A7 A7 A7 C2A7 A7 +A8 B8 B8 D081 A8 +A9 A9 A9 C2A9 A9 +AA BA BA D084 AA +AB AB AB C2AB AB +AC AC AC C2AC AC +AD AD AD C2AD AD +AE AE AE C2AE AE +AF BF BF D087 AF +B0 B0 B0 C2B0 B0 +B1 B1 B1 C2B1 B1 +B2 B3 B3 D086 B2 +B3 B3 B3 D196 B3 +B4 B4 B4 D291 B4 +B5 B5 B5 C2B5 B5 +B6 B6 B6 C2B6 B6 +B7 B7 B7 C2B7 B7 +B8 B8 B8 D191 B8 +B9 B9 B9 E28496 B9 +BA BA BA D194 BA +BB BB BB C2BB BB +BC BC BC D198 BC +BD BE BE D085 BD +BE BE BE D195 BE +BF BF BF D197 BF +C0 E0 E0 D090 C0 +C1 E1 E1 D091 C1 +C2 E2 E2 D092 C2 +C3 E3 E3 D093 C3 +C4 E4 E4 D094 C4 +C5 E5 E5 D095 C5 +C6 E6 E6 D096 C6 +C7 E7 E7 D097 C7 +C8 E8 E8 D098 C8 +C9 E9 E9 D099 C9 +CA EA EA D09A CA +CB EB EB D09B CB +CC EC EC D09C CC +CD ED ED D09D CD +CE EE EE D09E CE +CF EF EF D09F CF +D0 F0 F0 D0A0 D0 +D1 F1 F1 D0A1 D1 +D2 F2 F2 D0A2 D2 +D3 F3 F3 D0A3 D3 +D4 F4 F4 D0A4 D4 +D5 F5 F5 D0A5 D5 +D6 F6 F6 D0A6 D6 +D7 F7 F7 D0A7 D7 +D8 F8 F8 D0A8 D8 +D9 F9 F9 D0A9 D9 +DA FA FA D0AA DA +DB FB FB D0AB DB +DC FC FC D0AC DC +DD FD FD D0AD DD +DE FE FE D0AE DE +DF FF FF D0AF DF +E0 E0 E0 D0B0 E0 +E1 E1 E1 D0B1 E1 +E2 E2 E2 D0B2 E2 +E3 E3 E3 D0B3 E3 +E4 E4 E4 D0B4 E4 +E5 E5 E5 D0B5 E5 +E6 E6 E6 D0B6 E6 +E7 E7 E7 D0B7 E7 +E8 E8 E8 D0B8 E8 +E9 E9 E9 D0B9 E9 +EA EA EA D0BA EA +EB EB EB D0BB EB +EC EC EC D0BC EC +ED ED ED D0BD ED +EE EE EE D0BE EE +EF EF EF D0BF EF +F0 F0 F0 D180 F0 +F1 F1 F1 D181 F1 +F2 F2 F2 D182 F2 +F3 F3 F3 D183 F3 +F4 F4 F4 D184 F4 +F5 F5 F5 D185 F5 +F6 F6 F6 D186 F6 +F7 F7 F7 D187 F7 +F8 F8 F8 D188 F8 +F9 F9 F9 D189 F9 +FA FA FA D18A FA +FB FB FB D18B FB +FC FC FC D18C FC +FD FD FD D18D FD +FE FE FE D18E FE +FF FF FF D18F FF +DROP TABLE t1; +# +# End of 5.1 tests +# diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 80f04ffd455..61f1db9989f 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -400,4 +400,15 @@ SELECT 0 FROM (SELECT 0) t61; 0 0 +# +# A nested materialized derived table is used before being populated. +# (addon for bug#19077) +# +CREATE TABLE t1 (i INT, j BIGINT); +INSERT INTO t1 VALUES (1, 2), (2, 2), (3, 2); +SELECT * FROM (SELECT MIN(i) FROM t1 +WHERE j = SUBSTRING('12', (SELECT * FROM (SELECT MIN(j) FROM t1) t2))) t3; +MIN(i) +1 +DROP TABLE t1; # End of 5.0 tests diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index de592ece285..4a79a15a2b6 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -1037,4 +1037,16 @@ INSERT INTO t1 values (0),(0); SELECT POLYGON((SELECT 1 FROM (SELECT 1 IN (GROUP_CONCAT(t1.f1)) FROM t1, t1 t GROUP BY t.f1 ) d)); ERROR 22007: Illegal non geometric '(select 1 from (select (1 = group_concat(`test`.`t1`.`f1` separator ',')) AS `1 IN (GROUP_CONCAT(t1.f1))` from `test`.`t1` join `test`.`t1` `t` group by `t`.`f1`) `d`)' value found during parsing DROP TABLE t1; +# +# Bug#58396 group_concat and explain extended are still crashy +# +CREATE TABLE t1(a INT); +EXPLAIN EXTENDED SELECT UPDATEXML('1', a, '1') +FROM t1 ORDER BY (SELECT GROUP_CONCAT(1) FROM t1); +ERROR HY000: Only constant XPATH queries are supported +SHOW WARNINGS; +Level Code Message +Error 1105 Only constant XPATH queries are supported +Note 1003 select updatexml('1',`test`.`t1`.`a`,'1') AS `UPDATEXML('1', a, '1')` from `test`.`t1` order by (select group_concat(1 separator ',') from `test`.`t1`) +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 4268268fabb..0321b2d85ad 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -2600,4 +2600,16 @@ ORDER BY QUOTE(t1.a); 1 1 DROP TABLE t1; +# +# Bug#57913 large negative number to string conversion functions crash +# Bug#57810 case/when/then : Assertion failed: length || !scale +# +SELECT '1' IN ('1', SUBSTRING(-9223372036854775809, 1)); +'1' IN ('1', SUBSTRING(-9223372036854775809, 1)) +1 +SELECT CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3)); +CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3)) +1 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '' End of 5.1 tests diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index 08d8059f61b..f80fea0fc76 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -334,8 +334,7 @@ test.t1 check status OK DROP TABLE t1,t2; set global key_cache_block_size= @my_key_cache_block_size; set @@global.key_buffer_size=0; -Warnings: -Warning 1438 Cannot drop default keycache +ERROR HY000: Cannot drop default keycache select @@global.key_buffer_size; @@global.key_buffer_size 2097152 diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 1fb074d38bf..3af152672ab 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -2024,6 +2024,8 @@ SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='tm1'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT NULL test tm1 BASE TABLE NULL NULL NULL # # # # # # # # # # NULL # # Unable to open underlying table which is differently defined or of non-MyISAM ty +Warnings: +Warning 1168 Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist DROP TABLE tm1; CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM; CREATE TABLE t2(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM; diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index d77ad1d2953..df3d7be6714 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -659,4 +659,15 @@ Error 1242 Subquery returns more than 1 row Error 1242 Subquery returns more than 1 row DROP TABLE t1, t2, t3; SET SESSION sql_safe_updates = DEFAULT; +# +# Bug#52157 various crashes and assertions with multi-table update, stored function +# +CREATE FUNCTION f1 () RETURNS BLOB RETURN 1; +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 datetime value: '1' +DROP FUNCTION f1; +DROP TABLE t1; end of tests diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index 68f30ed80f8..f4298cc7a4c 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -235,4 +235,73 @@ Bug #47147: mysql client option --skip-column-names does not apply to vertical o *************************** 1. row *************************** 1 +# +# Bug #54899: --one-database option cannot handle DROP/CREATE DATABASE +# commands. +# +CREATE DATABASE connected_db; +USE connected_db; +SHOW TABLES; +Tables_in_connected_db +table_in_connected_db +DROP DATABASE connected_db; + +# +# Testing --one-database option +# +CREATE DATABASE connected_db; +SHOW TABLES IN connected_db; +Tables_in_connected_db +t1 +SHOW TABLES IN test; +Tables_in_test +t1 +USE test; +DROP TABLE t1; +DROP DATABASE connected_db; + +SHOW TABLES IN test; +Tables_in_test +SHOW TABLES IN test1; +Tables_in_test1 +DROP DATABASE test1; + +# +# Checking --one-database option followed by the execution of +# connect command. +# +CREATE DATABASE connected_db; +SHOW TABLES IN connected_db; +Tables_in_connected_db +t1 +t2 +SHOW TABLES IN test; +Tables_in_test +t1 +t2 +DROP TABLE test.t1; +DROP TABLE test.t2; +DROP DATABASE connected_db; + +# +# Checking --one-database option with no database specified +# at command-line. +# +SHOW TABLES IN test; +Tables_in_test + +# +# Checking --one-database option with non_existent_db +# specified with USE command +# +CREATE DATABASE connected_db; +SHOW TABLES IN connected_db; +Tables_in_connected_db +table_in_connected_db + +SHOW TABLES IN connected_db; +Tables_in_connected_db +table_in_connected_db +DROP DATABASE connected_db; + End of tests diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index fe81ef1aaaf..15730fff72c 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -591,7 +591,7 @@ if things work as expected Some data for cat_file command of mysqltest -mysqltest: At line 1: command "cat_file" failed with error 1 +mysqltest: At line 1: command "cat_file" failed with error 1. (my_errno) mysqltest: At line 1: Missing required argument 'filename' to command 'file_exists' mysqltest: At line 1: Missing required argument 'from_file' to command 'copy_file' mysqltest: At line 1: Missing required argument 'to_file' to command 'copy_file' diff --git a/mysql-test/r/plugin_not_embedded.result b/mysql-test/r/plugin_not_embedded.result index 82cfe7b23b8..27553366660 100644 --- a/mysql-test/r/plugin_not_embedded.result +++ b/mysql-test/r/plugin_not_embedded.result @@ -8,3 +8,5 @@ ERROR 42000: DELETE command denied to user 'bug51770'@'localhost' for table 'plu GRANT DELETE ON mysql.plugin TO bug51770@localhost; UNINSTALL PLUGIN example; DROP USER bug51770@localhost; +INSTALL PLUGIN example SONAME '../ha_example.so'; +ERROR HY000: No paths allowed for shared library diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 08b9211bd31..1aa3d62fc70 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -660,6 +660,8 @@ flush tables; SHOW TABLE STATUS like 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm' +Warnings: +Warning 1033 Incorrect information in file: './test/t1.frm' show create table t1; ERROR HY000: Incorrect information in file: './test/t1.frm' drop table if exists t1; diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index a297dbfa502..20f41c4a83c 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1511,4 +1511,37 @@ SELECT @@skip_name_resolve; SHOW VARIABLES LIKE 'skip_name_resolve'; Variable_name Value skip_name_resolve OFF +# +# Bug #43233 : Some server variables are clipped during "update," +# not "check" stage +# +SET @kbs=@@global.key_buffer_size; +SET @kcbs=@@global.key_cache_block_size; +throw errors in STRICT mode +SET SQL_MODE=STRICT_ALL_TABLES; +SET @@global.max_binlog_cache_size=-1; +ERROR 42000: Variable 'max_binlog_cache_size' can't be set to the value of '-1' +SET @@global.max_join_size=0; +ERROR 42000: Variable 'max_join_size' can't be set to the value of '0' +SET @@global.key_buffer_size=0; +ERROR HY000: Cannot drop default keycache +SET @@global.key_cache_block_size=0; +ERROR 42000: Variable 'key_cache_block_size' can't be set to the value of '0' +throw warnings in default mode +SET SQL_MODE=DEFAULT; +SET @@global.max_binlog_cache_size=-1; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '-1' +SET @@global.max_join_size=0; +Warnings: +Warning 1292 Truncated incorrect max_join_size value: '0' +SET @@global.key_buffer_size=0; +ERROR HY000: Cannot drop default keycache +SET @@global.key_cache_block_size=0; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '0' +SET @@global.max_binlog_cache_size=DEFAULT; +SET @@global.max_join_size=DEFAULT; +SET @@global.key_buffer_size=@kbs; +SET @@global.key_cache_block_size=@kcbs; End of 5.1 tests diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 0aec44b70f1..6b0a2103afa 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -840,6 +840,8 @@ show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL View 'test.v1' references invalid table(s) or column(s) or function(s) or define +Warnings: +Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them drop view v1; drop table t1; create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1; @@ -3882,6 +3884,19 @@ CREATE VIEW v1 AS SELECT 1 from t1 WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1')); DROP VIEW v1; DROP TABLE t1; +# +# Bug#57703 create view cause Assertion failed: 0, file .\item_subselect.cc, line 846 +# +CREATE TABLE t1(a int); +CREATE VIEW v1 AS SELECT 1 FROM t1 GROUP BY +SUBSTRING(1 FROM (SELECT 3 FROM t1 WHERE a >= ANY(SELECT 1))); +DROP VIEW v1; +DROP TABLE t1; +# +# Bug#57352 valgrind warnings when creating view +# +CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f; +DROP VIEW v1; # ----------------------------------------------------------------- # -- End of 5.1 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/suite/binlog/r/binlog_index.result b/mysql-test/suite/binlog/r/binlog_index.result index 52d698e9f96..11cf43b8a5e 100644 --- a/mysql-test/suite/binlog/r/binlog_index.result +++ b/mysql-test/suite/binlog/r/binlog_index.result @@ -2,7 +2,9 @@ call mtr.add_suppression('Attempting backtrace'); call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.'); call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file'); call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.'); +call mtr.add_suppression('Could not open .*'); call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to clean registers before purging logs.'); +RESET MASTER; flush logs; flush logs; flush logs; @@ -116,11 +118,31 @@ master-bin.000011 # This should put the server in unsafe state and stop # accepting any command. If we inject a fault at this # point and continue the execution the server crashes. -# Besides the flush command does not report an error. # +SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index'); +SELECT @index; +@index +master-bin.000006 +master-bin.000007 +master-bin.000008 +master-bin.000009 +master-bin.000010 +master-bin.000011 + # fault_injection_registering_index SET SESSION debug="+d,fault_injection_registering_index"; flush logs; +ERROR HY000: Can't open file: 'master-bin.000012' (errno: 1) +SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index'); +SELECT @index; +@index +master-bin.000006 +master-bin.000007 +master-bin.000008 +master-bin.000009 +master-bin.000010 +master-bin.000011 + SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index'); SELECT @index; @index @@ -135,6 +157,18 @@ master-bin.000012 # fault_injection_updating_index SET SESSION debug="+d,fault_injection_updating_index"; flush logs; +ERROR HY000: Can't open file: 'master-bin.000013' (errno: 1) +SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index'); +SELECT @index; +@index +master-bin.000006 +master-bin.000007 +master-bin.000008 +master-bin.000009 +master-bin.000010 +master-bin.000011 +master-bin.000012 + SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index'); SELECT @index; @index diff --git a/mysql-test/suite/binlog/r/binlog_mixed_failure_mixing_engines.result b/mysql-test/suite/binlog/r/binlog_mixed_failure_mixing_engines.result index dfc08d76a6a..4078103b1f7 100644 --- a/mysql-test/suite/binlog/r/binlog_mixed_failure_mixing_engines.result +++ b/mysql-test/suite/binlog/r/binlog_mixed_failure_mixing_engines.result @@ -1,3 +1,4 @@ +RESET MASTER; ################################################################################### # CONFIGURATION ################################################################################### diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index d612e7adde1..1678f8add58 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -1330,3 +1330,62 @@ Log_name Pos Event_type Server_id End_log_pos Info # # Write_rows 1 # table_id: # flags: STMT_END_F # # Query 1 # COMMIT DROP TABLE t1; + +# BUG#54903 BINLOG statement toggles session variables +# ---------------------------------------------------------------------- +# This test verify that BINLOG statement doesn't change current session's +# variables foreign_key_checks and unique_checks. + +CREATE TABLE t1 (c1 INT KEY); +SET @@SESSION.foreign_key_checks= ON; +SET @@SESSION.unique_checks= ON; +# INSERT INTO t1 VALUES (1) +# foreign_key_checks=0 and unique_checks=0 +BINLOG ' +dfLtTBMBAAAAKQAAANcAAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA== +'; +SELECT * FROM t1; +c1 +1 +# Their values should be ON +SHOW SESSION VARIABLES LIKE "%_checks"; +Variable_name Value +foreign_key_checks ON +unique_checks ON + +SET @@SESSION.foreign_key_checks= OFF; +SET @@SESSION.unique_checks= OFF; +# INSERT INTO t1 VALUES(2) +# foreign_key_checks=1 and unique_checks=1 +BINLOG ' +dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== +'; +SELECT * FROM t1; +c1 +1 +2 +# Their values should be OFF +SHOW SESSION VARIABLES LIKE "%_checks"; +Variable_name Value +foreign_key_checks OFF +unique_checks OFF +# INSERT INTO t1 VALUES(2) +# foreign_key_checks=1 and unique_checks=1 +# It should not change current session's variables, even error happens +BINLOG ' +dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== +'; +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +SELECT * FROM t1; +c1 +1 +2 +# Their values should be OFF +SHOW SESSION VARIABLES LIKE "%_checks"; +Variable_name Value +foreign_key_checks OFF +unique_checks OFF +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/r/binlog_row_failure_mixing_engines.result b/mysql-test/suite/binlog/r/binlog_row_failure_mixing_engines.result index 45c8640d3e3..2d493397ffd 100644 --- a/mysql-test/suite/binlog/r/binlog_row_failure_mixing_engines.result +++ b/mysql-test/suite/binlog/r/binlog_row_failure_mixing_engines.result @@ -1,3 +1,4 @@ +RESET MASTER; ################################################################################### # CONFIGURATION ################################################################################### diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index f5ba4524c61..872a93bef43 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -801,3 +801,62 @@ Log_name Pos Event_type Server_id End_log_pos Info # # Write_rows 1 # table_id: # flags: STMT_END_F # # Query 1 # COMMIT DROP TABLE t1; + +# BUG#54903 BINLOG statement toggles session variables +# ---------------------------------------------------------------------- +# This test verify that BINLOG statement doesn't change current session's +# variables foreign_key_checks and unique_checks. + +CREATE TABLE t1 (c1 INT KEY); +SET @@SESSION.foreign_key_checks= ON; +SET @@SESSION.unique_checks= ON; +# INSERT INTO t1 VALUES (1) +# foreign_key_checks=0 and unique_checks=0 +BINLOG ' +dfLtTBMBAAAAKQAAANcAAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA== +'; +SELECT * FROM t1; +c1 +1 +# Their values should be ON +SHOW SESSION VARIABLES LIKE "%_checks"; +Variable_name Value +foreign_key_checks ON +unique_checks ON + +SET @@SESSION.foreign_key_checks= OFF; +SET @@SESSION.unique_checks= OFF; +# INSERT INTO t1 VALUES(2) +# foreign_key_checks=1 and unique_checks=1 +BINLOG ' +dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== +'; +SELECT * FROM t1; +c1 +1 +2 +# Their values should be OFF +SHOW SESSION VARIABLES LIKE "%_checks"; +Variable_name Value +foreign_key_checks OFF +unique_checks OFF +# INSERT INTO t1 VALUES(2) +# foreign_key_checks=1 and unique_checks=1 +# It should not change current session's variables, even error happens +BINLOG ' +dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== +'; +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +SELECT * FROM t1; +c1 +1 +2 +# Their values should be OFF +SHOW SESSION VARIABLES LIKE "%_checks"; +Variable_name Value +foreign_key_checks OFF +unique_checks OFF +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result index 6b2a83c9483..b851e472689 100644 --- a/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -28,6 +28,7 @@ Warnings: Note 1592 Statement may not be safe to log in statement format. INSERT INTO t2 VALUES (@@hostname); Warnings: +Warning 1265 Data truncated for column 'a' at row 1 Note 1592 Statement may not be safe to log in statement format. ---- Insert from stored procedure ---- CREATE PROCEDURE proc() @@ -48,6 +49,7 @@ Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format. +Warning 1265 Data truncated for column 'a' at row 6 Note 1592 Statement may not be safe to log in statement format. ---- Insert from stored function ---- CREATE FUNCTION func() @@ -72,6 +74,7 @@ Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format. +Warning 1265 Data truncated for column 'a' at row 6 Note 1592 Statement may not be safe to log in statement format. ---- Insert from trigger ---- CREATE TRIGGER trig @@ -94,6 +97,7 @@ Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format. +Warning 1265 Data truncated for column 'a' at row 6 Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format. ---- Insert from prepared statement ---- @@ -124,6 +128,7 @@ Warnings: Note 1592 Statement may not be safe to log in statement format. EXECUTE p7; Warnings: +Warning 1265 Data truncated for column 'a' at row 1 Note 1592 Statement may not be safe to log in statement format. ---- Insert from nested call of triggers / functions / procedures ---- CREATE PROCEDURE proc1() @@ -160,6 +165,7 @@ Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format. +Warning 1265 Data truncated for column 'a' at row 6 Note 1592 Statement may not be safe to log in statement format. ==== Variables that should *not* be unsafe ==== INSERT INTO t1 VALUES (@@session.pseudo_thread_id); @@ -303,6 +309,8 @@ INSERT INTO t2 VALUES (@@global.init_slave); INSERT INTO t2 VALUES (@@hostname); END| INSERT INTO trigger_table VALUES ('bye.'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 6 DROP FUNCTION fun_check_log_bin; DROP FUNCTION func6; DROP FUNCTION func7; diff --git a/mysql-test/suite/binlog/t/binlog_index.test b/mysql-test/suite/binlog/t/binlog_index.test index 9d4a49602a6..b735574fdb9 100644 --- a/mysql-test/suite/binlog/t/binlog_index.test +++ b/mysql-test/suite/binlog/t/binlog_index.test @@ -10,9 +10,12 @@ call mtr.add_suppression('Attempting backtrace'); call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.'); call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file'); call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.'); +call mtr.add_suppression('Could not open .*'); call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to clean registers before purging logs.'); let $old=`select @@debug`; +RESET MASTER; + let $MYSQLD_DATADIR= `select @@datadir`; let $INDEX=$MYSQLD_DATADIR/master-bin.index; @@ -205,12 +208,26 @@ SELECT @index; --echo # This should put the server in unsafe state and stop --echo # accepting any command. If we inject a fault at this --echo # point and continue the execution the server crashes. ---echo # Besides the flush command does not report an error. --echo # +--chmod 0644 $INDEX +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval SET @index=LOAD_FILE('$index') +-- replace_regex /\.[\\\/]master/master/ +SELECT @index; + --echo # fault_injection_registering_index SET SESSION debug="+d,fault_injection_registering_index"; +-- replace_regex /\.[\\\/]master/master/ +-- error ER_CANT_OPEN_FILE flush logs; + +--chmod 0644 $INDEX +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval SET @index=LOAD_FILE('$index') +-- replace_regex /\.[\\\/]master/master/ +SELECT @index; + --source include/restart_mysqld.inc --chmod 0644 $INDEX @@ -221,7 +238,16 @@ SELECT @index; --echo # fault_injection_updating_index SET SESSION debug="+d,fault_injection_updating_index"; +-- replace_regex /\.[\\\/]master/master/ +-- error ER_CANT_OPEN_FILE flush logs; + +--chmod 0644 $INDEX +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval SET @index=LOAD_FILE('$index') +-- replace_regex /\.[\\\/]master/master/ +SELECT @index; + --source include/restart_mysqld.inc --chmod 0644 $INDEX diff --git a/mysql-test/suite/federated/federated_bug_35333.result b/mysql-test/suite/federated/federated_bug_35333.result new file mode 100644 index 00000000000..7ea1b374712 --- /dev/null +++ b/mysql-test/suite/federated/federated_bug_35333.result @@ -0,0 +1,67 @@ +# +# Bug 35333 "If a Federated table can't connect to the remote hose, can't retrieve metadata" +# +# Queries such as SHOW TABLE STATUS and SELECT * FROM INFORMATION_SCHEMA.TABLES fail +# when encountering a federated table that cannot connect to its remote table. +# +# The fix is to store the error text in the TABLE COMMENTS column of I_S.TABLES, clear +# the remote connection error and push a warning instead. This allows the SELECT operation +# to complete while still indicating a problem. This fix applies to any non-fatal system +# error that occurs during a query against I_S.TABLES.de +CREATE DATABASE federated; +CREATE DATABASE federated; +CREATE DATABASE IF NOT EXISTS realdb; +DROP TABLE IF EXISTS realdb.t0; +DROP TABLE IF EXISTS federated.t0; +# +# Create the base table to be referenced +# +CREATE TABLE realdb.t0 (a text, b text) ENGINE=MYISAM; +# +# Create a federated table with a bogus port number +# +CREATE TABLE federated.t0 (a text, b text) ENGINE=FEDERATED +CONNECTION='mysql://root@127.0.0.1:63333/realdb/t0'; +# +# Trigger a federated system error during a INFORMATION_SCHEMA.TABLES query +# +SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT +FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'realdb' or TABLE_SCHEMA = 'federated'; +TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_ROWS DATA_LENGTH TABLE_COMMENT +federated t0 BASE TABLE FEDERATED NULL 0 Unable to connect to foreign data source: Can't connect to MySQL server on '127. +realdb t0 BASE TABLE MyISAM Dynamic 0 0 +Warnings: +Warning 1429 Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno) +SHOW WARNINGS; +Level Code Message +Warning 1429 Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno) +# +# Create a MyISAM table then corrupt the file +# +USE realdb; +CREATE TABLE t1 (c1 int) ENGINE=MYISAM; +# +# Corrupt the MyISAM table by deleting the base file +# +# +# Trigger a MyISAM system error during an INFORMATION_SCHEMA.TABLES query +# +SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT +FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; +TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_ROWS DATA_LENGTH TABLE_COMMENT +realdb t1 BASE TABLE NULL NULL NULL NULL Can't find file: 't1' (errno: 2) +Warnings: +Warning 1017 Can't find file: 't1' (errno: 2) +SHOW WARNINGS; +Level Code Message +Warning 1017 Can't find file: 't1' (errno: 2) +# +# Cleanup +# +DROP TABLE IF EXISTS realdb.t0; +DROP TABLE IF EXISTS federated.t0; +DROP DATABASE realdb; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE federated; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE federated; diff --git a/mysql-test/suite/federated/federated_bug_35333.test b/mysql-test/suite/federated/federated_bug_35333.test new file mode 100644 index 00000000000..58c217d24f2 --- /dev/null +++ b/mysql-test/suite/federated/federated_bug_35333.test @@ -0,0 +1,74 @@ +--echo # +--echo # Bug 35333 "If a Federated table can't connect to the remote hose, can't retrieve metadata" +--echo # +--echo # Queries such as SHOW TABLE STATUS and SELECT * FROM INFORMATION_SCHEMA.TABLES fail +--echo # when encountering a federated table that cannot connect to its remote table. +--echo # +--echo # The fix is to store the error text in the TABLE COMMENTS column of I_S.TABLES, clear +--echo # the remote connection error and push a warning instead. This allows the SELECT operation +--echo # to complete while still indicating a problem. This fix applies to any non-fatal system +--echo # error that occurs during a query against I_S.TABLES.de + +--source federated.inc + +--disable_warnings +CREATE DATABASE IF NOT EXISTS realdb; +# Federated database exists +DROP TABLE IF EXISTS realdb.t0; +DROP TABLE IF EXISTS federated.t0; +--enable_warnings + +--echo # +--echo # Create the base table to be referenced +--echo # +CREATE TABLE realdb.t0 (a text, b text) ENGINE=MYISAM; + +--echo # +--echo # Create a federated table with a bogus port number +--echo # +CREATE TABLE federated.t0 (a text, b text) ENGINE=FEDERATED + CONNECTION='mysql://root@127.0.0.1:63333/realdb/t0'; + +#--warning ER_CONNECT_TO_FOREIGN_DATA_SOURCE + +--echo # +--echo # Trigger a federated system error during a INFORMATION_SCHEMA.TABLES query +--echo # +# Remove O/S-specific socket error +--replace_regex /\(.*\)/(socket errno)/ +SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT + FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'realdb' or TABLE_SCHEMA = 'federated'; + +# Remove O/S-specific socket error +--replace_regex /\(.*\)/(socket errno)/ +SHOW WARNINGS; + +--echo # +--echo # Create a MyISAM table then corrupt the file +--echo # +USE realdb; +CREATE TABLE t1 (c1 int) ENGINE=MYISAM; +--echo # +--echo # Corrupt the MyISAM table by deleting the base file +--echo # +let $MYSQLD_DATADIR= `SELECT @@datadir`; +--remove_file $MYSQLD_DATADIR/realdb/t1.MYD +--remove_file $MYSQLD_DATADIR/realdb/t1.MYI + +--echo # +--echo # Trigger a MyISAM system error during an INFORMATION_SCHEMA.TABLES query +--echo # +SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT + FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; + +SHOW WARNINGS; +--echo # +--echo # Cleanup +--echo # +--disable_warnings +DROP TABLE IF EXISTS realdb.t0; +DROP TABLE IF EXISTS federated.t0; +DROP DATABASE realdb; +--enable_warnings + +--source federated_cleanup.inc diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result index 350c7ebd541..0c8d16f27fb 100644 --- a/mysql-test/suite/innodb/r/innodb-autoinc.result +++ b/mysql-test/suite/innodb/r/innodb-autoinc.result @@ -471,17 +471,12 @@ SHOW VARIABLES LIKE "%auto_inc%"; Variable_name Value auto_increment_increment 2 auto_increment_offset 10 -INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine SELECT * FROM t1; c1 1 18446744073709551603 -18446744073709551604 -18446744073709551606 -18446744073709551608 -18446744073709551610 -18446744073709551612 -18446744073709551614 DROP TABLE t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; SET @@INSERT_ID=1; @@ -504,13 +499,12 @@ SHOW VARIABLES LIKE "%auto_inc%"; Variable_name Value auto_increment_increment 5 auto_increment_offset 7 -INSERT INTO t1 VALUES (NULL),(NULL); +INSERT INTO t1 VALUES (NULL),(NULL), (NULL); +ERROR HY000: Failed to read auto-increment value from storage engine SELECT * FROM t1; c1 1 18446744073709551603 -18446744073709551607 -18446744073709551612 DROP TABLE t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; SET @@INSERT_ID=1; @@ -572,12 +566,12 @@ SHOW VARIABLES LIKE "%auto_inc%"; Variable_name Value auto_increment_increment 65535 auto_increment_offset 65535 -INSERT INTO t1 VALUES (NULL); +INSERT INTO t1 VALUES (NULL),(NULL); +ERROR 22003: Out of range value for column 't1' at row 167 SELECT * FROM t1; c1 1 18446744073709551610 -18446744073709551615 DROP TABLE t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; SET @@INSERT_ID=1; diff --git a/mysql-test/suite/innodb/r/innodb_multi_update.result b/mysql-test/suite/innodb/r/innodb_multi_update.result index 7af9b030d1f..558fc3938a8 100644 --- a/mysql-test/suite/innodb/r/innodb_multi_update.result +++ b/mysql-test/suite/innodb/r/innodb_multi_update.result @@ -74,3 +74,11 @@ a b 4 14 5 15 drop table bug38999_1,bug38999_2; +# +# Bug#54475 improper error handling causes cascading crashing failures in innodb/ndb +# +CREATE TABLE t1(f1 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +UPDATE (SELECT ((SELECT 1 FROM t1), 1) FROM t1 WHERE (SELECT 1 FROM t1)) x, (SELECT 1) AS d SET d.f1 = 1; +ERROR 21000: Operand should contain 1 column(s) +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test index 10602499222..c3b64c7c963 100644 --- a/mysql-test/suite/innodb/t/innodb-autoinc.test +++ b/mysql-test/suite/innodb/t/innodb-autoinc.test @@ -291,21 +291,8 @@ INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13 SELECT * FROM t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10; SHOW VARIABLES LIKE "%auto_inc%"; -# This should fail because of overflow but it doesn't, it seems to be -# a MySQL server bug. It wraps around to 0 for the last value. -# See MySQL Bug# 39828 -# -# Instead of wrapping around, it asserts when MySQL is compiled --with-debug -# (see sql/handler.cc:handler::update_auto_increment()). Don't test for -# overflow until Bug #39828 is fixed. -# -# Since this asserts when compiled --with-debug, we can't properly test this -# until Bug #39828 is fixed. For now, this test is meaningless. -#if Bug #39828 is fixed -#INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); -#else -INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); -#endif +--error ER_AUTOINC_READ_FAILED +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); SELECT * FROM t1; DROP TABLE t1; @@ -323,20 +310,8 @@ INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13 SELECT * FROM t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7; SHOW VARIABLES LIKE "%auto_inc%"; -# This should fail because of overflow but it doesn't. It fails with -# a duplicate entry message because of a MySQL server bug, it wraps -# around. See MySQL Bug# 39828, once MySQL fix the bug we can replace -# the ER_DUP_ENTRY, 1062 below with the appropriate error message -# -# Since this asserts when compiled --with-debug, we can't properly test this -# until Bug #39828 is fixed. For now, this test is meaningless. -#if Bug #39828 is fixed -# Still need to fix this error code, error should mention overflow -#-- error ER_DUP_ENTRY,1062 -#INSERT INTO t1 VALUES (NULL),(NULL), (NULL); -#else -INSERT INTO t1 VALUES (NULL),(NULL); -#endif +--error ER_AUTOINC_READ_FAILED +INSERT INTO t1 VALUES (NULL),(NULL), (NULL); SELECT * FROM t1; DROP TABLE t1; @@ -374,20 +349,8 @@ INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2 SELECT * FROM t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976; SHOW VARIABLES LIKE "%auto_inc%"; -# This should fail because of overflow but it doesn't. It wraps around -# and the autoinc values look bogus too. -# See MySQL Bug# 39828, once MySQL fix the bug we can enable the error -# code expected test. -# -- error ER_AUTOINC_READ_FAILED,1467 -# -# Since this asserts when compiled --with-debug, we can't properly test this -# until Bug #39828 is fixed. For now, this test is meaningless. -#if Bug #39828 is fixed -#-- error ER_AUTOINC_READ_FAILED,1467 -#INSERT INTO t1 VALUES (NULL),(NULL); -#else -INSERT INTO t1 VALUES (NULL); -#endif +--error ER_WARN_DATA_OUT_OF_RANGE +INSERT INTO t1 VALUES (NULL),(NULL); SELECT * FROM t1; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_multi_update.test b/mysql-test/suite/innodb/t/innodb_multi_update.test index 7ab17ccf70a..8356c20c88f 100644 --- a/mysql-test/suite/innodb/t/innodb_multi_update.test +++ b/mysql-test/suite/innodb/t/innodb_multi_update.test @@ -27,3 +27,14 @@ select * from bug38999_1; select * from bug38999_2; drop table bug38999_1,bug38999_2; + + +--echo # +--echo # Bug#54475 improper error handling causes cascading crashing failures in innodb/ndb +--echo # +CREATE TABLE t1(f1 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +--error ER_OPERAND_COLUMNS +UPDATE (SELECT ((SELECT 1 FROM t1), 1) FROM t1 WHERE (SELECT 1 FROM t1)) x, (SELECT 1) AS d SET d.f1 = 1; +DROP TABLE t1; + diff --git a/mysql-test/suite/innodb_plugin/r/innodb-autoinc.result b/mysql-test/suite/innodb_plugin/r/innodb-autoinc.result index 350c7ebd541..0c8d16f27fb 100644 --- a/mysql-test/suite/innodb_plugin/r/innodb-autoinc.result +++ b/mysql-test/suite/innodb_plugin/r/innodb-autoinc.result @@ -471,17 +471,12 @@ SHOW VARIABLES LIKE "%auto_inc%"; Variable_name Value auto_increment_increment 2 auto_increment_offset 10 -INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine SELECT * FROM t1; c1 1 18446744073709551603 -18446744073709551604 -18446744073709551606 -18446744073709551608 -18446744073709551610 -18446744073709551612 -18446744073709551614 DROP TABLE t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; SET @@INSERT_ID=1; @@ -504,13 +499,12 @@ SHOW VARIABLES LIKE "%auto_inc%"; Variable_name Value auto_increment_increment 5 auto_increment_offset 7 -INSERT INTO t1 VALUES (NULL),(NULL); +INSERT INTO t1 VALUES (NULL),(NULL), (NULL); +ERROR HY000: Failed to read auto-increment value from storage engine SELECT * FROM t1; c1 1 18446744073709551603 -18446744073709551607 -18446744073709551612 DROP TABLE t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; SET @@INSERT_ID=1; @@ -572,12 +566,12 @@ SHOW VARIABLES LIKE "%auto_inc%"; Variable_name Value auto_increment_increment 65535 auto_increment_offset 65535 -INSERT INTO t1 VALUES (NULL); +INSERT INTO t1 VALUES (NULL),(NULL); +ERROR 22003: Out of range value for column 't1' at row 167 SELECT * FROM t1; c1 1 18446744073709551610 -18446744073709551615 DROP TABLE t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; SET @@INSERT_ID=1; diff --git a/mysql-test/suite/innodb_plugin/r/innodb_multi_update.result b/mysql-test/suite/innodb_plugin/r/innodb_multi_update.result index 7af9b030d1f..558fc3938a8 100644 --- a/mysql-test/suite/innodb_plugin/r/innodb_multi_update.result +++ b/mysql-test/suite/innodb_plugin/r/innodb_multi_update.result @@ -74,3 +74,11 @@ a b 4 14 5 15 drop table bug38999_1,bug38999_2; +# +# Bug#54475 improper error handling causes cascading crashing failures in innodb/ndb +# +CREATE TABLE t1(f1 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +UPDATE (SELECT ((SELECT 1 FROM t1), 1) FROM t1 WHERE (SELECT 1 FROM t1)) x, (SELECT 1) AS d SET d.f1 = 1; +ERROR 21000: Operand should contain 1 column(s) +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_plugin/t/innodb-autoinc.test b/mysql-test/suite/innodb_plugin/t/innodb-autoinc.test index 997c503d2d3..4967a6efbb9 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb-autoinc.test +++ b/mysql-test/suite/innodb_plugin/t/innodb-autoinc.test @@ -293,21 +293,8 @@ INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13 SELECT * FROM t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10; SHOW VARIABLES LIKE "%auto_inc%"; -# This should fail because of overflow but it doesn't, it seems to be -# a MySQL server bug. It wraps around to 0 for the last value. -# See MySQL Bug# 39828 -# -# Instead of wrapping around, it asserts when MySQL is compiled --with-debug -# (see sql/handler.cc:handler::update_auto_increment()). Don't test for -# overflow until Bug #39828 is fixed. -# -# Since this asserts when compiled --with-debug, we can't properly test this -# until Bug #39828 is fixed. For now, this test is meaningless. -#if Bug #39828 is fixed -#INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); -#else -INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); -#endif +--error ER_AUTOINC_READ_FAILED +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); SELECT * FROM t1; DROP TABLE t1; @@ -325,20 +312,8 @@ INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13 SELECT * FROM t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7; SHOW VARIABLES LIKE "%auto_inc%"; -# This should fail because of overflow but it doesn't. It fails with -# a duplicate entry message because of a MySQL server bug, it wraps -# around. See MySQL Bug# 39828, once MySQL fix the bug we can replace -# the ER_DUP_ENTRY, 1062 below with the appropriate error message -# -# Since this asserts when compiled --with-debug, we can't properly test this -# until Bug #39828 is fixed. For now, this test is meaningless. -#if Bug #39828 is fixed -# Still need to fix this error code, error should mention overflow -#-- error ER_DUP_ENTRY,1062 -#INSERT INTO t1 VALUES (NULL),(NULL), (NULL); -#else -INSERT INTO t1 VALUES (NULL),(NULL); -#endif +--error ER_AUTOINC_READ_FAILED +INSERT INTO t1 VALUES (NULL),(NULL), (NULL); SELECT * FROM t1; DROP TABLE t1; @@ -376,20 +351,8 @@ INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2 SELECT * FROM t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976; SHOW VARIABLES LIKE "%auto_inc%"; -# This should fail because of overflow but it doesn't. It wraps around -# and the autoinc values look bogus too. -# See MySQL Bug# 39828, once MySQL fix the bug we can enable the error -# code expected test. -# -- error ER_AUTOINC_READ_FAILED,1467 -# -# Since this asserts when compiled --with-debug, we can't properly test this -# until Bug #39828 is fixed. For now, this test is meaningless. -#if Bug #39828 is fixed -#-- error ER_AUTOINC_READ_FAILED,1467 -#INSERT INTO t1 VALUES (NULL),(NULL); -#else -INSERT INTO t1 VALUES (NULL); -#endif +--error ER_WARN_DATA_OUT_OF_RANGE +INSERT INTO t1 VALUES (NULL),(NULL); SELECT * FROM t1; DROP TABLE t1; diff --git a/mysql-test/suite/innodb_plugin/t/innodb_multi_update.test b/mysql-test/suite/innodb_plugin/t/innodb_multi_update.test index 890889301e6..3d9a9a53193 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_multi_update.test +++ b/mysql-test/suite/innodb_plugin/t/innodb_multi_update.test @@ -27,3 +27,14 @@ select * from bug38999_1; select * from bug38999_2; drop table bug38999_1,bug38999_2; + + +--echo # +--echo # Bug#54475 improper error handling causes cascading crashing failures in innodb/ndb +--echo # +CREATE TABLE t1(f1 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +--error ER_OPERAND_COLUMNS +UPDATE (SELECT ((SELECT 1 FROM t1), 1) FROM t1 WHERE (SELECT 1 FROM t1)) x, (SELECT 1) AS d SET d.f1 = 1; +DROP TABLE t1; + diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc b/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc index 25a9774d2a1..45d77225a23 100644 --- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc +++ b/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc @@ -39,29 +39,6 @@ let $val3 = 17 ; let $val4 = 15 ; --source suite/parts/inc/partition_supported_sql_funcs.inc - -let $sqlfunc = ceiling(col1); -let $valsqlfunc = ceiling(15); -let $coltype = float(7,4); -let $infile = part_supported_sql_funcs_int_float.inc; -let $val1 = 5.1230; -let $val2 = 13.345; -let $val3 = 17.987; -let $val4 = 15.654 ; -# DISABLED due to bug 30577 -#--source suite/parts/inc/partition_supported_sql_funcs.inc - -let $sqlfunc = floor(col1); -let $valsqlfunc = floor(15.123); -let $coltype = float(7,4); -let $infile = part_supported_sql_funcs_int_float.inc; -let $val1 = 5.1230; -let $val2 = 13.345; -let $val3 = 17.987; -let $val4 = 15.654 ; -# DISABLED due to bug 30577 -#--source suite/parts/inc/partition_supported_sql_funcs.inc - let $sqlfunc = mod(col1,10); let $valsqlfunc = mod(15,10); let $coltype = int; diff --git a/mysql-test/suite/parts/inc/partition_decimal.inc b/mysql-test/suite/parts/inc/partition_decimal.inc index 17cef08e275..7d3fe058de9 100644 --- a/mysql-test/suite/parts/inc/partition_decimal.inc +++ b/mysql-test/suite/parts/inc/partition_decimal.inc @@ -37,10 +37,8 @@ drop table t2; # Bug 30577: FLOOR() and CEILING() not usable as partition functions # Partition functions are required to return INT_RESULT; FLOOR() and -# CEILING() do not, unless they have an INT argument. Disable this -# portion of the test until bug 30577 is fixed. +# CEILING() do not, unless they have an INT or DECIMAL argument. ---disable_parsing eval create table t3 (a decimal(18,9) not null, primary key(a)) engine=$engine partition by range (floor(a)) subpartition by key (a) subpartitions 2 ( @@ -65,7 +63,7 @@ select count(*) from t3; drop table t3; eval create table t4 (a decimal(18,9) not null, primary key(a)) engine=$engine -partition by list (floor(a)) subpartition by key (a) subpartitions 2 ( +partition by list (ceiling(a)) subpartition by key (a) subpartitions 2 ( partition pa2 values in (1,2), partition pa4 values in (3,4), partition pa6 values in (5,6), @@ -85,6 +83,3 @@ dec $count; --enable_query_log select count(*) from t4; drop table t4; - -# Disabled due to Bug 30577 ---enable_parsing diff --git a/mysql-test/suite/parts/inc/partition_double.inc b/mysql-test/suite/parts/inc/partition_double.inc index befbe860b86..cfae95022ce 100644 --- a/mysql-test/suite/parts/inc/partition_double.inc +++ b/mysql-test/suite/parts/inc/partition_double.inc @@ -34,54 +34,3 @@ dec $count; --enable_query_log select count(*) from t2; drop table t2; - - -# Bug 30577: FLOOR() and CEILING() not usable as partition functions -# Partition functions are required to return INT_RESULT; FLOOR() and -# CEILING() do not, unless they have an INT argument. Disable this -# portion of the test until bug 30577 is fixed. - ---disable_parsing - -eval create table t3 (a double not null, primary key(a)) engine=$engine -partition by range (floor(a)) subpartition by key (a) subpartitions 3 ( -partition pa1 values less than (3), -partition pa3 values less than (6), -partition pa10 values less than (10) -); -show create table t3; -let $count=9; ---echo $count*3 inserts; -while ($count) -{ -eval insert into t3 values ($count); -eval insert into t3 values ($count+0.33); -eval insert into t3 values ($count+0.75); -dec $count; -} -select count(*) from t3; -select * from t3; -drop table t3; - -eval create table t4 (a double not null, primary key(a)) engine=$engine -partition by list (floor(a)) subpartition by key (a) subpartitions 3 ( -partition pa1 values in (1,2,3), -partition pa3 values in (4,5,6), -partition pa10 values in (7,8,9,10) -); -show create table t4; -let $count=9; ---echo $count*3 inserts; -while ($count) -{ -eval insert into t4 values ($count); -eval insert into t4 values ($count+0.33); -eval insert into t4 values ($count+0.75); -dec $count; -} -select count(*) from t4; -select * from t4; -drop table t4; - -# Disabled due to Bug 30577 ---enable_parsing diff --git a/mysql-test/suite/parts/inc/partition_float.inc b/mysql-test/suite/parts/inc/partition_float.inc index 34f14137d4d..7fa6b3043be 100644 --- a/mysql-test/suite/parts/inc/partition_float.inc +++ b/mysql-test/suite/parts/inc/partition_float.inc @@ -38,53 +38,3 @@ dec $count; --enable_query_log select count(*) from t2; drop table t2; - -# Bug 30577: FLOOR() and CEILING() not usable as partition functions -# Partition functions are required to return INT_RESULT; FLOOR() and -# CEILING() do not, unless they have an INT argument. Disable this -# portion of the test until bug 30577 is fixed. - ---disable_parsing - -eval create table t3 (a float not null, primary key(a)) engine=$engine -partition by range (floor(a)) subpartition by key (a) subpartitions 3 ( -partition pa1 values less than (3), -partition pa3 values less than (6), -partition pa10 values less than (10) -); -show create table t3; -let $count=9; ---echo $count*3 inserts; -while ($count) -{ -eval insert into t3 values ($count); -eval insert into t3 values ($count+0.33); -eval insert into t3 values ($count+0.75); -dec $count; -} -select count(*) from t3; -select * from t3; -drop table t3; - -eval create table t4 (a float not null, primary key(a)) engine=$engine -partition by list (floor(a)) subpartition by key (a) subpartitions 3 ( -partition pa1 values in (1,2,3), -partition pa3 values in (4,5,6), -partition pa10 values in (7,8,9,10) -); -show create table t4; -let $count=9; ---echo $count*3 inserts; -while ($count) -{ -eval insert into t4 values ($count); -eval insert into t4 values ($count+0.33); -eval insert into t4 values ($count+0.75); -dec $count; -} -select count(*) from t4; -select * from t4; -drop table t4; - -# Disabled due to Bug 30577 ---enable_parsing diff --git a/mysql-test/suite/parts/r/partition_decimal_innodb.result b/mysql-test/suite/parts/r/partition_decimal_innodb.result index 70debf3c595..c69c880cc6f 100644 --- a/mysql-test/suite/parts/r/partition_decimal_innodb.result +++ b/mysql-test/suite/parts/r/partition_decimal_innodb.result @@ -86,3 +86,111 @@ select count(*) from t2; count(*) 3072 drop table t2; +create table t3 (a decimal(18,9) not null, primary key(a)) engine='InnoDB' +partition by range (floor(a)) subpartition by key (a) subpartitions 2 ( +partition pa2 values less than (2), +partition pa4 values less than (4), +partition pa6 values less than (6), +partition pa8 values less than (8), +partition pa10 values less than (10) +); +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` decimal(18,9) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (floor(a)) +SUBPARTITION BY KEY (a) +SUBPARTITIONS 2 +(PARTITION pa2 VALUES LESS THAN (2) ENGINE = InnoDB, + PARTITION pa4 VALUES LESS THAN (4) ENGINE = InnoDB, + PARTITION pa6 VALUES LESS THAN (6) ENGINE = InnoDB, + PARTITION pa8 VALUES LESS THAN (8) ENGINE = InnoDB, + PARTITION pa10 VALUES LESS THAN (10) ENGINE = InnoDB) */ +9*3 inserts; +insert into t3 values (9); +insert into t3 values (9+0.333333333); +insert into t3 values (9+0.755555555); +insert into t3 values (8); +insert into t3 values (8+0.333333333); +insert into t3 values (8+0.755555555); +insert into t3 values (7); +insert into t3 values (7+0.333333333); +insert into t3 values (7+0.755555555); +insert into t3 values (6); +insert into t3 values (6+0.333333333); +insert into t3 values (6+0.755555555); +insert into t3 values (5); +insert into t3 values (5+0.333333333); +insert into t3 values (5+0.755555555); +insert into t3 values (4); +insert into t3 values (4+0.333333333); +insert into t3 values (4+0.755555555); +insert into t3 values (3); +insert into t3 values (3+0.333333333); +insert into t3 values (3+0.755555555); +insert into t3 values (2); +insert into t3 values (2+0.333333333); +insert into t3 values (2+0.755555555); +insert into t3 values (1); +insert into t3 values (1+0.333333333); +insert into t3 values (1+0.755555555); +select count(*) from t3; +count(*) +27 +drop table t3; +create table t4 (a decimal(18,9) not null, primary key(a)) engine='InnoDB' +partition by list (ceiling(a)) subpartition by key (a) subpartitions 2 ( +partition pa2 values in (1,2), +partition pa4 values in (3,4), +partition pa6 values in (5,6), +partition pa8 values in (7,8), +partition pa10 values in (9,10) +); +show create table t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `a` decimal(18,9) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (ceiling(a)) +SUBPARTITION BY KEY (a) +SUBPARTITIONS 2 +(PARTITION pa2 VALUES IN (1,2) ENGINE = InnoDB, + PARTITION pa4 VALUES IN (3,4) ENGINE = InnoDB, + PARTITION pa6 VALUES IN (5,6) ENGINE = InnoDB, + PARTITION pa8 VALUES IN (7,8) ENGINE = InnoDB, + PARTITION pa10 VALUES IN (9,10) ENGINE = InnoDB) */ +9*3 inserts; +insert into t4 values (9); +insert into t4 values (9+0.333333333); +insert into t4 values (9+0.755555555); +insert into t4 values (8); +insert into t4 values (8+0.333333333); +insert into t4 values (8+0.755555555); +insert into t4 values (7); +insert into t4 values (7+0.333333333); +insert into t4 values (7+0.755555555); +insert into t4 values (6); +insert into t4 values (6+0.333333333); +insert into t4 values (6+0.755555555); +insert into t4 values (5); +insert into t4 values (5+0.333333333); +insert into t4 values (5+0.755555555); +insert into t4 values (4); +insert into t4 values (4+0.333333333); +insert into t4 values (4+0.755555555); +insert into t4 values (3); +insert into t4 values (3+0.333333333); +insert into t4 values (3+0.755555555); +insert into t4 values (2); +insert into t4 values (2+0.333333333); +insert into t4 values (2+0.755555555); +insert into t4 values (1); +insert into t4 values (1+0.333333333); +insert into t4 values (1+0.755555555); +select count(*) from t4; +count(*) +27 +drop table t4; diff --git a/mysql-test/suite/parts/r/partition_decimal_myisam.result b/mysql-test/suite/parts/r/partition_decimal_myisam.result index f9f7a1e4fe2..cdafb721ea4 100644 --- a/mysql-test/suite/parts/r/partition_decimal_myisam.result +++ b/mysql-test/suite/parts/r/partition_decimal_myisam.result @@ -86,3 +86,111 @@ select count(*) from t2; count(*) 196605 drop table t2; +create table t3 (a decimal(18,9) not null, primary key(a)) engine='MYISAM' +partition by range (floor(a)) subpartition by key (a) subpartitions 2 ( +partition pa2 values less than (2), +partition pa4 values less than (4), +partition pa6 values less than (6), +partition pa8 values less than (8), +partition pa10 values less than (10) +); +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` decimal(18,9) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (floor(a)) +SUBPARTITION BY KEY (a) +SUBPARTITIONS 2 +(PARTITION pa2 VALUES LESS THAN (2) ENGINE = MyISAM, + PARTITION pa4 VALUES LESS THAN (4) ENGINE = MyISAM, + PARTITION pa6 VALUES LESS THAN (6) ENGINE = MyISAM, + PARTITION pa8 VALUES LESS THAN (8) ENGINE = MyISAM, + PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) */ +9*3 inserts; +insert into t3 values (9); +insert into t3 values (9+0.333333333); +insert into t3 values (9+0.755555555); +insert into t3 values (8); +insert into t3 values (8+0.333333333); +insert into t3 values (8+0.755555555); +insert into t3 values (7); +insert into t3 values (7+0.333333333); +insert into t3 values (7+0.755555555); +insert into t3 values (6); +insert into t3 values (6+0.333333333); +insert into t3 values (6+0.755555555); +insert into t3 values (5); +insert into t3 values (5+0.333333333); +insert into t3 values (5+0.755555555); +insert into t3 values (4); +insert into t3 values (4+0.333333333); +insert into t3 values (4+0.755555555); +insert into t3 values (3); +insert into t3 values (3+0.333333333); +insert into t3 values (3+0.755555555); +insert into t3 values (2); +insert into t3 values (2+0.333333333); +insert into t3 values (2+0.755555555); +insert into t3 values (1); +insert into t3 values (1+0.333333333); +insert into t3 values (1+0.755555555); +select count(*) from t3; +count(*) +27 +drop table t3; +create table t4 (a decimal(18,9) not null, primary key(a)) engine='MYISAM' +partition by list (ceiling(a)) subpartition by key (a) subpartitions 2 ( +partition pa2 values in (1,2), +partition pa4 values in (3,4), +partition pa6 values in (5,6), +partition pa8 values in (7,8), +partition pa10 values in (9,10) +); +show create table t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `a` decimal(18,9) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (ceiling(a)) +SUBPARTITION BY KEY (a) +SUBPARTITIONS 2 +(PARTITION pa2 VALUES IN (1,2) ENGINE = MyISAM, + PARTITION pa4 VALUES IN (3,4) ENGINE = MyISAM, + PARTITION pa6 VALUES IN (5,6) ENGINE = MyISAM, + PARTITION pa8 VALUES IN (7,8) ENGINE = MyISAM, + PARTITION pa10 VALUES IN (9,10) ENGINE = MyISAM) */ +9*3 inserts; +insert into t4 values (9); +insert into t4 values (9+0.333333333); +insert into t4 values (9+0.755555555); +insert into t4 values (8); +insert into t4 values (8+0.333333333); +insert into t4 values (8+0.755555555); +insert into t4 values (7); +insert into t4 values (7+0.333333333); +insert into t4 values (7+0.755555555); +insert into t4 values (6); +insert into t4 values (6+0.333333333); +insert into t4 values (6+0.755555555); +insert into t4 values (5); +insert into t4 values (5+0.333333333); +insert into t4 values (5+0.755555555); +insert into t4 values (4); +insert into t4 values (4+0.333333333); +insert into t4 values (4+0.755555555); +insert into t4 values (3); +insert into t4 values (3+0.333333333); +insert into t4 values (3+0.755555555); +insert into t4 values (2); +insert into t4 values (2+0.333333333); +insert into t4 values (2+0.755555555); +insert into t4 values (1); +insert into t4 values (1+0.333333333); +insert into t4 values (1+0.755555555); +select count(*) from t4; +count(*) +27 +drop table t4; diff --git a/mysql-test/suite/rpl/r/rpl_binlog_errors.result b/mysql-test/suite/rpl/r/rpl_binlog_errors.result new file mode 100644 index 00000000000..6c8c750bc79 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_binlog_errors.result @@ -0,0 +1,274 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +####################################################################### +####################### PART 1: MASTER TESTS ########################## +####################################################################### +include/stop_slave.inc +call mtr.add_suppression("Can't generate a unique log-filename"); +call mtr.add_suppression("Writing one row to the row-based binary log failed.*"); +call mtr.add_suppression("Error writing file .*"); +SET @old_debug= @@global.debug; +SELECT repeat('x',8192) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data'; +SELECT repeat('x',10) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data'; +RESET MASTER; +###################### TEST #1 +FLUSH LOGS; +# assert: must show two binlogs +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +###################### TEST #2 +RESET MASTER; +SET GLOBAL debug="+d,error_unique_log_filename"; +FLUSH LOGS; +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +# assert: must show one binlog +show binary logs; +Log_name File_size +master-bin.000001 # +SET GLOBAL debug=""; +RESET MASTER; +###################### TEST #3 +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB; +CREATE TABLE t4 (a VARCHAR(16384)); +INSERT INTO t1 VALUES (1); +RESET MASTER; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2; +# assert: must show two binlog +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +SET GLOBAL debug="-d,error_unique_log_filename"; +DELETE FROM t2; +RESET MASTER; +###################### TEST #4 +SET GLOBAL debug="+d,error_unique_log_filename"; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2; +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +# assert: must show one entry +SELECT count(*) FROM t2; +count(*) +1 +SET GLOBAL debug="-d,error_unique_log_filename"; +DELETE FROM t2; +RESET MASTER; +###################### TEST #5 +SET GLOBAL debug="+d,error_unique_log_filename"; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data' INTO TABLE t2; +# assert: must show one entry +SELECT count(*) FROM t2; +count(*) +1 +SET GLOBAL debug="-d,error_unique_log_filename"; +DELETE FROM t2; +RESET MASTER; +###################### TEST #6 +SET GLOBAL debug="+d,error_unique_log_filename"; +SET AUTOCOMMIT=0; +INSERT INTO t2 VALUES ('muse'); +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2; +INSERT INTO t2 VALUES ('muse'); +COMMIT; +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +# assert: must show three entries +SELECT count(*) FROM t2; +count(*) +3 +SET AUTOCOMMIT= 1; +SET GLOBAL debug="-d,error_unique_log_filename"; +DELETE FROM t2; +RESET MASTER; +###################### TEST #7 +SET GLOBAL debug="+d,error_unique_log_filename"; +SELECT count(*) FROM t4; +count(*) +0 +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4; +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +# assert: must show 1 entry +SELECT count(*) FROM t4; +count(*) +1 +### check that the incident event is written to the current log +SET GLOBAL debug="-d,error_unique_log_filename"; +FLUSH LOGS; +SHOW BINLOG EVENTS IN 'BINLOG_FILE' FROM <binlog_start> LIMIT 1; +Log_name Pos Event_type Server_id End_log_pos Info +BINLOG_FILE # Incident # # #1 (LOST_EVENTS) +DELETE FROM t4; +RESET MASTER; +###################### TEST #8 +SET GLOBAL debug="+d,error_unique_log_filename"; +# must show 0 entries +SELECT count(*) FROM t4; +count(*) +0 +SELECT count(*) FROM t2; +count(*) +0 +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4; +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2; +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'); +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +# INFO: Count(*) Before Offending DELETEs +# assert: must show 1 entry +SELECT count(*) FROM t4; +count(*) +1 +# assert: must show 4 entries +SELECT count(*) FROM t2; +count(*) +4 +DELETE FROM t4; +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +DELETE FROM t2; +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +# INFO: Count(*) After Offending DELETEs +# assert: must show zero entries +SELECT count(*) FROM t4; +count(*) +0 +SELECT count(*) FROM t2; +count(*) +0 +SET GLOBAL debug="-d,error_unique_log_filename"; +###################### TEST #9 +SET GLOBAL debug="+d,error_unique_log_filename"; +SET SQL_LOG_BIN=0; +INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd'); +INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh'); +# assert: must show four entries +SELECT count(*) FROM t2; +count(*) +4 +SELECT count(*) FROM t4; +count(*) +4 +DELETE FROM t2; +DELETE FROM t4; +# assert: must show zero entries +SELECT count(*) FROM t2; +count(*) +0 +SELECT count(*) FROM t4; +count(*) +0 +SET SQL_LOG_BIN=1; +SET GLOBAL debug="-d,error_unique_log_filename"; +###################### TEST #10 +call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file."); +call mtr.add_suppression("Could not open .*"); +RESET MASTER; +SHOW WARNINGS; +Level Code Message +SET GLOBAL debug="+d,fault_injection_registering_index"; +FLUSH LOGS; +ERROR HY000: Can't open file: 'master-bin.000002' (errno: 1) +SET GLOBAL debug="-d,fault_injection_registering_index"; +SHOW BINARY LOGS; +ERROR HY000: You are not using binary logging +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; +###################### TEST #11 +SET GLOBAL debug="+d,fault_injection_openning_index"; +FLUSH LOGS; +ERROR HY000: Can't open file: 'master-bin.index' (errno: 1) +SET GLOBAL debug="-d,fault_injection_openning_index"; +RESET MASTER; +ERROR HY000: Binlog closed, cannot RESET MASTER +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; +###################### TEST #12 +SET GLOBAL debug="+d,fault_injection_new_file_rotate_event"; +FLUSH LOGS; +ERROR HY000: Can't open file: 'master-bin' (errno: 2) +SET GLOBAL debug="-d,fault_injection_new_file_rotate_event"; +RESET MASTER; +ERROR HY000: Binlog closed, cannot RESET MASTER +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; +SET GLOBAL debug= @old_debug; +DROP TABLE t1, t2, t4; +RESET MASTER; +include/start_slave.inc +####################################################################### +####################### PART 2: SLAVE TESTS ########################### +####################################################################### +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*"); +call mtr.add_suppression("Error writing file .*"); +call mtr.add_suppression("Could not open .*"); +call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file."); +call mtr.add_suppression("Can't generate a unique log-filename .*"); +###################### TEST #13 +SET @old_debug=@@global.debug; +include/stop_slave.inc +SET GLOBAL debug="+d,error_unique_log_filename"; +START SLAVE io_thread; +Last_IO_Error = Relay log write failure: could not queue event from master +SET GLOBAL debug="-d,error_unique_log_filename"; +SET GLOBAL debug=@old_debug; +###################### TEST #14 +SET @old_debug=@@global.debug; +include/stop_slave.inc +SET GLOBAL debug="+d,fault_injection_new_file_rotate_event"; +START SLAVE io_thread; +Last_IO_Error = Relay log write failure: could not queue event from master +SET GLOBAL debug="-d,fault_injection_new_file_rotate_event"; +SET GLOBAL debug=@old_debug; +###################### TEST #15 +SET @old_debug=@@global.debug; +include/stop_slave.inc +SET GLOBAL debug="+d,fault_injection_registering_index"; +START SLAVE io_thread; +Last_IO_Error = Relay log write failure: could not queue event from master +SET GLOBAL debug="-d,fault_injection_registering_index"; +SET GLOBAL debug=@old_debug; +###################### TEST #16 +SET @old_debug=@@global.debug; +include/stop_slave.inc +SET GLOBAL debug="+d,fault_injection_openning_index"; +START SLAVE io_thread; +Last_IO_Error = Relay log write failure: could not queue event from master +SET GLOBAL debug="-d,fault_injection_openning_index"; +SET GLOBAL debug=@old_debug; +include/stop_slave.inc +SET GLOBAL debug=@old_debug; +RESET SLAVE; +RESET MASTER; +include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result index e69952787fb..4bbbc0e99c6 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result +++ b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result @@ -11,6 +11,6 @@ set sql_log_bin=1; insert into t1 values(1),(2); ERROR 23000: Duplicate entry '2' for key 'a' drop table t1; -Error: "Query caused different errors on master and slave. Error on master: 'Duplicate entry '%-.192s' for key %d' (1062), Error on slave: 'no error' (0). Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave) +Error: "Query caused different errors on master and slave. Error on master: message (format)='Duplicate entry '%-.192s' for key %d' error code=1062 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave) Errno: "0" (expected 0) drop table t1; diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors-master.opt b/mysql-test/suite/rpl/t/rpl_binlog_errors-master.opt new file mode 100644 index 00000000000..f8e46a44854 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_binlog_errors-master.opt @@ -0,0 +1 @@ +--max_binlog_size=4096 diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors.test b/mysql-test/suite/rpl/t/rpl_binlog_errors.test new file mode 100644 index 00000000000..e4eb212e1cd --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_binlog_errors.test @@ -0,0 +1,415 @@ +# BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error +# when generating new name. +# +# WHY +# === +# +# We want to check whether error is reported or not when +# new_file_impl fails (this may happen when rotation is not +# possible because there is some problem finding an +# unique filename). +# +# HOW +# === +# +# Test cases are documented inline. + +-- source include/master-slave.inc +-- source include/have_innodb.inc +-- source include/have_debug.inc + +-- echo ####################################################################### +-- echo ####################### PART 1: MASTER TESTS ########################## +-- echo ####################################################################### + + +### ACTION: stopping slave as it is not needed for the first part of +### the test + +-- connection slave +-- source include/stop_slave.inc +-- connection master + +call mtr.add_suppression("Can't generate a unique log-filename"); +call mtr.add_suppression("Writing one row to the row-based binary log failed.*"); +call mtr.add_suppression("Error writing file .*"); + +SET @old_debug= @@global.debug; + +### ACTION: create a large file (> 4096 bytes) that will be later used +### in LOAD DATA INFILE to check binlog errors in its vacinity +-- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data +-- let $MYSQLD_DATADIR= `select @@datadir` +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file' + +### ACTION: create a small file (< 4096 bytes) that will be later used +### in LOAD DATA INFILE to check for absence of binlog errors +### when file loading this file does not force flushing and +### rotating the binary log +-- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data +-- let $MYSQLD_DATADIR= `select @@datadir` +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2' + +RESET MASTER; + +-- echo ###################### TEST #1 + +### ASSERTION: no problem flushing logs (should show two binlogs) +FLUSH LOGS; +-- echo # assert: must show two binlogs +-- source include/show_binary_logs.inc + +-- echo ###################### TEST #2 + +### ASSERTION: check that FLUSH LOGS actually fails and reports +### failure back to the user if find_uniq_filename fails +### (should show just one binlog) + +RESET MASTER; +SET GLOBAL debug="+d,error_unique_log_filename"; +-- error ER_NO_UNIQUE_LOGFILE +FLUSH LOGS; +-- echo # assert: must show one binlog +-- source include/show_binary_logs.inc + +### ACTION: clean up and move to next test +SET GLOBAL debug=""; +RESET MASTER; + +-- echo ###################### TEST #3 + +### ACTION: create some tables (t1, t2, t4) and insert some values in +### table t1 +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB; +CREATE TABLE t4 (a VARCHAR(16384)); +INSERT INTO t1 VALUES (1); +RESET MASTER; + +### ASSERTION: we force rotation of the binary log because it exceeds +### the max_binlog_size option (should show two binary +### logs) + +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 + +# shows two binary logs +-- echo # assert: must show two binlog +-- source include/show_binary_logs.inc + +# clean up the table and the binlog to be used in next part of test +SET GLOBAL debug="-d,error_unique_log_filename"; +DELETE FROM t2; +RESET MASTER; + +-- echo ###################### TEST #4 + +### ASSERTION: load the big file into a transactional table and check +### that it reports error. The table will contain the +### changes performed despite the fact that it reported an +### error. + +SET GLOBAL debug="+d,error_unique_log_filename"; +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- error ER_NO_UNIQUE_LOGFILE +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 + +# show table +-- echo # assert: must show one entry +SELECT count(*) FROM t2; + +# clean up the table and the binlog to be used in next part of test +SET GLOBAL debug="-d,error_unique_log_filename"; +DELETE FROM t2; +RESET MASTER; + +-- echo ###################### TEST #5 + +### ASSERTION: load the small file into a transactional table and +### check that it succeeds + +SET GLOBAL debug="+d,error_unique_log_filename"; +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval LOAD DATA INFILE '$load_file2' INTO TABLE t2 + +# show table +-- echo # assert: must show one entry +SELECT count(*) FROM t2; + +# clean up the table and the binlog to be used in next part of test +SET GLOBAL debug="-d,error_unique_log_filename"; +DELETE FROM t2; +RESET MASTER; + +-- echo ###################### TEST #6 + +### ASSERTION: check that even if one is using a transactional table +### and explicit transactions (no autocommit) if rotation +### fails we get the error. Transaction is not rolledback +### because rotation happens after the commit. + +SET GLOBAL debug="+d,error_unique_log_filename"; +SET AUTOCOMMIT=0; +INSERT INTO t2 VALUES ('muse'); +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 +INSERT INTO t2 VALUES ('muse'); +-- error ER_NO_UNIQUE_LOGFILE +COMMIT; + +### ACTION: Show the contents of the table after the test +-- echo # assert: must show three entries +SELECT count(*) FROM t2; + +### ACTION: clean up and move to the next test +SET AUTOCOMMIT= 1; +SET GLOBAL debug="-d,error_unique_log_filename"; +DELETE FROM t2; +RESET MASTER; + +-- echo ###################### TEST #7 + +### ASSERTION: check that on a non-transactional table, if rotation +### fails then an error is reported and an incident event +### is written to the current binary log. + +SET GLOBAL debug="+d,error_unique_log_filename"; +SELECT count(*) FROM t4; +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- error ER_NO_UNIQUE_LOGFILE +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4 + +-- echo # assert: must show 1 entry +SELECT count(*) FROM t4; + +-- echo ### check that the incident event is written to the current log +SET GLOBAL debug="-d,error_unique_log_filename"; +-- let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1) +-- let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + +# 53 is the size of the incident event, so we start from 22 bytes before the +# current position +-- let $binlog_start = `SELECT $binlog_start - 53` +FLUSH LOGS; +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start> $binlog_file BINLOG_FILE +-- replace_column 2 # 4 # 5 # +-- eval SHOW BINLOG EVENTS IN '$binlog_file' FROM $binlog_start LIMIT 1 + +# clean up and move to next test +DELETE FROM t4; +RESET MASTER; + +-- echo ###################### TEST #8 + +### ASSERTION: check that statements end up in error but they succeed +### on changing the data. + +SET GLOBAL debug="+d,error_unique_log_filename"; +-- echo # must show 0 entries +SELECT count(*) FROM t4; +SELECT count(*) FROM t2; + +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- error ER_NO_UNIQUE_LOGFILE +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4 +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- error ER_NO_UNIQUE_LOGFILE +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 +-- error ER_NO_UNIQUE_LOGFILE +INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'); + +-- echo # INFO: Count(*) Before Offending DELETEs +-- echo # assert: must show 1 entry +SELECT count(*) FROM t4; +-- echo # assert: must show 4 entries +SELECT count(*) FROM t2; + +-- error ER_NO_UNIQUE_LOGFILE +DELETE FROM t4; +-- error ER_NO_UNIQUE_LOGFILE +DELETE FROM t2; + +-- echo # INFO: Count(*) After Offending DELETEs +-- echo # assert: must show zero entries +SELECT count(*) FROM t4; +SELECT count(*) FROM t2; + +# remove fault injection +SET GLOBAL debug="-d,error_unique_log_filename"; + +-- echo ###################### TEST #9 + +### ASSERTION: check that if we disable binlogging, then statements +### succeed. +SET GLOBAL debug="+d,error_unique_log_filename"; +SET SQL_LOG_BIN=0; +INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd'); +INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh'); +-- echo # assert: must show four entries +SELECT count(*) FROM t2; +SELECT count(*) FROM t4; +DELETE FROM t2; +DELETE FROM t4; +-- echo # assert: must show zero entries +SELECT count(*) FROM t2; +SELECT count(*) FROM t4; +SET SQL_LOG_BIN=1; +SET GLOBAL debug="-d,error_unique_log_filename"; + +-- echo ###################### TEST #10 + +### ASSERTION: check that error is reported if there is a failure +### while registering the index file and the binary log +### file or failure to write the rotate event. + +call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file."); +call mtr.add_suppression("Could not open .*"); + +RESET MASTER; +SHOW WARNINGS; + +# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open +SET GLOBAL debug="+d,fault_injection_registering_index"; +-- replace_regex /\.[\\\/]master/master/ +-- error ER_CANT_OPEN_FILE +FLUSH LOGS; +SET GLOBAL debug="-d,fault_injection_registering_index"; + +-- error ER_NO_BINARY_LOGGING +SHOW BINARY LOGS; + +# issue some statements and check that they don't fail +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; + +-- echo ###################### TEST #11 + +### ASSERTION: check that error is reported if there is a failure +### while opening the index file and the binary log file or +### failure to write the rotate event. + +# restart the server so that we have binlog again +--source include/restart_mysqld.inc + +# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file +SET GLOBAL debug="+d,fault_injection_openning_index"; +-- replace_regex /\.[\\\/]master/master/ +-- error ER_CANT_OPEN_FILE +FLUSH LOGS; +SET GLOBAL debug="-d,fault_injection_openning_index"; + +-- error ER_FLUSH_MASTER_BINLOG_CLOSED +RESET MASTER; + +# issue some statements and check that they don't fail +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; + +# restart the server so that we have binlog again +-- source include/restart_mysqld.inc + +-- echo ###################### TEST #12 + +### ASSERTION: check that error is reported if there is a failure +### while writing the rotate event when creating a new log +### file. + +# +d,fault_injection_new_file_rotate_event => injects fault on MYSQL_BIN_LOG::MYSQL_BIN_LOG::new_file_impl +SET GLOBAL debug="+d,fault_injection_new_file_rotate_event"; +-- error ER_ERROR_ON_WRITE +FLUSH LOGS; +SET GLOBAL debug="-d,fault_injection_new_file_rotate_event"; + +-- error ER_FLUSH_MASTER_BINLOG_CLOSED +RESET MASTER; + +# issue some statements and check that they don't fail +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; + +# restart the server so that we have binlog again +-- source include/restart_mysqld.inc + +## clean up +SET GLOBAL debug= @old_debug; +DROP TABLE t1, t2, t4; +RESET MASTER; + +# restart slave again +-- connection slave +-- source include/start_slave.inc +-- connection master + +-- echo ####################################################################### +-- echo ####################### PART 2: SLAVE TESTS ########################### +-- echo ####################################################################### + +### setup +-- connection master +# master-slave-reset starts the slave automatically +-- source include/master-slave-reset.inc +-- connection slave + +# slave suppressions + +call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*"); +call mtr.add_suppression("Error writing file .*"); +call mtr.add_suppression("Could not open .*"); +call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file."); +call mtr.add_suppression("Can't generate a unique log-filename .*"); +-- echo ###################### TEST #13 + +#### ASSERTION: check against unique log filename error +-- let $io_thd_injection_fault_flag= error_unique_log_filename +-- let $slave_io_errno= 1595 +-- let $show_slave_io_error= 1 +-- source include/io_thd_fault_injection.inc + +-- echo ###################### TEST #14 + +#### ASSERTION: check against rotate failing +-- let $io_thd_injection_fault_flag= fault_injection_new_file_rotate_event +-- let $slave_io_errno= 1595 +-- let $show_slave_io_error= 1 +-- source include/io_thd_fault_injection.inc + +-- echo ###################### TEST #15 + +#### ASSERTION: check against relay log open failure +-- let $io_thd_injection_fault_flag= fault_injection_registering_index +-- let $slave_io_errno= 1595 +-- let $show_slave_io_error= 1 +-- source include/io_thd_fault_injection.inc + +-- echo ###################### TEST #16 + +#### ASSERTION: check against relay log index open failure +-- let $io_thd_injection_fault_flag= fault_injection_openning_index +-- let $slave_io_errno= 1595 +-- let $show_slave_io_error= 1 +-- source include/io_thd_fault_injection.inc + +### clean up +-- disable_warnings +-- source include/stop_slave.inc +-- enable_warnings +SET GLOBAL debug=@old_debug; +RESET SLAVE; +RESET MASTER; +-- source include/start_slave.inc +-- connection master +-- source include/master-slave-end.inc diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test index e296da01bad..afa80e9c3f5 100644 --- a/mysql-test/suite/rpl/t/rpl_trigger.test +++ b/mysql-test/suite/rpl/t/rpl_trigger.test @@ -313,9 +313,7 @@ FLUSH LOGS; # Stop master server --echo --> Stop master server ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait -EOF +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --shutdown_server 10 --source include/wait_until_disconnected.inc # Replace binlog @@ -323,9 +321,7 @@ remove_file $MYSQLD_DATADIR/master-bin.000001; copy_file $MYSQL_TEST_DIR/std_data/bug16266.000001 $MYSQLD_DATADIR/master-bin.000001; --echo --> Start master server ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart -EOF +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --enable_reconnect --source include/wait_until_connected_again.inc let $binlog_version= query_get_value(SHOW BINLOG EVENTS, Info, 1); diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index 076e32eb22c..8ab2e6fcf31 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -342,3 +342,24 @@ SELECT a FROM t2; DROP TABLE t1, t2; +--echo # +--echo # Bug#39828 autoinc wraps around when offset and increment > 1 +--echo # + +CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) engine=MyISAM; +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES (18446744073709551601); + +SET @@SESSION.AUTO_INCREMENT_INCREMENT=10; + +SELECT @@SESSION.AUTO_INCREMENT_OFFSET; +--error ER_WARN_DATA_OUT_OF_RANGE +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SELECT * FROM t1; + +SET @@SESSION.AUTO_INCREMENT_INCREMENT=default; +SET @@SESSION.AUTO_INCREMENT_OFFSET=default; + +DROP TABLE t1; + +--echo End of 5.1 tests diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test index 89f35116a2c..3ed798e8d36 100644 --- a/mysql-test/t/change_user.test +++ b/mysql-test/t/change_user.test @@ -20,7 +20,7 @@ SET @@session.max_join_size = default; SELECT @@session.sql_big_selects; # On some machines the following will result into a warning --disable_warnings -SET @@global.max_join_size = -1; +SET @@global.max_join_size = 18446744073709551615; --enable_warnings SET @@session.max_join_size = default; --echo change_user diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test index 9a29e4ff861..d0b79ab6bd3 100644 --- a/mysql-test/t/connect.test +++ b/mysql-test/t/connect.test @@ -293,6 +293,34 @@ SET GLOBAL event_scheduler = OFF; --echo # -- End of Bug#35074. --echo + +########################################################################### + +--echo # +--echo # -- Bug#49752: 2469.126.2 unintentionally breaks authentication +--echo # against MySQL 5.1 server +--echo # + +GRANT ALL ON test.* TO 'Azundris12345678'@'localhost' IDENTIFIED BY 'test123'; + +FLUSH PRIVILEGES; + +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +connect (con1,localhost,Azundris123456789,test123,test); +disconnect con1; + +connection default; + +DROP USER 'Azundris12345678'@'localhost'; + +FLUSH PRIVILEGES; + +--echo # +--echo # -- End of Bug#49752 +--echo # + + + --echo # ------------------------------------------------------------------ --echo # -- End of 5.1 tests --echo # ------------------------------------------------------------------ diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test index 463a9cea4bc..2331c731061 100644 --- a/mysql-test/t/ctype_cp1251.test +++ b/mysql-test/t/ctype_cp1251.test @@ -48,3 +48,13 @@ select * from t1 where a like 'we_%'; drop table t1; # End of 4.1 tests + +--echo # +--echo # Start of 5.1 tests +--echo # + +--source include/ctype_8bit.inc + +--echo # +--echo # End of 5.1 tests +--echo # diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index d28c19bbd18..5ce6b52b74f 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -301,4 +301,15 @@ SELECT 0 FROM (SELECT 0) t56, (SELECT 0) t57, (SELECT 0) t58, (SELECT 0) t59, (SELECT 0) t60, (SELECT 0) t61; # 61 == MAX_TABLES +--echo # +--echo # A nested materialized derived table is used before being populated. +--echo # (addon for bug#19077) +--echo # + +CREATE TABLE t1 (i INT, j BIGINT); +INSERT INTO t1 VALUES (1, 2), (2, 2), (3, 2); +SELECT * FROM (SELECT MIN(i) FROM t1 +WHERE j = SUBSTRING('12', (SELECT * FROM (SELECT MIN(j) FROM t1) t2))) t3; +DROP TABLE t1; + --echo # End of 5.0 tests diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index a7072362759..1475ca082a5 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -746,4 +746,15 @@ SELECT POLYGON((SELECT 1 FROM (SELECT 1 IN (GROUP_CONCAT(t1.f1)) FROM t1, t1 t G --enable_ps_protocol DROP TABLE t1; +--echo # +--echo # Bug#58396 group_concat and explain extended are still crashy +--echo # + +CREATE TABLE t1(a INT); +--error ER_UNKNOWN_ERROR +EXPLAIN EXTENDED SELECT UPDATEXML('1', a, '1') +FROM t1 ORDER BY (SELECT GROUP_CONCAT(1) FROM t1); +SHOW WARNINGS; +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 3392a41519b..fdcfbcf519e 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1362,4 +1362,11 @@ SELECT 1 FROM t1, t1 t2 ORDER BY QUOTE(t1.a); DROP TABLE t1; +--echo # +--echo # Bug#57913 large negative number to string conversion functions crash +--echo # Bug#57810 case/when/then : Assertion failed: length || !scale +--echo # +SELECT '1' IN ('1', SUBSTRING(-9223372036854775809, 1)); +SELECT CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3)); + --echo End of 5.1 tests diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index 4c14dc96aaa..f12d20e962e 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -216,6 +216,7 @@ set global key_cache_block_size= @my_key_cache_block_size; # Bug#10473 - Can't set 'key_buffer_size' system variable to ZERO # (One cannot drop the default key cache.) # +--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE set @@global.key_buffer_size=0; select @@global.key_buffer_size; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 85d2ed19fda..5298701d790 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -673,4 +673,15 @@ SET t3.a = 0; DROP TABLE t1, t2, t3; SET SESSION sql_safe_updates = DEFAULT; +--echo # +--echo # Bug#52157 various crashes and assertions with multi-table update, stored function +--echo # + +CREATE FUNCTION f1 () RETURNS BLOB RETURN 1; +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; +DROP FUNCTION f1; +DROP TABLE t1; + --echo end of tests diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index d32d0996490..2dcc77a16c2 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -413,4 +413,147 @@ drop table t1; --exec $MYSQL --skip-column-names --vertical test -e "select 1 as a" --echo + +--echo # +--echo # Bug #54899: --one-database option cannot handle DROP/CREATE DATABASE +--echo # commands. +--echo # +--write_file $MYSQLTEST_VARDIR/tmp/bug54899.sql +DROP DATABASE connected_db; +CREATE DATABASE connected_db; +USE connected_db; +CREATE TABLE `table_in_connected_db`(a INT); +EOF + +CREATE DATABASE connected_db; +--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/bug54899.sql +USE connected_db; +SHOW TABLES; +DROP DATABASE connected_db; +--remove_file $MYSQLTEST_VARDIR/tmp/bug54899.sql + +--echo + +--echo # +--echo # Testing --one-database option +--echo # +--write_file $MYSQLTEST_VARDIR/tmp/one_db.sql +CREATE TABLE t1 (i INT); +CREATE TABLE test.t1 (i INT); +USE test; +# Following statements should be filtered. +CREATE TABLE connected_db.t2 (i INT); +CREATE TABLE t2 (i INT); +EOF + +CREATE DATABASE connected_db; +--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/one_db.sql +SHOW TABLES IN connected_db; +SHOW TABLES IN test; +USE test; +DROP TABLE t1; +DROP DATABASE connected_db; +--remove_file $MYSQLTEST_VARDIR/tmp/one_db.sql + +--echo +--write_file $MYSQLTEST_VARDIR/tmp/one_db.sql +CREATE DATABASE test1; +USE test1; +USE test1; +# Following statements should be filtered. +CREATE TABLE connected_db.t1 (i INT); +EOF + +--exec $MYSQL --one-database test < $MYSQLTEST_VARDIR/tmp/one_db.sql +SHOW TABLES IN test; +SHOW TABLES IN test1; +DROP DATABASE test1; +--remove_file $MYSQLTEST_VARDIR/tmp/one_db.sql + +--echo + +--echo # +--echo # Checking --one-database option followed by the execution of +--echo # connect command. +--echo # +--write_file $MYSQLTEST_VARDIR/tmp/one_db.sql +CREATE TABLE t1 (i INT); +CREATE TABLE test.t1 (i INT); +CONNECT test; +CREATE TABLE connected_db.t2 (i INT); +CREATE TABLE t2 (i INT); +USE connected_db; +# Following statements should be filtered. +CREATE TABLE connected_db.t3 (i INT); +CREATE TABLE t3 (i INT); +EOF + +CREATE DATABASE connected_db; +--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/one_db.sql +SHOW TABLES IN connected_db; +SHOW TABLES IN test; +DROP TABLE test.t1; +DROP TABLE test.t2; +DROP DATABASE connected_db; +--remove_file $MYSQLTEST_VARDIR/tmp/one_db.sql + +--echo + +--echo # +--echo # Checking --one-database option with no database specified +--echo # at command-line. +--echo # +--write_file $MYSQLTEST_VARDIR/tmp/one_db.sql +# All following statements should be filtered. +CREATE TABLE t1 (i INT); +CREATE TABLE test.t1 (i INT); +USE test; +CREATE TABLE test.t2 (i INT); +CREATE TABLE t2 (i INT); +EOF + +--exec $MYSQL --one-database < $MYSQLTEST_VARDIR/tmp/one_db.sql +SHOW TABLES IN test; +--remove_file $MYSQLTEST_VARDIR/tmp/one_db.sql + +--echo + +--echo # +--echo # Checking --one-database option with non_existent_db +--echo # specified with USE command +--echo # + +# CASE 1 : When 'connected_db' database exists and passed at commandline. +--write_file $MYSQLTEST_VARDIR/tmp/one_db_1.sql +CREATE TABLE `table_in_connected_db`(i INT); +USE non_existent_db; +# Following statement should be filtered out. +CREATE TABLE `table_in_non_existent_db`(i INT); +EOF + +# CASE 2 : When 'connected_db' database exists but dropped and recreated in +# load file. +--write_file $MYSQLTEST_VARDIR/tmp/one_db_2.sql +DROP DATABASE connected_db; +CREATE DATABASE connected_db; +USE non_existent_db; +# Following statements should be filtered out. +CREATE TABLE `table_in_non_existent_db`(i INT); +USE connected_db; +# Following statements should not be filtered out. +CREATE TABLE `table_in_connected_db`(i INT); +EOF + +CREATE DATABASE connected_db; +--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/one_db_1.sql +SHOW TABLES IN connected_db; +--echo +--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/one_db_2.sql +SHOW TABLES IN connected_db; +DROP DATABASE connected_db; + +--remove_file $MYSQLTEST_VARDIR/tmp/one_db_1.sql +--remove_file $MYSQLTEST_VARDIR/tmp/one_db_2.sql + +--echo --echo End of tests diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 5b17fedee2e..56c86f7d431 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -1936,6 +1936,7 @@ EOF cat_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; +--replace_regex /my_errno=[0-9]*/(my_errno)/ --error 1 --exec echo "cat_file non_existing_file;" | $MYSQL_TEST 2>&1 diff --git a/mysql-test/t/plugin_not_embedded.test b/mysql-test/t/plugin_not_embedded.test index 15aff548c29..40024efcaad 100644 --- a/mysql-test/t/plugin_not_embedded.test +++ b/mysql-test/t/plugin_not_embedded.test @@ -18,3 +18,15 @@ UNINSTALL PLUGIN example; disconnect con1; connection default; DROP USER bug51770@localhost; + +# +# BUG#58246: INSTALL PLUGIN not secure & crashable +# +# The bug consisted of not recognizing / on Windows, so checking / on +# all platforms should cover this case. + +let $path = `select CONCAT_WS('/', '..', $HA_EXAMPLE_SO)`; +--replace_regex /\.dll/.so/ +--error ER_UDF_NO_PATHS +eval INSTALL PLUGIN example SONAME '$path'; + diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index d5929041e8a..74d5c8450a2 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1255,4 +1255,48 @@ SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size; SELECT @@skip_name_resolve; SHOW VARIABLES LIKE 'skip_name_resolve'; +--echo # +--echo # Bug #43233 : Some server variables are clipped during "update," +--echo # not "check" stage +--echo # + +SET @kbs=@@global.key_buffer_size; +SET @kcbs=@@global.key_cache_block_size; + +--echo throw errors in STRICT mode +SET SQL_MODE=STRICT_ALL_TABLES; + +# sys_var_ulonglong_ptr: sys_max_binlog_cache_size +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.max_binlog_cache_size=-1; + +# sys_var_thd_ha_rows: "max_join_size" et al. +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.max_join_size=0; + +# sys_var_key_buffer_size: "key_buffer_size" +--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE +SET @@global.key_buffer_size=0; + +# sys_var_key_cache_long: "key_cache_block_size" et al. +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.key_cache_block_size=0; + +--echo throw warnings in default mode +SET SQL_MODE=DEFAULT; + +SET @@global.max_binlog_cache_size=-1; +SET @@global.max_join_size=0; +# this is an exception. since this is a new error/warning, let's stay +# compatible with the upcoming 5.6. +--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE +SET @@global.key_buffer_size=0; +SET @@global.key_cache_block_size=0; + +# cleanup +SET @@global.max_binlog_cache_size=DEFAULT; +SET @@global.max_join_size=DEFAULT; +SET @@global.key_buffer_size=@kbs; +SET @@global.key_cache_block_size=@kcbs; + --echo End of 5.1 tests diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 3736f53b288..b1b3b5f2a83 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3925,6 +3925,22 @@ WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1')); DROP VIEW v1; DROP TABLE t1; +--echo # +--echo # Bug#57703 create view cause Assertion failed: 0, file .\item_subselect.cc, line 846 +--echo # + +CREATE TABLE t1(a int); +CREATE VIEW v1 AS SELECT 1 FROM t1 GROUP BY +SUBSTRING(1 FROM (SELECT 3 FROM t1 WHERE a >= ANY(SELECT 1))); +DROP VIEW v1; +DROP TABLE t1; + +--echo # +--echo # Bug#57352 valgrind warnings when creating view +--echo # +CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f; +DROP VIEW v1; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.1 tests. --echo # ----------------------------------------------------------------- |