diff options
Diffstat (limited to 'mysql-test')
712 files changed, 25404 insertions, 14474 deletions
diff --git a/mysql-test/collections/smoke_test b/mysql-test/collections/smoke_test new file mode 100644 index 00000000000..6a9df661c4f --- /dev/null +++ b/mysql-test/collections/smoke_test @@ -0,0 +1,146 @@ +archive.archive +archive.archive_gis +archive.partition_archive +binlog.binlog_base64_flag +binlog.binlog_database +binlog.binlog_innodb +binlog.binlog_parallel_replication_marks_stm_mix +binlog.binlog_row_mix_innodb_myisam +binlog.flashback +binlog_encryption.encrypted_slave +connect.bin +connect.bson +connect.dbf +connect.dir +connect.endian +connect.general +connect.json +connect.mysql +connect.secure_file_priv +connect.tbl +csv.csv +disks.disks +encryption.encryption_force +encryption.innodb_encryption_tables +encryption.tempfiles_encrypted +federated.federated +federated.federatedx +gcol.gcol_select_innodb +handler.interface +heap.heap +innodb.innodb +innodb.autoinc_persist +innodb.innodb_defrag_binlog +innodb.innodb_mysql +innodb.monitor +innodb.purge +innodb.table_flags +innodb.xa_recovery +innodb_fts.fulltext +innodb_gis.geometry +innodb_gis.rtree +innodb_zip.innodb-zip +innodb_zip.page_size +json.json_no_table +main.blackhole +main.bootstrap +main.compress +main.connect +main.ctype_collate +main.ctype_utf8 +main.default +main.dyncol +main.fulltext +main.function_defaults +main.gis +main.grant +main.handlersocket +main.information_schema +main.innodb_ext_key +main.log_tables +main.lowercase_fs_off +main.myisam +main.mysql_client_test +main.mysql_protocols +main.mysql_upgrade +main.mysqladmin +main.mysqlbinlog +main.mysqlcheck +main.mysqld--defaults-file +main.mysqldump +main.mysqlhotcopy_myisam +main.mysqlshow +main.mysqlslap +main.mysqltest +main.parser +main.partition +main.perror +main.plugin +main.plugin_auth +main.pool_of_threads +main.ps +main.repair +main.shutdown +main.sp +main.ssl +main.ssl_compress +main.stat_tables +main.statistics +main.subselect +main.symlink +main.temp_table +main.timezone +main.type_timestamp_hires +main.user_var +main.userstat +main.variables +main.view +main.win +main.xa +maria.maria +mariabackup.full_backup +metadata_lock_info.table_metadata_lock +mroonga/storage.variable_version +mroonga/wrapper.count_star +multi_source.multisource +oqgraph.general-innodb +parts.rpl_partition +perfschema.selects +plugins.auth_ed25519 +plugins.cracklib_password_check +plugins.dialog +plugins.fulltext_plugin +plugins.locales +plugins.pam_cleartext +plugins.processlist +plugins.qc_info +plugins.server_audit +plugins.simple_password_check +plugins.sql_error_log +plugins.two_password_validations +plugins.unix_socket +query_response_time.basic +rocksdb.rocksdb +roles.definer +rpl.rpl_gtid_basic +rpl.rpl_relayrotate +rpl.rpl_row_blob_innodb +rpl.rpl_semi_sync_event +rpl.rpl_sp +rpl.rpl_stm_binlog_max_cache_size +rpl.rpl_switch_stm_row_mixed +sequence.simple +spider.basic_sql +spider.ha +sql_discovery.simple +sys_vars.sysvars_aria +sys_vars.sysvars_server_notembedded +wsrep.variables +compat/oracle.binlog_ptr_mysqlbinlog +compat/oracle.sp-package +compat/maxdb.rpl_mariadb_timestamp +sql_sequence.mysqldump +versioning.simple +versioning.trx_id +period.versioning +plugins.multiauth diff --git a/mysql-test/include/ctype_utf8mb4.inc b/mysql-test/include/ctype_utf8mb4.inc index 10d4f99efba..d24ee2fafeb 100644 --- a/mysql-test/include/ctype_utf8mb4.inc +++ b/mysql-test/include/ctype_utf8mb4.inc @@ -1587,7 +1587,7 @@ drop table t1; --echo # --echo # Check strnxfrm() with odd length --echo # -set max_sort_length=9; +set max_sort_length=65; select @@max_sort_length; eval create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci) engine $engine; insert into t1 values ('a'),('b'),('c'); diff --git a/mysql-test/include/galera_no_debug_sync.inc b/mysql-test/include/galera_no_debug_sync.inc new file mode 100644 index 00000000000..0819144c0b6 --- /dev/null +++ b/mysql-test/include/galera_no_debug_sync.inc @@ -0,0 +1,9 @@ +--disable_query_log + +--let $galera_have_debug_sync = `SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'` + +--if ($galera_have_debug_sync) { + --skip Test requires Galera debug library with no debug_sync functionality +} + +--enable_query_log diff --git a/mysql-test/include/icp_tests.inc b/mysql-test/include/icp_tests.inc index aa09b0025d4..66fdc3e754c 100644 --- a/mysql-test/include/icp_tests.inc +++ b/mysql-test/include/icp_tests.inc @@ -484,11 +484,11 @@ CREATE TABLE t1 ( INSERT INTO t1 VALUES (1,9),(2,7),(3,6),(4,3),(5,1); -EXPLAIN SELECT pk, c1 FROM t1 WHERE pk <> 3; +EXPLAIN SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3); SET SESSION optimizer_switch='index_condition_pushdown=off'; -SELECT pk, c1 FROM t1 WHERE pk <> 3; +SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3); DROP TABLE t1; @@ -727,16 +727,16 @@ INSERT INTO t2 VALUES SET SESSION optimizer_switch='index_condition_pushdown=off'; EXPLAIN -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; SET SESSION optimizer_switch='index_condition_pushdown=on'; EXPLAIN -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; DROP TABLE t1,t2; diff --git a/mysql-test/include/not_asan.inc b/mysql-test/include/not_asan.inc new file mode 100644 index 00000000000..9fc86a8525a --- /dev/null +++ b/mysql-test/include/not_asan.inc @@ -0,0 +1,8 @@ +# This file should only be used with test that finds bugs in ASan that can not +# be overcome. In normal cases one should fix the bug server/test case or in +# the worst case add a (temporary?) suppression in asan.supp or lsan.supp + +if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value="ASAN"`) +{ +--skip Can't be run with ASan +} diff --git a/mysql-test/include/not_ubsan.inc b/mysql-test/include/not_ubsan.inc new file mode 100644 index 00000000000..809f505507e --- /dev/null +++ b/mysql-test/include/not_ubsan.inc @@ -0,0 +1,8 @@ +# This file should only be used with test that finds bugs in ASan that can not +# be overcome. In normal cases one should fix the bug server/test case or in +# the worst case add a (temporary?) suppression in asan.supp or lsan.supp + +if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value="UBSAN"`) +{ +--skip Can't be run with UBSAN +} diff --git a/mysql-test/lib/My/Debugger.pm b/mysql-test/lib/My/Debugger.pm new file mode 100644 index 00000000000..7331238e1c8 --- /dev/null +++ b/mysql-test/lib/My/Debugger.pm @@ -0,0 +1,266 @@ +package My::Debugger; + +use strict; +use warnings; +use Text::Wrap; +use Cwd; +use My::Platform; + +# 1. options to support: +# --xxx[=ARGS] +# --manual-xxx[=ARGS] +# --client-xxx[=ARGS] +# --boot-xxx[=ARGS] +# TODO --manual-client-xxx[=ARGS] +# TODO --manual-boot-xxx[=ARGS] +# TODO --exec-xxx[=ARGS] (for $ENV{MYSQL}, etc) +# +# ARGS is a semicolon-separated list of commands for the +# command file. If the first command starts from '-' it'll +# be for a command line, not for a command file. +# +# 2. terminal to use: xterm +# TODO MTR_TERM="xterm -title {title} -e {command}" +# +# 3. debugger combinations are *not allowed* +# (thus no --valgrind --gdb) +# +# 4. variables for the command line / file templates: +# {vardir} -> vardir +# {exe} -> /path/to/binary/to/execute +# {args} -> command-line arguments, "-quoted +# {input} +# {type} -> client, mysqld.1, etc +# {script} -> vardir/tmp/{debugger}init.$type +# {log} -> vardir/log/$type.{debugger} +# {options} -> user options for the debugger. +# +# if {options} isn't used, they're auto-placed before {exe} +# or at the end if no {exe} + +my %debuggers = ( + gdb => { + term => 1, + options => '-x {script} {exe}', + script => 'set args {args} < {input}', + }, + ddd => { + options => '--command {script} {exe}', + script => 'set args {args} < {input}', + }, + dbx => { + term => 1, + options => '-c "stop in main; run {exe} {args} < {input}"', + }, + devenv => { + options => '/debugexe {exe} {args}', + }, + windbg => { + options => '{exe} {args}', + }, + lldb => { + term => 1, + options => '-s {script} {exe}', + script => 'process launch --stop-at-entry -- {args}', + }, + valgrind => { + options => '--tool=memcheck --show-reachable=yes --leak-check=yes --num-callers=16 --quiet --suppressions='.cwd().'/valgrind.supp {exe} {args} --loose-wait-for-pos-timeout=1500', + pre => sub { + my $debug_libraries_path= "/usr/lib/debug"; + $ENV{LD_LIBRARY_PATH} .= ":$debug_libraries_path" if -d $debug_libraries_path; + } + }, + strace => { + options => '-f -o {log} {exe} {args}', + }, + rr => { + options => '_RR_TRACE_DIR={log} rr record {exe} {args}', + run => 'env', + pre => sub { + ::mtr_error('rr requires kernel.perf_event_paranoid <= 1') + if ::mtr_grab_file('/proc/sys/kernel/perf_event_paranoid') > 1; + } + }, + valgdb => { + term => 1, + run => 'gdb', + options => '-x {script} {exe}', + script => <<EEE, +py +import subprocess,shlex,time +valg=subprocess.Popen(shlex.split("""valgrind --tool=memcheck --show-reachable=yes --leak-check=yes --num-callers=16 --quiet --suppressions=valgrind.supp --vgdb-error=0 {exe} {args} --loose-wait-for-pos-timeout=1500""")) +time.sleep(2) +gdb.execute("target remote | /usr/lib64/valgrind/../../bin/vgdb --pid=" + str(valg.pid)) +EEE + pre => sub { + my $debug_libraries_path= "/usr/lib/debug"; + $ENV{LD_LIBRARY_PATH} .= ":$debug_libraries_path" if -d $debug_libraries_path; + } + }, + + # aliases + vsjitdebugger => 'windbg', + ktrace => 'strace', +); + +my %opts; +my %opt_vals; +my $help = "\n\nOptions for running debuggers\n\n"; + +for my $k (sort keys %debuggers) { + my $v = $debuggers{$k}; + $v = $debuggers{$k} = $debuggers{$v} if not ref $v; # resolve aliases + + sub register_opt($$) { + my ($name, $msg) = @_; + $opts{"$name=s"} = \$opt_vals{$name}; + $help .= wrap(sprintf(" %-23s", $name), ' 'x25, "$msg under $name\n"); + } + + $v->{script} = '' unless $v->{script}; + $v->{options} =~ s/(\{exe\}|$)/ {options} $&/ unless $v->{options} =~ /\{options\}/; + + register_opt "$k" => "Start mysqld"; + register_opt "client-$k" => "Start mysqltest client"; + register_opt "boot-$k" => "Start bootstrap server"; + register_opt "manual-$k" => "Before running test(s) let user manually start mysqld"; +} + +sub subst($%) { + use warnings FATAL => 'uninitialized'; + my ($templ, %vars) = @_; + $templ =~ s/\{(\w+)\}/$vars{$1}/g; + $templ; +} + +sub do_args($$$$$) { + my ($args, $exe, $input, $type, $opt) = @_; + my $k = $opt =~ /^(?:client|boot|manual)-(.*)$/ ? $1 : $opt; + my $v = $debuggers{$k}; + + # on windows mtr args are quoted (for system), otherwise not (for exec) + sub quote($) { $_[0] =~ / / ? "\"$_[0]\"" : $_[0] } + sub unquote($) { $_[0] =~ s/^"(.*)"$/$1/; $_[0] } + sub quote_from_mtr($) { IS_WINDOWS() ? $_[0] : quote($_[0]) } + sub unquote_for_mtr($) { IS_WINDOWS() ? $_[0] : unquote($_[0]) } + + my %vars = ( + vardir => $::opt_vardir, + exe => $$exe, + args => join(' ', map { quote_from_mtr $_ } @$$args, '--gdb'), + input => $input, + script => "$::opt_vardir/tmp/${k}init.$type", + log => "$::opt_vardir/log/$type.$k", + options => '', + ); + my @params = split /;/, $opt_vals{$opt}; + $vars{options} = shift @params if @params and $params[0] =~ /^-/; + + my $script = join "\n", @params; + if ($v->{script}) { + ::mtr_tofile($vars{script}, subst($v->{script}, %vars)."\n".$script); + } elsif ($script) { + die "$k is not using a script file, nowhere to write the script \n---\n$script\n---\n"; + } + + my $options = subst($v->{options}, %vars); + @$$args = map { unquote_for_mtr $_ } $options =~ /("[^"]+"|\S+)/g; + my $run = $v->{run} || $k; + + if ($opt =~ /^manual-/) { + print "\nTo start $k for $type, type in another window:\n"; + print "$run $options\n"; + $$exe= undef; # Indicate the exe should not be started + } elsif ($v->{term}) { + unshift @$$args, '-title', $type, '-e', $run; + $$exe = 'xterm'; + } else { + $$exe = $run; + } +} + +sub options() { %opts } +sub help() { $help } + +sub fix_options(@) { + my $re=join '|', keys %opts; + $re =~ s/=s//g; + map { $_ . (/^--($re)$/ and '=;') } @_; +} + +sub pre_setup() { + my $used; + for my $k (keys %debuggers) { + for my $opt ($k, "manual-$k", "boot-$k", "client-$k") { + if ($opt_vals{$opt}) + { + $used = 1; + if ($debuggers{$k}->{pre}) { + $debuggers{$k}->{pre}->(); + delete $debuggers{$k}->{pre}; + } + } + } + } + + if ($used) { + $ENV{ASAN_OPTIONS}= 'abort_on_error=1:'.($ENV{ASAN_OPTIONS} || ''); + ::mtr_error("Can't use --extern when using debugger") if $ENV{USE_RUNNING_SERVER}; + + $::opt_retry= 1; + $::opt_retry_failure= 1; + $::opt_testcase_timeout= 7 * 24 * 60; # in minutes + $::opt_suite_timeout= 7 * 24 * 60; # in minutes + $::opt_shutdown_timeout= 24 * 60 *60; # in seconds + $::opt_start_timeout= 24 * 60 * 60; # in seconds + } +} + +sub setup_boot_args($$$) { + my ($args, $exe, $input) = @_; + my $found; + + for my $k (keys %debuggers) { + if ($opt_vals{"boot-$k"}) { + die "--boot-$k and --$found cannot be used at the same time\n" if $found; + + $found="boot-$k"; + do_args($args, $exe, $input, 'bootstrap', $found); + } + } +} + +sub setup_client_args($$) { + my ($args, $exe) = @_; + my $found; + my $embedded = $::opt_embedded_server ? ' with --embedded' : ''; + + for my $k (keys %debuggers) { + my @opt_names=("client-$k"); + push @opt_names, $k if $embedded; + for my $opt (@opt_names) { + if ($opt_vals{$opt}) { + die "--$opt and --$found cannot be used at the same time$embedded\n" if $found; + $found=$opt; + do_args($args, $exe, IS_WINDOWS() ? 'NUL' : '/dev/null', 'client', $found); + } + } + } +} + +sub setup_args($$$) { + my ($args, $exe, $type) = @_; + my $found; + + for my $k (keys %debuggers) { + for my $opt ($k, "manual-$k") { + if ($opt_vals{$opt}) { + die "--$opt and --$found cannot be used at the same time\n" if $found; + $found=$opt; + do_args($args, $exe, IS_WINDOWS() ? 'NUL' : '/dev/null', $type, $found); + } + } + } +} + +1; diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 473b21441e2..8144a6ef02e 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -497,23 +497,21 @@ sub mtr_report_stats ($$$$) { $test_time = sprintf("%.3f", $test->{timer} / 1000); $test->{'name'} =~ s/$current_suite\.//; - my $test_result; - - # if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML - if ($test->{'retries'} > 0) { - $test_result = "MTR_RES_FAILED"; + my $combinations; + if (defined($test->{combinations})){ + $combinations = join ',', sort @{$test->{combinations}}; } else { - $test_result = $test->{'result'}; + $combinations = ""; } - $xml_report .= qq(\t\t<testcase assertions="" classname="$current_suite" name="$test->{'name'}" status="$test_result" time="$test_time"); + $xml_report .= qq(\t\t<testcase assertions="" classname="$current_suite" name="$test->{'name'}" ). + qq(status="$test->{'result'}" time="$test_time" combinations="$combinations"); - my $comment = $test->{'comment'}; - $comment =~ s/[\"]//g; + my $comment= replace_special_symbols($test->{'comment'}); - # if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML - if ($test->{'result'} eq "MTR_RES_FAILED" || $test->{'retries'} > 0) { + if ($test->{'result'} eq "MTR_RES_FAILED") { my $logcontents = $test->{'logfile-failed'} || $test->{'logfile'}; + $logcontents= $logcontents.$test->{'warnings'}."\n"; # remove any double ] that would end the cdata $logcontents =~ s/]]/\x{fffd}/g; # replace wide characters that aren't allowed in XML 1.0 @@ -576,6 +574,16 @@ sub mtr_print_line () { print '-' x 74 . "\n"; } +sub replace_special_symbols($) { + my $text= shift; + $text =~ s/&/&/g; + $text =~ s/'/'/g; + $text =~ s/"/"/g; + $text =~ s/</</g; + $text =~ s/>/>/g; + return $text; +} + sub mtr_print_thick_line { my $char= shift || '='; diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result index 908435710a3..3c59b83f2ce 100644 --- a/mysql-test/main/alter_table.result +++ b/mysql-test/main/alter_table.result @@ -2529,6 +2529,23 @@ ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT 1 FROM t2 limit 1); ERROR HY000: Function or expression 'select ...' cannot be used in the DEFAULT clause of `k1` DROP TABLE t1,t2; # +# MDEV-25403 ALTER TABLE wrongly checks for field's default value if AFTER is used +# +create table t1(t int, d date not null); +insert into t1 values (1,'2001-1-1'); +set sql_mode = "no_zero_date"; +alter table t1 change d d date not null after t, add i int; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `t` int(11) DEFAULT NULL, + `d` date NOT NULL, + `i` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 add x date not null; +ERROR 22007: Incorrect date value: '0000-00-00' for column `test`.`t1`.`x` at row 1 +drop table t1; +# # End of 10.2 tests # # diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test index ce461b2fe46..fa931fcadbf 100644 --- a/mysql-test/main/alter_table.test +++ b/mysql-test/main/alter_table.test @@ -2051,6 +2051,18 @@ ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT 1 FROM t2 limit 1); DROP TABLE t1,t2; --echo # +--echo # MDEV-25403 ALTER TABLE wrongly checks for field's default value if AFTER is used +--echo # +create table t1(t int, d date not null); +insert into t1 values (1,'2001-1-1'); +set sql_mode = "no_zero_date"; +alter table t1 change d d date not null after t, add i int; +show create table t1; +--error ER_TRUNCATED_WRONG_VALUE +alter table t1 add x date not null; +drop table t1; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/backup_lock_binlog.result b/mysql-test/main/backup_lock_binlog.result new file mode 100644 index 00000000000..adf960a9cb1 --- /dev/null +++ b/mysql-test/main/backup_lock_binlog.result @@ -0,0 +1,40 @@ +# +# MDEV-25334 FTWRL/Backup blocks DDL on temporary tables with binlog +# enabled assertion fails in Diagnostics_area::set_error_status +# +select @@binlog_format; +@@binlog_format +MIXED +connect con1,localhost,root,,; +connection default; +# +# Test 1 +# +CREATE TEMPORARY TABLE tmp (a INT); +connection con1; +FLUSH TABLES WITH READ LOCK; +connection default; +SET lock_wait_timeout= 1; +ALTER TABLE tmp; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection con1; +unlock tables; +connection default; +drop table tmp; +# +# Test 2 (In statement format to ensure temporary table gets logged) +# +set @@binlog_format=statement; +CREATE TEMPORARY TABLE tmp (a INT); +connection con1; +BACKUP STAGE START; +BACKUP STAGE BLOCK_COMMIT; +connection default; +SET lock_wait_timeout= 1; +ALTER TABLE tmp; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection con1; +BACKUP STAGE end; +connection default; +drop table tmp; +disconnect con1; diff --git a/mysql-test/main/backup_lock_binlog.test b/mysql-test/main/backup_lock_binlog.test new file mode 100644 index 00000000000..45b3f1cfbd9 --- /dev/null +++ b/mysql-test/main/backup_lock_binlog.test @@ -0,0 +1,49 @@ +--source include/have_binlog_format_mixed_or_statement.inc + +# +# Tests involving locks and binlog +# + +--echo # +--echo # MDEV-25334 FTWRL/Backup blocks DDL on temporary tables with binlog +--echo # enabled assertion fails in Diagnostics_area::set_error_status +--echo # + +select @@binlog_format; +--connect (con1,localhost,root,,) +connection default; + +--echo # +--echo # Test 1 +--echo # + +CREATE TEMPORARY TABLE tmp (a INT); +--connection con1 +FLUSH TABLES WITH READ LOCK; +--connection default +SET lock_wait_timeout= 1; +--error ER_LOCK_WAIT_TIMEOUT +ALTER TABLE tmp; +--connection con1 +unlock tables; +--connection default +drop table tmp; + +--echo # +--echo # Test 2 (In statement format to ensure temporary table gets logged) +--echo # + +set @@binlog_format=statement; +CREATE TEMPORARY TABLE tmp (a INT); +--connection con1 +BACKUP STAGE START; +BACKUP STAGE BLOCK_COMMIT; +--connection default +SET lock_wait_timeout= 1; +--error ER_LOCK_WAIT_TIMEOUT +ALTER TABLE tmp; +--connection con1 +BACKUP STAGE end; +--connection default +drop table tmp; +--disconnect con1 diff --git a/mysql-test/main/brackets.result b/mysql-test/main/brackets.result index dedd9a2a2bf..c221d64fd17 100644 --- a/mysql-test/main/brackets.result +++ b/mysql-test/main/brackets.result @@ -4397,7 +4397,7 @@ with t as (select * from t1 where a <=3) select * from t; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where `t1`.`a` <= 3)select `t`.`a` AS `a` from `t` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` <= 3)select `t`.`a` AS `a` from `t` latin1 latin1_swedish_ci select * from v1; a 3 @@ -4413,7 +4413,7 @@ order by a desc limit 3 ) select a from t1 where a=4 union select a from t where a=7; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3 union select `t1`.`a` AS `a` from `t1` where `t1`.`a` > 3 order by `a` desc limit 3)select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3 order by `a` desc limit 3)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 latin1 latin1_swedish_ci select * from v1; a 4 @@ -4429,7 +4429,7 @@ order by a desc limit 3 ) (select a from t1 where a=4 union select a from t where a=7 order by a desc); show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as ((select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3) union (select `t1`.`a` AS `a` from `t1` where `t1`.`a` > 3) order by `a` desc limit 3)select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as ((select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3) union (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3) order by `a` desc limit 3)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci select * from v1; a 7 @@ -4444,7 +4444,7 @@ order by a desc limit 3 ) (select a from t where a=4 union select a from t where a=7 order by a desc); show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as ((select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3) union (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3) order by `a` desc limit 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 4 union select `t`.`a` AS `a` from ((select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3) union (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3) order by `a` desc limit 3) `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as ((select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3) union (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3) order by `a` desc limit 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci select * from v1; a 7 @@ -4469,7 +4469,7 @@ order by 1 desc limit 3 ) select a from t1 where a=4 union select a from t where a=7 order by a desc; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t(a) as (values (2),(1) union (values (4),(7)) order by 1 desc limit 3)select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t(a) as (values (2),(1) union (values (4),(7)) order by 1 desc limit 3)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci select * from v1; a 7 @@ -4484,7 +4484,7 @@ order by 1 desc limit 3 ) select a from t1 where a=1 union select a from t where a=7 order by a desc; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t(a) as ((values (2),(1)) union (values (4),(7) order by 1 desc) order by 1 desc limit 3)select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 1 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t(a) as ((values (2),(1)) union (values (4),(7) order by 1 desc) order by 1 desc limit 3)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci select * from v1; a 7 @@ -4496,7 +4496,7 @@ s as (select * from t1 where a > 3) select a from t where a=1 union select a from s where a=7 order by a desc; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3), s as (select `t1`.`a` AS `a` from `t1` where `t1`.`a` > 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 1 union select `s`.`a` AS `a` from `s` where `s`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3), s as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 1 union select `s`.`a` AS `a` from `s` where `s`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci select * from v1; a 7 @@ -4508,7 +4508,7 @@ s as (select * from t where a > 3) select a from t where a=1 union select a from s where a=7 order by a desc; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3), s as (select `t`.`a` AS `a` from (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3) `t` where `t`.`a` > 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 1 union select `s`.`a` AS `a` from `s` where `s`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3), s as (select `t`.`a` AS `a` from `t` where `t`.`a` > 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 1 union select `s`.`a` AS `a` from `s` where `s`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci select * from v1; a 1 diff --git a/mysql-test/main/check_constraint.result b/mysql-test/main/check_constraint.result index 3511af84166..f851b99e5c1 100644 --- a/mysql-test/main/check_constraint.result +++ b/mysql-test/main/check_constraint.result @@ -235,3 +235,15 @@ a b insert t1 (b) values (1); ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1` drop table t1; +# +# MDEV-24274 ALTER TABLE with CHECK CONSTRAINTS gives "Out of Memory" error +# +create table t1 (id varchar(2), constraint id check (id regexp '[a-z]')); +alter table t1 force; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` varchar(2) DEFAULT NULL, + CONSTRAINT `id` CHECK (`id` regexp '[a-z]') +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/main/check_constraint.test b/mysql-test/main/check_constraint.test index 93538fd1666..1258a9e3be6 100644 --- a/mysql-test/main/check_constraint.test +++ b/mysql-test/main/check_constraint.test @@ -176,3 +176,11 @@ select * from t1 where a is null; --error ER_CONSTRAINT_FAILED insert t1 (b) values (1); drop table t1; + +--echo # +--echo # MDEV-24274 ALTER TABLE with CHECK CONSTRAINTS gives "Out of Memory" error +--echo # +create table t1 (id varchar(2), constraint id check (id regexp '[a-z]')); +alter table t1 force; +show create table t1; +drop table t1; diff --git a/mysql-test/main/contributors.result b/mysql-test/main/contributors.result index 3e4bf5f0d43..0c7ca03a2c5 100644 --- a/mysql-test/main/contributors.result +++ b/mysql-test/main/contributors.result @@ -1,21 +1,16 @@ SHOW CONTRIBUTORS; Name Location Comment -Booking.com https://www.booking.com Founding member, Platinum Sponsor of the MariaDB Foundation Alibaba Cloud https://www.alibabacloud.com/ Platinum Sponsor of the MariaDB Foundation Tencent Cloud https://cloud.tencent.com Platinum Sponsor of the MariaDB Foundation Microsoft https://microsoft.com/ Platinum Sponsor of the MariaDB Foundation MariaDB Corporation https://mariadb.com Founding member, Platinum Sponsor of the MariaDB Foundation +ServiceNow https://servicenow.com Platinum Sponsor of the MariaDB Foundation Visma https://visma.com Gold Sponsor of the MariaDB Foundation DBS https://dbs.com Gold Sponsor of the MariaDB Foundation IBM https://www.ibm.com Gold Sponsor of the MariaDB Foundation -Tencent Games http://game.qq.com/ Gold Sponsor of the MariaDB Foundation -Nexedi https://www.nexedi.com Silver Sponsor of the MariaDB Foundation -Acronis https://www.acronis.com Silver Sponsor of the MariaDB Foundation -Verkkokauppa.com https://www.verkkokauppa.com Bronze Sponsor of the MariaDB Foundation -Virtuozzo https://virtuozzo.com Bronze Sponsor of the MariaDB Foundation -Tencent Game DBA http://tencentdba.com/about Bronze Sponsor of the MariaDB Foundation -Tencent TDSQL http://tdsql.org Bronze Sponsor of the MariaDB Foundation -Percona https://www.percona.com/ Bronze Sponsor of the MariaDB Foundation +Automattic https://automattic.com Silver Sponsor of the MariaDB Foundation +Percona https://www.percona.com/ Sponsor of the MariaDB Foundation +Galera Cluster https://galeracluster.com Sponsor of the MariaDB Foundation Google USA Sponsoring encryption, parallel replication and GTID Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction diff --git a/mysql-test/main/create.result b/mysql-test/main/create.result index 2905103b707..39ede1f90b9 100644 --- a/mysql-test/main/create.result +++ b/mysql-test/main/create.result @@ -1,7 +1,4 @@ call mtr.add_suppression("table or database name 't-1'"); -drop table if exists t1,t2,t3,t4,t5; -drop database if exists mysqltest; -drop view if exists v1; create table t1 (b char(0)); insert into t1 values (""),(null); select * from t1; @@ -1225,7 +1222,7 @@ drop table if exists t1,t2,t3; # Fix modified for MariaDB: we support this syntax create table t1 (a int) transactional=0; Warnings: -Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1' +Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=0' create table t2 (a int) page_checksum=1; create table t3 (a int) row_format=page; drop table t1,t2,t3; @@ -2001,19 +1998,42 @@ alter table t1 add key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0064 (f64) comment 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'; ERROR HY000: Cannot create table `t1`: index information is too long. Decrease number of indexes or use shorter index names or shorter comments. drop table t1; -End of 5.5 tests +# +# End of 5.5 tests +# +# +# MDEV-4880 Attempt to create a table without columns produces ER_ILLEGAL_HA instead of ER_TABLE_MUST_HAVE_COLUMNS +# create table t1; ERROR 42000: A table must have at least 1 column +# +# MDEV-11231 Server crashes in check_duplicate_key on CREATE TABLE ... SELECT +# create table t1 (i int, j int, key(i), key(i)) as select 1 as i, 2 as j; Warnings: Note 1831 Duplicate index `i_2`. This is deprecated and will be disallowed in a future release drop table t1; +# +# End of 10.0 tests +# +# +# MDEV-18428 Memory: If transactional=0 is specified in CREATE TABLE, it is not possible to ALTER TABLE +# +create table t1 (c int(10) unsigned) engine=memory transactional=0; +ERROR HY000: Table storage engine 'MEMORY' does not support the create option 'TRANSACTIONAL=0' +# +# End of 10.2 tests +# +# +# MDEV-17544 No warning when trying to name a primary key constraint. +# CREATE TABLE t1 ( id1 INT, id2 INT, CONSTRAINT `foo` PRIMARY KEY (id1), CONSTRAINT `bar` UNIQUE KEY(id2)); Warnings: Warning 1280 Name 'foo' ignored for PRIMARY key. DROP TABLE t1; # -# 10.4 Test +# End of 10.3 tests +# # # MDEV-21017: Assertion `!is_set() || (m_status == DA_OK_BULK && # is_bulk_op())' failed or late ER_PERIOD_FIELD_WRONG_ATTRIBUTES @@ -2026,4 +2046,6 @@ e DATE, PERIOD FOR app(s,e)); ERROR HY000: Period field `s` cannot be GENERATED ALWAYS AS UNLOCK TABLES; DROP TABLE t1; -# End of 10.4 Test +# +# End of 10.4 tests +# diff --git a/mysql-test/main/create.test b/mysql-test/main/create.test index a6a6ba0c782..adac81f02c5 100644 --- a/mysql-test/main/create.test +++ b/mysql-test/main/create.test @@ -5,12 +5,6 @@ call mtr.add_suppression("table or database name 't-1'"); # Check some special create statements. # ---disable_warnings -drop table if exists t1,t2,t3,t4,t5; -drop database if exists mysqltest; -drop view if exists v1; ---enable_warnings - create table t1 (b char(0)); insert into t1 values (""),(null); select * from t1; @@ -29,30 +23,30 @@ drop table t1; # Test of some CREATE TABLE'S that should fail # ---error 1146 +--error ER_NO_SUCH_TABLE create table t2 engine=heap select * from t1; ---error 1146 +--error ER_NO_SUCH_TABLE create table t2 select auto+1 from t1; drop table if exists t1,t2; ---error 1167 +--error ER_WRONG_KEY_COLUMN create table t1 (b char(0) not null, index(b)); ---error 1163 +--error ER_TABLE_CANT_HANDLE_BLOB create table t1 (a int not null,b text) engine=heap; drop table if exists t1; ---error 1075 +--error ER_WRONG_AUTO_KEY create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap; --- error 1049 +--error ER_BAD_DB_ERROR create table not_existing_database.test (a int); create table `a/a` (a int); show create table `a/a`; create table t1 like `a/a`; drop table `a/a`; drop table `t1`; ---error 1103 +--error ER_WRONG_TABLE_NAME create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int); ---error 1059 +--error ER_TOO_LONG_IDENT create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int); # @@ -62,17 +56,17 @@ create table t1 (a datetime default now()); drop table t1; create table t1 (a datetime on update now()); drop table t1; ---error 1067 +--error ER_INVALID_DEFAULT create table t1 (a int default 100 auto_increment); ---error 1067 +--error ER_INVALID_DEFAULT create table t1 (a tinyint default 1000); ---error 1067 +--error ER_INVALID_DEFAULT create table t1 (a varchar(5) default 'abcdef'); create table t1 (a varchar(5) default 'abcde'); insert into t1 values(); select * from t1; ---error 1067 +--error ER_INVALID_DEFAULT SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR alter table t1 alter column a set default 'abcdef'; drop table t1; @@ -97,13 +91,13 @@ create table mysqltest.test2$ (a int); drop table mysqltest.test2$; drop database mysqltest; ---error 1103 +--error ER_WRONG_TABLE_NAME create table `` (a int); ---error 1103 +--error ER_WRONG_TABLE_NAME drop table if exists ``; ---error 1166 +--error ER_WRONG_COLUMN_NAME create table t1 (`` int); ---error 1280 +--error ER_WRONG_NAME_FOR_INDEX create table t1 (i int, index `` (i)); # @@ -158,13 +152,13 @@ create table t2 (a int) select * from t1; describe t1; describe t2; drop table if exists t2; ---error 1060 +--error ER_DUP_FIELDNAME create table t2 (a int, a float) select * from t1; drop table if exists t2; ---error 1060 +--error ER_DUP_FIELDNAME create table t2 (a int) select a as b, a+1 as b from t1; drop table if exists t2; ---error 1060 +--error ER_DUP_FIELDNAME create table t2 (b int) select a as b, a+1 as b from t1; drop table if exists t1,t2; @@ -176,7 +170,7 @@ CREATE TABLE t1 (a int not null); INSERT INTO t1 values (1),(2),(1); --error ER_DUP_ENTRY CREATE TABLE t2 (primary key(a)) SELECT * FROM t1; ---error 1146 +--error ER_NO_SUCH_TABLE SELECT * from t2; DROP TABLE t1; DROP TABLE IF EXISTS t2; @@ -202,7 +196,7 @@ SELECT @@storage_engine; CREATE TABLE t1 (a int not null); show create table t1; drop table t1; ---error 1286 +--error ER_UNKNOWN_STORAGE_ENGINE SET SESSION storage_engine="gemini"; SELECT @@storage_engine; CREATE TABLE t1 (a int not null); @@ -216,11 +210,11 @@ drop table t1; # create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2)); insert into t1 values ("a", 1), ("b", 2); ---error 1048 +--error ER_BAD_NULL_ERROR insert into t1 values ("c", NULL); ---error 1048 +--error ER_BAD_NULL_ERROR insert into t1 values (NULL, 3); ---error 1048 +--error ER_BAD_NULL_ERROR insert into t1 values (NULL, NULL); drop table t1; @@ -262,11 +256,11 @@ drop table t1; # "Table truncated when creating another table name with Spaces" # ---error 1103 +--error ER_WRONG_TABLE_NAME create table `t1 `(a int); ---error 1102 +--error ER_WRONG_DB_NAME create database `db1 `; ---error 1166 +--error ER_WRONG_COLUMN_NAME create table t1(`a ` int); # @@ -274,11 +268,11 @@ create table t1(`a ` int); # "Parser permits multiple commas without syntax error" # ---error 1064 +--error ER_PARSE_ERROR create table t1 (a int,); ---error 1064 +--error ER_PARSE_ERROR create table t1 (a int,,b int); ---error 1064 +--error ER_PARSE_ERROR create table t1 (,b int); # @@ -320,13 +314,13 @@ create table t2 like t3; show create table t2; select * from t2; create table t3 like t1; ---error 1050 +--error ER_TABLE_EXISTS_ERROR create table t3 like mysqltest.t3; ---error 1049 +--error ER_BAD_DB_ERROR create table non_existing_database.t1 like t1; --error ER_NO_SUCH_TABLE create table t4 like non_existing_table; ---error 1050 +--error ER_TABLE_EXISTS_ERROR create temporary table t3 like t1; drop table t1, t2, t3; drop table t3; @@ -360,7 +354,7 @@ SELECT @@storage_engine; CREATE TABLE t1 (a int not null); show create table t1; drop table t1; ---error 1286 +--error ER_UNKNOWN_STORAGE_ENGINE SET SESSION storage_engine="gemini"; SELECT @@storage_engine; CREATE TABLE t1 (a int not null); @@ -480,9 +474,9 @@ use test; # Test for Bug 856 'Naming a key "Primary" causes trouble' # ---error 1280 +--error ER_WRONG_NAME_FOR_INDEX create table t1 (a int, index `primary` (a)); ---error 1280 +--error ER_WRONG_NAME_FOR_INDEX create table t1 (a int, index `PRIMARY` (a)); create table t1 (`primary` int, index(`primary`)); @@ -491,9 +485,9 @@ create table t2 (`PRIMARY` int, index(`PRIMARY`)); show create table t2; create table t3 (a int); ---error 1280 +--error ER_WRONG_NAME_FOR_INDEX alter table t3 add index `primary` (a); ---error 1280 +--error ER_WRONG_NAME_FOR_INDEX alter table t3 add index `PRIMARY` (a); create table t4 (`primary` int); @@ -548,11 +542,11 @@ drop table t1; # # Bug#10413: Invalid column name is not rejected # ---error 1103 +--error ER_WRONG_TABLE_NAME create table t1(column.name int); ---error 1103 +--error ER_WRONG_TABLE_NAME create table t1(test.column.name int); ---error 1102 +--error ER_WRONG_DB_NAME create table t1(xyz.t1.name int); create table t1(t1.name int); create table t2(test.t2.name int); @@ -591,7 +585,7 @@ drop table if exists test.t1; create database mysqltest; use mysqltest; create view v1 as select 'foo' from dual; ---error 1347 +--error ER_WRONG_OBJECT create table t1 like v1; drop view v1; drop database mysqltest; @@ -712,7 +706,7 @@ drop table t1, t2; # # Bug #15316 SET value having comma not correctly handled # ---error 1367 +--error ER_ILLEGAL_VALUE_FOR_TYPE create table t1(a set("a,b","c,d") not null); # End of 4.1 tests @@ -914,9 +908,9 @@ INSERT IGNORE INTO t1 (b) VALUES (5); CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY) SELECT a FROM t1; ---error 1062 +--error ER_DUP_ENTRY INSERT INTO t2 SELECT a FROM t1; ---error 1062 +--error ER_DUP_ENTRY INSERT INTO t2 SELECT a FROM t1; DROP TABLE t1, t2; @@ -976,24 +970,24 @@ drop table t1,t2; # Test incorrect database names # ---error 1102 +--error ER_WRONG_DB_NAME CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; ---error 1102 +--error ER_WRONG_DB_NAME DROP DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; # TODO: enable these tests when RENAME DATABASE is implemented. -# --error 1049 +# --error ER_BAD_DB_ERROR # RENAME DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa TO a; -# --error 1102 +# --error ER_WRONG_DB_NAME # RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; # create database mysqltest; -# --error 1102 +# --error ER_WRONG_DB_NAME # RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; # drop database mysqltest; ---error 1102 +--error ER_WRONG_DB_NAME USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; ---error 1102 +--error ER_WRONG_DB_NAME SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; # @@ -1853,28 +1847,46 @@ alter table t1 add key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0064 (f64) comment 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'; drop table t1; ---echo End of 5.5 tests +--echo # +--echo # End of 5.5 tests +--echo # -# -# MDEV-4880 Attempt to create a table without columns produces ER_ILLEGAL_HA instead of ER_TABLE_MUST_HAVE_COLUMNS -# +--echo # +--echo # MDEV-4880 Attempt to create a table without columns produces ER_ILLEGAL_HA instead of ER_TABLE_MUST_HAVE_COLUMNS +--echo # --error ER_TABLE_MUST_HAVE_COLUMNS create table t1; -# -# MDEV-11231 Server crashes in check_duplicate_key on CREATE TABLE ... SELECT -# +--echo # +--echo # MDEV-11231 Server crashes in check_duplicate_key on CREATE TABLE ... SELECT +--echo # create table t1 (i int, j int, key(i), key(i)) as select 1 as i, 2 as j; drop table t1; -# -# MDEV-17544 No warning when trying to name a primary key constraint. -# +--echo # +--echo # End of 10.0 tests +--echo # + +--echo # +--echo # MDEV-18428 Memory: If transactional=0 is specified in CREATE TABLE, it is not possible to ALTER TABLE +--echo # +--error ER_ILLEGAL_HA_CREATE_OPTION +create table t1 (c int(10) unsigned) engine=memory transactional=0; + +--echo # +--echo # End of 10.2 tests +--echo # + +--echo # +--echo # MDEV-17544 No warning when trying to name a primary key constraint. +--echo # CREATE TABLE t1 ( id1 INT, id2 INT, CONSTRAINT `foo` PRIMARY KEY (id1), CONSTRAINT `bar` UNIQUE KEY(id2)); DROP TABLE t1; --echo # ---echo # 10.4 Test +--echo # End of 10.3 tests +--echo # + --echo # --echo # MDEV-21017: Assertion `!is_set() || (m_status == DA_OK_BULK && --echo # is_bulk_op())' failed or late ER_PERIOD_FIELD_WRONG_ATTRIBUTES @@ -1890,4 +1902,6 @@ e DATE, PERIOD FOR app(s,e)); UNLOCK TABLES; DROP TABLE t1; ---echo # End of 10.4 Test +--echo # +--echo # End of 10.4 tests +--echo # diff --git a/mysql-test/main/cte_nonrecursive.result b/mysql-test/main/cte_nonrecursive.result index d23618344bd..f50ac50ded9 100644 --- a/mysql-test/main/cte_nonrecursive.result +++ b/mysql-test/main/cte_nonrecursive.result @@ -571,7 +571,7 @@ with t as (select a from t1 where b >= 'c') select * from t2,t where t2.c=t.a; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where `t1`.`b` >= 'c')select `t2`.`c` AS `c`,`t`.`a` AS `a` from (`t2` join `t`) where `t2`.`c` = `t`.`a` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `test`.`t2`.`c` AS `c`,`t`.`a` AS `a` from (`test`.`t2` join `t`) where `test`.`t2`.`c` = `t`.`a` latin1 latin1_swedish_ci select * from v1; c a 4 4 @@ -588,7 +588,7 @@ with t as (select a, count(*) from t1 where b >= 'c' group by a) select * from t2,t where t2.c=t.a; show create view v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS with t as (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` where `t1`.`b` >= 'c' group by `t1`.`a`)select `t2`.`c` AS `c`,`t`.`a` AS `a`,`t`.`count(*)` AS `count(*)` from (`t2` join `t`) where `t2`.`c` = `t`.`a` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS with t as (select `test`.`t1`.`a` AS `a`,count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` >= 'c' group by `test`.`t1`.`a`)select `test`.`t2`.`c` AS `c`,`t`.`a` AS `a`,`t`.`count(*)` AS `count(*)` from (`test`.`t2` join `t`) where `test`.`t2`.`c` = `t`.`a` latin1 latin1_swedish_ci select * from v2; c a count(*) 4 4 2 @@ -606,7 +606,7 @@ with t(c) as (select a from t1 where b >= 'c') select * from t r1 where r1.c=4; show create view v3; View Create View character_set_client collation_connection -v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS with t(c) as (select `t1`.`a` AS `c` from `t1` where `t1`.`b` >= 'c')select `r1`.`c` AS `c` from `t` `r1` where `r1`.`c` = 4 latin1 latin1_swedish_ci +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS with t(c) as (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `r1`.`c` AS `c` from `t` `r1` where `r1`.`c` = 4 latin1 latin1_swedish_ci select * from v3; c 4 @@ -618,7 +618,7 @@ with t(c) as (select a from t1 where b >= 'c') select * from t r1, t r2 where r1.c=r2.c and r2.c=4; show create view v4; View Create View character_set_client collation_connection -v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS with t(c) as (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `r1`.`c` AS `c`,`r2`.`c` AS `d` from (`t` `r1` join (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c') `r2`) where `r1`.`c` = `r2`.`c` and `r2`.`c` = 4 latin1 latin1_swedish_ci +v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS with t(c) as (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `r1`.`c` AS `c`,`r2`.`c` AS `d` from (`t` `r1` join `t` `r2`) where `r1`.`c` = `r2`.`c` and `r2`.`c` = 4 latin1 latin1_swedish_ci select * from v4; c d 4 4 @@ -1126,7 +1126,7 @@ NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL NULL NULL UNION RESULT <union11,12> ALL NULL NULL NULL NULL NULL NULL NULL UNION RESULT <union1,6> ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 with cte_e as (with cte_o as (with cte_i as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1 union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1)select `cte_e1`.`a` AS `a` from `cte_e` `cte_e1` where `cte_e1`.`a` > 1 union select `cte_e2`.`a` AS `a` from (with cte_o as (with cte_i as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7) `cte_e2` +Note 1003 with cte_e as (with cte_o as (with cte_i as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1 union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1)select `cte_e1`.`a` AS `a` from `cte_e` `cte_e1` where `cte_e1`.`a` > 1 union select `cte_e2`.`a` AS `a` from `cte_e` `cte_e2` drop table t1; # # MDEV-13753: embedded CTE in a VIEW created in prepared statement @@ -1349,7 +1349,7 @@ r.r_regionkey in select r_regionkey from t where r_name <> "ASIA"); show create view v; View Create View character_set_client collation_connection -v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `n`.`n_nationkey` AS `n_nationkey`,`n`.`n_name` AS `n_name`,`n`.`n_regionkey` AS `n_regionkey`,`r`.`r_regionkey` AS `r_regionkey`,`r`.`r_name` AS `r_name` from (`nation` `n` join `region` `r`) where `n`.`n_regionkey` = `r`.`r_regionkey` and `r`.`r_regionkey` in (with t as (select `region`.`r_regionkey` AS `r_regionkey`,`region`.`r_name` AS `r_name` from `region` where `region`.`r_regionkey` <= 3)select `t`.`r_regionkey` from `t` where `t`.`r_name` <> 'ASIA') latin1 latin1_swedish_ci +v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `n`.`n_nationkey` AS `n_nationkey`,`n`.`n_name` AS `n_name`,`n`.`n_regionkey` AS `n_regionkey`,`r`.`r_regionkey` AS `r_regionkey`,`r`.`r_name` AS `r_name` from (`test`.`nation` `n` join `test`.`region` `r`) where `n`.`n_regionkey` = `r`.`r_regionkey` and `r`.`r_regionkey` in (with t as (select `test`.`region`.`r_regionkey` AS `r_regionkey`,`test`.`region`.`r_name` AS `r_name` from `test`.`region` where `test`.`region`.`r_regionkey` <= 3)select `t`.`r_regionkey` from `t` where `t`.`r_name` <> 'ASIA') latin1 latin1_swedish_ci select * from v; n_nationkey n_name n_regionkey r_regionkey r_name 0 ALGERIA 0 0 AFRICA @@ -1690,6 +1690,79 @@ ERROR 3D000: No database selected DROP TABLE test.t; connection default; disconnect con1; +# +# MDEV-22781: create view with CTE without default database +# +drop database test; +create database db1; +create table db1.t1 (a int); +insert into db1.t1 values (3),(7),(1); +create view db1.v1 as with t as (select * from db1.t1) select * from t; +show create view db1.v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `db1`.`v1` AS with t as (select `db1`.`t1`.`a` AS `a` from `db1`.`t1`)select `t`.`a` AS `a` from `t` latin1 latin1_swedish_ci +select * from db1.v1; +a +3 +7 +1 +drop view db1.v1; +prepare stmt from " +create view db1.v1 as with t as (select * from db1.t1) select * from t; +"; +execute stmt; +deallocate prepare stmt; +show create view db1.v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `db1`.`v1` AS with t as (select `db1`.`t1`.`a` AS `a` from `db1`.`t1`)select `t`.`a` AS `a` from `t` latin1 latin1_swedish_ci +select * from db1.v1; +a +3 +7 +1 +drop view db1.v1; +drop table db1.t1; +drop database db1; +create database test; +use test; +# +# MDEV-24597: CTE with union used multiple times in query +# +with cte(a) as +(select 1 as d union select 2 as d) +select a from cte as r1 +union +select a from cte as r2; +a +1 +2 +create table t1 (a int, b int) engine=myisam; +insert into t1 values +(3,30), (7,70), (1,10), (7,71), (2,20), (7,72), (3,33), (4,44), +(5,50), (4,40), (3,33), (4,42), (4,43), (5,51); +with cte(c) as +(select a from t1 where b < 30 union select a from t1 where b > 40) +select * from cte as r1, cte as r2 where r1.c = r2.c; +c c +1 1 +2 2 +7 7 +4 4 +5 5 +with cte(a,c) as +( +select a, count(*) from t1 group by a having count(*) = 1 +union +select a, count(*) from t1 group by a having count(*) = 3 +) +select a, c from cte as r1 where a < 3 +union +select a, c from cte as r2 where a > 4; +a c +1 1 +2 1 +7 3 +drop table t1; # End of 10.2 tests # # MDEV-21673: several references to CTE that uses diff --git a/mysql-test/main/cte_nonrecursive.test b/mysql-test/main/cte_nonrecursive.test index 1f5b2a6b70d..49df2bb9ec0 100644 --- a/mysql-test/main/cte_nonrecursive.test +++ b/mysql-test/main/cte_nonrecursive.test @@ -1201,6 +1201,66 @@ DROP TABLE test.t; --connection default --disconnect con1 +--echo # +--echo # MDEV-22781: create view with CTE without default database +--echo # + +drop database test; +create database db1; +create table db1.t1 (a int); +insert into db1.t1 values (3),(7),(1); + +create view db1.v1 as with t as (select * from db1.t1) select * from t; +show create view db1.v1; +select * from db1.v1; +drop view db1.v1; + +prepare stmt from " +create view db1.v1 as with t as (select * from db1.t1) select * from t; +"; +execute stmt; +deallocate prepare stmt; +show create view db1.v1; +select * from db1.v1; +drop view db1.v1; + +drop table db1.t1; +drop database db1; + +create database test; +use test; + +--echo # +--echo # MDEV-24597: CTE with union used multiple times in query +--echo # + +with cte(a) as +(select 1 as d union select 2 as d) +select a from cte as r1 +union +select a from cte as r2; + +create table t1 (a int, b int) engine=myisam; +insert into t1 values +(3,30), (7,70), (1,10), (7,71), (2,20), (7,72), (3,33), (4,44), +(5,50), (4,40), (3,33), (4,42), (4,43), (5,51); + +with cte(c) as +(select a from t1 where b < 30 union select a from t1 where b > 40) +select * from cte as r1, cte as r2 where r1.c = r2.c; + +with cte(a,c) as +( + select a, count(*) from t1 group by a having count(*) = 1 + union + select a, count(*) from t1 group by a having count(*) = 3 +) +select a, c from cte as r1 where a < 3 +union +select a, c from cte as r2 where a > 4; + +drop table t1; + --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/cte_nonrecursive_not_embedded.result b/mysql-test/main/cte_nonrecursive_not_embedded.result new file mode 100644 index 00000000000..c96a1ec2849 --- /dev/null +++ b/mysql-test/main/cte_nonrecursive_not_embedded.result @@ -0,0 +1,48 @@ +# +# MDEV-20751: query using many CTEs with grant_tables enabled +# +connection default; +CREATE DATABASE db; +USE db; +CREATE TABLE t1 (a int) ENGINE=MYISAM; +INSERT INTO t1 VALUES (3), (7), (1); +CREATE TABLE t2 (a int) ENGINE=MYISAM; +INSERT INTO t2 VALUES (2), (8), (4); +CREATE USER 'u1'@'localhost'; +GRANT USAGE ON db.* TO 'u1'@'localhost'; +GRANT SELECT ON db.t1 TO 'u1'@'localhost'; +FLUSH PRIVILEGES; +connect u1,'localhost',u1,,; +connection u1; +USE db; +WITH +cte1 AS +(SELECT a FROM t1), +cte2 AS +(SELECT cte1.a FROM t1,cte1 WHERE cte1.a = t1.a), +cte3 AS +(SELECT cte2.a FROM t1,cte1,cte2 WHERE cte1.a = t1.a AND t1.a = cte2.a), +cte4 AS +(SELECT cte2.a FROM t1,cte2 WHERE cte2.a = t1.a) +SELECT * FROM cte4 as r; +a +3 +7 +1 +WITH +cte1 AS +(SELECT a FROM t2), +cte2 AS +(SELECT cte1.a FROM t2,cte1 WHERE cte1.a = t2.a), +cte3 AS +(SELECT cte2.a FROM t2,cte1,cte2 WHERE cte1.a = t2.a AND t2.a = cte2.a), +cte4 AS +(SELECT cte2.a FROM t2,cte2 WHERE cte2.a = t2.a) +SELECT * FROM cte4 as r; +ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table 't2' +disconnect u1; +connection default; +DROP USER 'u1'@'localhost'; +DROP DATABASE db; +USE test; +# End of 10.2 tests diff --git a/mysql-test/main/cte_nonrecursive_not_embedded.test b/mysql-test/main/cte_nonrecursive_not_embedded.test new file mode 100644 index 00000000000..e80baeaf591 --- /dev/null +++ b/mysql-test/main/cte_nonrecursive_not_embedded.test @@ -0,0 +1,58 @@ +-- source include/not_embedded.inc + +--echo # +--echo # MDEV-20751: query using many CTEs with grant_tables enabled +--echo # + +--connection default + +CREATE DATABASE db; +USE db; + +CREATE TABLE t1 (a int) ENGINE=MYISAM; +INSERT INTO t1 VALUES (3), (7), (1); +CREATE TABLE t2 (a int) ENGINE=MYISAM; +INSERT INTO t2 VALUES (2), (8), (4); + + +CREATE USER 'u1'@'localhost'; +GRANT USAGE ON db.* TO 'u1'@'localhost'; +GRANT SELECT ON db.t1 TO 'u1'@'localhost'; +FLUSH PRIVILEGES; + +--connect (u1,'localhost',u1,,) +--connection u1 +USE db; + +WITH +cte1 AS +(SELECT a FROM t1), +cte2 AS +(SELECT cte1.a FROM t1,cte1 WHERE cte1.a = t1.a), +cte3 AS +(SELECT cte2.a FROM t1,cte1,cte2 WHERE cte1.a = t1.a AND t1.a = cte2.a), +cte4 AS +(SELECT cte2.a FROM t1,cte2 WHERE cte2.a = t1.a) +SELECT * FROM cte4 as r; + +--error ER_TABLEACCESS_DENIED_ERROR +WITH +cte1 AS +(SELECT a FROM t2), +cte2 AS +(SELECT cte1.a FROM t2,cte1 WHERE cte1.a = t2.a), +cte3 AS +(SELECT cte2.a FROM t2,cte1,cte2 WHERE cte1.a = t2.a AND t2.a = cte2.a), +cte4 AS +(SELECT cte2.a FROM t2,cte2 WHERE cte2.a = t2.a) +SELECT * FROM cte4 as r; + +--disconnect u1 +--connection default + +DROP USER 'u1'@'localhost'; +DROP DATABASE db; + +USE test; + +--echo # End of 10.2 tests diff --git a/mysql-test/main/cte_recursive.result b/mysql-test/main/cte_recursive.result index 960bce44e58..6f30de39b46 100644 --- a/mysql-test/main/cte_recursive.result +++ b/mysql-test/main/cte_recursive.result @@ -818,7 +818,7 @@ where p.id = a.father or p.id = a.mother select * from ancestors; show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with recursive ancestors as (select `folks`.`id` AS `id`,`folks`.`name` AS `name`,`folks`.`dob` AS `dob`,`folks`.`father` AS `father`,`folks`.`mother` AS `mother` from `folks` where `folks`.`name` = 'Me' and `folks`.`dob` = '2000-01-01' union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`folks` `p` join `ancestors` `a`) where `p`.`id` = `a`.`father` or `p`.`id` = `a`.`mother`)select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with recursive ancestors as (select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' and `test`.`folks`.`dob` = '2000-01-01' union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`test`.`folks` `p` join `ancestors` `a`) where `p`.`id` = `a`.`father` or `p`.`id` = `a`.`mother`)select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` latin1 latin1_swedish_ci select * from v1; id name dob father mother 100 Me 2000-01-01 20 30 @@ -849,7 +849,7 @@ where p.id = ma.mother select * from ancestors; show create view v2; View Create View character_set_client collation_connection -v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS with recursive ancestors as (select `folks`.`id` AS `id`,`folks`.`name` AS `name`,`folks`.`dob` AS `dob`,`folks`.`father` AS `father`,`folks`.`mother` AS `mother` from `folks` where `folks`.`name` = 'Me' union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`folks` `p` join `ancestors` `fa`) where `p`.`id` = `fa`.`father` union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`folks` `p` join `ancestors` `ma`) where `p`.`id` = `ma`.`mother`)select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` latin1 latin1_swedish_ci +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS with recursive ancestors as (select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`test`.`folks` `p` join `ancestors` `fa`) where `p`.`id` = `fa`.`father` union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`test`.`folks` `p` join `ancestors` `ma`) where `p`.`id` = `ma`.`mother`)select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` latin1 latin1_swedish_ci select * from v2; id name dob father mother 100 Me 2000-01-01 20 30 @@ -1301,7 +1301,7 @@ select ancestors.name, ancestors.dob from ancestors; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived4> ALL NULL NULL NULL NULL 24 4 DERIVED folks ALL NULL NULL NULL NULL 12 Using where -6 RECURSIVE UNION <derived3> ALL NULL NULL NULL NULL 12 +6 UNION <derived3> ALL NULL NULL NULL NULL 12 5 RECURSIVE UNION <derived4> ALL NULL NULL NULL NULL 24 NULL UNION RESULT <union4,6,5> ALL NULL NULL NULL NULL NULL 3 DERIVED folks ALL NULL NULL NULL NULL 12 Using where @@ -4029,7 +4029,7 @@ id select_type table type possible_keys key key_len ref rows Extra 3 RECURSIVE UNION t1 ALL NULL NULL NULL NULL 4 Using where 3 RECURSIVE UNION <derived2> ref key0 key0 9 test.t1.c 2 NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL -4 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 4 +4 UNION <derived2> ALL NULL NULL NULL NULL 4 with recursive r_cte as ( select * from t1 as s union @@ -4237,6 +4237,269 @@ a b c deallocate prepare stmt; drop table t1; # +# MDEV-24019: query with recursive CTE when no default database is set +# +drop database test; +with recursive a as +(select 1 from dual union select * from a as r) +select * from a; +1 +1 +create database db1; +create table db1.t1 (a int); +insert into db1.t1 values (3), (7), (1); +with recursive cte as +(select * from db1.t1 union select * from (select * from cte) as t) +select * from cte; +a +3 +7 +1 +explain with recursive cte as +(select * from db1.t1 union select * from (select * from cte) as t) +select * from cte; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 +2 DERIVED t1 ALL NULL NULL NULL NULL 3 +3 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 3 +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +prepare stmt from "with recursive cte as +(select * from db1.t1 union select * from (select * from cte) as t) +select * from cte"; +execute stmt; +a +3 +7 +1 +execute stmt; +a +3 +7 +1 +deallocate prepare stmt; +drop database db1; +create database test; +use test; +# +# MDEV-23406: query with mutually recursive CTEs when big_tables=1 +# +set @save_big_tables=@@big_tables; +set big_tables=1; +create table folks(id int, name char(32), dob date, father int, mother int); +insert into folks values +(100, 'Me', '2000-01-01', 20, 30), +(20, 'Dad', '1970-02-02', 10, 9), +(30, 'Mom', '1975-03-03', 8, 7), +(10, 'Grandpa Bill', '1940-04-05', null, null), +(9, 'Grandma Ann', '1941-10-15', null, null), +(25, 'Uncle Jim', '1968-11-18', 8, 7), +(98, 'Sister Amy', '2001-06-20', 20, 30), +(7, 'Grandma Sally', '1943-08-23', null, 6), +(8, 'Grandpa Ben', '1940-10-21', null, null), +(6, 'Grandgrandma Martha', '1923-05-17', null, null), +(67, 'Cousin Eddie', '1992-02-28', 25, 27), +(27, 'Auntie Melinda', '1971-03-29', null, null); +with recursive +ancestor_couples(h_id, h_name, h_dob, h_father, h_mother, +w_id, w_name, w_dob, w_father, w_mother) +as +( +select h.*, w.* +from folks h, folks w, coupled_ancestors a +where a.father = h.id AND a.mother = w.id +union +select h.*, w.* +from folks v, folks h, folks w +where v.name = 'Me' and +(v.father = h.id AND v.mother= w.id) +), +coupled_ancestors (id, name, dob, father, mother) +as +( +select h_id, h_name, h_dob, h_father, h_mother +from ancestor_couples +union +select w_id, w_name, w_dob, w_father, w_mother +from ancestor_couples +) +select h_name, h_dob, w_name, w_dob +from ancestor_couples; +h_name h_dob w_name w_dob +Dad 1970-02-02 Mom 1975-03-03 +Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15 +Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23 +explain with recursive +ancestor_couples(h_id, h_name, h_dob, h_father, h_mother, +w_id, w_name, w_dob, w_father, w_mother) +as +( +select h.*, w.* +from folks h, folks w, coupled_ancestors a +where a.father = h.id AND a.mother = w.id +union +select h.*, w.* +from folks v, folks h, folks w +where v.name = 'Me' and +(v.father = h.id AND v.mother= w.id) +), +coupled_ancestors (id, name, dob, father, mother) +as +( +select h_id, h_name, h_dob, h_father, h_mother +from ancestor_couples +union +select w_id, w_name, w_dob, w_father, w_mother +from ancestor_couples +) +select h_name, h_dob, w_name, w_dob +from ancestor_couples; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived3> ALL NULL NULL NULL NULL 1728 +4 DERIVED <derived3> ALL NULL NULL NULL NULL 1728 +5 RECURSIVE UNION <derived3> ALL NULL NULL NULL NULL 1728 +NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL +3 DERIVED v ALL NULL NULL NULL NULL 12 Using where +3 DERIVED h ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) +3 DERIVED w ALL NULL NULL NULL NULL 12 Using where; Using join buffer (incremental, BNL join) +2 RECURSIVE UNION <derived4> ALL NULL NULL NULL NULL 2 +2 RECURSIVE UNION h ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) +2 RECURSIVE UNION w ALL NULL NULL NULL NULL 12 Using where; Using join buffer (incremental, BNL join) +NULL UNION RESULT <union3,2> ALL NULL NULL NULL NULL NULL +prepare stmt from "with recursive +ancestor_couples(h_id, h_name, h_dob, h_father, h_mother, +w_id, w_name, w_dob, w_father, w_mother) +as +( +select h.*, w.* +from folks h, folks w, coupled_ancestors a +where a.father = h.id AND a.mother = w.id +union +select h.*, w.* +from folks v, folks h, folks w +where v.name = 'Me' and +(v.father = h.id AND v.mother= w.id) +), +coupled_ancestors (id, name, dob, father, mother) +as +( +select h_id, h_name, h_dob, h_father, h_mother +from ancestor_couples +union +select w_id, w_name, w_dob, w_father, w_mother +from ancestor_couples +) +select h_name, h_dob, w_name, w_dob +from ancestor_couples"; +execute stmt; +h_name h_dob w_name w_dob +Dad 1970-02-02 Mom 1975-03-03 +Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15 +Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23 +execute stmt; +h_name h_dob w_name w_dob +Dad 1970-02-02 Mom 1975-03-03 +Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15 +Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23 +deallocate prepare stmt; +with recursive +ancestor_couples(h_id, h_name, h_dob, h_father, h_mother, +w_id, w_name, w_dob, w_father, w_mother) +as +( +select h.*, w.* +from folks h, folks w, coupled_ancestors a +where a.father = h.id AND a.mother = w.id +), +coupled_ancestors (id, name, dob, father, mother) +as +( +select * +from folks +where name = 'Me' + union all +select h_id, h_name, h_dob, h_father, h_mother +from ancestor_couples +union all +select w_id, w_name, w_dob, w_father, w_mother +from ancestor_couples +) +select h_name, h_dob, w_name, w_dob +from ancestor_couples; +h_name h_dob w_name w_dob +Dad 1970-02-02 Mom 1975-03-03 +Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15 +Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23 +explain with recursive +ancestor_couples(h_id, h_name, h_dob, h_father, h_mother, +w_id, w_name, w_dob, w_father, w_mother) +as +( +select h.*, w.* +from folks h, folks w, coupled_ancestors a +where a.father = h.id AND a.mother = w.id +), +coupled_ancestors (id, name, dob, father, mother) +as +( +select * +from folks +where name = 'Me' + union all +select h_id, h_name, h_dob, h_father, h_mother +from ancestor_couples +union all +select w_id, w_name, w_dob, w_father, w_mother +from ancestor_couples +) +select h_name, h_dob, w_name, w_dob +from ancestor_couples; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 +3 DERIVED folks ALL NULL NULL NULL NULL 12 Using where +4 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 2 +5 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 2 +NULL UNION RESULT <union3,4,5> ALL NULL NULL NULL NULL NULL +2 DERIVED h ALL NULL NULL NULL NULL 12 Using where +2 DERIVED <derived3> ref key0 key0 5 test.h.id 2 +2 DERIVED w ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) +prepare stmt from "with recursive +ancestor_couples(h_id, h_name, h_dob, h_father, h_mother, +w_id, w_name, w_dob, w_father, w_mother) +as +( +select h.*, w.* +from folks h, folks w, coupled_ancestors a +where a.father = h.id AND a.mother = w.id +), +coupled_ancestors (id, name, dob, father, mother) +as +( +select * +from folks +where name = 'Me' + union all +select h_id, h_name, h_dob, h_father, h_mother +from ancestor_couples +union all +select w_id, w_name, w_dob, w_father, w_mother +from ancestor_couples +) +select h_name, h_dob, w_name, w_dob +from ancestor_couples"; +execute stmt; +h_name h_dob w_name w_dob +Dad 1970-02-02 Mom 1975-03-03 +Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15 +Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23 +execute stmt; +h_name h_dob w_name w_dob +Dad 1970-02-02 Mom 1975-03-03 +Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15 +Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23 +deallocate prepare stmt; +drop table folks; +set big_tables=@save_big_tables; +# # End of 10.2 tests # # diff --git a/mysql-test/main/cte_recursive.test b/mysql-test/main/cte_recursive.test index 58264baac02..c3537e5bd0c 100644 --- a/mysql-test/main/cte_recursive.test +++ b/mysql-test/main/cte_recursive.test @@ -2726,6 +2726,135 @@ deallocate prepare stmt; drop table t1; --echo # +--echo # MDEV-24019: query with recursive CTE when no default database is set +--echo # + +drop database test; + +let $q= +with recursive a as + (select 1 from dual union select * from a as r) +select * from a; + +eval $q; + +create database db1; +create table db1.t1 (a int); +insert into db1.t1 values (3), (7), (1); + +let $q= +with recursive cte as + (select * from db1.t1 union select * from (select * from cte) as t) +select * from cte; + +eval $q; +eval explain $q; + +eval prepare stmt from "$q"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +drop database db1; + +create database test; +use test; + +--echo # +--echo # MDEV-23406: query with mutually recursive CTEs when big_tables=1 +--echo # + +set @save_big_tables=@@big_tables; +set big_tables=1; + +create table folks(id int, name char(32), dob date, father int, mother int); + +insert into folks values +(100, 'Me', '2000-01-01', 20, 30), +(20, 'Dad', '1970-02-02', 10, 9), +(30, 'Mom', '1975-03-03', 8, 7), +(10, 'Grandpa Bill', '1940-04-05', null, null), +(9, 'Grandma Ann', '1941-10-15', null, null), +(25, 'Uncle Jim', '1968-11-18', 8, 7), +(98, 'Sister Amy', '2001-06-20', 20, 30), +(7, 'Grandma Sally', '1943-08-23', null, 6), +(8, 'Grandpa Ben', '1940-10-21', null, null), +(6, 'Grandgrandma Martha', '1923-05-17', null, null), +(67, 'Cousin Eddie', '1992-02-28', 25, 27), +(27, 'Auntie Melinda', '1971-03-29', null, null); + +let q= +with recursive +ancestor_couples(h_id, h_name, h_dob, h_father, h_mother, + w_id, w_name, w_dob, w_father, w_mother) +as +( + select h.*, w.* + from folks h, folks w, coupled_ancestors a + where a.father = h.id AND a.mother = w.id + union + select h.*, w.* + from folks v, folks h, folks w + where v.name = 'Me' and + (v.father = h.id AND v.mother= w.id) +), +coupled_ancestors (id, name, dob, father, mother) +as +( + select h_id, h_name, h_dob, h_father, h_mother + from ancestor_couples + union + select w_id, w_name, w_dob, w_father, w_mother + from ancestor_couples +) +select h_name, h_dob, w_name, w_dob + from ancestor_couples; + +eval $q; +eval explain $q; +eval prepare stmt from "$q"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +let $q= +with recursive +ancestor_couples(h_id, h_name, h_dob, h_father, h_mother, + w_id, w_name, w_dob, w_father, w_mother) +as +( + select h.*, w.* + from folks h, folks w, coupled_ancestors a + where a.father = h.id AND a.mother = w.id +), +coupled_ancestors (id, name, dob, father, mother) +as +( + select * + from folks + where name = 'Me' + union all + select h_id, h_name, h_dob, h_father, h_mother + from ancestor_couples + union all + select w_id, w_name, w_dob, w_father, w_mother + from ancestor_couples +) +select h_name, h_dob, w_name, w_dob + from ancestor_couples; + +eval $q; +eval explain $q; +eval prepare stmt from "$q"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +drop table folks; + +set big_tables=@save_big_tables; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/ctype_utf16.result b/mysql-test/main/ctype_utf16.result index 3d634bc2005..3643e170376 100644 --- a/mysql-test/main/ctype_utf16.result +++ b/mysql-test/main/ctype_utf16.result @@ -1492,6 +1492,8 @@ ab AE AE SET max_sort_length=8; +Warnings: +Warning 1292 Truncated incorrect max_sort_length value: '8' SELECT * FROM t1 ORDER BY s1; s1 ab diff --git a/mysql-test/main/ctype_utf16le.result b/mysql-test/main/ctype_utf16le.result index 00eb559837b..d791d09d7d4 100644 --- a/mysql-test/main/ctype_utf16le.result +++ b/mysql-test/main/ctype_utf16le.result @@ -1765,6 +1765,8 @@ ab AE AE SET max_sort_length=8; +Warnings: +Warning 1292 Truncated incorrect max_sort_length value: '8' SELECT * FROM t1 ORDER BY s1; s1 ab diff --git a/mysql-test/main/ctype_utf32.result b/mysql-test/main/ctype_utf32.result index 49531570fd2..da71f6eb59c 100644 --- a/mysql-test/main/ctype_utf32.result +++ b/mysql-test/main/ctype_utf32.result @@ -1306,7 +1306,7 @@ create table t1 (a varchar(334) character set utf32 primary key); ERROR 42000: Specified key was too long; max key length is 1000 bytes create table t1 (a varchar(333) character set utf32, key(a)); Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes insert into t1 values (repeat('a',333)), (repeat('b',333)); flush tables; check table t1; @@ -1505,6 +1505,8 @@ ab AE AE SET max_sort_length=8; +Warnings: +Warning 1292 Truncated incorrect max_sort_length value: '8' SELECT * FROM t1 ORDER BY s1; s1 ab diff --git a/mysql-test/main/ctype_utf8.result b/mysql-test/main/ctype_utf8.result index 1ed593d10d4..4ca9b1e4cb7 100644 --- a/mysql-test/main/ctype_utf8.result +++ b/mysql-test/main/ctype_utf8.result @@ -6757,9 +6757,11 @@ DFFFDFFF9CFF9DFF9EFF # Checking strnxfrm() with odd length # set max_sort_length=9; +Warnings: +Warning 1292 Truncated incorrect max_sort_length value: '9' select @@max_sort_length; @@max_sort_length -9 +64 create table t1 (a varchar(128) character set utf8 collate utf8_general_ci); insert into t1 values ('a'),('b'),('c'); select * from t1 order by a; diff --git a/mysql-test/main/ctype_utf8mb4.result b/mysql-test/main/ctype_utf8mb4.result index 691ac51e241..2762873b9c7 100644 --- a/mysql-test/main/ctype_utf8mb4.result +++ b/mysql-test/main/ctype_utf8mb4.result @@ -1478,7 +1478,7 @@ a varchar(255) NOT NULL default '', KEY a (a) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes insert into t1 values (_utf8mb4 0xe880bd); insert into t1 values (_utf8mb4 0x5b); select hex(a) from t1; @@ -1526,7 +1526,7 @@ Warnings: Note 1051 Unknown table 'test.t1' CREATE TABLE t1(a VARCHAR(255), KEY(a)) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'); INSERT INTO t1 VALUES('uu'); check table t1; @@ -2371,10 +2371,10 @@ drop table t1; # # Check strnxfrm() with odd length # -set max_sort_length=9; +set max_sort_length=65; select @@max_sort_length; @@max_sort_length -9 +65 create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci); insert into t1 values ('a'),('b'),('c'); select * from t1 order by a; @@ -2726,7 +2726,7 @@ DEFAULT CHARACTER SET utf8, MODIFY subject varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, MODIFY p varchar(255) CHARACTER SET utf8; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/main/ctype_utf8mb4.test b/mysql-test/main/ctype_utf8mb4.test index 532729dafde..8fbbee872ce 100644 --- a/mysql-test/main/ctype_utf8mb4.test +++ b/mysql-test/main/ctype_utf8mb4.test @@ -1520,7 +1520,7 @@ drop table t1; --echo # --echo # Check strnxfrm() with odd length --echo # -set max_sort_length=9; +set max_sort_length=65; select @@max_sort_length; create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci); insert into t1 values ('a'),('b'),('c'); diff --git a/mysql-test/main/ctype_utf8mb4_heap.result b/mysql-test/main/ctype_utf8mb4_heap.result index 4aef2d8cb66..9eb7d48370f 100644 --- a/mysql-test/main/ctype_utf8mb4_heap.result +++ b/mysql-test/main/ctype_utf8mb4_heap.result @@ -2203,10 +2203,10 @@ drop table t1; # # Check strnxfrm() with odd length # -set max_sort_length=9; +set max_sort_length=65; select @@max_sort_length; @@max_sort_length -9 +65 create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci) engine heap; insert into t1 values ('a'),('b'),('c'); select * from t1 order by a; diff --git a/mysql-test/main/ctype_utf8mb4_innodb.result b/mysql-test/main/ctype_utf8mb4_innodb.result index 3c7d0ba2fb7..fc2a368f3f0 100644 --- a/mysql-test/main/ctype_utf8mb4_innodb.result +++ b/mysql-test/main/ctype_utf8mb4_innodb.result @@ -2329,10 +2329,10 @@ drop table t1; # # Check strnxfrm() with odd length # -set max_sort_length=9; +set max_sort_length=65; select @@max_sort_length; @@max_sort_length -9 +65 create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci) engine InnoDB; insert into t1 values ('a'),('b'),('c'); select * from t1 order by a; diff --git a/mysql-test/main/ctype_utf8mb4_myisam.result b/mysql-test/main/ctype_utf8mb4_myisam.result index fd8d7adf3a0..ee2bd4431fc 100644 --- a/mysql-test/main/ctype_utf8mb4_myisam.result +++ b/mysql-test/main/ctype_utf8mb4_myisam.result @@ -1443,7 +1443,7 @@ a varchar(255) NOT NULL default '', KEY a (a) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes insert into t1 values (_utf8mb4 0xe880bd); insert into t1 values (_utf8mb4 0x5b); select hex(a) from t1; @@ -1491,7 +1491,7 @@ Warnings: Note 1051 Unknown table 'test.t1' CREATE TABLE t1(a VARCHAR(255), KEY(a)) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'); INSERT INTO t1 VALUES('uu'); check table t1; @@ -2336,10 +2336,10 @@ drop table t1; # # Check strnxfrm() with odd length # -set max_sort_length=9; +set max_sort_length=65; select @@max_sort_length; @@max_sort_length -9 +65 create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci) engine MyISAM; insert into t1 values ('a'),('b'),('c'); select * from t1 order by a; diff --git a/mysql-test/main/deadlock_ftwrl.result b/mysql-test/main/deadlock_ftwrl.result new file mode 100644 index 00000000000..95eed70f664 --- /dev/null +++ b/mysql-test/main/deadlock_ftwrl.result @@ -0,0 +1,21 @@ +CREATE TABLE t1(a INT); +SELECT GET_LOCK("l1", 0); +GET_LOCK("l1", 0) +1 +connect con1,localhost,root,,; +LOCK TABLES t1 WRITE; +connection default; +set debug_sync='mdl_acquire_lock_wait SIGNAL ftwrl'; +FLUSH TABLES WITH READ LOCK; +connection con1; +set debug_sync='now WAIT_FOR ftwrl'; +SELECT GET_LOCK("l1", 1000); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +disconnect con1; +connection default; +SELECT RELEASE_LOCK("l1"); +RELEASE_LOCK("l1") +1 +UNLOCK TABLES; +DROP TABLE t1; +set debug_sync='reset'; diff --git a/mysql-test/main/deadlock_ftwrl.test b/mysql-test/main/deadlock_ftwrl.test new file mode 100644 index 00000000000..fc943bcf953 --- /dev/null +++ b/mysql-test/main/deadlock_ftwrl.test @@ -0,0 +1,36 @@ +# MDEV-20946 Hard FTWRL deadlock under user level locks +# +# Deadlock detector should resolve conflicts between FTWRL and user locks. + +--source include/have_debug_sync.inc +--source include/count_sessions.inc + +CREATE TABLE t1(a INT); +SELECT GET_LOCK("l1", 0); + +connect(con1,localhost,root,,); +LOCK TABLES t1 WRITE; + +connection default; +set debug_sync='mdl_acquire_lock_wait SIGNAL ftwrl'; +send FLUSH TABLES WITH READ LOCK; +# At this point "default" is waiting for tables to be unlocked from +# LOCK TABLES WRITE issued by "con1". + +connection con1; +set debug_sync='now WAIT_FOR ftwrl'; +# The lock in the following GET_LOCK cannot be acquired since "default" holds +# a lock on "l1" and is waiting in FLUSH TABLES for con1. +--error ER_LOCK_DEADLOCK +SELECT GET_LOCK("l1", 1000); +disconnect con1; # Performs an implicit UNLOCK TABLES. + +connection default; +reap; +SELECT RELEASE_LOCK("l1"); +UNLOCK TABLES; +DROP TABLE t1; + +set debug_sync='reset'; + +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/main/default.result b/mysql-test/main/default.result index ca65c66ea41..0d2c2e6acbc 100644 --- a/mysql-test/main/default.result +++ b/mysql-test/main/default.result @@ -3388,3 +3388,18 @@ ALTER TABLE t1 ADD b CHAR(255) DEFAULT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ERROR 42S22: Unknown column 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' in 'DEFAULT' DROP TABLE t1; # end of 10.2 test +# +# MDEV-22703 DEFAULT() on a BLOB column can overwrite the default +# record, which can cause crashes when accessing already released +# memory. +# +CREATE TEMPORARY TABLE t1 (h POINT DEFAULT ST_GEOMFROMTEXT('Point(1 1)')) ENGINE=InnoDB; +INSERT INTO t1 () VALUES (),(); +ALTER TABLE t1 FORCE; +SELECT DEFAULT(h) FROM t1; +SELECT length(DEFAULT(h)) FROM t1; +length(DEFAULT(h)) +25 +25 +INSERT INTO t1 () VALUES (); +drop table t1; diff --git a/mysql-test/main/default.test b/mysql-test/main/default.test index 27e38eeeb49..c0561deac67 100644 --- a/mysql-test/main/default.test +++ b/mysql-test/main/default.test @@ -1,3 +1,5 @@ +--source include/have_innodb.inc + # # test of already fixed bugs # @@ -2107,5 +2109,20 @@ CREATE OR REPLACE TABLE t1(i int); ALTER TABLE t1 ADD b CHAR(255) DEFAULT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`; DROP TABLE t1; - --echo # end of 10.2 test + +--echo # +--echo # MDEV-22703 DEFAULT() on a BLOB column can overwrite the default +--echo # record, which can cause crashes when accessing already released +--echo # memory. +--echo # + +CREATE TEMPORARY TABLE t1 (h POINT DEFAULT ST_GEOMFROMTEXT('Point(1 1)')) ENGINE=InnoDB; +INSERT INTO t1 () VALUES (),(); +ALTER TABLE t1 FORCE; +--disable_result_log +SELECT DEFAULT(h) FROM t1; +--enable_result_log +SELECT length(DEFAULT(h)) FROM t1; +INSERT INTO t1 () VALUES (); +drop table t1; diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index 0f2e6f0e2a2..7644e65a868 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -17058,6 +17058,290 @@ id 2 3 DROP TABLE t; +# +# MDEV-23804: Server crashes in st_select_lex::collect_grouping_fields_for_derived +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (3),(4); +CREATE VIEW v1 AS SELECT a FROM t1 UNION VALUES (3),(4); +ANALYZE FORMAT=JSON SELECT * from v1 WHERE a=3; +ANALYZE +{ + "query_block": { + "select_id": 1, + "r_loops": 1, + "r_total_time_ms": "REPLACED", + "table": { + "table_name": "<derived2>", + "access_type": "ALL", + "r_loops": 1, + "rows": 4, + "r_rows": 2, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 50, + "attached_condition": "v1.a = 3", + "materialized": { + "query_block": { + "union_result": { + "table_name": "<union2,3>", + "access_type": "ALL", + "r_loops": 1, + "r_rows": 2, + "query_specifications": [ + { + "query_block": { + "select_id": 2, + "r_loops": 1, + "r_total_time_ms": "REPLACED", + "table": { + "table_name": "t1", + "access_type": "ALL", + "r_loops": 1, + "rows": 2, + "r_rows": 2, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 50, + "attached_condition": "t1.a = 3" + } + } + }, + { + "query_block": { + "select_id": 3, + "operation": "UNION", + "table": { + "message": "No tables used" + } + } + } + ] + } + } + } + } + } +} +SELECT * from v1 WHERE a=3; +a +3 +DROP VIEW v1; +DROP TABLE t1; +# +# MDEV-25128: Split optimization for join with materialized semi-join +# +create table t1 (id int, a int, index (a), index (id, a)) engine=myisam; +insert into t1 values +(17,1),(17,3010),(17,3013),(17,3053),(21,2446),(21,2467),(21,2); +create table t2 (a int) engine=myisam; +insert into t2 values (1),(2),(3); +create table t3 (id int) engine=myisam; +insert into t3 values (1),(2); +analyze table t1,t2,t3; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK +test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status OK +set optimizer_switch="split_materialized=off"; +select * from t1, (select a from t1 cp2 group by a) dt, t3 +where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2); +id a a id +17 1 1 1 +21 2 2 2 +explain select * from t1, (select a from t1 cp2 group by a) dt, t3 +where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where +1 PRIMARY t1 ref a a 5 test.t3.id 1 +1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 +1 PRIMARY <derived2> ref key0 key0 5 test.t3.id 2 +3 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 +2 DERIVED cp2 index NULL a 5 NULL 7 Using index +explain format=json select * from t1, (select a from t1 cp2 group by a) dt, t3 +where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2); +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "t3", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t3.`id` is not null and t3.`id` is not null" + }, + "table": { + "table_name": "t1", + "access_type": "ref", + "possible_keys": ["a"], + "key": "a", + "key_length": "5", + "used_key_parts": ["a"], + "ref": ["test.t3.id"], + "rows": 1, + "filtered": 100 + }, + "table": { + "table_name": "<subquery3>", + "access_type": "eq_ref", + "possible_keys": ["distinct_key"], + "key": "distinct_key", + "key_length": "4", + "used_key_parts": ["a"], + "ref": ["func"], + "rows": 1, + "filtered": 100, + "materialized": { + "unique": 1, + "query_block": { + "select_id": 3, + "table": { + "table_name": "t2", + "access_type": "ALL", + "rows": 3, + "filtered": 100 + } + } + } + }, + "table": { + "table_name": "<derived2>", + "access_type": "ref", + "possible_keys": ["key0"], + "key": "key0", + "key_length": "5", + "used_key_parts": ["a"], + "ref": ["test.t3.id"], + "rows": 2, + "filtered": 100, + "materialized": { + "query_block": { + "select_id": 2, + "table": { + "table_name": "cp2", + "access_type": "index", + "key": "a", + "key_length": "5", + "used_key_parts": ["a"], + "rows": 7, + "filtered": 100, + "using_index": true + } + } + } + } + } +} +set optimizer_switch="split_materialized=default"; +select * from t1, (select a from t1 cp2 group by a) dt, t3 +where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2); +id a a id +17 1 1 1 +21 2 2 2 +explain select * from t1, (select a from t1 cp2 group by a) dt, t3 +where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where +1 PRIMARY t1 ref a a 5 test.t3.id 1 +1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 +1 PRIMARY <derived2> ref key0 key0 5 test.t3.id 2 +3 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 +2 LATERAL DERIVED cp2 ref a a 5 test.t1.a 1 Using index +explain format=json select * from t1, (select a from t1 cp2 group by a) dt, t3 +where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2); +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "t3", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t3.`id` is not null and t3.`id` is not null" + }, + "table": { + "table_name": "t1", + "access_type": "ref", + "possible_keys": ["a"], + "key": "a", + "key_length": "5", + "used_key_parts": ["a"], + "ref": ["test.t3.id"], + "rows": 1, + "filtered": 100 + }, + "table": { + "table_name": "<subquery3>", + "access_type": "eq_ref", + "possible_keys": ["distinct_key"], + "key": "distinct_key", + "key_length": "4", + "used_key_parts": ["a"], + "ref": ["func"], + "rows": 1, + "filtered": 100, + "materialized": { + "unique": 1, + "query_block": { + "select_id": 3, + "table": { + "table_name": "t2", + "access_type": "ALL", + "rows": 3, + "filtered": 100 + } + } + } + }, + "table": { + "table_name": "<derived2>", + "access_type": "ref", + "possible_keys": ["key0"], + "key": "key0", + "key_length": "5", + "used_key_parts": ["a"], + "ref": ["test.t3.id"], + "rows": 2, + "filtered": 100, + "materialized": { + "lateral": 1, + "query_block": { + "select_id": 2, + "outer_ref_condition": "t1.a is not null", + "table": { + "table_name": "cp2", + "access_type": "ref", + "possible_keys": ["a"], + "key": "a", + "key_length": "5", + "used_key_parts": ["a"], + "ref": ["test.t1.a"], + "rows": 1, + "filtered": 100, + "using_index": true + } + } + } + } + } +} +prepare stmt from "select * from t1, (select a from t1 cp2 group by a) dt, t3 +where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2)"; +execute stmt; +id a a id +17 1 1 1 +21 2 2 2 +execute stmt; +id a a id +17 1 1 1 +21 2 2 2 +deallocate prepare stmt; +drop table t1,t2,t3; # End of 10.3 tests # # MDEV-18679: materialized view with SELECT S containing materialized diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test index 7667cd44ed2..a880712c8bd 100644 --- a/mysql-test/main/derived_cond_pushdown.test +++ b/mysql-test/main/derived_cond_pushdown.test @@ -3466,6 +3466,56 @@ eval set statement optimizer_switch='split_materialized=on' for $q; DROP TABLE t; +--echo # +--echo # MDEV-23804: Server crashes in st_select_lex::collect_grouping_fields_for_derived +--echo # + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (3),(4); +CREATE VIEW v1 AS SELECT a FROM t1 UNION VALUES (3),(4); +--source include/analyze-format.inc +ANALYZE FORMAT=JSON SELECT * from v1 WHERE a=3; +SELECT * from v1 WHERE a=3; +DROP VIEW v1; +DROP TABLE t1; + +--echo # +--echo # MDEV-25128: Split optimization for join with materialized semi-join +--echo # + +create table t1 (id int, a int, index (a), index (id, a)) engine=myisam; +insert into t1 values +(17,1),(17,3010),(17,3013),(17,3053),(21,2446),(21,2467),(21,2); + +create table t2 (a int) engine=myisam; +insert into t2 values (1),(2),(3); + +create table t3 (id int) engine=myisam; +insert into t3 values (1),(2); + +analyze table t1,t2,t3; + +let $q= +select * from t1, (select a from t1 cp2 group by a) dt, t3 + where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2); + +set optimizer_switch="split_materialized=off"; +eval $q; +eval explain $q; +eval explain format=json $q; + +set optimizer_switch="split_materialized=default"; +eval $q; +eval explain $q; +eval explain format=json $q; + +eval prepare stmt from "$q"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +drop table t1,t2,t3; + --echo # End of 10.3 tests --echo # diff --git a/mysql-test/main/derived_opt.result b/mysql-test/main/derived_opt.result index c30f56d9925..907c97e92d4 100644 --- a/mysql-test/main/derived_opt.result +++ b/mysql-test/main/derived_opt.result @@ -540,4 +540,31 @@ id select_type table type possible_keys key key_len ref rows Extra set join_cache_level=default; set optimizer_switch= @save_optimizer_switch; DROP TABLE t1,t2; +set @save_optimizer_switch= @@optimizer_switch; +set optimizer_switch="derived_merge=on"; +CREATE TABLE t1 (id int, d2 datetime, id1 int) ; +insert into t1 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',3); +CREATE TABLE t2 (id int, d1 datetime, id1 int) ; +insert into t2 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',2); +prepare stmt from " +SELECT * from + (SELECT min(d2) AS d2, min(d1) AS d1 FROM + (SELECT t1.d2 AS d2, (SELECT t2.d1 + FROM t2 WHERE t1.id1 = t2.id1 + ORDER BY t2.id DESC LIMIT 1) AS d1 + FROM t1 + ) dt2 + ) ca + ORDER BY ca.d2;"; +execute stmt; +d2 d1 +2020-01-01 10:10:10 2020-01-01 10:10:10 +execute stmt; +d2 d1 +2020-01-01 10:10:10 2020-01-01 10:10:10 +set optimizer_switch= @save_optimizer_switch; +DROP TABLE t1, t2; +# +# End of 10.3 tests +# set optimizer_switch=@exit_optimizer_switch; diff --git a/mysql-test/main/derived_opt.test b/mysql-test/main/derived_opt.test index eccf4c13020..dee424559ee 100644 --- a/mysql-test/main/derived_opt.test +++ b/mysql-test/main/derived_opt.test @@ -406,5 +406,38 @@ set optimizer_switch= @save_optimizer_switch; DROP TABLE t1,t2; +# +# MDEV-25182: Complex query in Store procedure corrupts results +# +set @save_optimizer_switch= @@optimizer_switch; +set optimizer_switch="derived_merge=on"; + +CREATE TABLE t1 (id int, d2 datetime, id1 int) ; +insert into t1 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',3); + +CREATE TABLE t2 (id int, d1 datetime, id1 int) ; +insert into t2 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',2); + +prepare stmt from " +SELECT * from + (SELECT min(d2) AS d2, min(d1) AS d1 FROM + (SELECT t1.d2 AS d2, (SELECT t2.d1 + FROM t2 WHERE t1.id1 = t2.id1 + ORDER BY t2.id DESC LIMIT 1) AS d1 + FROM t1 + ) dt2 + ) ca + ORDER BY ca.d2;"; + +execute stmt; +execute stmt; + +set optimizer_switch= @save_optimizer_switch; +DROP TABLE t1, t2; + +--echo # +--echo # End of 10.3 tests +--echo # + # The following command must be the last one the file set optimizer_switch=@exit_optimizer_switch; diff --git a/mysql-test/main/empty_string_literal.result b/mysql-test/main/empty_string_literal.result index 2ca491a7dd8..bbcf27cf993 100644 --- a/mysql-test/main/empty_string_literal.result +++ b/mysql-test/main/empty_string_literal.result @@ -179,3 +179,32 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1003 select NULL AS `NULL` +# +# MDEV-20763 Table corruption or Assertion `btr_validate_index(index, 0, false)' failed in row_upd_sec_index_entry with virtual column and EMPTY_STRING_IS_NULL SQL mode +# +create table t1 (a int, b binary(1) generated always as (''), key(a,b)); +insert into t1 (a) values (1); +set sql_mode= default; +flush tables; +update t1 set a = 2; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` binary(1) GENERATED ALWAYS AS (NULL) VIRTUAL, + KEY `a` (`a`,`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a int, b binary(1) generated always as (''), key(a,b)); +insert into t1 (a) values (1); +set sql_mode= 'empty_string_is_null'; +flush tables; +update t1 set a = 2; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` binary(1) GENERATED ALWAYS AS ('') VIRTUAL, + KEY `a` (`a`,`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/main/empty_string_literal.test b/mysql-test/main/empty_string_literal.test index 71e98d872bb..9174a7714a2 100644 --- a/mysql-test/main/empty_string_literal.test +++ b/mysql-test/main/empty_string_literal.test @@ -6,3 +6,22 @@ USE test; set @mode='EMPTY_STRING_IS_NULL'; --source include/empty_string_literal.inc + +--echo # +--echo # MDEV-20763 Table corruption or Assertion `btr_validate_index(index, 0, false)' failed in row_upd_sec_index_entry with virtual column and EMPTY_STRING_IS_NULL SQL mode +--echo # +create table t1 (a int, b binary(1) generated always as (''), key(a,b)); +insert into t1 (a) values (1); +set sql_mode= default; +flush tables; +update t1 set a = 2; +show create table t1; +drop table t1; + +create table t1 (a int, b binary(1) generated always as (''), key(a,b)); +insert into t1 (a) values (1); +set sql_mode= 'empty_string_is_null'; +flush tables; +update t1 set a = 2; +show create table t1; +drop table t1; diff --git a/mysql-test/main/flush_and_binlog.result b/mysql-test/main/flush_and_binlog.result new file mode 100644 index 00000000000..a1d73c6590f --- /dev/null +++ b/mysql-test/main/flush_and_binlog.result @@ -0,0 +1,33 @@ +# +# MDEV-23843 Assertions in Diagnostics_area upon table operations under +# FTWRL +# +CREATE TABLE t1 (a INT); +FLUSH TABLES WITH READ LOCK; +connect con1,localhost,root,,; +SET lock_wait_timeout= 1; +OPTIMIZE TABLE t1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +disconnect con1; +connection default; +UNLOCK TABLES; +DROP TABLE t1; +FLUSH TABLES WITH READ LOCK; +connect con1,localhost,root,,test; +SET lock_wait_timeout= 1; +FLUSH TABLES; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection default; +disconnect con1; +unlock tables; +# Second test from MDEV-23843 +CREATE TABLE t (a INT); +FLUSH TABLES WITH READ LOCK; +connect con1,localhost,root,,; +SET lock_wait_timeout= 1; +ANALYZE TABLE t; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +disconnect con1; +connection default; +UNLOCK TABLES; +DROP TABLE t; diff --git a/mysql-test/main/flush_and_binlog.test b/mysql-test/main/flush_and_binlog.test new file mode 100644 index 00000000000..a28d8e365dd --- /dev/null +++ b/mysql-test/main/flush_and_binlog.test @@ -0,0 +1,43 @@ +--source include/have_log_bin.inc + +--echo # +--echo # MDEV-23843 Assertions in Diagnostics_area upon table operations under +--echo # FTWRL +--echo # + +CREATE TABLE t1 (a INT); +FLUSH TABLES WITH READ LOCK; +--connect (con1,localhost,root,,) +SET lock_wait_timeout= 1; +--error ER_LOCK_WAIT_TIMEOUT +OPTIMIZE TABLE t1; +# Cleanup +--disconnect con1 +--connection default +UNLOCK TABLES; +DROP TABLE t1; +# +# Second test case from MDEV_23843 +# +FLUSH TABLES WITH READ LOCK; +--connect (con1,localhost,root,,test) +SET lock_wait_timeout= 1; +--error ER_LOCK_WAIT_TIMEOUT +FLUSH TABLES; +--connection default +--disconnect con1 +unlock tables; + +--echo # Second test from MDEV-23843 + +CREATE TABLE t (a INT); +FLUSH TABLES WITH READ LOCK; +--connect (con1,localhost,root,,) +SET lock_wait_timeout= 1; +--error ER_LOCK_WAIT_TIMEOUT +ANALYZE TABLE t; +# Cleanup +--disconnect con1 +--connection default +UNLOCK TABLES; +DROP TABLE t; diff --git a/mysql-test/main/func_gconcat.result b/mysql-test/main/func_gconcat.result index 94c24a63bb5..a7517e98134 100644 --- a/mysql-test/main/func_gconcat.result +++ b/mysql-test/main/func_gconcat.result @@ -1280,6 +1280,18 @@ Name_exp_1 DROP VIEW v1; DROP TABLE t1; # +# MDEV-4677 GROUP_CONCAT not showing any output with group_concat_max_len >= 4Gb +# +set group_concat_max_len=1024*1024*1024*4; +Warnings: +Warning 1292 Truncated incorrect group_concat_max_len value: '4294967296' +create table t1 (i int, j int); +insert into t1 values (1,1),(1,2); +select i, group_concat(j) from t1 group by i; +i group_concat(j) +1 1,2 +drop table t1; +# # End of 10.2 tests # # diff --git a/mysql-test/main/func_gconcat.test b/mysql-test/main/func_gconcat.test index 2ab856e0edd..3c21aa04ffc 100644 --- a/mysql-test/main/func_gconcat.test +++ b/mysql-test/main/func_gconcat.test @@ -939,6 +939,16 @@ DROP VIEW v1; DROP TABLE t1; + +--echo # +--echo # MDEV-4677 GROUP_CONCAT not showing any output with group_concat_max_len >= 4Gb +--echo # +set group_concat_max_len=1024*1024*1024*4; +create table t1 (i int, j int); +insert into t1 values (1,1),(1,2); +select i, group_concat(j) from t1 group by i; +drop table t1; + --echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/func_group.result b/mysql-test/main/func_group.result index 9311a556191..071c155cd6b 100644 --- a/mysql-test/main/func_group.result +++ b/mysql-test/main/func_group.result @@ -606,7 +606,7 @@ select min(a1) from t1 where a1 > 'KKK' or a1 < 'XXX'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index PRIMARY PRIMARY 3 NULL 15 Using where; Using index explain -select min(a1) from t1 where a1 != 'KKK'; +select min(a1) from t1 where (a1 < 'KKK' or a1 > 'KKK'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index PRIMARY PRIMARY 3 NULL 15 Using where; Using index explain @@ -2460,7 +2460,38 @@ count(*)+sleep(0) 2 drop table t1; # -# Start of 10.3 tests +# MDEV-25112: MIN/MAX optimization for query containing BETWEEN in WHERE +# +create table t1 (a int) engine=myisam; +insert into t1 values (267), (273), (287), (303), (308); +select max(a) from t1 where a < 303 and (a between 267 AND 287); +max(a) +287 +explain select max(a) from t1 where a < 303 and (a between 267 AND 287); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where +select min(a) from t1 where a > 267 and (a between 273 AND 303); +min(a) +273 +explain select min(a) from t1 where a > 267 and (a between 273 AND 303); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where +create index idx on t1(a); +select max(a) from t1 where a < 303 and (a between 267 AND 287); +max(a) +287 +explain select max(a) from t1 where a < 303 and (a between 267 AND 287); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(a) from t1 where a > 267 and (a between 273 AND 303); +min(a) +273 +explain select min(a) from t1 where a > 267 and (a between 273 AND 303); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +drop table t1; +# +# End of 10.2 tests # # # MDEV-9408 CREATE TABLE SELECT MAX(int_column) creates different columns for table vs view @@ -2492,3 +2523,6 @@ t2 CREATE TABLE `t2` ( DROP TABLE t2; DROP VIEW v1; DROP TABLE t1; +# +# End of 10.3 tests +# diff --git a/mysql-test/main/func_group.test b/mysql-test/main/func_group.test index bc2d6e9047d..a28b39c28f6 100644 --- a/mysql-test/main/func_group.test +++ b/mysql-test/main/func_group.test @@ -359,7 +359,7 @@ select min(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK'; explain select min(a1) from t1 where a1 > 'KKK' or a1 < 'XXX'; explain -select min(a1) from t1 where a1 != 'KKK'; +select min(a1) from t1 where (a1 < 'KKK' or a1 > 'KKK'); explain select max(a3) from t1 where a2 < 2 and a3 < 'SEA'; explain @@ -1705,7 +1705,33 @@ select count(*)+sleep(0) from t1; drop table t1; --echo # ---echo # Start of 10.3 tests +--echo # MDEV-25112: MIN/MAX optimization for query containing BETWEEN in WHERE +--echo # + +create table t1 (a int) engine=myisam; +insert into t1 values (267), (273), (287), (303), (308); + +let $q1= +select max(a) from t1 where a < 303 and (a between 267 AND 287); +let $q2= +select min(a) from t1 where a > 267 and (a between 273 AND 303); + +eval $q1; +eval explain $q1; +eval $q2; +eval explain $q2; + +create index idx on t1(a); + +eval $q1; +eval explain $q1; +eval $q2; +eval explain $q2; + +drop table t1; + +--echo # +--echo # End of 10.2 tests --echo # --echo # @@ -1730,3 +1756,7 @@ DROP TABLE t2; DROP VIEW v1; DROP TABLE t1; + +--echo # +--echo # End of 10.3 tests +--echo # diff --git a/mysql-test/main/func_like.result b/mysql-test/main/func_like.result index a937037167c..fc306c42067 100644 --- a/mysql-test/main/func_like.result +++ b/mysql-test/main/func_like.result @@ -289,6 +289,24 @@ a b c d 3 f_ 1 0 1 3 f\_ 0 1 0 drop table t1; +create table t1 (f int); +insert t1 values (1),(2); +select 1 from (select distinct * from t1) as x where f < (select 1 like 2 escape (3=1)); +1 +drop table t1; +create table t1(f1 int); +insert into t1 values(1); +update (select 1 like 2 escape (1 in (select 1 from t1))) x, t1 as d set d.f1 = 1; +ERROR HY000: Incorrect arguments to ESCAPE +select * from (select 1 like 2 escape (1 in (select 1 from t1))) x; +1 like 2 escape (1 in (select 1 from t1)) +0 +drop table t1; +create table t1 (f int); +insert t1 values (1),(2); +create view v1 as select * from t1 where (1 like 2 escape (3 in (('h', 'b') in (select 'k', 'k' union select 'g', 'j'))) and f >= 0); +drop view v1; +drop table t1; # # MDEV-17359 - Extend expression supported by like (| & << >> || + - * / DIV MOD ^ ) # diff --git a/mysql-test/main/func_like.test b/mysql-test/main/func_like.test index cb50fb91879..ef13d46c268 100644 --- a/mysql-test/main/func_like.test +++ b/mysql-test/main/func_like.test @@ -187,7 +187,7 @@ DROP TABLE t1; --echo # # -# Item_func_line::print() +# Item_func_like::print() # create view v1 as select 'foo!' like 'foo!!', 'foo!' like 'foo!!' escape '!'; show create view v1; @@ -208,6 +208,33 @@ set sql_mode=default; select * from t1; drop table t1; +# +# Item_func_like::fix_fields() +# +create table t1 (f int); +insert t1 values (1),(2); +select 1 from (select distinct * from t1) as x where f < (select 1 like 2 escape (3=1)); +drop table t1; + +# +# Item_func_like::fix_fields, ESCAPE, const_item() +# +create table t1(f1 int); +insert into t1 values(1); +--error ER_WRONG_ARGUMENTS +update (select 1 like 2 escape (1 in (select 1 from t1))) x, t1 as d set d.f1 = 1; +select * from (select 1 like 2 escape (1 in (select 1 from t1))) x; +drop table t1; + +# +# Item_func_like::walk +# +create table t1 (f int); +insert t1 values (1),(2); +create view v1 as select * from t1 where (1 like 2 escape (3 in (('h', 'b') in (select 'k', 'k' union select 'g', 'j'))) and f >= 0); +drop view v1; +drop table t1; + --echo # --echo # MDEV-17359 - Extend expression supported by like (| & << >> || + - * / DIV MOD ^ ) --echo # diff --git a/mysql-test/main/gis-json.result b/mysql-test/main/gis-json.result index 1d6e2193fc9..e52a7c809c6 100644 --- a/mysql-test/main/gis-json.result +++ b/mysql-test/main/gis-json.result @@ -62,9 +62,9 @@ SELECT st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } }]}')) GEOMETRYCOLLECTION(POINT(102 0.5)) SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',5)); -ERROR HY000: Incorrect option value: '5' for function ST_GeometryFromJSON +ERROR HY000: Incorrect option value: '5' for function ST_GeomFromGeoJSON SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',1)); -ERROR 22023: Invalid GIS data provided to function ST_GeometryFromJSON. +ERROR 22023: Invalid GIS data provided to function ST_GeomFromGeoJSON. SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',2)); ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',2)) POINT(5.3 15) @@ -104,6 +104,9 @@ a NULL Warnings: Warning 4076 Incorrect GeoJSON format - empty 'coordinates' array. +SELECT ST_GEOMFROMGEOJSON("{ \"type\": \"Feature\", \"geometry\": [10, 20] }"); +ST_GEOMFROMGEOJSON("{ \"type\": \"Feature\", \"geometry\": [10, 20] }") +NULL # # End of 10.2 tests # diff --git a/mysql-test/main/gis-json.test b/mysql-test/main/gis-json.test index b91ef235fd0..a97e9411e5c 100644 --- a/mysql-test/main/gis-json.test +++ b/mysql-test/main/gis-json.test @@ -44,6 +44,8 @@ SELECT st_astext(st_geomfromgeojson('{"type": "MultiLineString","coordinates": [ SELECT st_astext(st_geomfromgeojson('{"type": "Polygon","coordinates": []}')) as a; SELECT st_astext(st_geomfromgeojson('{"type": "MultiPolygon","coordinates": []}')) as a; +SELECT ST_GEOMFROMGEOJSON("{ \"type\": \"Feature\", \"geometry\": [10, 20] }"); + --echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/gis-precise.result b/mysql-test/main/gis-precise.result index 4e4161c34ec..513d8b6e8c2 100644 --- a/mysql-test/main/gis-precise.result +++ b/mysql-test/main/gis-precise.result @@ -806,3 +806,114 @@ SRID(GEOMETRYFROMTEXT(' MULTIPOINT(8 4,5 0,7 8,6 9,3 4,7 3,5 5) ')))); ASTEXT(ST_BUFFER(POLYGONFROMTEXT(' POLYGON((9 9,5 2,4 5,9 9))'), SRID(GEOMETRYFROMTEXT(' MULTIPOINT(8 4,5 0,7 8,6 9,3 4,7 3,5 5) ')))) POLYGON((9 9,5 2,4 5,9 9)) +# +# MDEV-13467 Feature request: Support for ST_Distance_Sphere() +# +SELECT ST_DISTANCE_SPHERE(); +ERROR 42000: Incorrect parameter count in the call to native function 'ST_DISTANCE_SPHERE' +SELECT ST_DISTANCE_SPHERE(NULL); +ERROR 42000: Incorrect parameter count in the call to native function 'ST_DISTANCE_SPHERE' +SELECT ST_DISTANCE_SPHERE(NULL, NULL); +ST_DISTANCE_SPHERE(NULL, NULL) +NULL +SELECT ST_DISTANCE_SPHERE(NULL, NULL, 3); +ST_DISTANCE_SPHERE(NULL, NULL, 3) +NULL +SELECT ST_DISTANCE_SPHERE(NULL, 1, 3); +ST_DISTANCE_SPHERE(NULL, 1, 3) +NULL +SELECT ST_DISTANCE_SPHERE(1, NULL, 3); +ST_DISTANCE_SPHERE(1, NULL, 3) +NULL +SELECT ST_DISTANCE_SPHERE(1, 1); +ERROR 22023: Invalid GIS data provided to function ST_Distance_Sphere. +SELECT ST_DISTANCE_SPHERE(1, 1, 3); +ERROR 22023: Invalid GIS data provided to function ST_Distance_Sphere. +SELECT ST_DISTANCE_SPHERE(1, 1, NULL); +ST_DISTANCE_SPHERE(1, 1, NULL) +NULL +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('LINESTRING(0 0, 1 1)')); +ERROR HY000: Internal error: st_distance_sphere +# Test Points and radius +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)')) +157249.0357231545 +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-1 -1)'), ST_GEOMFROMTEXT('POINT(-2 -2)')), 10); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-1 -1)'), ST_GEOMFROMTEXT('POINT(-2 -2)')), 10) +157225.0865419108 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), 1); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), 1) +0.024682056391766436 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), 0); +ERROR HY000: Internal error: Radius must be greater than zero. +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), -1); +ERROR HY000: Internal error: Radius must be greater than zero. +# Test longitude/lattitude +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POINT(1 2)')), 10); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POINT(1 2)')), 10) +157225.0865419108 +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POINT(2 1)')), 10); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POINT(2 1)')), 10) +222355.4901806686 +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('POINT(1 2)')), 10); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('POINT(1 2)')), 10) +222389.3645969269 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('POINT(2 1)')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('POINT(2 1)')) +157249.0357231545 +# Test Points - Multipoints +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1)')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1)')) +157249.0357231545 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)')) +157249.0357231545 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,2 2)')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,2 2)')) +157249.0357231545 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2,1 1)')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2,1 1)')) +157249.0357231545 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,2 2)'), 1); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,2 2)'), 1) +0.024682056391766436 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2,1 1)'), 1); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2,1 1)'), 1) +0.024682056391766436 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2, 1 1, 3 4)'), 1); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2, 1 1, 3 4)'), 1) +0.024682056391766436 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2, 1 1,5 6)'), 1); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2, 1 1,5 6)'), 1) +0.024682056391766436 +# Test Multipoints - Multipoints +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )'), ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )')); +ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )'), ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )')) +0 +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )')), 10); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )')), 10) +314282.5644496733 +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )')), 10); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )')), 10) +314282.5644496733 +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )'),1), 17); +TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )'),1), 17) +0.04933028646581131 +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )'),0); +ERROR HY000: Internal error: Radius must be greater than zero. +set @pt1 = ST_GeomFromText('POINT(190 -30)'); +set @pt2 = ST_GeomFromText('POINT(-30 50)'); +SELECT ST_Distance_Sphere(@pt1, @pt2); +ERROR HY000: Out of range error: Longitude should be [-180,180] in function ST_Distance_Sphere. +set @pt1 = ST_GeomFromText('POINT(135 -30)'); +set @pt2 = ST_GeomFromText('POINT(-30 91)'); +SELECT ST_Distance_Sphere(@pt1, @pt2); +ERROR HY000: Out of range error: Latitude should be [-90,90] in function ST_Distance_Sphere. +set @zenica = ST_GeomFromText('POINT(17.907743 44.203438)'); +set @sarajevo = ST_GeomFromText('POINT(18.413076 43.856258)'); +SELECT TRUNCATE(ST_Distance_Sphere(@zenica, @sarajevo), 10); +TRUNCATE(ST_Distance_Sphere(@zenica, @sarajevo), 10) +55878.5933759170 +SELECT TRUNCATE(ST_Distance_Sphere(@sarajevo, @zenica), 10); +TRUNCATE(ST_Distance_Sphere(@sarajevo, @zenica), 10) +55878.5933759170 diff --git a/mysql-test/main/gis-precise.test b/mysql-test/main/gis-precise.test index 24f4ac9113e..da72a0c4d8a 100644 --- a/mysql-test/main/gis-precise.test +++ b/mysql-test/main/gis-precise.test @@ -394,3 +394,81 @@ with cte1 as( select (st_symdifference(point(1,1),point(1,1))) as a1 ), cte2 a --source include/gis_debug.inc + +--echo # +--echo # MDEV-13467 Feature request: Support for ST_Distance_Sphere() +--echo # + +--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +SELECT ST_DISTANCE_SPHERE(); +--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +SELECT ST_DISTANCE_SPHERE(NULL); +SELECT ST_DISTANCE_SPHERE(NULL, NULL); +# NULL args and optional radius will return NULL +SELECT ST_DISTANCE_SPHERE(NULL, NULL, 3); +# At least 1 NULL arg and optional radius will return NULL +SELECT ST_DISTANCE_SPHERE(NULL, 1, 3); +# At least 1 NULL arg and optional radius will return NULL +SELECT ST_DISTANCE_SPHERE(1, NULL, 3); +# Return ER_GIS_INVALID_DATA for invalid geometry +--error ER_GIS_INVALID_DATA +SELECT ST_DISTANCE_SPHERE(1, 1); +--error ER_GIS_INVALID_DATA +SELECT ST_DISTANCE_SPHERE(1, 1, 3); +# Return NULL if radius is NULL +SELECT ST_DISTANCE_SPHERE(1, 1, NULL); +# Wrong geometry +--error ER_INTERNAL_ERROR +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('LINESTRING(0 0, 1 1)')); + +--echo # Test Points and radius +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)')); +# make bb x86 happy +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-1 -1)'), ST_GEOMFROMTEXT('POINT(-2 -2)')), 10); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), 1); +--error ER_INTERNAL_ERROR +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), 0); +--error ER_INTERNAL_ERROR +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), -1); +--echo # Test longitude/lattitude +# make bb x86 happy +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POINT(1 2)')), 10); +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POINT(2 1)')), 10); +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('POINT(1 2)')), 10); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('POINT(2 1)')); +--echo # Test Points - Multipoints +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1)')); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)')); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,2 2)')); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2,1 1)')); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,2 2)'), 1); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2,1 1)'), 1); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2, 1 1, 3 4)'), 1); +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(2 2, 1 1,5 6)'), 1); +--echo # Test Multipoints - Multipoints +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )'), ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )')); +# make bb x86 happy +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(3 4,8 9 )')), 10); +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )')), 10); +# make bb x86 happy +SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )'),1), 17); +--error ER_INTERNAL_ERROR +SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )'),0); + +# Longitude out of range [-180,180] +set @pt1 = ST_GeomFromText('POINT(190 -30)'); +set @pt2 = ST_GeomFromText('POINT(-30 50)'); +--error ER_STD_OUT_OF_RANGE_ERROR +SELECT ST_Distance_Sphere(@pt1, @pt2); + +# Latitude out of range [-90, 90] +set @pt1 = ST_GeomFromText('POINT(135 -30)'); +set @pt2 = ST_GeomFromText('POINT(-30 91)'); +--error ER_STD_OUT_OF_RANGE_ERROR +SELECT ST_Distance_Sphere(@pt1, @pt2); + +# POINT in form (longitude[-180, 180] latitude[-90, 90]) +set @zenica = ST_GeomFromText('POINT(17.907743 44.203438)'); +set @sarajevo = ST_GeomFromText('POINT(18.413076 43.856258)'); +SELECT TRUNCATE(ST_Distance_Sphere(@zenica, @sarajevo), 10); +SELECT TRUNCATE(ST_Distance_Sphere(@sarajevo, @zenica), 10); diff --git a/mysql-test/main/group_by.result b/mysql-test/main/group_by.result index ecd115c2dd0..db75287c61c 100644 --- a/mysql-test/main/group_by.result +++ b/mysql-test/main/group_by.result @@ -2884,6 +2884,52 @@ GROUP BY t.table_name; ERROR HY001: Out of sort memory, consider increasing server sort buffer size SET max_sort_length= @save_max_sort_length; # +# MDEV-23826: ORDER BY in view definition leads to wrong result with GROUP BY on query using view +# +CREATE TABLE t1 +( +id INT PRIMARY KEY AUTO_INCREMENT, +dt datetime, +INDEX(dt), +foo int +); +INSERT INTO t1 VALUES (1,'2020-09-26 12:00:00',1); +INSERT INTO t1 VALUES (2,'2020-09-26 13:00:00',1); +INSERT INTO t1 VALUES (3,'2020-09-27 13:00:00',1); +INSERT INTO t1 VALUES (4,'2020-09-27 12:00:00',1); +INSERT INTO t1 VALUES (5,'2020-09-28 12:00:00',1); +INSERT INTO t1 VALUES (6,'2020-09-28 13:00:00',1); +INSERT INTO t1 VALUES (7,'2020-09-25 12:00:00',1); +INSERT INTO t1 VALUES (8,'2020-09-25 13:00:00',1); +INSERT INTO t1 VALUES (9,'2020-09-26 13:00:00',1); +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE VIEW v2 AS SELECT * FROM t1 ORDER BY dt; +SELECT dt, sum(foo) AS foo FROM v1 WHERE dt>DATE_SUB('2020-09-27 00:00:00', INTERVAL 3 DAY) GROUP BY dt; +dt foo +2020-09-25 12:00:00 1 +2020-09-25 13:00:00 1 +2020-09-26 12:00:00 1 +2020-09-26 13:00:00 2 +2020-09-27 12:00:00 1 +2020-09-27 13:00:00 1 +2020-09-28 12:00:00 1 +2020-09-28 13:00:00 1 +SELECT dt, sum(foo) AS foo FROM v2 WHERE dt>DATE_SUB('2020-09-27 00:00:00', INTERVAL 3 DAY) GROUP BY dt; +dt foo +2020-09-25 12:00:00 1 +2020-09-25 13:00:00 1 +2020-09-26 12:00:00 1 +2020-09-26 13:00:00 2 +2020-09-27 12:00:00 1 +2020-09-27 13:00:00 1 +2020-09-28 12:00:00 1 +2020-09-28 13:00:00 1 +DROP TABLE t1; +DROP VIEW v1,v2; +# +# End of 10.2 tests +# +# # MDEV-16170 # Server crashes in Item_null_result::type_handler on SELECT with ROLLUP # @@ -2894,4 +2940,35 @@ f COUNT(*) 1 1 NULL 1 DROP TABLE t1; +# +# MDEV-24710 Uninitialized value upon CREATE .. SELECT ... VALUE +# +CREATE TABLE t1 (a VARCHAR(8) NOT NULL DEFAULT ''); +INSERT INTO t1 (a) VALUES ('foo'); +CREATE TABLE t2 AS SELECT MAX(a) AS f1, a AS f2 FROM t1 WHERE VALUE(a) IS NOT NULL; +SELECT * from t2; +f1 f2 +NULL NULL +SELECT MAX(a) AS f1, a AS f2 FROM t1 WHERE VALUE(a) IS NOT NULL; +f1 f2 +NULL NULL +SELECT MAX(a) AS f1, a AS f2 FROM t1 WHERE 1=0; +f1 f2 +NULL NULL +drop table t1,t2; +# Extra test by to check the fix for MDEV-24710 +create table t20 (pk int primary key, a int); +insert into t20 values (1,1); +create table t21 (pk int primary key, b int not null); +insert into t21 values (1,1); +create table t22 (a int); +insert into t22 values (1),(2); +select a, (select max(t21.b) from t20 left join t21 on t21.pk=t20.a+10 +where t20.pk=1 and rand(123) < 0.5) as SUBQ from t22; +a SUBQ +1 NULL +2 NULL +drop table t20, t21, t22; +# # End of 10.3 tests +# diff --git a/mysql-test/main/group_by.test b/mysql-test/main/group_by.test index 3dc0ee9f00b..3ca518420a0 100644 --- a/mysql-test/main/group_by.test +++ b/mysql-test/main/group_by.test @@ -1987,7 +1987,6 @@ drop table t1; --echo # GROUP BY leads to crash --echo # - CALL mtr.add_suppression("Out of sort memory"); CALL mtr.add_suppression("Sort aborted"); SET @save_max_sort_length= @@max_sort_length; @@ -2000,6 +1999,40 @@ GROUP BY t.table_name; SET max_sort_length= @save_max_sort_length; --echo # +--echo # MDEV-23826: ORDER BY in view definition leads to wrong result with GROUP BY on query using view +--echo # + +CREATE TABLE t1 +( + id INT PRIMARY KEY AUTO_INCREMENT, + dt datetime, + INDEX(dt), + foo int +); + +INSERT INTO t1 VALUES (1,'2020-09-26 12:00:00',1); +INSERT INTO t1 VALUES (2,'2020-09-26 13:00:00',1); +INSERT INTO t1 VALUES (3,'2020-09-27 13:00:00',1); +INSERT INTO t1 VALUES (4,'2020-09-27 12:00:00',1); +INSERT INTO t1 VALUES (5,'2020-09-28 12:00:00',1); +INSERT INTO t1 VALUES (6,'2020-09-28 13:00:00',1); +INSERT INTO t1 VALUES (7,'2020-09-25 12:00:00',1); +INSERT INTO t1 VALUES (8,'2020-09-25 13:00:00',1); +INSERT INTO t1 VALUES (9,'2020-09-26 13:00:00',1); + +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE VIEW v2 AS SELECT * FROM t1 ORDER BY dt; +SELECT dt, sum(foo) AS foo FROM v1 WHERE dt>DATE_SUB('2020-09-27 00:00:00', INTERVAL 3 DAY) GROUP BY dt; +SELECT dt, sum(foo) AS foo FROM v2 WHERE dt>DATE_SUB('2020-09-27 00:00:00', INTERVAL 3 DAY) GROUP BY dt; + +DROP TABLE t1; +DROP VIEW v1,v2; + +--echo # +--echo # End of 10.2 tests +--echo # + +--echo # --echo # MDEV-16170 --echo # Server crashes in Item_null_result::type_handler on SELECT with ROLLUP --echo # @@ -2009,4 +2042,29 @@ INSERT INTO t1 VALUES ('2032-10-08'); SELECT d != '2023-03-04' AS f, COUNT(*) FROM t1 GROUP BY d WITH ROLLUP; DROP TABLE t1; +--echo # +--echo # MDEV-24710 Uninitialized value upon CREATE .. SELECT ... VALUE +--echo # + +CREATE TABLE t1 (a VARCHAR(8) NOT NULL DEFAULT ''); +INSERT INTO t1 (a) VALUES ('foo'); +CREATE TABLE t2 AS SELECT MAX(a) AS f1, a AS f2 FROM t1 WHERE VALUE(a) IS NOT NULL; +SELECT * from t2; +SELECT MAX(a) AS f1, a AS f2 FROM t1 WHERE VALUE(a) IS NOT NULL; +SELECT MAX(a) AS f1, a AS f2 FROM t1 WHERE 1=0; +drop table t1,t2; + +--echo # Extra test by to check the fix for MDEV-24710 + +create table t20 (pk int primary key, a int); +insert into t20 values (1,1);create table t21 (pk int primary key, b int not null); +insert into t21 values (1,1); +create table t22 (a int); +insert into t22 values (1),(2); +select a, (select max(t21.b) from t20 left join t21 on t21.pk=t20.a+10 + where t20.pk=1 and rand(123) < 0.5) as SUBQ from t22; +drop table t20, t21, t22; + +--echo # --echo # End of 10.3 tests +--echo # diff --git a/mysql-test/main/group_min_max.result b/mysql-test/main/group_min_max.result index a28cc418207..8d240f9f36d 100644 --- a/mysql-test/main/group_min_max.result +++ b/mysql-test/main/group_min_max.result @@ -2940,7 +2940,7 @@ NULL EXPLAIN SELECT MIN( a ) FROM t1 WHERE a <> NULL; id select_type table type possible_keys key key_len ref rows Extra -x x x x x x x x x Impossible WHERE noticed after reading const tables +x x x x x x x x x Using where; Using index SELECT MIN( a ) FROM t1 WHERE a <> NULL; MIN( a ) NULL diff --git a/mysql-test/main/having.result b/mysql-test/main/having.result index 703f013c2da..51b88c5b8d2 100644 --- a/mysql-test/main/having.result +++ b/mysql-test/main/having.result @@ -847,6 +847,39 @@ t r DROP TABLE t1; DROP FUNCTION next_seq_value; DROP TABLE series; +# +# MDEV-24958 Server crashes in my_strtod / +# Value_source::Converter_strntod::Converter_strntod with DEFAULT(blob) +# +# MDEV-24942 Server crashes in _ma_rec_pack / _ma_write_blob_record with +# DEFAULT() on BLOB +# +CREATE TABLE t1 (id INT, f MEDIUMTEXT NOT NULL DEFAULT 'A'); +INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); +SELECT f FROM t1 GROUP BY id ORDER BY DEFAULT(f); +f +foo +bar +SELECT DEFAULT(f) AS h FROM t1 HAVING h > 5; +h +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'A' +SELECT DEFAULT(f) AS h FROM t1 HAVING h >= 0; +h +A +A +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'A' +SELECT DEFAULT(f) AS h FROM t1 HAVING h >= 'A'; +h +A +A +alter table t1 add column b int default (rand()+1+3); +select default(b) AS h FROM t1 HAVING h > "2"; +h +# +# +drop table t1; # End of 10.3 tests # # MDEV-18681: AND formula in HAVING with several occurances diff --git a/mysql-test/main/having.test b/mysql-test/main/having.test index 072f1a088dc..7e0a0439f8e 100644 --- a/mysql-test/main/having.test +++ b/mysql-test/main/having.test @@ -891,6 +891,27 @@ DROP TABLE t1; DROP FUNCTION next_seq_value; DROP TABLE series; + +--echo # +--echo # MDEV-24958 Server crashes in my_strtod / +--echo # Value_source::Converter_strntod::Converter_strntod with DEFAULT(blob) +--echo # +--echo # MDEV-24942 Server crashes in _ma_rec_pack / _ma_write_blob_record with +--echo # DEFAULT() on BLOB +--echo # + +CREATE TABLE t1 (id INT, f MEDIUMTEXT NOT NULL DEFAULT 'A'); +INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); +SELECT f FROM t1 GROUP BY id ORDER BY DEFAULT(f); +SELECT DEFAULT(f) AS h FROM t1 HAVING h > 5; +SELECT DEFAULT(f) AS h FROM t1 HAVING h >= 0; +SELECT DEFAULT(f) AS h FROM t1 HAVING h >= 'A'; + +alter table t1 add column b int default (rand()+1+3); +--replace_column 1 # +select default(b) AS h FROM t1 HAVING h > "2"; +drop table t1; + --echo # End of 10.3 tests --echo # diff --git a/mysql-test/main/index_merge_myisam.result b/mysql-test/main/index_merge_myisam.result index 387bab6b408..55caf051720 100644 --- a/mysql-test/main/index_merge_myisam.result +++ b/mysql-test/main/index_merge_myisam.result @@ -1687,7 +1687,8 @@ INSERT INTO t1 VALUES ALTER TABLE t1 ENABLE KEYS; EXPLAIN SELECT * FROM t1 FORCE KEY (PRIMARY , i , c1 , c2) -WHERE pk = 255 OR i = 22 OR (pk IN (1 , 136) AND c2 IN ('c' , 'w') AND (c1 NOT BETWEEN 'e' AND 'i' OR c2 > 'g')) OR pk != 1 ; +WHERE pk = 255 OR i = 22 OR (pk IN (1 , 136) AND c2 IN ('c' , 'w') AND (c1 +NOT BETWEEN 'e' AND 'i' OR c2 > 'g')) OR (pk is not null and (pk <1 or pk>1)) ; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge PRIMARY,c1,i,c2 PRIMARY,i 0,5 NULL 69 Using sort_union(PRIMARY,i); Using where DROP TABLE t1; diff --git a/mysql-test/main/index_merge_myisam.test b/mysql-test/main/index_merge_myisam.test index 0b0d8d60c15..b77c9bc1ca2 100644 --- a/mysql-test/main/index_merge_myisam.test +++ b/mysql-test/main/index_merge_myisam.test @@ -236,9 +236,11 @@ INSERT INTO t1 VALUES ALTER TABLE t1 ENABLE KEYS; +# note: (pk is not null and (pk <1 or pk>1)) below is a sargable form of pk!=1 EXPLAIN SELECT * FROM t1 FORCE KEY (PRIMARY , i , c1 , c2) -WHERE pk = 255 OR i = 22 OR (pk IN (1 , 136) AND c2 IN ('c' , 'w') AND (c1 NOT BETWEEN 'e' AND 'i' OR c2 > 'g')) OR pk != 1 ; +WHERE pk = 255 OR i = 22 OR (pk IN (1 , 136) AND c2 IN ('c' , 'w') AND (c1 +NOT BETWEEN 'e' AND 'i' OR c2 > 'g')) OR (pk is not null and (pk <1 or pk>1)) ; DROP TABLE t1; diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result index 51dbad1d628..3534c4bd337 100644 --- a/mysql-test/main/information_schema.result +++ b/mysql-test/main/information_schema.result @@ -565,7 +565,7 @@ create view v2 (c) as select a from t1 WITH LOCAL CHECK OPTION; create view v3 (c) as select a from t1 WITH CASCADED CHECK OPTION; select * from information_schema.views; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM -def mysql user select `mysql`.`global_priv`.`Host` AS `Host`,`mysql`.`global_priv`.`User` AS `User`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `mysql`.`global_priv` NONE YES mariadb.sys@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED +def mysql user select `mysql`.`global_priv`.`Host` AS `Host`,`mysql`.`global_priv`.`User` AS `User`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,if(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.password_last_changed'),1) = 0,'Y','N') AS `password_expired`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `mysql`.`global_priv` NONE YES mariadb.sys@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED def test v1 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED def test v2 select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED def test v3 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED @@ -863,6 +863,7 @@ where data_type = 'longtext' and table_schema != 'performance_schema' order by binary table_name, ordinal_position; table_schema table_name column_name information_schema ALL_PLUGINS PLUGIN_DESCRIPTION +information_schema CHECK_CONSTRAINTS CHECK_CLAUSE information_schema COLUMNS COLUMN_DEFAULT information_schema COLUMNS COLUMN_TYPE information_schema COLUMNS GENERATION_EXPRESSION @@ -2222,17 +2223,22 @@ SCHEMA_NAME # MDEV-14836: Assertion `m_status == DA_ERROR' failed in # Diagnostics_area::sql_errno upon query from I_S with LIMIT ROWS EXAMINED # -SELECT * FROM seq_1_to_100 LIMIT ROWS EXAMINED 10; -seq -1 -2 -3 -4 -5 -6 -7 +SELECT * FROM INFORMATION_SCHEMA.`COLUMNS` LIMIT ROWS EXAMINED 10; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 11 rows, which exceeds LIMIT ROWS EXAMINED (10). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query examined at least ### rows, which exceeds LIMIT ROWS EXAMINED (10). The query result may be incomplete +# +# MDEV-24179: AAssertion `m_status == DA_ERROR || m_status == DA_OK || +# m_status == DA_OK_BULK' failed in Diagnostics_area::message() +# +call mtr.add_suppression("Sort aborted.*"); +DROP DATABASE test; +CREATE DATABASE test; +USE test; +CREATE VIEW v AS SELECT table_schema AS object_schema, table_name AS object_name, table_type AS object_type FROM information_schema.tables ORDER BY object_schema; +SELECT * FROM v LIMIT ROWS EXAMINED 9; +ERROR HY000: Sort aborted: +DROP VIEW v; # # End of 10.2 Test # @@ -2310,5 +2316,34 @@ create table t2 (n int); insert into t1 set n = (select table_rows from information_schema.tables where table_name='t2'); drop table t1, t2; # +# MDEV-24593 Signal 11 when group by primary key of table joined to information_schema.columns +# +create table t1 (f varchar(64) primary key); +select f from information_schema.columns i +inner join t1 on f=i.column_name +group by f; +f +drop table t1; +# +# MDEV-24929 Server crash in thr_multi_unlock or in +# get_schema_tables_result upon select from I_S with joins +# +CREATE TABLE t1 (a TIMESTAMP, KEY (a)); +INSERT INTO t1 VALUES ('2012-12-12'),('2021-11-11'); +SELECT count(*) FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.ROUTINES) ON (t1b.a IS NULL); +count(*) +2 +SELECT count(*) FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.PROFILING) ON (t1b.a IS NULL); +count(*) +2 +DROP TABLE t1; +# +# MDEV-24868 Server crashes in optimize_schema_tables_memory_usage after select from information_schema.innodb_sys_columns +# +create table t1 ( name varchar(64) character set utf8, len int); +select * from t1 where (name, len) in (select name, len from information_schema.innodb_sys_columns having len = 8); +name len +drop table t1; +# # End of 10.3 tests # diff --git a/mysql-test/main/information_schema.test b/mysql-test/main/information_schema.test index d9952538142..c3dbc1f6e6b 100644 --- a/mysql-test/main/information_schema.test +++ b/mysql-test/main/information_schema.test @@ -1931,7 +1931,25 @@ SELECT SCHEMA_NAME from information_schema.schemata where schema_name=REPEAT('a' --echo # Diagnostics_area::sql_errno upon query from I_S with LIMIT ROWS EXAMINED --echo # -SELECT * FROM seq_1_to_100 LIMIT ROWS EXAMINED 10; +replace_regex /at least \d+ rows/at least ### rows/; +SELECT * FROM INFORMATION_SCHEMA.`COLUMNS` LIMIT ROWS EXAMINED 10; + +--echo # +--echo # MDEV-24179: AAssertion `m_status == DA_ERROR || m_status == DA_OK || +--echo # m_status == DA_OK_BULK' failed in Diagnostics_area::message() +--echo # + +call mtr.add_suppression("Sort aborted.*"); + +DROP DATABASE test; +CREATE DATABASE test; +USE test; +CREATE VIEW v AS SELECT table_schema AS object_schema, table_name AS object_name, table_type AS object_type FROM information_schema.tables ORDER BY object_schema; + +--error ER_FILSORT_ABORT +SELECT * FROM v LIMIT ROWS EXAMINED 9; + +DROP VIEW v; --echo # --echo # End of 10.2 Test @@ -2007,6 +2025,34 @@ create table t2 (n int); insert into t1 set n = (select table_rows from information_schema.tables where table_name='t2'); drop table t1, t2; + +--echo # +--echo # MDEV-24593 Signal 11 when group by primary key of table joined to information_schema.columns +--echo # +create table t1 (f varchar(64) primary key); +select f from information_schema.columns i +inner join t1 on f=i.column_name +group by f; +drop table t1; + +--echo # +--echo # MDEV-24929 Server crash in thr_multi_unlock or in +--echo # get_schema_tables_result upon select from I_S with joins +--echo # + +CREATE TABLE t1 (a TIMESTAMP, KEY (a)); +INSERT INTO t1 VALUES ('2012-12-12'),('2021-11-11'); +SELECT count(*) FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.ROUTINES) ON (t1b.a IS NULL); +SELECT count(*) FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.PROFILING) ON (t1b.a IS NULL); +DROP TABLE t1; + +--echo # +--echo # MDEV-24868 Server crashes in optimize_schema_tables_memory_usage after select from information_schema.innodb_sys_columns +--echo # +create table t1 ( name varchar(64) character set utf8, len int); +select * from t1 where (name, len) in (select name, len from information_schema.innodb_sys_columns having len = 8); +drop table t1; + --echo # --echo # End of 10.3 tests --echo # diff --git a/mysql-test/main/innodb_ext_key.result b/mysql-test/main/innodb_ext_key.result index 7cc03bee546..6fba116d35d 100644 --- a/mysql-test/main/innodb_ext_key.result +++ b/mysql-test/main/innodb_ext_key.result @@ -795,6 +795,21 @@ EXPLAIN } drop table t1; SET optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; +# +# MDEV-11172: EXPLAIN shows non-sensical value for key_len with type=index +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +CREATE TABLE t2 ( +pk VARCHAR(50), +a VARCHAR(20), +KEY k1(a), +PRIMARY KEY(pk) +)ENGINE=INNODB; +INSERT INTO t2 SELECT a,a FROM t1; +EXPLAIN SELECT pk FROM t2 FORCE INDEX(k1); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index NULL k1 23 NULL # Using index +DROP TABLE t1,t2; set global innodb_stats_persistent= @innodb_stats_persistent_save; -set global innodb_stats_persistent_sample_pages= -@innodb_stats_persistent_sample_pages_save; +set global innodb_stats_persistent_sample_pages= @innodb_stats_persistent_sample_pages_save; diff --git a/mysql-test/main/innodb_ext_key.test b/mysql-test/main/innodb_ext_key.test index 413d5570be5..1ff0ea51990 100644 --- a/mysql-test/main/innodb_ext_key.test +++ b/mysql-test/main/innodb_ext_key.test @@ -620,6 +620,26 @@ select * from t1 force index(k1) where f2 <= 5 and pk2 <=5 and pk1 = 'abc' and drop table t1; SET optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; + +--echo # +--echo # MDEV-11172: EXPLAIN shows non-sensical value for key_len with type=index +--echo # + +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +CREATE TABLE t2 ( + pk VARCHAR(50), + a VARCHAR(20), + KEY k1(a), + PRIMARY KEY(pk) +)ENGINE=INNODB; + +INSERT INTO t2 SELECT a,a FROM t1; +--replace_column 9 # +EXPLAIN SELECT pk FROM t2 FORCE INDEX(k1); + +DROP TABLE t1,t2; + set global innodb_stats_persistent= @innodb_stats_persistent_save; -set global innodb_stats_persistent_sample_pages= - @innodb_stats_persistent_sample_pages_save; +set global innodb_stats_persistent_sample_pages= @innodb_stats_persistent_sample_pages_save; diff --git a/mysql-test/main/innodb_icp.result b/mysql-test/main/innodb_icp.result index 949bc9a00d8..96ff1964ac1 100644 --- a/mysql-test/main/innodb_icp.result +++ b/mysql-test/main/innodb_icp.result @@ -455,11 +455,11 @@ c1 INT NOT NULL, PRIMARY KEY (pk) ); INSERT INTO t1 VALUES (1,9),(2,7),(3,6),(4,3),(5,1); -EXPLAIN SELECT pk, c1 FROM t1 WHERE pk <> 3; +EXPLAIN SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 4 Using where SET SESSION optimizer_switch='index_condition_pushdown=off'; -SELECT pk, c1 FROM t1 WHERE pk <> 3; +SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3); pk c1 1 9 2 7 @@ -687,23 +687,23 @@ INSERT INTO t2 VALUES ('Ill'), ('eckqzsflbzaffti'), ('w'), ('she'), ('gxbwypqtjzwywwer'), ('w'); SET SESSION optimizer_switch='index_condition_pushdown=off'; EXPLAIN -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 1 Using where; Using filesort 1 SIMPLE t2 ref a a 515 test.t1.a 1 Using where -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; b c 1 4 SET SESSION optimizer_switch='index_condition_pushdown=on'; EXPLAIN -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 1 Using where; Using filesort 1 SIMPLE t2 ref a a 515 test.t1.a 1 Using where -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; b c 1 4 diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result index 290aa492a98..e8fe3a10b18 100644 --- a/mysql-test/main/join_cache.result +++ b/mysql-test/main/join_cache.result @@ -6069,6 +6069,93 @@ f2 drop table t1, t2; set join_buffer_size=@save_join_buffer_size; # +# MDEV-21104: BNLH used for multi-join query with embedded outer join +# and possible 'not exists' optimization +# +set join_cache_level=4; +CREATE TABLE t1 (a int) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b int, c int) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1,2),(2,4); +CREATE TABLE t3 (d int, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (1),(2); +CREATE TABLE t4 (e int primary key) ENGINE=MyISAM; +INSERT INTO t4 VALUES (1),(2); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK +test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status OK +test.t4 analyze status Engine-independent statistics collected +test.t4 analyze status OK +SELECT * FROM t2 LEFT JOIN t3 ON c = d; +b c d +1 2 2 +2 4 NULL +SELECT * FROM (t2 LEFT JOIN t3 ON c = d ) JOIN t4; +b c d e +1 2 2 1 +2 4 NULL 1 +1 2 2 2 +2 4 NULL 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t3 hash_index d #hash#d:d 5:5 test.t2.c 2 Using where; Using index; Using join buffer (incremental, BNLH join) +1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b 2 Using index; Using join buffer (incremental, BNLH join) +SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e; +a b c d e +1 1 2 2 1 +2 1 2 2 1 +1 2 4 NULL 2 +2 2 4 NULL 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e +WHERE e IS NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t3 hash_index d #hash#d:d 5:5 test.t2.c 2 Using where; Using index; Using join buffer (incremental, BNLH join) +1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b 2 Using where; Using index; Not exists; Using join buffer (incremental, BNLH join) +SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e +WHERE e IS NULL; +a b c d e +DROP TABLE t1,t2,t3,t4; +set join_cache_level=@save_join_cache_level; +# +# MDEV-24767: forced BNLH used for equi-join supported by compound index +# +create table t1 (a int, b int, c int ) engine=myisam ; +create table t2 (a int, b int, c int, primary key (c,a,b)) engine=myisam ; +insert into t1 values (3,4,2), (5,6,4); +insert into t2 values (3,4,2), (5,6,4); +select t1.a, t1.b, t1.c from t1,t2 +where t2.a = t1.a and t2.b = t1.b and t2.c=t1.c; +a b c +3 4 2 +5 6 4 +explain select t1.a, t1.b, t1.c from t1,t2 +where t2.a = t1.a and t2.b = t1.b and t2.c=t1.c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 12 test.t1.c,test.t1.a,test.t1.b 1 Using index +set join_cache_level=3; +select t1.a, t1.b, t1.c from t1,t2 +where t2.a = t1.a and t2.b = t1.b and t2.c=t1.c; +a b c +3 4 2 +5 6 4 +explain select t1.a, t1.b, t1.c from t1,t2 +where t2.a = t1.a and t2.b = t1.b and t2.c=t1.c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 12:12 test.t1.c,test.t1.a,test.t1.b 2 Using index; Using join buffer (flat, BNLH join) +drop table t1,t2; +set join_cache_level=@save_join_cache_level; +# # MDEV-21243: Join buffer: condition is checked in wrong place for range access # create table t1(a int primary key); @@ -6141,6 +6228,7 @@ EXPLAIN } } drop table t1,t2,t3; +# End of 10.3 tests set @@optimizer_switch=@save_optimizer_switch; set global innodb_stats_persistent= @innodb_stats_persistent_save; set global innodb_stats_persistent_sample_pages= diff --git a/mysql-test/main/join_cache.test b/mysql-test/main/join_cache.test index ce84ccb56fc..b4271f648e3 100644 --- a/mysql-test/main/join_cache.test +++ b/mysql-test/main/join_cache.test @@ -4071,6 +4071,65 @@ set join_buffer_size=@save_join_buffer_size; --echo # +--echo # MDEV-21104: BNLH used for multi-join query with embedded outer join +--echo # and possible 'not exists' optimization +--echo # + +set join_cache_level=4; + +CREATE TABLE t1 (a int) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b int, c int) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1,2),(2,4); +CREATE TABLE t3 (d int, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (1),(2); +CREATE TABLE t4 (e int primary key) ENGINE=MyISAM; +INSERT INTO t4 VALUES (1),(2); +ANALYZE TABLE t1,t2,t3,t4; + +SELECT * FROM t2 LEFT JOIN t3 ON c = d; +SELECT * FROM (t2 LEFT JOIN t3 ON c = d ) JOIN t4; + +let $q1= +SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e; +eval EXPLAIN $q1; +eval $q1; + +let $q2= +SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e + WHERE e IS NULL; +eval EXPLAIN $q2; +eval $q2; + +DROP TABLE t1,t2,t3,t4; + +set join_cache_level=@save_join_cache_level; + +--echo # +--echo # MDEV-24767: forced BNLH used for equi-join supported by compound index +--echo # + +create table t1 (a int, b int, c int ) engine=myisam ; +create table t2 (a int, b int, c int, primary key (c,a,b)) engine=myisam ; +insert into t1 values (3,4,2), (5,6,4); +insert into t2 values (3,4,2), (5,6,4); + +let $q= +select t1.a, t1.b, t1.c from t1,t2 + where t2.a = t1.a and t2.b = t1.b and t2.c=t1.c; + +eval $q; +eval explain $q; + +set join_cache_level=3; +eval $q; +eval explain $q; + +drop table t1,t2; + +set join_cache_level=@save_join_cache_level; + +--echo # --echo # MDEV-21243: Join buffer: condition is checked in wrong place for range access --echo # create table t1(a int primary key); @@ -4109,7 +4168,9 @@ where drop table t1,t2,t3; -# The following command must be the last one in the file +--echo # End of 10.3 tests + +# The following command must be the last one in the file set @@optimizer_switch=@save_optimizer_switch; set global innodb_stats_persistent= @innodb_stats_persistent_save; diff --git a/mysql-test/main/join_outer.result b/mysql-test/main/join_outer.result index c92b8e6115b..b7fcb55e4fe 100644 --- a/mysql-test/main/join_outer.result +++ b/mysql-test/main/join_outer.result @@ -2687,6 +2687,77 @@ id timestamp modifiedBy id REV REVTYPE profile_id id REV person_id id REV DROP TABLE t1,t2,t3,t4; # end of 10.1 tests # +# MDEV-25362: name resolution for subqueries in ON expressions +# +create table t1 (a int, b int); +create table t2 (c int, d int); +create table t3 (e int, f int); +create table t4 (g int, h int); +explain +select * +from +t1 left join +(t2 +join +t3 on +(t3.f=t1.a) +) on (t2.c=t1.a ); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +explain +select * +from +t1 left join +(t2 +join +t3 on +(t3.f=(select max(g) from t4 where t4.h=t1.a)) +) on (t2.c=t1.a ); +ERROR 42S22: Unknown column 't1.a' in 'where clause' +drop table t1,t2,t3,t4; +create table t1 (a int); +insert into t1 values (1),(2); +create table t2 (b int); +insert into t2 values (1),(2); +create table t3 (c int); +insert into t3 values (1),(2); +select * from ( select * from t1 left join t2 +on b in (select x from t3 as sq1) +) as sq2; +ERROR 42S22: Unknown column 'x' in 'field list' +drop table t1,t2,t3; +# end of 10.2 tests +# +# MDEV-22866: Crash in join optimizer with constant outer join nest +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3),(4); +CREATE TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM; +CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t4 VALUES (5),(6); +CREATE TABLE t5 (e INT) ENGINE=MyISAM; +INSERT INTO t5 VALUES (7),(8); +CREATE TABLE t6 (f INT) ENGINE=MyISAM; +INSERT INTO t6 VALUES (9),(10); +SELECT * +FROM +t1 +LEFT JOIN ( +t2 LEFT JOIN ( +t3 JOIN +t4 ON t3.c = t4.d and t3.c >2 and t3.c<0 +) ON t2.b >= t4.d +) ON t1.a <= t2.b +LEFT JOIN t5 ON t2.b = t5.e +LEFT JOIN t6 ON t3.c = t6.f; +a b c d e f +1 3 NULL NULL NULL NULL +1 4 NULL NULL NULL NULL +2 3 NULL NULL NULL NULL +2 4 NULL NULL NULL NULL +drop table t1,t2,t3,t4,t5,t6; +# # MDEV-17518: Range optimization doesn't use ON expressions from nested outer joins # create table t1(a int); @@ -2754,35 +2825,5 @@ WHERE t3.pk IN (2); 1 drop view v4; drop table t1,t2,t3,t4; +# end of 10.3 tests SET optimizer_switch=@org_optimizer_switch; -# -# MDEV-22866: Crash in join optimizer with constant outer join nest -# -CREATE TABLE t1 (a INT) ENGINE=MyISAM; -INSERT INTO t1 VALUES (1),(2); -CREATE TABLE t2 (b INT) ENGINE=MyISAM; -INSERT INTO t2 VALUES (3),(4); -CREATE TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM; -CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM; -INSERT INTO t4 VALUES (5),(6); -CREATE TABLE t5 (e INT) ENGINE=MyISAM; -INSERT INTO t5 VALUES (7),(8); -CREATE TABLE t6 (f INT) ENGINE=MyISAM; -INSERT INTO t6 VALUES (9),(10); -SELECT * -FROM -t1 -LEFT JOIN ( -t2 LEFT JOIN ( -t3 JOIN -t4 ON t3.c = t4.d and t3.c >2 and t3.c<0 -) ON t2.b >= t4.d -) ON t1.a <= t2.b -LEFT JOIN t5 ON t2.b = t5.e -LEFT JOIN t6 ON t3.c = t6.f; -a b c d e f -1 3 NULL NULL NULL NULL -2 3 NULL NULL NULL NULL -1 4 NULL NULL NULL NULL -2 4 NULL NULL NULL NULL -drop table t1,t2,t3,t4,t5,t6; diff --git a/mysql-test/main/join_outer.test b/mysql-test/main/join_outer.test index f835d8af5a8..82c7b265b56 100644 --- a/mysql-test/main/join_outer.test +++ b/mysql-test/main/join_outer.test @@ -2192,6 +2192,91 @@ DROP TABLE t1,t2,t3,t4; --echo # end of 10.1 tests --echo # +--echo # MDEV-25362: name resolution for subqueries in ON expressions +--echo # + +create table t1 (a int, b int); +create table t2 (c int, d int); +create table t3 (e int, f int); +create table t4 (g int, h int); + +--error ER_BAD_FIELD_ERROR +explain +select * +from + t1 left join + (t2 + join + t3 on + (t3.f=t1.a) + ) on (t2.c=t1.a ); + +# This must produce an error: +--error ER_BAD_FIELD_ERROR +explain +select * +from + t1 left join + (t2 + join + t3 on + (t3.f=(select max(g) from t4 where t4.h=t1.a)) + ) on (t2.c=t1.a ); + +drop table t1,t2,t3,t4; + +create table t1 (a int); +insert into t1 values (1),(2); +create table t2 (b int); +insert into t2 values (1),(2); +create table t3 (c int); +insert into t3 values (1),(2); + +--error ER_BAD_FIELD_ERROR +select * from ( select * from t1 left join t2 + on b in (select x from t3 as sq1) + ) as sq2; + +drop table t1,t2,t3; + +--echo # end of 10.2 tests + +--echo # +--echo # MDEV-22866: Crash in join optimizer with constant outer join nest +--echo # + +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3),(4); + +CREATE TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM; + +CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t4 VALUES (5),(6); + +CREATE TABLE t5 (e INT) ENGINE=MyISAM; +INSERT INTO t5 VALUES (7),(8); + +CREATE TABLE t6 (f INT) ENGINE=MyISAM; +INSERT INTO t6 VALUES (9),(10); + +SELECT * +FROM + t1 + LEFT JOIN ( + t2 LEFT JOIN ( + t3 JOIN + t4 ON t3.c = t4.d and t3.c >2 and t3.c<0 + ) ON t2.b >= t4.d + ) ON t1.a <= t2.b + LEFT JOIN t5 ON t2.b = t5.e + LEFT JOIN t6 ON t3.c = t6.f; + +drop table t1,t2,t3,t4,t5,t6; + +--echo # --echo # MDEV-17518: Range optimization doesn't use ON expressions from nested outer joins --echo # create table t1(a int); @@ -2251,39 +2336,6 @@ WHERE t3.pk IN (2); drop view v4; drop table t1,t2,t3,t4; -SET optimizer_switch=@org_optimizer_switch; - ---echo # ---echo # MDEV-22866: Crash in join optimizer with constant outer join nest ---echo # - -CREATE TABLE t1 (a INT) ENGINE=MyISAM; -INSERT INTO t1 VALUES (1),(2); +--echo # end of 10.3 tests -CREATE TABLE t2 (b INT) ENGINE=MyISAM; -INSERT INTO t2 VALUES (3),(4); - -CREATE TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM; - -CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM; -INSERT INTO t4 VALUES (5),(6); - -CREATE TABLE t5 (e INT) ENGINE=MyISAM; -INSERT INTO t5 VALUES (7),(8); - -CREATE TABLE t6 (f INT) ENGINE=MyISAM; -INSERT INTO t6 VALUES (9),(10); - -SELECT * -FROM - t1 - LEFT JOIN ( - t2 LEFT JOIN ( - t3 JOIN - t4 ON t3.c = t4.d and t3.c >2 and t3.c<0 - ) ON t2.b >= t4.d - ) ON t1.a <= t2.b - LEFT JOIN t5 ON t2.b = t5.e - LEFT JOIN t6 ON t3.c = t6.f; - -drop table t1,t2,t3,t4,t5,t6; +SET optimizer_switch=@org_optimizer_switch; diff --git a/mysql-test/main/join_outer_jcl6.result b/mysql-test/main/join_outer_jcl6.result index 2c7dc7b85bb..3cb846426fe 100644 --- a/mysql-test/main/join_outer_jcl6.result +++ b/mysql-test/main/join_outer_jcl6.result @@ -2694,6 +2694,77 @@ id timestamp modifiedBy id REV REVTYPE profile_id id REV person_id id REV DROP TABLE t1,t2,t3,t4; # end of 10.1 tests # +# MDEV-25362: name resolution for subqueries in ON expressions +# +create table t1 (a int, b int); +create table t2 (c int, d int); +create table t3 (e int, f int); +create table t4 (g int, h int); +explain +select * +from +t1 left join +(t2 +join +t3 on +(t3.f=t1.a) +) on (t2.c=t1.a ); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +explain +select * +from +t1 left join +(t2 +join +t3 on +(t3.f=(select max(g) from t4 where t4.h=t1.a)) +) on (t2.c=t1.a ); +ERROR 42S22: Unknown column 't1.a' in 'where clause' +drop table t1,t2,t3,t4; +create table t1 (a int); +insert into t1 values (1),(2); +create table t2 (b int); +insert into t2 values (1),(2); +create table t3 (c int); +insert into t3 values (1),(2); +select * from ( select * from t1 left join t2 +on b in (select x from t3 as sq1) +) as sq2; +ERROR 42S22: Unknown column 'x' in 'field list' +drop table t1,t2,t3; +# end of 10.2 tests +# +# MDEV-22866: Crash in join optimizer with constant outer join nest +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3),(4); +CREATE TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM; +CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t4 VALUES (5),(6); +CREATE TABLE t5 (e INT) ENGINE=MyISAM; +INSERT INTO t5 VALUES (7),(8); +CREATE TABLE t6 (f INT) ENGINE=MyISAM; +INSERT INTO t6 VALUES (9),(10); +SELECT * +FROM +t1 +LEFT JOIN ( +t2 LEFT JOIN ( +t3 JOIN +t4 ON t3.c = t4.d and t3.c >2 and t3.c<0 +) ON t2.b >= t4.d +) ON t1.a <= t2.b +LEFT JOIN t5 ON t2.b = t5.e +LEFT JOIN t6 ON t3.c = t6.f; +a b c d e f +1 3 NULL NULL NULL NULL +2 3 NULL NULL NULL NULL +1 4 NULL NULL NULL NULL +2 4 NULL NULL NULL NULL +drop table t1,t2,t3,t4,t5,t6; +# # MDEV-17518: Range optimization doesn't use ON expressions from nested outer joins # create table t1(a int); @@ -2761,35 +2832,5 @@ WHERE t3.pk IN (2); 1 drop view v4; drop table t1,t2,t3,t4; +# end of 10.3 tests SET optimizer_switch=@org_optimizer_switch; -# -# MDEV-22866: Crash in join optimizer with constant outer join nest -# -CREATE TABLE t1 (a INT) ENGINE=MyISAM; -INSERT INTO t1 VALUES (1),(2); -CREATE TABLE t2 (b INT) ENGINE=MyISAM; -INSERT INTO t2 VALUES (3),(4); -CREATE TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM; -CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM; -INSERT INTO t4 VALUES (5),(6); -CREATE TABLE t5 (e INT) ENGINE=MyISAM; -INSERT INTO t5 VALUES (7),(8); -CREATE TABLE t6 (f INT) ENGINE=MyISAM; -INSERT INTO t6 VALUES (9),(10); -SELECT * -FROM -t1 -LEFT JOIN ( -t2 LEFT JOIN ( -t3 JOIN -t4 ON t3.c = t4.d and t3.c >2 and t3.c<0 -) ON t2.b >= t4.d -) ON t1.a <= t2.b -LEFT JOIN t5 ON t2.b = t5.e -LEFT JOIN t6 ON t3.c = t6.f; -a b c d e f -1 3 NULL NULL NULL NULL -2 3 NULL NULL NULL NULL -1 4 NULL NULL NULL NULL -2 4 NULL NULL NULL NULL -drop table t1,t2,t3,t4,t5,t6; diff --git a/mysql-test/main/kill.result b/mysql-test/main/kill.result index 1ea06aee096..cbb0598485f 100644 --- a/mysql-test/main/kill.result +++ b/mysql-test/main/kill.result @@ -413,3 +413,8 @@ ALTER TABLE t2 DROP c; UNLOCK TABLES; DROP VIEW v1; DROP TABLE t1, t2; +# +# KILL QUERY ID USER +# +kill query id user 'foo'; +ERROR 42S22: Unknown column 'user' in 'field list' diff --git a/mysql-test/main/kill.test b/mysql-test/main/kill.test index c5bbd349574..05e70ff8651 100644 --- a/mysql-test/main/kill.test +++ b/mysql-test/main/kill.test @@ -664,3 +664,9 @@ ALTER TABLE t2 DROP c; UNLOCK TABLES; DROP VIEW v1; DROP TABLE t1, t2; + +--echo # +--echo # KILL QUERY ID USER +--echo # +--error ER_BAD_FIELD_ERROR +kill query id user 'foo'; diff --git a/mysql-test/main/lock_user.result b/mysql-test/main/lock_user.result index 7d9aeebb7aa..560ae6ce425 100644 --- a/mysql-test/main/lock_user.result +++ b/mysql-test/main/lock_user.result @@ -156,6 +156,7 @@ alter user user1@localhost PASSWORD EXPIRE NEVER ACCOUNT UNLOCK ; show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE NEVER alter user user1@localhost ACCOUNT LOCK PASSWORD EXPIRE DEFAULT; show create user user1@localhost; CREATE USER for user1@localhost @@ -167,5 +168,6 @@ localhost user1 {"access":0,"plugin":"mysql_native_password","authentication_str show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE INTERVAL 60 DAY drop user user1@localhost; drop user user2@localhost; diff --git a/mysql-test/main/lock_view.result b/mysql-test/main/lock_view.result index 4d375bace42..364c2cddf60 100644 --- a/mysql-test/main/lock_view.result +++ b/mysql-test/main/lock_view.result @@ -229,3 +229,37 @@ drop user definer@localhost; drop database mysqltest1; drop database mysqltest2; drop database mysqltest3; +# +# MDEV-24331 mysqldump fails with "Got error: 1356" if the database contains a view with a subquery +# +create user u1@localhost; +grant all privileges on test.* to u1@localhost; +connect con1,localhost,u1; +use test; +create table t1 (id int not null); +create view v1 as select * from (select * from t1) dt; +lock table v1 read; +disconnect con1; +connection default; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v1` ( + `id` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +/*!50001 DROP TABLE IF EXISTS `v1`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`u1`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v1` AS select `dt`.`id` AS `id` from (select `test`.`t1`.`id` AS `id` from `test`.`t1`) `dt` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +drop view v1; +drop table t1; +drop user u1@localhost; diff --git a/mysql-test/main/lock_view.test b/mysql-test/main/lock_view.test index 4b1adac5be1..abb8d317946 100644 --- a/mysql-test/main/lock_view.test +++ b/mysql-test/main/lock_view.test @@ -75,3 +75,20 @@ drop user definer@localhost; drop database mysqltest1; drop database mysqltest2; drop database mysqltest3; + +--echo # +--echo # MDEV-24331 mysqldump fails with "Got error: 1356" if the database contains a view with a subquery +--echo # +create user u1@localhost; +grant all privileges on test.* to u1@localhost; +connect con1,localhost,u1; +use test; +create table t1 (id int not null); +create view v1 as select * from (select * from t1) dt; +lock table v1 read; +disconnect con1; +connection default; +exec $MYSQL_DUMP test v1 -uu1 --compact; +drop view v1; +drop table t1; +drop user u1@localhost; diff --git a/mysql-test/main/long_unique.result b/mysql-test/main/long_unique.result index efa0444fff5..eb61a080c96 100644 --- a/mysql-test/main/long_unique.result +++ b/mysql-test/main/long_unique.result @@ -1439,7 +1439,7 @@ drop table t1; create table t1(a varchar(4000)); alter table t1 add index(a); Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/main/long_unique_bugs.result b/mysql-test/main/long_unique_bugs.result index 72dab5bb181..5d6c0562c8a 100644 --- a/mysql-test/main/long_unique_bugs.result +++ b/mysql-test/main/long_unique_bugs.result @@ -148,7 +148,7 @@ ALTER TABLE t1 DROP KEY f, ADD INDEX idx1(f), ALGORITHM=INSTANT; ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY ALTER TABLE t1 ADD KEY idx2(f); Warnings: -Warning 1071 Specified key was too long; max key length is 3072 bytes +Note 1071 Specified key was too long; max key length is 3072 bytes DROP TABLE t1; CREATE TABLE t1(a blob , b blob , unique(a,b)); alter table t1 drop column b; diff --git a/mysql-test/main/mix2_myisam.result b/mysql-test/main/mix2_myisam.result index 5acec2616fa..220d14f3b0e 100644 --- a/mysql-test/main/mix2_myisam.result +++ b/mysql-test/main/mix2_myisam.result @@ -1990,7 +1990,7 @@ a b drop table t1; create table t1 (v varchar(65530), key(v)); Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes drop table t1; SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR create table t1 (v varchar(65536)); diff --git a/mysql-test/main/multi_update.result b/mysql-test/main/multi_update.result index d792b2828b8..4001a47ecd4 100644 --- a/mysql-test/main/multi_update.result +++ b/mysql-test/main/multi_update.result @@ -982,6 +982,59 @@ drop function f1; # # end of 5.5 tests # +# +# MDEV-24823: Invalid multi-table update of view within SP +# +create table t1 (id int) engine=myisam; +insert into t1 values (1),(2),(1); +create table t2 (pk int, c0 int) engine=myisam; +insert into t2 values (1,1), (2,3); +create view v2 as select * from t2; +create view v3 as select * from t2 where c0 < 3; +create procedure sp0() update t1, v2 set v2.pk = 1 where v2.c0 = t1.c1; +call sp0(); +ERROR 42S22: Unknown column 't1.c1' in 'where clause' +call sp0(); +ERROR 42S22: Unknown column 't1.c1' in 'where clause' +create procedure sp1() update (t1 join v2 on v2.c0 = t1.c1) set v2.pk = 1; +call sp1(); +ERROR 42S22: Unknown column 't1.c1' in 'on clause' +call sp1(); +ERROR 42S22: Unknown column 't1.c1' in 'on clause' +create procedure sp2() update (t1 join v3 on v3.c0 = t1.c1) set v3.pk = 1; +call sp2(); +ERROR 42S22: Unknown column 't1.c1' in 'on clause' +call sp2(); +ERROR 42S22: Unknown column 't1.c1' in 'on clause' +create procedure sp3() +update (t1 join v2 on v2.c0 = t1.id) set v2.c0 = v2.c0+1; +select * from t2; +pk c0 +1 1 +2 3 +call sp3(); +select * from t2; +pk c0 +1 2 +2 3 +call sp3(); +select * from t2; +pk c0 +1 3 +2 3 +create procedure sp4() delete t1 from t1 join v2 on v2.c0 = t1.c1; +call sp4(); +ERROR 42S22: Unknown column 't1.c1' in 'on clause' +call sp4(); +ERROR 42S22: Unknown column 't1.c1' in 'on clause' +drop procedure sp0; +drop procedure sp1; +drop procedure sp2; +drop procedure sp3; +drop procedure sp4; +drop view v2,v3; +drop table t1,t2; +# End of 10.2 tests create table t1 (c1 int, c3 int); insert t1(c3) values (1), (2), (3), (4), (5), (6), (7), (8); create table t2 select * from t1; diff --git a/mysql-test/main/multi_update.test b/mysql-test/main/multi_update.test index 8a32f626818..84f06a7c165 100644 --- a/mysql-test/main/multi_update.test +++ b/mysql-test/main/multi_update.test @@ -958,6 +958,59 @@ drop function f1; --echo # end of 5.5 tests --echo # +--echo # +--echo # MDEV-24823: Invalid multi-table update of view within SP +--echo # + +create table t1 (id int) engine=myisam; +insert into t1 values (1),(2),(1); +create table t2 (pk int, c0 int) engine=myisam; +insert into t2 values (1,1), (2,3); +create view v2 as select * from t2; +create view v3 as select * from t2 where c0 < 3; + +create procedure sp0() update t1, v2 set v2.pk = 1 where v2.c0 = t1.c1; +--error ER_BAD_FIELD_ERROR +call sp0(); +--error ER_BAD_FIELD_ERROR +call sp0(); + +create procedure sp1() update (t1 join v2 on v2.c0 = t1.c1) set v2.pk = 1; +--error ER_BAD_FIELD_ERROR +call sp1(); +--error ER_BAD_FIELD_ERROR +call sp1(); + +create procedure sp2() update (t1 join v3 on v3.c0 = t1.c1) set v3.pk = 1; +--error ER_BAD_FIELD_ERROR +call sp2(); +--error ER_BAD_FIELD_ERROR +call sp2(); + +create procedure sp3() +update (t1 join v2 on v2.c0 = t1.id) set v2.c0 = v2.c0+1; +select * from t2; +call sp3(); +select * from t2; +call sp3(); +select * from t2; + +create procedure sp4() delete t1 from t1 join v2 on v2.c0 = t1.c1; +--error ER_BAD_FIELD_ERROR +call sp4(); +--error ER_BAD_FIELD_ERROR +call sp4(); + +drop procedure sp0; +drop procedure sp1; +drop procedure sp2; +drop procedure sp3; +drop procedure sp4; +drop view v2,v3; +drop table t1,t2; + +--echo # End of 10.2 tests + # # MDEV-13911 Support ORDER BY and LIMIT in multi-table update # diff --git a/mysql-test/main/myisam.result b/mysql-test/main/myisam.result index 7556e64936a..32737bd8399 100644 --- a/mysql-test/main/myisam.result +++ b/mysql-test/main/myisam.result @@ -1706,7 +1706,7 @@ a b drop table t1; create table t1 (v varchar(65530), key(v)); Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes drop table if exists t1; set statement sql_mode = 'NO_ENGINE_SUBSTITUTION' for create table t1 (v varchar(65536)); @@ -1980,7 +1980,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a varchar(2048), key `a` (a)); Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1990,7 +1990,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a varchar(2048), key `a` (a) key_block_size=1024); Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -2000,7 +2000,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=1024; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -2046,7 +2046,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=8192; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -2136,7 +2136,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) key_block_size=8192; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -2166,7 +2166,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000); Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -2412,6 +2412,7 @@ Key Start Len Index Type 1 2 30 multip. varchar 2 33 30 multip. char NULL DROP TABLE t1; +set statement sql_mode='' for create table t1 (n int not null, c char(1)) transactional=1; Warnings: Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1' diff --git a/mysql-test/main/myisam.test b/mysql-test/main/myisam.test index 0b153514ecb..9b81ab197ae 100644 --- a/mysql-test/main/myisam.test +++ b/mysql-test/main/myisam.test @@ -1557,6 +1557,7 @@ DROP TABLE t1; # MariaDB: Note that the table will still have 'TRANSACTIONAL=1' attribute. # That's the intended behavior atm. # +set statement sql_mode='' for create table t1 (n int not null, c char(1)) transactional=1; show create table t1; drop table t1; diff --git a/mysql-test/main/myisam_icp.result b/mysql-test/main/myisam_icp.result index 7f34b274764..68770229926 100644 --- a/mysql-test/main/myisam_icp.result +++ b/mysql-test/main/myisam_icp.result @@ -448,11 +448,11 @@ c1 INT NOT NULL, PRIMARY KEY (pk) ); INSERT INTO t1 VALUES (1,9),(2,7),(3,6),(4,3),(5,1); -EXPLAIN SELECT pk, c1 FROM t1 WHERE pk <> 3; +EXPLAIN SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 5 Using where SET SESSION optimizer_switch='index_condition_pushdown=off'; -SELECT pk, c1 FROM t1 WHERE pk <> 3; +SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3); pk c1 1 9 2 7 @@ -680,23 +680,23 @@ INSERT INTO t2 VALUES ('Ill'), ('eckqzsflbzaffti'), ('w'), ('she'), ('gxbwypqtjzwywwer'), ('w'); SET SESSION optimizer_switch='index_condition_pushdown=off'; EXPLAIN -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 1 SIMPLE t2 ref a a 515 const 1 Using where -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; b c 1 4 SET SESSION optimizer_switch='index_condition_pushdown=on'; EXPLAIN -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 1 SIMPLE t2 ref a a 515 const 1 Using where -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; b c 1 4 diff --git a/mysql-test/main/mysql_upgrade.result b/mysql-test/main/mysql_upgrade.result index 6d5df6d90de..596b2673d82 100644 --- a/mysql-test/main/mysql_upgrade.result +++ b/mysql-test/main/mysql_upgrade.result @@ -484,8 +484,6 @@ even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@loca DROP USER very_long_user_name_number_1, very_long_user_name_number_2, even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost; DROP PROCEDURE test.pr; use test; -call mtr.add_suppression('Column last_update in table `mysql`.`innodb_table_stats` is INT NOT NULL but should be'); -alter table mysql.innodb_table_stats modify last_update int not null; create table extralongname_extralongname_extralongname_extralongname_ext ( id int(10) unsigned not null, created_date date not null, @@ -677,7 +675,7 @@ Phase 7/7: Running 'FLUSH PRIVILEGES' OK SHOW CREATE TABLE mysql.user; View Create View character_set_client collation_connection -user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `mysql`.`user` AS select `mysql`.`global_priv`.`Host` AS `Host`,`mysql`.`global_priv`.`User` AS `User`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `mysql`.`global_priv` latin1 latin1_swedish_ci +user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `mysql`.`user` AS select `mysql`.`global_priv`.`Host` AS `Host`,`mysql`.`global_priv`.`User` AS `User`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,if(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.password_last_changed'),1) = 0,'Y','N') AS `password_expired`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `mysql`.`global_priv` latin1 latin1_swedish_ci CREATE ROLE `aRole`; SET ROLE `aRole`; FLUSH PRIVILEGES; @@ -690,8 +688,88 @@ root N root N root N aRole Y +DROP ROLE aRole; +# +# MDEV-24122 Fix previously MySQL-5.7 data directories that upgraded prior to MDEV-23201 +# +# switching from mysql.global_priv to mysql.user +drop view mysql.user_bak; +drop table mysql.user; +truncate table mysql.tables_priv; +FLUSH TABLES mysql.user; +ALTER TABLE mysql.user ADD is_role enum('N', 'Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE mysql.user ADD default_role char(80) binary DEFAULT '' NOT NULL; +ALTER TABLE mysql.user ADD max_statement_time decimal(12,6) DEFAULT 0 NOT NULL; +FLUSH PRIVILEGES; +Phase 1/7: Checking and upgrading mysql database +Processing databases +mysql +mysql.column_stats OK +mysql.columns_priv OK +mysql.db OK +mysql.event OK +mysql.func OK +mysql.global_priv_bak OK +mysql.gtid_slave_pos OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.index_stats OK +mysql.innodb_index_stats OK +mysql.innodb_table_stats OK +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.proxies_priv OK +mysql.roles_mapping OK +mysql.servers OK +mysql.table_stats OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.transaction_registry OK +mysql.user OK +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables +Processing databases +information_schema +mtr +mtr.global_suppressions OK +mtr.test_suppressions OK +performance_schema +test +Phase 7/7: Running 'FLUSH PRIVILEGES' +OK +SHOW CREATE TABLE mysql.user; +View Create View character_set_client collation_connection +user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `mysql`.`user` AS select `mysql`.`global_priv`.`Host` AS `Host`,`mysql`.`global_priv`.`User` AS `User`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,if(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.password_last_changed'),1) = 0,'Y','N') AS `password_expired`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `mysql`.`global_priv` latin1 latin1_swedish_ci +CREATE ROLE `aRole`; +SET DEFAULT ROLE aRole; +SHOW GRANTS; +Grants for root@localhost +GRANT `aRole` TO `root`@`localhost` WITH ADMIN OPTION +GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION +GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION +GRANT USAGE ON *.* TO `aRole` +SET DEFAULT ROLE aRole FOR 'root'@'localhost' +SET DEFAULT ROLE NONE; +SHOW GRANTS; +Grants for root@localhost +GRANT `aRole` TO `root`@`localhost` WITH ADMIN OPTION +GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION +GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION +GRANT USAGE ON *.* TO `aRole` DROP ROLE `aRole`; FLUSH PRIVILEGES; +drop table mysql.global_priv; +rename table mysql.global_priv_bak to mysql.global_priv; # End of 10.2 tests # # Ensure that mysql_upgrade correctly sets truncate_versioning_priv diff --git a/mysql-test/main/mysql_upgrade.test b/mysql-test/main/mysql_upgrade.test index 168104660e7..7d673d2bb4d 100644 --- a/mysql-test/main/mysql_upgrade.test +++ b/mysql-test/main/mysql_upgrade.test @@ -172,8 +172,6 @@ DROP PROCEDURE test.pr; # MDEV-13274 mysql_upgrade fails if dbname+tablename+partioname > 64 chars # use test; -call mtr.add_suppression('Column last_update in table `mysql`.`innodb_table_stats` is INT NOT NULL but should be'); -alter table mysql.innodb_table_stats modify last_update int not null; create table extralongname_extralongname_extralongname_extralongname_ext ( id int(10) unsigned not null, @@ -245,10 +243,42 @@ FLUSH PRIVILEGES; SET ROLE `aRole`; SELECT `User`, `is_role` FROM `mysql`.`user`; +DROP ROLE aRole; + +--echo # +--echo # MDEV-24122 Fix previously MySQL-5.7 data directories that upgraded prior to MDEV-23201 +--echo # + +--source include/switch_to_mysql_user.inc +drop view mysql.user_bak; +drop table mysql.user; +truncate table mysql.tables_priv; +--copy_file std_data/mysql57user.frm $MYSQLD_DATADIR/mysql/user.frm +--copy_file std_data/mysql57user.MYI $MYSQLD_DATADIR/mysql/user.MYI +--copy_file std_data/mysql57user.MYD $MYSQLD_DATADIR/mysql/user.MYD +FLUSH TABLES mysql.user; + +# What prior to MDEV-23201 would of done: +ALTER TABLE mysql.user ADD is_role enum('N', 'Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE mysql.user ADD default_role char(80) binary DEFAULT '' NOT NULL; +ALTER TABLE mysql.user ADD max_statement_time decimal(12,6) DEFAULT 0 NOT NULL; +FLUSH PRIVILEGES; + +--exec $MYSQL_UPGRADE --force 2>&1 +SHOW CREATE TABLE mysql.user; + +CREATE ROLE `aRole`; +SET DEFAULT ROLE aRole; +SHOW GRANTS; +SET DEFAULT ROLE NONE; +SHOW GRANTS; + DROP ROLE `aRole`; --exec $MYSQL mysql < $MYSQLTEST_VARDIR/tmp/user.sql FLUSH PRIVILEGES; --remove_file $MYSQLD_DATADIR/mysql_upgrade_info +drop table mysql.global_priv; +rename table mysql.global_priv_bak to mysql.global_priv; --echo # End of 10.2 tests diff --git a/mysql-test/main/mysqld--help.test b/mysql-test/main/mysqld--help.test index 6efd088cbdd..6fff3f51006 100644 --- a/mysql-test/main/mysqld--help.test +++ b/mysql-test/main/mysqld--help.test @@ -2,6 +2,8 @@ # mysqld --help # --source include/not_embedded.inc +--source include/not_asan.inc +--source include/not_ubsan.inc --source include/have_perfschema.inc --source include/have_profiling.inc --source include/platform.inc diff --git a/mysql-test/main/mysqldump-nl.test b/mysql-test/main/mysqldump-nl.test index 863c846b9a6..4451b0605c2 100644 --- a/mysql-test/main/mysqldump-nl.test +++ b/mysql-test/main/mysqldump-nl.test @@ -26,10 +26,10 @@ create procedure sp() select * from `v1 flush tables; use test; -exec $MYSQL_DUMP --compact --comment --routines --add-drop-database --databases 'mysqltest1 +exec $MYSQL_DUMP --compact --comments --routines --add-drop-database --databases 'mysqltest1 1tsetlqsym'; -exec $MYSQL_DUMP --compact --comment --routines --add-drop-database --databases 'mysqltest1 +exec $MYSQL_DUMP --compact --comments --routines --add-drop-database --databases 'mysqltest1 1tsetlqsym' | $MYSQL; show tables from `mysqltest1 @@ -45,11 +45,11 @@ create database `test\`` show databases like 'test%'; -exec $MYSQL_DUMP --compact --comment --add-drop-database --databases 'test`' 'test\` +exec $MYSQL_DUMP --compact --comments --add-drop-database --databases 'test`' 'test\` \! ls #'; -exec $MYSQL_DUMP --compact --comment --add-drop-database --databases 'test`' 'test\` +exec $MYSQL_DUMP --compact --comments --add-drop-database --databases 'test`' 'test\` \! ls #' | $MYSQL; diff --git a/mysql-test/main/mysqldump-system.result b/mysql-test/main/mysqldump-system.result index d887df81d2b..c443e250e4a 100644 --- a/mysql-test/main/mysqldump-system.result +++ b/mysql-test/main/mysqldump-system.result @@ -90,31 +90,31 @@ USE mysql; LOCK TABLES `column_stats` WRITE; /*!40000 ALTER TABLE `column_stats` DISABLE KEYS */; -INSERT INTO `column_stats` VALUES ('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿'); +REPLACE INTO `column_stats` VALUES ('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿'); /*!40000 ALTER TABLE `column_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `index_stats` WRITE; /*!40000 ALTER TABLE `index_stats` DISABLE KEYS */; -INSERT INTO `index_stats` VALUES ('mysql','tz','PRIMARY',1,98.2500); +REPLACE INTO `index_stats` VALUES ('mysql','tz','PRIMARY',1,98.2500); /*!40000 ALTER TABLE `index_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `table_stats` WRITE; /*!40000 ALTER TABLE `table_stats` DISABLE KEYS */; -INSERT INTO `table_stats` VALUES ('mysql','tz',393); +REPLACE INTO `table_stats` VALUES ('mysql','tz',393); /*!40000 ALTER TABLE `table_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `innodb_index_stats` WRITE; /*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */; -INSERT INTO `innodb_index_stats` VALUES ('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index'); +REPLACE INTO `innodb_index_stats` VALUES ('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index'); /*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `innodb_table_stats` WRITE; /*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */; -INSERT INTO `innodb_table_stats` VALUES ('mysql','tz','2019-12-31 21:00:00',393,1,0); +REPLACE INTO `innodb_table_stats` VALUES ('mysql','tz','2019-12-31 21:00:00',393,1,0); /*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */; UNLOCK TABLES; @@ -122,31 +122,31 @@ USE mysql; LOCK TABLES `time_zone` WRITE; /*!40000 ALTER TABLE `time_zone` DISABLE KEYS */; -INSERT INTO `time_zone` VALUES (1,'N'),(2,'N'),(3,'N'),(4,'Y'),(5,'N'); +REPLACE INTO `time_zone` VALUES (1,'N'),(2,'N'),(3,'N'),(4,'Y'),(5,'N'); /*!40000 ALTER TABLE `time_zone` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_name` WRITE; /*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */; -INSERT INTO `time_zone_name` VALUES ('Europe/Moscow',3),('Japan',5),('leap/Europe/Moscow',4),('MET',1),('Universal',2),('UTC',2); +REPLACE INTO `time_zone_name` VALUES ('Europe/Moscow',3),('Japan',5),('leap/Europe/Moscow',4),('MET',1),('Universal',2),('UTC',2); /*!40000 ALTER TABLE `time_zone_name` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_leap_second` WRITE; /*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */; -INSERT INTO `time_zone_leap_second` VALUES (78796800,1),(94694401,2),(126230402,3),(157766403,4),(189302404,5),(220924805,6),(252460806,7),(283996807,8),(315532808,9),(362793609,10),(394329610,11),(425865611,12),(489024012,13),(567993613,14),(631152014,15),(662688015,16),(709948816,17),(741484817,18),(773020818,19),(820454419,20),(867715220,21),(915148821,22); +REPLACE INTO `time_zone_leap_second` VALUES (78796800,1),(94694401,2),(126230402,3),(157766403,4),(189302404,5),(220924805,6),(252460806,7),(283996807,8),(315532808,9),(362793609,10),(394329610,11),(425865611,12),(489024012,13),(567993613,14),(631152014,15),(662688015,16),(709948816,17),(741484817,18),(773020818,19),(820454419,20),(867715220,21),(915148821,22); /*!40000 ALTER TABLE `time_zone_leap_second` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_transition` WRITE; /*!40000 ALTER TABLE `time_zone_transition` DISABLE KEYS */; -INSERT INTO `time_zone_transition` VALUES (1,-1693706400,0),(1,-1680483600,1),(1,-1663455600,2),(1,-1650150000,3),(1,-1632006000,2),(1,-1618700400,3),(1,-938905200,2),(1,-857257200,3),(1,-844556400,2),(1,-828226800,3),(1,-812502000,2),(1,-796777200,3),(1,228877200,2),(1,243997200,3),(1,260326800,2),(1,276051600,3),(1,291776400,2),(1,307501200,3),(1,323830800,2),(1,338950800,3),(1,354675600,2),(1,370400400,3),(1,386125200,2),(1,401850000,3),(1,417574800,2),(1,433299600,3),(1,449024400,2),(1,465354000,3),(1,481078800,2),(1,496803600,3),(1,512528400,2),(1,528253200,3),(1,543978000,2),(1,559702800,3),(1,575427600,2),(1,591152400,3),(1,606877200,2),(1,622602000,3),(1,638326800,2),(1,654656400,3),(1,670381200,2),(1,686106000,3),(1,701830800,2),(1,717555600,3),(1,733280400,2),(1,749005200,3),(1,764730000,2),(1,780454800,3),(1,796179600,2),(1,811904400,3),(1,828234000,2),(1,846378000,3),(1,859683600,2),(1,877827600,3),(1,891133200,2),(1,909277200,3),(1,922582800,2),(1,941331600,3),(1,954032400,2),(1,972781200,3),(1,985482000,2),(1,1004230800,3),(1,1017536400,2),(1,1035680400,3),(1,1048986000,2),(1,1067130000,3),(1,1080435600,2),(1,1099184400,3),(1,1111885200,2),(1,1130634000,3),(1,1143334800,2),(1,1162083600,3),(1,1174784400,2),(1,1193533200,3),(1,1206838800,2),(1,1224982800,3),(1,1238288400,2),(1,1256432400,3),(1,1269738000,2),(1,1288486800,3),(1,1301187600,2),(1,1319936400,3),(1,1332637200,2),(1,1351386000,3),(1,1364691600,2),(1,1382835600,3),(1,1396141200,2),(1,1414285200,3),(1,1427590800,2),(1,1445734800,3),(1,1459040400,2),(1,1477789200,3),(1,1490490000,2),(1,1509238800,3),(1,1521939600,2),(1,1540688400,3),(1,1553994000,2),(1,1572138000,3),(1,1585443600,2),(1,1603587600,3),(1,1616893200,2),(1,1635642000,3),(1,1648342800,2),(1,1667091600,3),(1,1679792400,2),(1,1698541200,3),(1,1711846800,2),(1,1729990800,3),(1,1743296400,2),(1,1761440400,3),(1,1774746000,2),(1,1792890000,3),(1,1806195600,2),(1,1824944400,3),(1,1837645200,2),(1,1856394000,3),(1,1869094800,2),(1,1887843600,3),(1,1901149200,2),(1,1919293200,3),(1,1932598800,2),(1,1950742800,3),(1,1964048400,2),(1,1982797200,3),(1,1995498000,2),(1,2014246800,3),(1,2026947600,2),(1,2045696400,3),(1,2058397200,2),(1,2077146000,3),(1,2090451600,2),(1,2108595600,3),(1,2121901200,2),(1,2140045200,3),(3,-1688265000,2),(3,-1656819048,1),(3,-1641353448,2),(3,-1627965048,3),(3,-1618716648,1),(3,-1596429048,3),(3,-1593829848,5),(3,-1589860800,4),(3,-1542427200,5),(3,-1539493200,6),(3,-1525323600,5),(3,-1522728000,4),(3,-1491188400,7),(3,-1247536800,4),(3,354920400,5),(3,370728000,4),(3,386456400,5),(3,402264000,4),(3,417992400,5),(3,433800000,4),(3,449614800,5),(3,465346800,8),(3,481071600,9),(3,496796400,8),(3,512521200,9),(3,528246000,8),(3,543970800,9),(3,559695600,8),(3,575420400,9),(3,591145200,8),(3,606870000,9),(3,622594800,8),(3,638319600,9),(3,654649200,8),(3,670374000,10),(3,686102400,11),(3,695779200,8),(3,701812800,5),(3,717534000,4),(3,733273200,9),(3,748998000,8),(3,764722800,9),(3,780447600,8),(3,796172400,9),(3,811897200,8),(3,828226800,9),(3,846370800,8),(3,859676400,9),(3,877820400,8),(3,891126000,9),(3,909270000,8),(3,922575600,9),(3,941324400,8),(3,954025200,9),(3,972774000,8),(3,985474800,9),(3,1004223600,8),(3,1017529200,9),(3,1035673200,8),(3,1048978800,9),(3,1067122800,8),(3,1080428400,9),(3,1099177200,8),(3,1111878000,9),(3,1130626800,8),(3,1143327600,9),(3,1162076400,8),(3,1174777200,9),(3,1193526000,8),(3,1206831600,9),(3,1224975600,8),(3,1238281200,9),(3,1256425200,8),(3,1269730800,9),(3,1288479600,8),(3,1301180400,9),(3,1319929200,8),(3,1332630000,9),(3,1351378800,8),(3,1364684400,9),(3,1382828400,8),(3,1396134000,9),(3,1414278000,8),(3,1427583600,9),(3,1445727600,8),(3,1459033200,9),(3,1477782000,8),(3,1490482800,9),(3,1509231600,8),(3,1521932400,9),(3,1540681200,8),(3,1553986800,9),(3,1572130800,8),(3,1585436400,9),(3,1603580400,8),(3,1616886000,9),(3,1635634800,8),(3,1648335600,9),(3,1667084400,8),(3,1679785200,9),(3,1698534000,8),(3,1711839600,9),(3,1729983600,8),(3,1743289200,9),(3,1761433200,8),(3,1774738800,9),(3,1792882800,8),(3,1806188400,9),(3,1824937200,8),(3,1837638000,9),(3,1856386800,8),(3,1869087600,9),(3,1887836400,8),(3,1901142000,9),(3,1919286000,8),(3,1932591600,9),(3,1950735600,8),(3,1964041200,9),(3,1982790000,8),(3,1995490800,9),(3,2014239600,8),(3,2026940400,9),(3,2045689200,8),(3,2058390000,9),(3,2077138800,8),(3,2090444400,9),(3,2108588400,8),(3,2121894000,9),(3,2140038000,8),(4,-1688265000,2),(4,-1656819048,1),(4,-1641353448,2),(4,-1627965048,3),(4,-1618716648,1),(4,-1596429048,3),(4,-1593829848,5),(4,-1589860800,4),(4,-1542427200,5),(4,-1539493200,6),(4,-1525323600,5),(4,-1522728000,4),(4,-1491188400,7),(4,-1247536800,4),(4,354920409,5),(4,370728010,4),(4,386456410,5),(4,402264011,4),(4,417992411,5),(4,433800012,4),(4,449614812,5),(4,465346812,8),(4,481071612,9),(4,496796413,8),(4,512521213,9),(4,528246013,8),(4,543970813,9),(4,559695613,8),(4,575420414,9),(4,591145214,8),(4,606870014,9),(4,622594814,8),(4,638319615,9),(4,654649215,8),(4,670374016,10),(4,686102416,11),(4,695779216,8),(4,701812816,5),(4,717534017,4),(4,733273217,9),(4,748998018,8),(4,764722818,9),(4,780447619,8),(4,796172419,9),(4,811897219,8),(4,828226820,9),(4,846370820,8),(4,859676420,9),(4,877820421,8),(4,891126021,9),(4,909270021,8),(4,922575622,9),(4,941324422,8),(4,954025222,9),(4,972774022,8),(4,985474822,9),(4,1004223622,8),(4,1017529222,9),(4,1035673222,8),(4,1048978822,9),(4,1067122822,8),(4,1080428422,9),(4,1099177222,8),(4,1111878022,9),(4,1130626822,8),(4,1143327622,9),(4,1162076422,8),(4,1174777222,9),(4,1193526022,8),(4,1206831622,9),(4,1224975622,8),(4,1238281222,9),(4,1256425222,8),(4,1269730822,9),(4,1288479622,8),(4,1301180422,9),(4,1319929222,8),(4,1332630022,9),(4,1351378822,8),(4,1364684422,9),(4,1382828422,8),(4,1396134022,9),(4,1414278022,8),(4,1427583622,9),(4,1445727622,8),(4,1459033222,9),(4,1477782022,8),(4,1490482822,9),(4,1509231622,8),(4,1521932422,9),(4,1540681222,8),(4,1553986822,9),(4,1572130822,8),(4,1585436422,9),(4,1603580422,8),(4,1616886022,9),(4,1635634822,8),(4,1648335622,9),(4,1667084422,8),(4,1679785222,9),(4,1698534022,8),(4,1711839622,9),(4,1729983622,8),(4,1743289222,9),(4,1761433222,8),(4,1774738822,9),(4,1792882822,8),(4,1806188422,9),(4,1824937222,8),(4,1837638022,9),(4,1856386822,8),(4,1869087622,9),(4,1887836422,8),(4,1901142022,9),(4,1919286022,8),(4,1932591622,9),(4,1950735622,8),(4,1964041222,9),(4,1982790022,8),(4,1995490822,9),(4,2014239622,8),(4,2026940422,9),(4,2045689222,8),(4,2058390022,9),(4,2077138822,8),(4,2090444422,9),(4,2108588422,8),(4,2121894022,9),(4,2140038022,8),(5,-1009875600,1); +REPLACE INTO `time_zone_transition` VALUES (1,-1693706400,0),(1,-1680483600,1),(1,-1663455600,2),(1,-1650150000,3),(1,-1632006000,2),(1,-1618700400,3),(1,-938905200,2),(1,-857257200,3),(1,-844556400,2),(1,-828226800,3),(1,-812502000,2),(1,-796777200,3),(1,228877200,2),(1,243997200,3),(1,260326800,2),(1,276051600,3),(1,291776400,2),(1,307501200,3),(1,323830800,2),(1,338950800,3),(1,354675600,2),(1,370400400,3),(1,386125200,2),(1,401850000,3),(1,417574800,2),(1,433299600,3),(1,449024400,2),(1,465354000,3),(1,481078800,2),(1,496803600,3),(1,512528400,2),(1,528253200,3),(1,543978000,2),(1,559702800,3),(1,575427600,2),(1,591152400,3),(1,606877200,2),(1,622602000,3),(1,638326800,2),(1,654656400,3),(1,670381200,2),(1,686106000,3),(1,701830800,2),(1,717555600,3),(1,733280400,2),(1,749005200,3),(1,764730000,2),(1,780454800,3),(1,796179600,2),(1,811904400,3),(1,828234000,2),(1,846378000,3),(1,859683600,2),(1,877827600,3),(1,891133200,2),(1,909277200,3),(1,922582800,2),(1,941331600,3),(1,954032400,2),(1,972781200,3),(1,985482000,2),(1,1004230800,3),(1,1017536400,2),(1,1035680400,3),(1,1048986000,2),(1,1067130000,3),(1,1080435600,2),(1,1099184400,3),(1,1111885200,2),(1,1130634000,3),(1,1143334800,2),(1,1162083600,3),(1,1174784400,2),(1,1193533200,3),(1,1206838800,2),(1,1224982800,3),(1,1238288400,2),(1,1256432400,3),(1,1269738000,2),(1,1288486800,3),(1,1301187600,2),(1,1319936400,3),(1,1332637200,2),(1,1351386000,3),(1,1364691600,2),(1,1382835600,3),(1,1396141200,2),(1,1414285200,3),(1,1427590800,2),(1,1445734800,3),(1,1459040400,2),(1,1477789200,3),(1,1490490000,2),(1,1509238800,3),(1,1521939600,2),(1,1540688400,3),(1,1553994000,2),(1,1572138000,3),(1,1585443600,2),(1,1603587600,3),(1,1616893200,2),(1,1635642000,3),(1,1648342800,2),(1,1667091600,3),(1,1679792400,2),(1,1698541200,3),(1,1711846800,2),(1,1729990800,3),(1,1743296400,2),(1,1761440400,3),(1,1774746000,2),(1,1792890000,3),(1,1806195600,2),(1,1824944400,3),(1,1837645200,2),(1,1856394000,3),(1,1869094800,2),(1,1887843600,3),(1,1901149200,2),(1,1919293200,3),(1,1932598800,2),(1,1950742800,3),(1,1964048400,2),(1,1982797200,3),(1,1995498000,2),(1,2014246800,3),(1,2026947600,2),(1,2045696400,3),(1,2058397200,2),(1,2077146000,3),(1,2090451600,2),(1,2108595600,3),(1,2121901200,2),(1,2140045200,3),(3,-1688265000,2),(3,-1656819048,1),(3,-1641353448,2),(3,-1627965048,3),(3,-1618716648,1),(3,-1596429048,3),(3,-1593829848,5),(3,-1589860800,4),(3,-1542427200,5),(3,-1539493200,6),(3,-1525323600,5),(3,-1522728000,4),(3,-1491188400,7),(3,-1247536800,4),(3,354920400,5),(3,370728000,4),(3,386456400,5),(3,402264000,4),(3,417992400,5),(3,433800000,4),(3,449614800,5),(3,465346800,8),(3,481071600,9),(3,496796400,8),(3,512521200,9),(3,528246000,8),(3,543970800,9),(3,559695600,8),(3,575420400,9),(3,591145200,8),(3,606870000,9),(3,622594800,8),(3,638319600,9),(3,654649200,8),(3,670374000,10),(3,686102400,11),(3,695779200,8),(3,701812800,5),(3,717534000,4),(3,733273200,9),(3,748998000,8),(3,764722800,9),(3,780447600,8),(3,796172400,9),(3,811897200,8),(3,828226800,9),(3,846370800,8),(3,859676400,9),(3,877820400,8),(3,891126000,9),(3,909270000,8),(3,922575600,9),(3,941324400,8),(3,954025200,9),(3,972774000,8),(3,985474800,9),(3,1004223600,8),(3,1017529200,9),(3,1035673200,8),(3,1048978800,9),(3,1067122800,8),(3,1080428400,9),(3,1099177200,8),(3,1111878000,9),(3,1130626800,8),(3,1143327600,9),(3,1162076400,8),(3,1174777200,9),(3,1193526000,8),(3,1206831600,9),(3,1224975600,8),(3,1238281200,9),(3,1256425200,8),(3,1269730800,9),(3,1288479600,8),(3,1301180400,9),(3,1319929200,8),(3,1332630000,9),(3,1351378800,8),(3,1364684400,9),(3,1382828400,8),(3,1396134000,9),(3,1414278000,8),(3,1427583600,9),(3,1445727600,8),(3,1459033200,9),(3,1477782000,8),(3,1490482800,9),(3,1509231600,8),(3,1521932400,9),(3,1540681200,8),(3,1553986800,9),(3,1572130800,8),(3,1585436400,9),(3,1603580400,8),(3,1616886000,9),(3,1635634800,8),(3,1648335600,9),(3,1667084400,8),(3,1679785200,9),(3,1698534000,8),(3,1711839600,9),(3,1729983600,8),(3,1743289200,9),(3,1761433200,8),(3,1774738800,9),(3,1792882800,8),(3,1806188400,9),(3,1824937200,8),(3,1837638000,9),(3,1856386800,8),(3,1869087600,9),(3,1887836400,8),(3,1901142000,9),(3,1919286000,8),(3,1932591600,9),(3,1950735600,8),(3,1964041200,9),(3,1982790000,8),(3,1995490800,9),(3,2014239600,8),(3,2026940400,9),(3,2045689200,8),(3,2058390000,9),(3,2077138800,8),(3,2090444400,9),(3,2108588400,8),(3,2121894000,9),(3,2140038000,8),(4,-1688265000,2),(4,-1656819048,1),(4,-1641353448,2),(4,-1627965048,3),(4,-1618716648,1),(4,-1596429048,3),(4,-1593829848,5),(4,-1589860800,4),(4,-1542427200,5),(4,-1539493200,6),(4,-1525323600,5),(4,-1522728000,4),(4,-1491188400,7),(4,-1247536800,4),(4,354920409,5),(4,370728010,4),(4,386456410,5),(4,402264011,4),(4,417992411,5),(4,433800012,4),(4,449614812,5),(4,465346812,8),(4,481071612,9),(4,496796413,8),(4,512521213,9),(4,528246013,8),(4,543970813,9),(4,559695613,8),(4,575420414,9),(4,591145214,8),(4,606870014,9),(4,622594814,8),(4,638319615,9),(4,654649215,8),(4,670374016,10),(4,686102416,11),(4,695779216,8),(4,701812816,5),(4,717534017,4),(4,733273217,9),(4,748998018,8),(4,764722818,9),(4,780447619,8),(4,796172419,9),(4,811897219,8),(4,828226820,9),(4,846370820,8),(4,859676420,9),(4,877820421,8),(4,891126021,9),(4,909270021,8),(4,922575622,9),(4,941324422,8),(4,954025222,9),(4,972774022,8),(4,985474822,9),(4,1004223622,8),(4,1017529222,9),(4,1035673222,8),(4,1048978822,9),(4,1067122822,8),(4,1080428422,9),(4,1099177222,8),(4,1111878022,9),(4,1130626822,8),(4,1143327622,9),(4,1162076422,8),(4,1174777222,9),(4,1193526022,8),(4,1206831622,9),(4,1224975622,8),(4,1238281222,9),(4,1256425222,8),(4,1269730822,9),(4,1288479622,8),(4,1301180422,9),(4,1319929222,8),(4,1332630022,9),(4,1351378822,8),(4,1364684422,9),(4,1382828422,8),(4,1396134022,9),(4,1414278022,8),(4,1427583622,9),(4,1445727622,8),(4,1459033222,9),(4,1477782022,8),(4,1490482822,9),(4,1509231622,8),(4,1521932422,9),(4,1540681222,8),(4,1553986822,9),(4,1572130822,8),(4,1585436422,9),(4,1603580422,8),(4,1616886022,9),(4,1635634822,8),(4,1648335622,9),(4,1667084422,8),(4,1679785222,9),(4,1698534022,8),(4,1711839622,9),(4,1729983622,8),(4,1743289222,9),(4,1761433222,8),(4,1774738822,9),(4,1792882822,8),(4,1806188422,9),(4,1824937222,8),(4,1837638022,9),(4,1856386822,8),(4,1869087622,9),(4,1887836422,8),(4,1901142022,9),(4,1919286022,8),(4,1932591622,9),(4,1950735622,8),(4,1964041222,9),(4,1982790022,8),(4,1995490822,9),(4,2014239622,8),(4,2026940422,9),(4,2045689222,8),(4,2058390022,9),(4,2077138822,8),(4,2090444422,9),(4,2108588422,8),(4,2121894022,9),(4,2140038022,8),(5,-1009875600,1); /*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `time_zone_transition_type` WRITE; /*!40000 ALTER TABLE `time_zone_transition_type` DISABLE KEYS */; -INSERT INTO `time_zone_transition_type` VALUES (1,0,7200,1,'MEST'),(1,1,3600,0,'MET'),(1,2,7200,1,'MEST'),(1,3,3600,0,'MET'),(2,0,0,0,'UTC'),(3,0,9000,0,'MMT'),(3,1,12648,1,'MST'),(3,2,9048,0,'MMT'),(3,3,16248,1,'MDST'),(3,4,10800,0,'MSK'),(3,5,14400,1,'MSD'),(3,6,18000,1,'MSD'),(3,7,7200,0,'EET'),(3,8,10800,0,'MSK'),(3,9,14400,1,'MSD'),(3,10,10800,1,'EEST'),(3,11,7200,0,'EET'),(4,0,9000,0,'MMT'),(4,1,12648,1,'MST'),(4,2,9048,0,'MMT'),(4,3,16248,1,'MDST'),(4,4,10800,0,'MSK'),(4,5,14400,1,'MSD'),(4,6,18000,1,'MSD'),(4,7,7200,0,'EET'),(4,8,10800,0,'MSK'),(4,9,14400,1,'MSD'),(4,10,10800,1,'EEST'),(4,11,7200,0,'EET'),(5,0,32400,0,'CJT'),(5,1,32400,0,'JST'); +REPLACE INTO `time_zone_transition_type` VALUES (1,0,7200,1,'MEST'),(1,1,3600,0,'MET'),(1,2,7200,1,'MEST'),(1,3,3600,0,'MET'),(2,0,0,0,'UTC'),(3,0,9000,0,'MMT'),(3,1,12648,1,'MST'),(3,2,9048,0,'MMT'),(3,3,16248,1,'MDST'),(3,4,10800,0,'MSK'),(3,5,14400,1,'MSD'),(3,6,18000,1,'MSD'),(3,7,7200,0,'EET'),(3,8,10800,0,'MSK'),(3,9,14400,1,'MSD'),(3,10,10800,1,'EEST'),(3,11,7200,0,'EET'),(4,0,9000,0,'MMT'),(4,1,12648,1,'MST'),(4,2,9048,0,'MMT'),(4,3,16248,1,'MDST'),(4,4,10800,0,'MSK'),(4,5,14400,1,'MSD'),(4,6,18000,1,'MSD'),(4,7,7200,0,'EET'),(4,8,10800,0,'MSK'),(4,9,14400,1,'MSD'),(4,10,10800,1,'EEST'),(4,11,7200,0,'EET'),(5,0,32400,0,'CJT'),(5,1,32400,0,'JST'); /*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; diff --git a/mysql-test/main/mysqldump.result b/mysql-test/main/mysqldump.result index 19ffca17b1e..d0d054b5473 100644 --- a/mysql-test/main/mysqldump.result +++ b/mysql-test/main/mysqldump.result @@ -1,14 +1,10 @@ call mtr.add_suppression("@003f.frm' \\(errno: 22\\)"); +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); # Bug#37938 Test "mysqldump" lacks various insert statements # Turn off concurrent inserts to avoid random errors # NOTE: We reset the variable back to saved value at the end of test SET @OLD_CONCURRENT_INSERT = @@GLOBAL.CONCURRENT_INSERT; SET @@GLOBAL.CONCURRENT_INSERT = 0; -DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3; -drop database if exists mysqldump_test_db; -drop database if exists db1; -drop database if exists db2; -drop view if exists v1, v2, v3; CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024; INSERT INTO t1 VALUES (1), (2); <?xml version="1.0"?> @@ -5726,6 +5722,315 @@ DELIMITER ; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; +# +# MDEV-20939: Race condition between mysqldump import and InnoDB +# persistent statistics calculation +# +# +# Without --replace and --insert-ignore +# + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `innodb_index_stats`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `innodb_index_stats` ( + `database_name` varchar(64) COLLATE utf8_bin NOT NULL, + `table_name` varchar(199) COLLATE utf8_bin NOT NULL, + `index_name` varchar(64) COLLATE utf8_bin NOT NULL, + `last_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `stat_name` varchar(64) COLLATE utf8_bin NOT NULL, + `stat_value` bigint(20) unsigned NOT NULL, + `sample_size` bigint(20) unsigned DEFAULT NULL, + `stat_description` varchar(1024) COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `innodb_table_stats`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `innodb_table_stats` ( + `database_name` varchar(64) COLLATE utf8_bin NOT NULL, + `table_name` varchar(199) COLLATE utf8_bin NOT NULL, + `last_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `n_rows` bigint(20) unsigned NOT NULL, + `clustered_index_size` bigint(20) unsigned NOT NULL, + `sum_of_other_index_sizes` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`database_name`,`table_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `general_log` ( + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `user_host` mediumtext NOT NULL, + `thread_id` bigint(21) unsigned NOT NULL, + `server_id` int(10) unsigned NOT NULL, + `command_type` varchar(64) NOT NULL, + `argument` mediumtext NOT NULL +) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `slow_log` ( + `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `user_host` mediumtext NOT NULL, + `query_time` time(6) NOT NULL, + `lock_time` time(6) NOT NULL, + `rows_sent` int(11) NOT NULL, + `rows_examined` int(11) NOT NULL, + `db` varchar(512) NOT NULL, + `last_insert_id` int(11) NOT NULL, + `insert_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, + `sql_text` mediumtext NOT NULL, + `thread_id` bigint(21) unsigned NOT NULL, + `rows_affected` int(11) NOT NULL +) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `transaction_registry` ( + `transaction_id` bigint(20) unsigned NOT NULL, + `commit_id` bigint(20) unsigned NOT NULL, + `begin_timestamp` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', + `commit_timestamp` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', + `isolation_level` enum('READ-UNCOMMITTED','READ-COMMITTED','REPEATABLE-READ','SERIALIZABLE') COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`transaction_id`), + UNIQUE KEY `commit_id` (`commit_id`), + KEY `begin_timestamp` (`begin_timestamp`), + KEY `commit_timestamp` (`commit_timestamp`,`transaction_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +# +# With --replace +# + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `innodb_index_stats`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `innodb_index_stats` ( + `database_name` varchar(64) COLLATE utf8_bin NOT NULL, + `table_name` varchar(199) COLLATE utf8_bin NOT NULL, + `index_name` varchar(64) COLLATE utf8_bin NOT NULL, + `last_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `stat_name` varchar(64) COLLATE utf8_bin NOT NULL, + `stat_value` bigint(20) unsigned NOT NULL, + `sample_size` bigint(20) unsigned DEFAULT NULL, + `stat_description` varchar(1024) COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0; +/*!40101 SET character_set_client = @saved_cs_client */; + +LOCK TABLES `innodb_index_stats` WRITE; +/*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */; +/*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */; +UNLOCK TABLES; +DROP TABLE IF EXISTS `innodb_table_stats`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `innodb_table_stats` ( + `database_name` varchar(64) COLLATE utf8_bin NOT NULL, + `table_name` varchar(199) COLLATE utf8_bin NOT NULL, + `last_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `n_rows` bigint(20) unsigned NOT NULL, + `clustered_index_size` bigint(20) unsigned NOT NULL, + `sum_of_other_index_sizes` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`database_name`,`table_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0; +/*!40101 SET character_set_client = @saved_cs_client */; + +LOCK TABLES `innodb_table_stats` WRITE; +/*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */; +/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */; +UNLOCK TABLES; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `general_log` ( + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `user_host` mediumtext NOT NULL, + `thread_id` bigint(21) unsigned NOT NULL, + `server_id` int(10) unsigned NOT NULL, + `command_type` varchar(64) NOT NULL, + `argument` mediumtext NOT NULL +) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `slow_log` ( + `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `user_host` mediumtext NOT NULL, + `query_time` time(6) NOT NULL, + `lock_time` time(6) NOT NULL, + `rows_sent` int(11) NOT NULL, + `rows_examined` int(11) NOT NULL, + `db` varchar(512) NOT NULL, + `last_insert_id` int(11) NOT NULL, + `insert_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, + `sql_text` mediumtext NOT NULL, + `thread_id` bigint(21) unsigned NOT NULL, + `rows_affected` int(11) NOT NULL +) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `transaction_registry` ( + `transaction_id` bigint(20) unsigned NOT NULL, + `commit_id` bigint(20) unsigned NOT NULL, + `begin_timestamp` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', + `commit_timestamp` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', + `isolation_level` enum('READ-UNCOMMITTED','READ-COMMITTED','REPEATABLE-READ','SERIALIZABLE') COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`transaction_id`), + UNIQUE KEY `commit_id` (`commit_id`), + KEY `begin_timestamp` (`begin_timestamp`), + KEY `commit_timestamp` (`commit_timestamp`,`transaction_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +# +# With --insert-ignore +# + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `innodb_index_stats`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `innodb_index_stats` ( + `database_name` varchar(64) COLLATE utf8_bin NOT NULL, + `table_name` varchar(199) COLLATE utf8_bin NOT NULL, + `index_name` varchar(64) COLLATE utf8_bin NOT NULL, + `last_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `stat_name` varchar(64) COLLATE utf8_bin NOT NULL, + `stat_value` bigint(20) unsigned NOT NULL, + `sample_size` bigint(20) unsigned DEFAULT NULL, + `stat_description` varchar(1024) COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0; +/*!40101 SET character_set_client = @saved_cs_client */; + +LOCK TABLES `innodb_index_stats` WRITE; +/*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */; +/*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */; +UNLOCK TABLES; +DROP TABLE IF EXISTS `innodb_table_stats`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `innodb_table_stats` ( + `database_name` varchar(64) COLLATE utf8_bin NOT NULL, + `table_name` varchar(199) COLLATE utf8_bin NOT NULL, + `last_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `n_rows` bigint(20) unsigned NOT NULL, + `clustered_index_size` bigint(20) unsigned NOT NULL, + `sum_of_other_index_sizes` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`database_name`,`table_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0; +/*!40101 SET character_set_client = @saved_cs_client */; + +LOCK TABLES `innodb_table_stats` WRITE; +/*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */; +/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */; +UNLOCK TABLES; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `general_log` ( + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `user_host` mediumtext NOT NULL, + `thread_id` bigint(21) unsigned NOT NULL, + `server_id` int(10) unsigned NOT NULL, + `command_type` varchar(64) NOT NULL, + `argument` mediumtext NOT NULL +) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `slow_log` ( + `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `user_host` mediumtext NOT NULL, + `query_time` time(6) NOT NULL, + `lock_time` time(6) NOT NULL, + `rows_sent` int(11) NOT NULL, + `rows_examined` int(11) NOT NULL, + `db` varchar(512) NOT NULL, + `last_insert_id` int(11) NOT NULL, + `insert_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, + `sql_text` mediumtext NOT NULL, + `thread_id` bigint(21) unsigned NOT NULL, + `rows_affected` int(11) NOT NULL +) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE IF NOT EXISTS `transaction_registry` ( + `transaction_id` bigint(20) unsigned NOT NULL, + `commit_id` bigint(20) unsigned NOT NULL, + `begin_timestamp` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', + `commit_timestamp` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', + `isolation_level` enum('READ-UNCOMMITTED','READ-COMMITTED','REPEATABLE-READ','SERIALIZABLE') COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`transaction_id`), + UNIQUE KEY `commit_id` (`commit_id`), + KEY `begin_timestamp` (`begin_timestamp`), + KEY `commit_timestamp` (`commit_timestamp`,`transaction_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + # End of 10.2 tests # # Test for Invisible columns diff --git a/mysql-test/main/mysqldump.test b/mysql-test/main/mysqldump.test index f328bf32361..799f24665ee 100644 --- a/mysql-test/main/mysqldump.test +++ b/mysql-test/main/mysqldump.test @@ -19,12 +19,7 @@ let collation=utf8_unicode_ci; # There are tables in 'mysql' database of type innodb --source include/have_innodb.inc -# This test is slow on buildbot. ---source include/big_test.inc - -disable_query_log; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -enable_query_log; --echo # Bug#37938 Test "mysqldump" lacks various insert statements --echo # Turn off concurrent inserts to avoid random errors @@ -32,15 +27,6 @@ enable_query_log; SET @OLD_CONCURRENT_INSERT = @@GLOBAL.CONCURRENT_INSERT; SET @@GLOBAL.CONCURRENT_INSERT = 0; - ---disable_warnings -DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3; -drop database if exists mysqldump_test_db; -drop database if exists db1; -drop database if exists db2; -drop view if exists v1, v2, v3; ---enable_warnings - # XML output CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024; @@ -2747,6 +2733,29 @@ INSERT INTO t1 (a) VALUES (1),(2),(3); --exec $MYSQL_DUMP --default-character-set=utf8mb4 --triggers --no-data --no-create-info --add-drop-trigger --skip-comments --databases test DROP TABLE t1; +--echo # +--echo # MDEV-20939: Race condition between mysqldump import and InnoDB +--echo # persistent statistics calculation +--echo # + +--let $ignore= --ignore-table=mysql.proxies_priv --ignore-table=mysql.user --ignore-table=mysql.global_priv --ignore-table=mysql.column_stats --ignore-table=mysql.columns_priv --ignore-table=mysql.db --ignore-table=mysql.event --ignore-table=mysql.func --ignore-table=mysql.gtid_slave_pos --ignore-table=mysql.help_category --ignore-table=mysql.help_keyword --ignore-table=mysql.help_relation --ignore-table=mysql.help_topic --ignore-table=mysql.host --ignore-table=mysql.index_stats --ignore-table=mysql.plugin --ignore-table=mysql.proc --ignore-table=mysql.procs_priv --ignore-table=mysql.roles_mapping --ignore-table=mysql.servers --ignore-table=mysql.table_stats --ignore-table=mysql.tables_priv --ignore-table=mysql.time_zone --ignore-table=mysql.time_zone_leap_second --ignore-table=mysql.time_zone_name --ignore-table=mysql.time_zone_transition --ignore-table=mysql.time_zone_transition_type --ignore-table=mysql.general_log --ignore-table=mysql.slow_log +--let $skip_opts= --skip-dump-date --skip-comments + +--echo # +--echo # Without --replace and --insert-ignore +--echo # +--exec $MYSQL_DUMP $ignore $skip_opts mysql + +--echo # +--echo # With --replace +--echo # +--exec $MYSQL_DUMP $ignore $skip_opts --replace mysql + +--echo # +--echo # With --insert-ignore +--echo # +--exec $MYSQL_DUMP $ignore $skip_opts --insert-ignore mysql + --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index ee1273decf6..0ced5f19e14 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -8591,4 +8591,13 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives')) ] DROP TABLE t1; set optimizer_trace='enabled=off'; +# +# MDEV-24975 Server consumes extra 4G memory upon querying INFORMATION_SCHEMA.OPTIIMIZER_TRACE +# +set max_session_mem_used=1024*1024*1024; +select count(*) from information_schema.optimizer_trace; +select * from information_schema.optimizer_trace; +set max_session_mem_used=default; +# # End of 10.4 tests +# diff --git a/mysql-test/main/opt_trace.test b/mysql-test/main/opt_trace.test index 9040b5a54d0..3fae7f34750 100644 --- a/mysql-test/main/opt_trace.test +++ b/mysql-test/main/opt_trace.test @@ -623,4 +623,17 @@ SELECT JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives')) from IN DROP TABLE t1; set optimizer_trace='enabled=off'; + +--echo # +--echo # MDEV-24975 Server consumes extra 4G memory upon querying INFORMATION_SCHEMA.OPTIIMIZER_TRACE +--echo # +set max_session_mem_used=1024*1024*1024; +--disable_result_log +select count(*) from information_schema.optimizer_trace; +select * from information_schema.optimizer_trace; +--enable_result_log +set max_session_mem_used=default; + +--echo # --echo # End of 10.4 tests +--echo # diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result index 22dfcbaa23e..826daf0542f 100644 --- a/mysql-test/main/order_by.result +++ b/mysql-test/main/order_by.result @@ -845,18 +845,20 @@ col2 col col 2 2 2 1 3 3 drop table t1, t2; -create table t1 (a char(25)); +create table t1 (a char(70)); insert into t1 set a = repeat('x', 20); -insert into t1 set a = concat(repeat('x', 19), 'z'); -insert into t1 set a = concat(repeat('x', 19), 'ab'); -insert into t1 set a = concat(repeat('x', 19), 'aa'); +insert into t1 set a = concat(repeat('x', 63), 'z'); +insert into t1 set a = concat(repeat('x', 63), 'ab'); +insert into t1 set a = concat(repeat('x', 63), 'aa'); set max_sort_length=20; +Warnings: +Warning 1292 Truncated incorrect max_sort_length value: '20' select a from t1 order by a; a -xxxxxxxxxxxxxxxxxxxab -xxxxxxxxxxxxxxxxxxxaa xxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxz +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxab +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaa +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz drop table t1; create table t1 ( `sid` decimal(8,0) default null, @@ -3317,6 +3319,8 @@ drop table t1; SET @save_sort_buffer_size= @@sort_buffer_size; SET @save_max_sort_length= @@max_sort_length; SET max_sort_length=8; +Warnings: +Warning 1292 Truncated incorrect max_sort_length value: '8' SET sort_buffer_size=1024; CREATE TABLE t1(a INT, b DECIMAL(65), c BLOB); INSERT INTO t1 SELECT seq, seq, seq from seq_1_to_25; @@ -3384,6 +3388,8 @@ SET @save_max_sort_length= @@max_sort_length; SET @save_sort_buffer_size= @@sort_buffer_size; SET @save_max_length_for_sort_data= @@max_length_for_sort_data; SET max_sort_length=8; +Warnings: +Warning 1292 Truncated incorrect max_sort_length value: '8' SET sort_buffer_size=1024; SET max_length_for_sort_data=7000; CREATE TABLE t1(a VARCHAR(64), b VARCHAR(2048))DEFAULT CHARSET=utf8; @@ -3519,6 +3525,8 @@ INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); SET max_length_for_sort_data= 30; SET sql_select_limit = 3; SET max_sort_length=8; +Warnings: +Warning 1292 Truncated incorrect max_sort_length value: '8' SELECT * FROM t1 ORDER BY a+1; a b 1 1 diff --git a/mysql-test/main/order_by.test b/mysql-test/main/order_by.test index 1269800e79e..1bf353fd69d 100644 --- a/mysql-test/main/order_by.test +++ b/mysql-test/main/order_by.test @@ -532,11 +532,11 @@ drop table t1, t2; # Bug #5428: a problem with small max_sort_length value # -create table t1 (a char(25)); +create table t1 (a char(70)); insert into t1 set a = repeat('x', 20); -insert into t1 set a = concat(repeat('x', 19), 'z'); -insert into t1 set a = concat(repeat('x', 19), 'ab'); -insert into t1 set a = concat(repeat('x', 19), 'aa'); +insert into t1 set a = concat(repeat('x', 63), 'z'); +insert into t1 set a = concat(repeat('x', 63), 'ab'); +insert into t1 set a = concat(repeat('x', 63), 'aa'); set max_sort_length=20; select a from t1 order by a; drop table t1; diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result index a32f160853b..5ca0e099026 100644 --- a/mysql-test/main/parser.result +++ b/mysql-test/main/parser.result @@ -1788,6 +1788,15 @@ EXECUTE IMMEDIATE 'if(`systeminfo /FO LIST'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`systeminfo /FO LIST' at line 1 EXECUTE IMMEDIATE 'if(`systeminfo'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`systeminfo' at line 1 +# +# MDEV-23666 Assertion failed in Lex_input_stream::body_utf8_append +# +SET @@sql_mode='ANSI_QUOTES'; +EXECUTE IMMEDIATE 'CREATE PROCEDURE p() UPDATE t SET c=\'\'"'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"' at line 1 +EXECUTE IMMEDIATE 'CREATE PROCEDURE p() UPDATE t SET c=\'\'"abc'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"abc' at line 1 +SET @@sql_mode=@save_sql_mode; # End of 10.3 tests # # MDEV-19540: 10.4 allow lock options with SELECT in brackets diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test index 0bc470ceb9e..d9a6c2df191 100644 --- a/mysql-test/main/parser.test +++ b/mysql-test/main/parser.test @@ -1564,6 +1564,21 @@ EXECUTE IMMEDIATE 'if(`systeminfo /FO LIST'; --error ER_PARSE_ERROR EXECUTE IMMEDIATE 'if(`systeminfo'; +--echo # +--echo # MDEV-23666 Assertion failed in Lex_input_stream::body_utf8_append +--echo # +SET @@sql_mode='ANSI_QUOTES'; + +# Without a patch execution of the following statements results in assertion +# in Lex_input_stream::body_utf8_append on parsing the statement +--error ER_PARSE_ERROR +EXECUTE IMMEDIATE 'CREATE PROCEDURE p() UPDATE t SET c=\'\'"'; + +--error ER_PARSE_ERROR +EXECUTE IMMEDIATE 'CREATE PROCEDURE p() UPDATE t SET c=\'\'"abc'; + +SET @@sql_mode=@save_sql_mode; + --echo # End of 10.3 tests --echo # diff --git a/mysql-test/main/parser_not_embedded.test b/mysql-test/main/parser_not_embedded.test index 3ebd23e888e..3af1260f4ad 100644 --- a/mysql-test/main/parser_not_embedded.test +++ b/mysql-test/main/parser_not_embedded.test @@ -21,7 +21,7 @@ select 7 as expected, /*!01000 1 + /*!01000 8 + /*!01000 error */ 16 + */ 2 + */ select 4 as expected, /* 1 + /*!01000 8 + */ 2 + */ 4; EOF ---exec $MYSQL --comment --force --table test <$MYSQLTEST_VARDIR/tmp/bug39559.sql +--exec $MYSQL --comments --force --table test <$MYSQLTEST_VARDIR/tmp/bug39559.sql --remove_file $MYSQLTEST_VARDIR/tmp/bug39559.sql --echo # Bug#46527 "COMMIT AND CHAIN RELEASE does not make sense" diff --git a/mysql-test/main/password_expiration.result b/mysql-test/main/password_expiration.result index d05f6b3b5d0..897811bb4ad 100644 --- a/mysql-test/main/password_expiration.result +++ b/mysql-test/main/password_expiration.result @@ -125,6 +125,7 @@ alter user user1@localhost password expire; show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE INTERVAL 123 DAY set password for user1@localhost= password(''); show create user user1@localhost; CREATE USER for user1@localhost @@ -151,10 +152,12 @@ alter user user1@localhost password expire; show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE NEVER flush privileges; show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE NEVER set password for user1@localhost= password(''); alter user user1@localhost password expire default; show create user user1@localhost; @@ -184,10 +187,12 @@ alter user user1@localhost password expire; show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE NEVER flush privileges; show create user user1@localhost; CREATE USER for user1@localhost CREATE USER `user1`@`localhost` PASSWORD EXPIRE +ALTER USER `user1`@`localhost` PASSWORD EXPIRE NEVER set global disconnect_on_expired_password=ON; connect(localhost,user1,,test,MYSQL_PORT,MYSQL_SOCK); connect con1,localhost,user1; diff --git a/mysql-test/main/precedence.result b/mysql-test/main/precedence.result index d5d4e662a8e..fc6579651b4 100644 --- a/mysql-test/main/precedence.result +++ b/mysql-test/main/precedence.result @@ -8016,4 +8016,8 @@ create or replace view v1 as select 1 IS TRUE IS FALSE, 2 IS FALSE IS UNKNOWN, 3 Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; view_definition select 1 is true is false AS `1 IS TRUE IS FALSE`,/*always not null*/ 1 is null AS `2 IS FALSE IS UNKNOWN`,/*always not null*/ 1 is null AS `3 IS UNKNOWN IS NULL`,/*always not null*/ 1 is null is true AS `4 IS NULL IS TRUE` +create or replace view v1 as select 2 IS TRUE = 3, 2 IS FALSE = 3, 2 IS UNKNOWN = 3, 2 IS NULL = 3, ISNULL(2) = 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 is true = 3 AS `2 IS TRUE = 3`,2 is false = 3 AS `2 IS FALSE = 3`,/*always not null*/ 1 is null = 3 AS `2 IS UNKNOWN = 3`,/*always not null*/ 1 is null = 3 AS `2 IS NULL = 3`,/*always not null*/ 1 is null = 1 AS `ISNULL(2) = 1` drop view v1; diff --git a/mysql-test/main/precedence.test b/mysql-test/main/precedence.test index ad367c23603..cd7cee4f911 100644 --- a/mysql-test/main/precedence.test +++ b/mysql-test/main/precedence.test @@ -4785,4 +4785,7 @@ Select view_definition from information_schema.views where table_schema='test' a create or replace view v1 as select 1 IS TRUE IS FALSE, 2 IS FALSE IS UNKNOWN, 3 IS UNKNOWN IS NULL, 4 IS NULL IS TRUE; Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +create or replace view v1 as select 2 IS TRUE = 3, 2 IS FALSE = 3, 2 IS UNKNOWN = 3, 2 IS NULL = 3, ISNULL(2) = 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; + drop view v1; diff --git a/mysql-test/main/processlist_notembedded.result b/mysql-test/main/processlist_notembedded.result index 3c2671ff5e3..d5c25c0a1d9 100644 --- a/mysql-test/main/processlist_notembedded.result +++ b/mysql-test/main/processlist_notembedded.result @@ -1,7 +1,7 @@ # # MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes # -connect con1,localhost,root,,; +connect con1,localhost,root; connection con1; SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync WAIT_FOR go'; connection default; @@ -13,17 +13,21 @@ User disconnect con1; connection default; SET DEBUG_SYNC = 'RESET'; -End of 5.5 tests +# +# End of 5.5 tests +# # # MDEV-23752: SHOW EXPLAIN FOR thd waits for sleep # -connect con1,localhost,root,,; -select sleep(100000);; +connect con1,localhost,root; +select sleep(100000); connection default; -SHOW EXPLAIN FOR con_id; +SHOW EXPLAIN FOR $con_id; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1003 select sleep(100000) -KILL QUERY con_id; +KILL QUERY $con_id; +# # End of 10.2 tests +# diff --git a/mysql-test/main/processlist_notembedded.test b/mysql-test/main/processlist_notembedded.test index 26021040c39..cc577200368 100644 --- a/mysql-test/main/processlist_notembedded.test +++ b/mysql-test/main/processlist_notembedded.test @@ -7,7 +7,7 @@ source include/count_sessions.inc; --echo # MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes --echo # -connect (con1,localhost,root,,); +connect con1,localhost,root; connection con1; @@ -39,22 +39,22 @@ SET DEBUG_SYNC = 'RESET'; source include/wait_until_count_sessions.inc; ---echo End of 5.5 tests +--echo # +--echo # End of 5.5 tests +--echo # --echo # --echo # MDEV-23752: SHOW EXPLAIN FOR thd waits for sleep --echo # ---connect (con1,localhost,root,,) +--connect con1,localhost,root --let $con_id = `SELECT CONNECTION_ID()` ---send select sleep(100000); +--send select sleep(100000) --connection default +evalp SHOW EXPLAIN FOR $con_id; +evalp KILL QUERY $con_id; ---replace_result $con_id con_id -eval SHOW EXPLAIN FOR $con_id; - ---replace_result $con_id con_id -eval KILL QUERY $con_id; - +--echo # --echo # End of 10.2 tests +--echo # diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result index f1972b6b40e..5a436ec5196 100644 --- a/mysql-test/main/ps.result +++ b/mysql-test/main/ps.result @@ -5489,6 +5489,72 @@ ERROR HY000: Default/ignore value is not supported for such parameter usage EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING 0; Database # +# MDEV-24779: main.subselect fails in buildbot with --ps-protocol +# +CREATE TABLE t1(a INT); +PREPARE stmt FROM "SELECT EXISTS(SELECT 1 FROM t1 GROUP BY a IN (select a from t1))"; +EXECUTE stmt; +EXISTS(SELECT 1 FROM t1 GROUP BY a IN (select a from t1)) +0 +EXECUTE stmt; +EXISTS(SELECT 1 FROM t1 GROUP BY a IN (select a from t1)) +0 +DROP TABLE t1; +# +# MDEV-25006: Failed assertion on executing EXPLAIN DELETE statement as a prepared statement +# +CREATE TABLE t1(c1 CHAR(255) PRIMARY KEY); +PREPARE stmt FROM 'EXPLAIN DELETE b FROM t1 AS a JOIN t1 AS b'; +EXECUTE stmt; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE a system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE b system NULL NULL NULL NULL 0 Const row not found +DROP TABLE t1; +CREATE TABLE t1(a INT); +PREPARE stmt FROM 'EXPLAIN DELETE FROM t1.* USING t1'; +EXECUTE stmt; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found +DEALLOCATE PREPARE stmt; +DROP TABLE t1; +# +# MDEV-25108: Running of the EXPLAIN EXTENDED statement produces extra warning +# in case it is executed in PS (prepared statement) mode +# +CREATE TABLE t1 (c int); +CREATE TABLE t2 (d int); +# EXPLAIN EXTENDED in regular way (not PS mode) +EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 +Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` +SHOW WARNINGS; +Level Code Message +Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 +Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` +# Now run the same EXPLAIN EXTENDED in PS mode. Number of warnings +# and their content must be the same as in case running the statement +# in regular way +PREPARE stmt FROM "EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1"; +Warnings: +Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 +EXECUTE stmt; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 +Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` +SHOW WARNINGS; +Level Code Message +Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 +Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` +DEALLOCATE PREPARE stmt; +DROP TABLE t1, t2; +# # End of 10.2 tests # # @@ -5507,5 +5573,37 @@ DEALLOCATE PREPARE stmt; DROP VIEW v1; DROP TABLE t1; # +# MDEV-25197: The statement set password=password('') executed in PS mode +# fails in case it is run by a user with expired password +# +CREATE USER user1@localhost PASSWORD EXPIRE; +SET @disconnect_on_expired_password_save=@@global.disconnect_on_expired_password; +SET GLOBAL disconnect_on_expired_password=OFF; +connect con1,localhost,user1; +connection con1; +# Check that no regular statement like SELECT can be prepared +# by a user with an expired password +PREPARE stmt FROM "SELECT 1"; +ERROR HY000: You must SET PASSWORD before executing this statement +# Check that the DEALLOCATE PREPARE statement can be run by a user +# with an expired password +PREPARE stmt FROM "SET password=password('')"; +DEALLOCATE PREPARE stmt; +# Check that the SET PASSWORD statement can be executed in PS mode by +# a user with an expired password +PREPARE stmt FROM "SET password=password('')"; +EXECUTE stmt; +PREPARE stmt FROM "SELECT 1"; +# Check that user's password is not expired anymore +EXECUTE stmt; +1 +1 +DEALLOCATE PREPARE stmt; +# Clean up +disconnect con1; +connection default; +SET GLOBAL disconnect_on_expired_password=@disconnect_on_expired_password_save; +DROP USER user1@localhost; +# # End of 10.4 tests # diff --git a/mysql-test/main/ps.test b/mysql-test/main/ps.test index e702cb76bbb..2a468d33ace 100644 --- a/mysql-test/main/ps.test +++ b/mysql-test/main/ps.test @@ -4932,6 +4932,50 @@ EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING DEFAULT; EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING 0; --echo # +--echo # MDEV-24779: main.subselect fails in buildbot with --ps-protocol +--echo # + +CREATE TABLE t1(a INT); +PREPARE stmt FROM "SELECT EXISTS(SELECT 1 FROM t1 GROUP BY a IN (select a from t1))"; +EXECUTE stmt; +EXECUTE stmt; +DROP TABLE t1; + +--echo # +--echo # MDEV-25006: Failed assertion on executing EXPLAIN DELETE statement as a prepared statement +--echo # + +CREATE TABLE t1(c1 CHAR(255) PRIMARY KEY); +PREPARE stmt FROM 'EXPLAIN DELETE b FROM t1 AS a JOIN t1 AS b'; +EXECUTE stmt; +DROP TABLE t1; +CREATE TABLE t1(a INT); +PREPARE stmt FROM 'EXPLAIN DELETE FROM t1.* USING t1'; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +DROP TABLE t1; + +--echo # +--echo # MDEV-25108: Running of the EXPLAIN EXTENDED statement produces extra warning +--echo # in case it is executed in PS (prepared statement) mode +--echo # +CREATE TABLE t1 (c int); +CREATE TABLE t2 (d int); + +--echo # EXPLAIN EXTENDED in regular way (not PS mode) +EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1; +SHOW WARNINGS; + +--echo # Now run the same EXPLAIN EXTENDED in PS mode. Number of warnings +--echo # and their content must be the same as in case running the statement +--echo # in regular way +PREPARE stmt FROM "EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1"; +EXECUTE stmt; +SHOW WARNINGS; + +DEALLOCATE PREPARE stmt; +DROP TABLE t1, t2; +--echo # --echo # End of 10.2 tests --echo # @@ -4956,5 +5000,42 @@ DROP VIEW v1; DROP TABLE t1; --echo # +--echo # MDEV-25197: The statement set password=password('') executed in PS mode +--echo # fails in case it is run by a user with expired password +--echo # +CREATE USER user1@localhost PASSWORD EXPIRE; + +SET @disconnect_on_expired_password_save=@@global.disconnect_on_expired_password; +SET GLOBAL disconnect_on_expired_password=OFF; + +connect(con1,localhost,user1); +connection con1; +--echo # Check that no regular statement like SELECT can be prepared +--echo # by a user with an expired password +--error ER_MUST_CHANGE_PASSWORD +PREPARE stmt FROM "SELECT 1"; + +--echo # Check that the DEALLOCATE PREPARE statement can be run by a user +--echo # with an expired password +PREPARE stmt FROM "SET password=password('')"; +DEALLOCATE PREPARE stmt; + +--echo # Check that the SET PASSWORD statement can be executed in PS mode by +--echo # a user with an expired password +PREPARE stmt FROM "SET password=password('')"; +EXECUTE stmt; +PREPARE stmt FROM "SELECT 1"; +--echo # Check that user's password is not expired anymore +EXECUTE stmt; +DEALLOCATE PREPARE stmt; + +--echo # Clean up +disconnect con1; +connection default; + +SET GLOBAL disconnect_on_expired_password=@disconnect_on_expired_password_save; +DROP USER user1@localhost; + +--echo # --echo # End of 10.4 tests --echo # diff --git a/mysql-test/main/ps_show_log.result b/mysql-test/main/ps_show_log.result new file mode 100644 index 00000000000..54eabaeded6 --- /dev/null +++ b/mysql-test/main/ps_show_log.result @@ -0,0 +1,65 @@ +# +# MDEV-24208 SHOW RELAYLOG EVENTS command is not supported in the prepared +# statement protocol yet +# +CREATE USER u1; +include/master-slave.inc +[connection master] +connection master; +CREATE TABLE t1(n INT); +DROP TABLE t1; +connection slave; +PREPARE stmt_1 FROM 'SHOW BINLOG EVENTS'; +EXECUTE stmt_1; +Log_name Pos Event_type Server_id End_log_pos Info +# # Format_desc # # # +# # Gtid_list # # [] +# # Binlog_checkpoint # # # +# # Gtid # # GTID 0-1-1 +# # Query # # use `test`; CREATE TABLE t1(n INT) +# # Gtid # # GTID 0-1-2 +# # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ +# Execute the same prepared statement the second time to check that +# no internal structures used for handling the statement +# 'SHOW BINLOG EVENTS' were damaged. +EXECUTE stmt_1; +Log_name Pos Event_type Server_id End_log_pos Info +# # Format_desc # # # +# # Gtid_list # # [] +# # Binlog_checkpoint # # # +# # Gtid # # GTID 0-1-1 +# # Query # # use `test`; CREATE TABLE t1(n INT) +# # Gtid # # GTID 0-1-2 +# # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ +DEALLOCATE PREPARE stmt_1; +connection slave; +PREPARE stmt_1 FROM 'SHOW RELAYLOG EVENTS'; +EXECUTE stmt_1; +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000001 # Format_desc # # # +slave-relay-bin.000001 # Rotate # # # +# Execute the same prepared statement the second time to check that +# no internal structures used for handling the statement +# 'SHOW RELAYLOG EVENTS' were damaged. +EXECUTE stmt_1; +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000001 # Format_desc # # # +slave-relay-bin.000001 # Rotate # # # +DEALLOCATE PREPARE stmt_1; +# Create the user u1 without the REPLICATION SLAVE privilege required +# for running the statements SHOW BINLOG EVENTS/SHOW RELAYLOG EVENTS +# and check that attempt to execute the statements SHOW BINLOG EVENTS/ +# SHOW RELAYLOG EVENTS as a prepred statements by a user without required +# privileges results in error. +connect con2,localhost,u1,,test; +PREPARE stmt_1 FROM 'SHOW BINLOG EVENTS'; +EXECUTE stmt_1; +ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE privilege(s) for this operation +PREPARE stmt_1 FROM 'SHOW RELAYLOG EVENTS'; +EXECUTE stmt_1; +ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE privilege(s) for this operation +DEALLOCATE PREPARE stmt_1; +include/rpl_end.inc +connection default; +DROP USER u1; +# End of 10.2 tests diff --git a/mysql-test/main/ps_show_log.test b/mysql-test/main/ps_show_log.test new file mode 100644 index 00000000000..95000d2d7e0 --- /dev/null +++ b/mysql-test/main/ps_show_log.test @@ -0,0 +1,73 @@ +--echo # +--echo # MDEV-24208 SHOW RELAYLOG EVENTS command is not supported in the prepared +--echo # statement protocol yet +--echo # + +CREATE USER u1; + +--source include/have_binlog_format_statement.inc +--source include/master-slave.inc +--connection master +CREATE TABLE t1(n INT); + +DROP TABLE t1; + +--sync_slave_with_master +PREPARE stmt_1 FROM 'SHOW BINLOG EVENTS'; + +--replace_column 2 # 4 # 5 # +--replace_regex /Server ver:.*Binlog ver: .*/#/ /slave-bin.*/#/ +EXECUTE stmt_1; + +--echo # Execute the same prepared statement the second time to check that +--echo # no internal structures used for handling the statement +--echo # 'SHOW BINLOG EVENTS' were damaged. + +--replace_column 2 # 4 # 5 # +--replace_regex /Server ver:.*Binlog ver: .*/#/ /slave-bin.*/#/ +EXECUTE stmt_1; + +DEALLOCATE PREPARE stmt_1; + +--connection slave +PREPARE stmt_1 FROM 'SHOW RELAYLOG EVENTS'; +--replace_column 2 # 4 # 5 # +--replace_regex /Server ver:.*Binlog ver: .*/#/ /slave-relay-bin.*;pos=.*/#/ +EXECUTE stmt_1; + +--echo # Execute the same prepared statement the second time to check that +--echo # no internal structures used for handling the statement +--echo # 'SHOW RELAYLOG EVENTS' were damaged. + +--replace_column 2 # 4 # 5 # +--replace_regex /Server ver:.*Binlog ver: .*/#/ /slave-relay-bin.*;pos=.*/#/ +EXECUTE stmt_1; + +DEALLOCATE PREPARE stmt_1; + +--echo # Create the user u1 without the REPLICATION SLAVE privilege required +--echo # for running the statements SHOW BINLOG EVENTS/SHOW RELAYLOG EVENTS +--echo # and check that attempt to execute the statements SHOW BINLOG EVENTS/ +--echo # SHOW RELAYLOG EVENTS as a prepred statements by a user without required +--echo # privileges results in error. + +--connect (con2,localhost,u1,,test) +PREPARE stmt_1 FROM 'SHOW BINLOG EVENTS'; + +--error ER_SPECIFIC_ACCESS_DENIED_ERROR +EXECUTE stmt_1; + +PREPARE stmt_1 FROM 'SHOW RELAYLOG EVENTS'; + +--error ER_SPECIFIC_ACCESS_DENIED_ERROR +EXECUTE stmt_1; + +DEALLOCATE PREPARE stmt_1; + +--source include/rpl_end.inc + +--connection default +# Clean up +DROP USER u1; + +--echo # End of 10.2 tests diff --git a/mysql-test/main/query_cache.result b/mysql-test/main/query_cache.result index 4615c63feb2..fc7ca726c48 100644 --- a/mysql-test/main/query_cache.result +++ b/mysql-test/main/query_cache.result @@ -818,33 +818,33 @@ select @@character_set_results; NULL set character_set_results=default; set GLOBAL query_cache_size=1355776; -create table t1 (id int auto_increment primary key, c char(25)); +create table t1 (id int auto_increment primary key, c char(65)); insert into t1 set c = repeat('x',24); -insert into t1 set c = concat(repeat('x',24),'x'); -insert into t1 set c = concat(repeat('x',24),'w'); -insert into t1 set c = concat(repeat('x',24),'y'); +insert into t1 set c = concat(repeat('x',64),'x'); +insert into t1 set c = concat(repeat('x',64),'w'); +insert into t1 set c = concat(repeat('x',64),'y'); set max_sort_length=200; select c from t1 order by c, id; c xxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxw -xxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxy reset query cache; -set max_sort_length=20; +set max_sort_length=64; select c from t1 order by c, id; c xxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxw -xxxxxxxxxxxxxxxxxxxxxxxxy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxy set max_sort_length=200; select c from t1 order by c, id; c xxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxw -xxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxy set max_sort_length=default; select '1' || '3' from t1; '1' || '3' diff --git a/mysql-test/main/query_cache.test b/mysql-test/main/query_cache.test index 118ebbf1703..6e113f0cdb7 100644 --- a/mysql-test/main/query_cache.test +++ b/mysql-test/main/query_cache.test @@ -606,15 +606,15 @@ set character_set_results=default; # # max_sort_length set GLOBAL query_cache_size=1355776; -create table t1 (id int auto_increment primary key, c char(25)); +create table t1 (id int auto_increment primary key, c char(65)); insert into t1 set c = repeat('x',24); -insert into t1 set c = concat(repeat('x',24),'x'); -insert into t1 set c = concat(repeat('x',24),'w'); -insert into t1 set c = concat(repeat('x',24),'y'); +insert into t1 set c = concat(repeat('x',64),'x'); +insert into t1 set c = concat(repeat('x',64),'w'); +insert into t1 set c = concat(repeat('x',64),'y'); set max_sort_length=200; select c from t1 order by c, id; reset query cache; -set max_sort_length=20; +set max_sort_length=64; select c from t1 order by c, id; set max_sort_length=200; select c from t1 order by c, id; diff --git a/mysql-test/main/range.result b/mysql-test/main/range.result index c10ddf9d9fd..afd1571283f 100644 --- a/mysql-test/main/range.result +++ b/mysql-test/main/range.result @@ -3218,6 +3218,59 @@ pk a b 1 5 50 65 5 50 drop table t1; +create table t1(a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 ( +pk int primary key, +key1 int, +col1 varchar(255), +key (key1, pk) +); +insert into t2 (pk, key1) +select A.a+10 *B.a + 100*C.a, A.a+10 *B.a +100*C.a from t1 A, t1 B, t1 C; +# This must use ALL, not range: +explain select * from t2 force index (primary) where pk not in (1,2,3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 1000 Using where +drop table t1,t2; +# +# MDEV-24444: ASAN use-after-poison in Item_func_in::get_func_mm_tree with NOT IN +# +CREATE TABLE t1 (id INT, a CHAR(3), b INT, PRIMARY KEY(id), KEY(b), KEY(a)); +INSERT INTO t1 VALUES (1,'foo',10),(2,'bar',20); +CREATE TABLE t2 (code CHAR(8), num INT, PRIMARY KEY (code)); +INSERT INTO t2 VALUES ('100',1),('111',2); +SELECT * FROM t1 JOIN t2 ON (t2.code = t1.b) WHERE t1.a NOT IN ('baz', 'qux') OR t2.num != 3; +id a b code num +DROP TABLE t1, t2; +# +# MDEV-23634: Select query hanged the server and leads to OOM ... +# (The fix is to add the same handling for "col!=const" as MDEV-21958 did for NOT IN) +# +create table t1 (pk int primary key, a int); +insert into t1 (pk) values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +# must not use range: +explain select * from t1 force index (primary) where pk != 1 and pk!=2 ; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 10 Using where +drop table t1; +# +# MDEV-22251: get_key_scans_params: Conditional jump or move depends on uninitialised value +# +create table t1 (pk int, i int, v int, primary key (pk), key(v)); +insert into t1 (pk,i,v) values (1,1,2),(2,2,4),(3,3,6),(4,4,8),(5,5,10),(6,6,12),(7,7,14),(8,8,16); +create table t2 (a int, b int); +insert into t2 values (1,2),(2,4); +EXPLAIN +select * from t1 inner join t2 on ( t2.b = t1.v or t2.a = t1.pk); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +1 SIMPLE t1 ALL PRIMARY,v NULL NULL NULL 8 Range checked for each record (index map: 0x3) +select * from t1 inner join t2 on ( t2.b = t1.v or t2.a = t1.pk); +pk i v a b +1 1 2 1 2 +2 2 4 2 4 +drop table t1, t2; # # End of 10.2 tests # diff --git a/mysql-test/main/range.test b/mysql-test/main/range.test index 65f580698c5..de2a428c49a 100644 --- a/mysql-test/main/range.test +++ b/mysql-test/main/range.test @@ -2180,6 +2180,65 @@ eval $q4; drop table t1; +# +# MDEV-21958: Query having many NOT-IN clauses running forever (testcase 2) +# +create table t1(a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t2 ( + pk int primary key, + key1 int, + col1 varchar(255), + key (key1, pk) +); + +insert into t2 (pk, key1) +select A.a+10 *B.a + 100*C.a, A.a+10 *B.a +100*C.a from t1 A, t1 B, t1 C; + +--echo # This must use ALL, not range: +explain select * from t2 force index (primary) where pk not in (1,2,3); + +drop table t1,t2; + +--echo # +--echo # MDEV-24444: ASAN use-after-poison in Item_func_in::get_func_mm_tree with NOT IN +--echo # +CREATE TABLE t1 (id INT, a CHAR(3), b INT, PRIMARY KEY(id), KEY(b), KEY(a)); +INSERT INTO t1 VALUES (1,'foo',10),(2,'bar',20); + +CREATE TABLE t2 (code CHAR(8), num INT, PRIMARY KEY (code)); +INSERT INTO t2 VALUES ('100',1),('111',2); + +SELECT * FROM t1 JOIN t2 ON (t2.code = t1.b) WHERE t1.a NOT IN ('baz', 'qux') OR t2.num != 3; + +DROP TABLE t1, t2; + + +--echo # +--echo # MDEV-23634: Select query hanged the server and leads to OOM ... +--echo # (The fix is to add the same handling for "col!=const" as MDEV-21958 did for NOT IN) +--echo # +create table t1 (pk int primary key, a int); +insert into t1 (pk) values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +--echo # must not use range: +explain select * from t1 force index (primary) where pk != 1 and pk!=2 ; +drop table t1; + +--echo # +--echo # MDEV-22251: get_key_scans_params: Conditional jump or move depends on uninitialised value +--echo # + +create table t1 (pk int, i int, v int, primary key (pk), key(v)); +insert into t1 (pk,i,v) values (1,1,2),(2,2,4),(3,3,6),(4,4,8),(5,5,10),(6,6,12),(7,7,14),(8,8,16); +create table t2 (a int, b int); +insert into t2 values (1,2),(2,4); +EXPLAIN +select * from t1 inner join t2 on ( t2.b = t1.v or t2.a = t1.pk); +select * from t1 inner join t2 on ( t2.b = t1.v or t2.a = t1.pk); +drop table t1, t2; + --echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/range_mrr_icp.result b/mysql-test/main/range_mrr_icp.result index 826ac621064..3fce8b0fc23 100644 --- a/mysql-test/main/range_mrr_icp.result +++ b/mysql-test/main/range_mrr_icp.result @@ -3215,6 +3215,59 @@ pk a b 70 4 40 71 2 20 drop table t1; +create table t1(a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 ( +pk int primary key, +key1 int, +col1 varchar(255), +key (key1, pk) +); +insert into t2 (pk, key1) +select A.a+10 *B.a + 100*C.a, A.a+10 *B.a +100*C.a from t1 A, t1 B, t1 C; +# This must use ALL, not range: +explain select * from t2 force index (primary) where pk not in (1,2,3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 1000 Using where +drop table t1,t2; +# +# MDEV-24444: ASAN use-after-poison in Item_func_in::get_func_mm_tree with NOT IN +# +CREATE TABLE t1 (id INT, a CHAR(3), b INT, PRIMARY KEY(id), KEY(b), KEY(a)); +INSERT INTO t1 VALUES (1,'foo',10),(2,'bar',20); +CREATE TABLE t2 (code CHAR(8), num INT, PRIMARY KEY (code)); +INSERT INTO t2 VALUES ('100',1),('111',2); +SELECT * FROM t1 JOIN t2 ON (t2.code = t1.b) WHERE t1.a NOT IN ('baz', 'qux') OR t2.num != 3; +id a b code num +DROP TABLE t1, t2; +# +# MDEV-23634: Select query hanged the server and leads to OOM ... +# (The fix is to add the same handling for "col!=const" as MDEV-21958 did for NOT IN) +# +create table t1 (pk int primary key, a int); +insert into t1 (pk) values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +# must not use range: +explain select * from t1 force index (primary) where pk != 1 and pk!=2 ; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 10 Using where +drop table t1; +# +# MDEV-22251: get_key_scans_params: Conditional jump or move depends on uninitialised value +# +create table t1 (pk int, i int, v int, primary key (pk), key(v)); +insert into t1 (pk,i,v) values (1,1,2),(2,2,4),(3,3,6),(4,4,8),(5,5,10),(6,6,12),(7,7,14),(8,8,16); +create table t2 (a int, b int); +insert into t2 values (1,2),(2,4); +EXPLAIN +select * from t1 inner join t2 on ( t2.b = t1.v or t2.a = t1.pk); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +1 SIMPLE t1 ALL PRIMARY,v NULL NULL NULL 8 Range checked for each record (index map: 0x3) +select * from t1 inner join t2 on ( t2.b = t1.v or t2.a = t1.pk); +pk i v a b +1 1 2 1 2 +2 2 4 2 4 +drop table t1, t2; # # End of 10.2 tests # diff --git a/mysql-test/main/range_vs_index_merge.result b/mysql-test/main/range_vs_index_merge.result index f0bf2224c92..286338d0433 100644 --- a/mysql-test/main/range_vs_index_merge.result +++ b/mysql-test/main/range_vs_index_merge.result @@ -1810,11 +1810,11 @@ CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX idx(b)); INSERT INTO t1 VALUES (167,9999), (168,10000); EXPLAIN SELECT * FROM t1 -WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR a!=2; +WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR (a<2 or a>2); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY,idx PRIMARY 0 NULL 2 Using index condition; Using where SELECT * FROM t1 -WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR a!=2; +WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR (a<2 or a>2); a b 167 9999 168 10000 @@ -1846,12 +1846,12 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK EXPLAIN SELECT * FROM t1 FORCE KEY (state,capital) -WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND id != 9 +WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND (id<9 or id>9) OR ( capital >= 'Topeka' OR state = 'Kansas' ) AND state != 'Texas'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range state,capital state 71 NULL 8 Using index condition; Using where SELECT * FROM t1 FORCE KEY (state,capital) -WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND id != 9 +WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND (id<9 or id>9) OR ( capital >= 'Topeka' OR state = 'Kansas' ) AND state != 'Texas'; id state capital 4 Florida Tallahassee diff --git a/mysql-test/main/range_vs_index_merge.test b/mysql-test/main/range_vs_index_merge.test index 5ed5f621ab6..94210ce5dd3 100644 --- a/mysql-test/main/range_vs_index_merge.test +++ b/mysql-test/main/range_vs_index_merge.test @@ -1231,9 +1231,9 @@ INSERT INTO t1 VALUES (167,9999), (168,10000); EXPLAIN SELECT * FROM t1 - WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR a!=2; + WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR (a<2 or a>2); SELECT * FROM t1 - WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR a!=2; + WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR (a<2 or a>2); DROP TABLE t1; @@ -1266,10 +1266,10 @@ ANALYZE TABLE t1; EXPLAIN SELECT * FROM t1 FORCE KEY (state,capital) -WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND id != 9 +WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND (id<9 or id>9) OR ( capital >= 'Topeka' OR state = 'Kansas' ) AND state != 'Texas'; SELECT * FROM t1 FORCE KEY (state,capital) -WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND id != 9 +WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND (id<9 or id>9) OR ( capital >= 'Topeka' OR state = 'Kansas' ) AND state != 'Texas'; DROP TABLE t1; diff --git a/mysql-test/main/range_vs_index_merge_innodb.result b/mysql-test/main/range_vs_index_merge_innodb.result index 4cb4745d63a..65800e7397b 100644 --- a/mysql-test/main/range_vs_index_merge_innodb.result +++ b/mysql-test/main/range_vs_index_merge_innodb.result @@ -1816,11 +1816,11 @@ CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX idx(b)); INSERT INTO t1 VALUES (167,9999), (168,10000); EXPLAIN SELECT * FROM t1 -WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR a!=2; +WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR (a<2 or a>2); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index PRIMARY,idx idx 5 NULL 2 Using where; Using index SELECT * FROM t1 -WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR a!=2; +WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR (a<2 or a>2); a b 167 9999 168 10000 @@ -1852,12 +1852,12 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK EXPLAIN SELECT * FROM t1 FORCE KEY (state,capital) -WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND id != 9 +WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND (id<9 or id>9) OR ( capital >= 'Topeka' OR state = 'Kansas' ) AND state != 'Texas'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range state,capital state 71 NULL 8 Using index condition; Using where SELECT * FROM t1 FORCE KEY (state,capital) -WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND id != 9 +WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND (id<9 or id>9) OR ( capital >= 'Topeka' OR state = 'Kansas' ) AND state != 'Texas'; id state capital 4 Florida Tallahassee diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result index ca6a7ef25c7..7e3202337ec 100644 --- a/mysql-test/main/selectivity.result +++ b/mysql-test/main/selectivity.result @@ -1882,4 +1882,62 @@ a b set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; drop table t1; # End of 10.1 tests +# +# MDEV-22583: Selectivity for BIT columns in filtered column for EXPLAIN is incorrect +# +SET optimizer_use_condition_selectivity=4; +SET histogram_size=255; +CREATE TABLE t1 (a BIT(32), b INT); +INSERT INTO t1 VALUES (80, 80), (81, 81), (82, 82); +ANALYZE TABLE t1 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +EXPLAIN EXTENDED SELECT * from t1 where t1.a >= 81; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 66.41 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` >= 81 +SELECT HEX(a), b from t1 where t1.a >= 81; +HEX(a) b +51 81 +52 82 +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +DROP TABLE t1; +# +# MDEV-19474: Histogram statistics are used even with optimizer_use_condition_selectivity=3 +# +CREATE TABLE t1(a int); +INSERT INTO t1 values (1),(2),(2),(3),(4); +SET optimizer_use_condition_selectivity=4; +SET histogram_size= 255; +set use_stat_tables='preferably'; +ANALYZE TABLE t1 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 39.84 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +SET optimizer_use_condition_selectivity=3; +# filtered should show 25 % +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +FLUSH TABLES; +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +set use_stat_tables= @save_use_stat_tables; +DROP TABLE t1; +# End of 10.2 tests set @@global.histogram_size=@save_histogram_size; diff --git a/mysql-test/main/selectivity.test b/mysql-test/main/selectivity.test index 2a0cc823eb4..1d96dc0bf80 100644 --- a/mysql-test/main/selectivity.test +++ b/mysql-test/main/selectivity.test @@ -1281,6 +1281,51 @@ drop table t1; --echo # End of 10.1 tests +--echo # +--echo # MDEV-22583: Selectivity for BIT columns in filtered column for EXPLAIN is incorrect +--echo # + +SET optimizer_use_condition_selectivity=4; +SET histogram_size=255; +CREATE TABLE t1 (a BIT(32), b INT); +INSERT INTO t1 VALUES (80, 80), (81, 81), (82, 82); +ANALYZE TABLE t1 PERSISTENT FOR ALL; +EXPLAIN EXTENDED SELECT * from t1 where t1.a >= 81; +SELECT HEX(a), b from t1 where t1.a >= 81; + +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +DROP TABLE t1; + +--echo # +--echo # MDEV-19474: Histogram statistics are used even with optimizer_use_condition_selectivity=3 +--echo # + +CREATE TABLE t1(a int); +INSERT INTO t1 values (1),(2),(2),(3),(4); +SET optimizer_use_condition_selectivity=4; +SET histogram_size= 255; + +set use_stat_tables='preferably'; + +ANALYZE TABLE t1 PERSISTENT FOR ALL; + +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +SET optimizer_use_condition_selectivity=3; + +--echo # filtered should show 25 % +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +FLUSH TABLES; + +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +set use_stat_tables= @save_use_stat_tables; + +DROP TABLE t1; + +--echo # End of 10.2 tests + # # Clean up # diff --git a/mysql-test/main/selectivity_innodb.result b/mysql-test/main/selectivity_innodb.result index 3bf313ae2b3..a87d0f53bfe 100644 --- a/mysql-test/main/selectivity_innodb.result +++ b/mysql-test/main/selectivity_innodb.result @@ -1443,7 +1443,7 @@ EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a <> 'USARussian' AND b IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref PRIMARY,b b 5 const 2 66.67 Using where; Using index +1 SIMPLE t1 ref PRIMARY,b b 5 const 1 100.00 Using where; Using index 1 SIMPLE t2 ALL NULL NULL NULL NULL 14 100.00 Using join buffer (flat, BNL join) Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`i` AS `i` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` <> 'USARussian' and `test`.`t1`.`b` is null @@ -1892,6 +1892,64 @@ a b set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; drop table t1; # End of 10.1 tests +# +# MDEV-22583: Selectivity for BIT columns in filtered column for EXPLAIN is incorrect +# +SET optimizer_use_condition_selectivity=4; +SET histogram_size=255; +CREATE TABLE t1 (a BIT(32), b INT); +INSERT INTO t1 VALUES (80, 80), (81, 81), (82, 82); +ANALYZE TABLE t1 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +EXPLAIN EXTENDED SELECT * from t1 where t1.a >= 81; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 66.41 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` >= 81 +SELECT HEX(a), b from t1 where t1.a >= 81; +HEX(a) b +51 81 +52 82 +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +DROP TABLE t1; +# +# MDEV-19474: Histogram statistics are used even with optimizer_use_condition_selectivity=3 +# +CREATE TABLE t1(a int); +INSERT INTO t1 values (1),(2),(2),(3),(4); +SET optimizer_use_condition_selectivity=4; +SET histogram_size= 255; +set use_stat_tables='preferably'; +ANALYZE TABLE t1 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 39.84 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +SET optimizer_use_condition_selectivity=3; +# filtered should show 25 % +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +FLUSH TABLES; +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +set use_stat_tables= @save_use_stat_tables; +DROP TABLE t1; +# End of 10.2 tests set @@global.histogram_size=@save_histogram_size; set optimizer_switch=@save_optimizer_switch_for_selectivity_test; set @tmp_ust= @@use_stat_tables; diff --git a/mysql-test/main/set_statement.result b/mysql-test/main/set_statement.result index 511ecf77357..53574fb4e4f 100644 --- a/mysql-test/main/set_statement.result +++ b/mysql-test/main/set_statement.result @@ -1217,6 +1217,31 @@ set @rnd=1; select @rnd; @rnd 0 +# +# MDEV-24860: Incorrect behaviour of SET STATEMENT in case +# it is executed as a prepared statement +# +PREPARE stmt FROM "SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR CREATE TABLE t1 AS SELECT CONCAT('abc') AS c1"; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +# Show definition of the table t1 created using Prepared Statement +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# Create the table t1 with the same definition as it used before +# using regular statement execution mode. +SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR CREATE TABLE t1 AS SELECT CONCAT('abc') AS c1; +# Show that the table has the same definition as it is in case the table +# created in prepared statement mode. +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(3) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; create table t (a int); SET sql_mode=ORACLE; SET STATEMENT myisam_sort_buffer_size=800000 FOR OPTIMIZE TABLE t; @@ -1234,3 +1259,4 @@ SET sql_mode=ORACLE; SET STATEMENT max_statement_time=30 FOR DELETE FROM mysql.user where user = 'unknown'; SET sql_mode=default; SET STATEMENT max_statement_time=30 FOR DELETE FROM mysql.user where user = 'unknown'; +# End of 10.4 tests diff --git a/mysql-test/main/set_statement.test b/mysql-test/main/set_statement.test index 12a6ccad8f9..670e9862abc 100644 --- a/mysql-test/main/set_statement.test +++ b/mysql-test/main/set_statement.test @@ -1137,6 +1137,30 @@ while ($1) --echo # @rnd should be 0 select @rnd; + +--echo # +--echo # MDEV-24860: Incorrect behaviour of SET STATEMENT in case +--echo # it is executed as a prepared statement +--echo # +PREPARE stmt FROM "SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR CREATE TABLE t1 AS SELECT CONCAT('abc') AS c1"; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; + +--echo # Show definition of the table t1 created using Prepared Statement +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--echo # Create the table t1 with the same definition as it used before +--echo # using regular statement execution mode. +SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR CREATE TABLE t1 AS SELECT CONCAT('abc') AS c1; + +--echo # Show that the table has the same definition as it is in case the table +--echo # created in prepared statement mode. +SHOW CREATE TABLE t1; + +DROP TABLE t1; + create table t (a int); SET sql_mode=ORACLE; SET STATEMENT myisam_sort_buffer_size=800000 FOR OPTIMIZE TABLE t; @@ -1152,3 +1176,5 @@ SET sql_mode=ORACLE; SET STATEMENT max_statement_time=30 FOR DELETE FROM mysql.user where user = 'unknown'; SET sql_mode=default; SET STATEMENT max_statement_time=30 FOR DELETE FROM mysql.user where user = 'unknown'; + +--echo # End of 10.4 tests diff --git a/mysql-test/main/skip_grants-master.opt b/mysql-test/main/skip_grants.opt index 5699a3387b8..5699a3387b8 100644 --- a/mysql-test/main/skip_grants-master.opt +++ b/mysql-test/main/skip_grants.opt diff --git a/mysql-test/main/skip_grants.result b/mysql-test/main/skip_grants.result index 154f77fff76..a8633807571 100644 --- a/mysql-test/main/skip_grants.result +++ b/mysql-test/main/skip_grants.result @@ -48,10 +48,16 @@ DROP PROCEDURE p3; DROP FUNCTION f1; DROP FUNCTION f2; DROP FUNCTION f3; +# +# Bug #26807 "set global event_scheduler=1" and --skip-grant-tables crashes server +# set global event_scheduler=1; Warnings: Note 1408 Event Scheduler: Loaded 0 events set global event_scheduler=0; +# +# Bug#26285 Selecting information_schema crahes server +# select count(*) from information_schema.COLUMN_PRIVILEGES; count(*) 0 @@ -64,14 +70,21 @@ count(*) select count(*) from information_schema.USER_PRIVILEGES; count(*) 0 -End of 5.0 tests +# +# End of 5.0 tests +# # # Bug#29817 Queries with UDF fail with non-descriptive error # if mysql.proc is missing # select no_such_function(1); ERROR 42000: FUNCTION test.no_such_function does not exist -End of 5.1 tests +# +# End of 5.1 tests +# +# +# MDEV-8280 crash in 'show global status' with --skip-grant-tables +# show global status like 'Acl%'; Variable_name Value Acl_column_grants 0 @@ -85,6 +98,17 @@ Acl_role_grants 0 Acl_roles 0 Acl_table_grants 0 Acl_users 0 +# +# End of 10.1 tests +# +# +# MDEV-22966 Server crashes or hangs with SET ROLE when started with skip-grant-tables +# +set role x; +ERROR HY000: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement +# +# End of 10.2 tests +# show create user root@localhost; ERROR HY000: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement insert mysql.global_priv values ('foo', 'bar', '{}'); @@ -112,3 +136,6 @@ CREATE USER `baz`@`baz` IDENTIFIED BY PASSWORD '*E52096EF8EB0240275A7FE9E069101C drop user bar@foo; drop user baz@baz; # restart +# +# End of 10.3 tests +# diff --git a/mysql-test/main/skip_grants.test b/mysql-test/main/skip_grants.test index ccad3c2d13f..eb8d3c3df88 100644 --- a/mysql-test/main/skip_grants.test +++ b/mysql-test/main/skip_grants.test @@ -89,20 +89,23 @@ DROP FUNCTION f1; DROP FUNCTION f2; DROP FUNCTION f3; -# -# Bug #26807 "set global event_scheduler=1" and --skip-grant-tables crashes server -# +--echo # +--echo # Bug #26807 "set global event_scheduler=1" and --skip-grant-tables crashes server +--echo # set global event_scheduler=1; set global event_scheduler=0; -# -# Bug#26285 Selecting information_schema crahes server -# +--echo # +--echo # Bug#26285 Selecting information_schema crahes server +--echo # select count(*) from information_schema.COLUMN_PRIVILEGES; select count(*) from information_schema.SCHEMA_PRIVILEGES; select count(*) from information_schema.TABLE_PRIVILEGES; select count(*) from information_schema.USER_PRIVILEGES; ---echo End of 5.0 tests + +--echo # +--echo # End of 5.0 tests +--echo # --echo # --echo # Bug#29817 Queries with UDF fail with non-descriptive error @@ -111,13 +114,30 @@ select count(*) from information_schema.USER_PRIVILEGES; --error ER_SP_DOES_NOT_EXIST select no_such_function(1); ---echo End of 5.1 tests +--echo # +--echo # End of 5.1 tests +--echo # -# -# MDEV-8280 crash in 'show global status' with --skip-grant-tables -# +--echo # +--echo # MDEV-8280 crash in 'show global status' with --skip-grant-tables +--echo # show global status like 'Acl%'; +--echo # +--echo # End of 10.1 tests +--echo # + +--echo # +--echo # MDEV-22966 Server crashes or hangs with SET ROLE when started with skip-grant-tables +--echo # + +--error ER_OPTION_PREVENTS_STATEMENT +set role x; + +--echo # +--echo # End of 10.2 tests +--echo # + # # MDEV-18297 # How to reset a forgotten root password @@ -140,3 +160,7 @@ drop user bar@foo; drop user baz@baz; # need to restart the server to restore the --skip-grant state --source include/restart_mysqld.inc + +--echo # +--echo # End of 10.3 tests +--echo # diff --git a/mysql-test/main/sp-ucs2.result b/mysql-test/main/sp-ucs2.result index ca448efa535..047a64713af 100644 --- a/mysql-test/main/sp-ucs2.result +++ b/mysql-test/main/sp-ucs2.result @@ -100,22 +100,21 @@ RETURNS VARCHAR(64) CHARACTER SET ucs2 BEGIN RETURN 'str'; END| -ERROR 42000: COLLATION 'ucs2_unicode_ci' is not valid for CHARACTER SET 'latin1' +DROP FUNCTION f| CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2) RETURNS VARCHAR(64) COLLATE ucs2_unicode_ci BEGIN RETURN 'str'; END| -ERROR 42000: COLLATION 'ucs2_unicode_ci' is not valid for CHARACTER SET 'latin1' +DROP FUNCTION f| CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2) RETURNS VARCHAR(64) CHARACTER SET ucs2 BEGIN DECLARE f2 VARCHAR(64) COLLATE ucs2_unicode_ci; RETURN 'str'; END| -ERROR 42000: COLLATION 'ucs2_unicode_ci' is not valid for CHARACTER SET 'latin1' +DROP FUNCTION f| SET NAMES utf8; -DROP FUNCTION IF EXISTS bug48766; CREATE FUNCTION bug48766 () RETURNS ENUM( 'w' ) CHARACTER SET ucs2 RETURN 0; @@ -140,3 +139,13 @@ WHERE ROUTINE_NAME='bug48766'; DTD_IDENTIFIER enum('а','б','в','г') DROP FUNCTION bug48766; +call mtr.add_suppression('invalid value in column mysql.proc.'); +set collation_connection=ucs2_general_ci; +insert into mysql.proc (db, name, type, specific_name, language, sql_data_access, is_deterministic, security_type, param_list, returns, body, definer, created, modified, sql_mode, comment, character_set_client, collation_connection, db_collation, body_utf8 ) values ( 'a', 'a', 'function', 'bug14233_1', 'sql', 'reads_sql_data', 'no', 'definer', '', 'int(10)', 'select * from mysql.user', 'root@localhost', now(), '0000-00-00 00:00:00', '', '', '', '', '', 'select * from mysql.user' ); +select routine_name from information_schema.routines where routine_name='a'; +routine_name +a +Warnings: +Warning 1601 Creation context of stored routine `a`.`a` is invalid +set collation_connection=default; +delete from mysql.proc where name='a'; diff --git a/mysql-test/main/sp-ucs2.test b/mysql-test/main/sp-ucs2.test index a1aec8071b4..c6dbdaacb5e 100644 --- a/mysql-test/main/sp-ucs2.test +++ b/mysql-test/main/sp-ucs2.test @@ -114,35 +114,35 @@ DROP FUNCTION f1| # # COLLATE with no CHARACTER SET in IN param # ---error ER_COLLATION_CHARSET_MISMATCH CREATE FUNCTION f(f1 VARCHAR(64) COLLATE ucs2_unicode_ci) RETURNS VARCHAR(64) CHARACTER SET ucs2 BEGIN RETURN 'str'; END| +DROP FUNCTION f| # # COLLATE with no CHARACTER SET in RETURNS # ---error ER_COLLATION_CHARSET_MISMATCH CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2) RETURNS VARCHAR(64) COLLATE ucs2_unicode_ci BEGIN RETURN 'str'; END| +DROP FUNCTION f| # # COLLATE with no CHARACTER SET in DECLARE # ---error ER_COLLATION_CHARSET_MISMATCH CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2) RETURNS VARCHAR(64) CHARACTER SET ucs2 BEGIN DECLARE f2 VARCHAR(64) COLLATE ucs2_unicode_ci; RETURN 'str'; END| +DROP FUNCTION f| delimiter ;| @@ -151,9 +151,6 @@ delimiter ;| # Bug#48766 SHOW CREATE FUNCTION returns extra data in return clause # SET NAMES utf8; ---disable_warnings -DROP FUNCTION IF EXISTS bug48766; ---enable_warnings # # Test that Latin letters are not prepended with extra '\0'. # @@ -175,3 +172,13 @@ SELECT DTD_IDENTIFIER FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME='bug48766'; DROP FUNCTION bug48766; + +# +# +# +call mtr.add_suppression('invalid value in column mysql.proc.'); +set collation_connection=ucs2_general_ci; +insert into mysql.proc (db, name, type, specific_name, language, sql_data_access, is_deterministic, security_type, param_list, returns, body, definer, created, modified, sql_mode, comment, character_set_client, collation_connection, db_collation, body_utf8 ) values ( 'a', 'a', 'function', 'bug14233_1', 'sql', 'reads_sql_data', 'no', 'definer', '', 'int(10)', 'select * from mysql.user', 'root@localhost', now(), '0000-00-00 00:00:00', '', '', '', '', '', 'select * from mysql.user' ); +select routine_name from information_schema.routines where routine_name='a'; +set collation_connection=default; +delete from mysql.proc where name='a'; diff --git a/mysql-test/main/stat_tables.result b/mysql-test/main/stat_tables.result index 55d8bbf51c9..53557b39b05 100644 --- a/mysql-test/main/stat_tables.result +++ b/mysql-test/main/stat_tables.result @@ -829,6 +829,20 @@ length(a) set names latin1; set @@use_stat_tables=@save_use_stat_tables; drop table t1; +# +# MDEV-23753: SIGSEGV in Column_stat::store_stat_fields +# +CREATE TABLE t1 (a INT, b INT) PARTITION BY HASH (b) PARTITIONS 2; +LOCK TABLES t1 WRITE; +ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (a) INDEXES (); +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (nonexisting) INDEXES (nonexisting); +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze error Invalid argument +DROP TABLE t1; # please keep this at the last set @@global.histogram_size=@save_histogram_size; # Start of 10.4 tests diff --git a/mysql-test/main/stat_tables.test b/mysql-test/main/stat_tables.test index ca341a93b81..9955908bd60 100644 --- a/mysql-test/main/stat_tables.test +++ b/mysql-test/main/stat_tables.test @@ -1,4 +1,5 @@ --source include/have_stat_tables.inc +--source include/have_partition.inc select @@global.use_stat_tables; select @@session.use_stat_tables; @@ -573,6 +574,17 @@ set names latin1; set @@use_stat_tables=@save_use_stat_tables; drop table t1; +--echo # +--echo # MDEV-23753: SIGSEGV in Column_stat::store_stat_fields +--echo # + +CREATE TABLE t1 (a INT, b INT) PARTITION BY HASH (b) PARTITIONS 2; +LOCK TABLES t1 WRITE; +ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (a) INDEXES (); +ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (nonexisting) INDEXES (nonexisting); +DROP TABLE t1; + + --echo # please keep this at the last set @@global.histogram_size=@save_histogram_size; diff --git a/mysql-test/main/stat_tables_innodb.result b/mysql-test/main/stat_tables_innodb.result index 26d4bff6be9..41fd303ed4c 100644 --- a/mysql-test/main/stat_tables_innodb.result +++ b/mysql-test/main/stat_tables_innodb.result @@ -861,6 +861,20 @@ length(a) set names latin1; set @@use_stat_tables=@save_use_stat_tables; drop table t1; +# +# MDEV-23753: SIGSEGV in Column_stat::store_stat_fields +# +CREATE TABLE t1 (a INT, b INT) PARTITION BY HASH (b) PARTITIONS 2; +LOCK TABLES t1 WRITE; +ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (a) INDEXES (); +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (nonexisting) INDEXES (nonexisting); +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze error Invalid argument +DROP TABLE t1; # please keep this at the last set @@global.histogram_size=@save_histogram_size; # Start of 10.4 tests diff --git a/mysql-test/main/status2.result b/mysql-test/main/status2.result index fa0fc4e1061..60309e14fe3 100644 --- a/mysql-test/main/status2.result +++ b/mysql-test/main/status2.result @@ -74,4 +74,12 @@ DROP TRIGGER trigg1; DROP FUNCTION testQuestion; DROP EVENT ev1; DROP TABLE t1,t2; -End of 6.0 tests +# +# End of 5.5 tests +# +select variable_value < 1024*1024*1024 from information_schema.global_status where variable_name='memory_used'; +variable_value < 1024*1024*1024 +1 +# +# End of 10.2 tests +# diff --git a/mysql-test/main/status2.test b/mysql-test/main/status2.test index fa3b718efaa..ea674c2ed7c 100644 --- a/mysql-test/main/status2.test +++ b/mysql-test/main/status2.test @@ -64,5 +64,14 @@ DROP TRIGGER trigg1; DROP FUNCTION testQuestion; DROP EVENT ev1; DROP TABLE t1,t2; ---echo End of 6.0 tests + +--echo # +--echo # End of 5.5 tests +--echo # + +select variable_value < 1024*1024*1024 from information_schema.global_status where variable_name='memory_used'; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/main/subselect.result b/mysql-test/main/subselect.result index 349e7dca129..15ebaa33474 100644 --- a/mysql-test/main/subselect.result +++ b/mysql-test/main/subselect.result @@ -7344,6 +7344,44 @@ WHERE (t2.i, t2.pk) NOT IN ( SELECT t3.i, t3.i FROM t t3, t t4 ) AND t1.c = 'foo pk i c pk i c 1 10 foo 1 10 foo DROP TABLE t; +# +# MDEV-25002: Outer reference in ON clause of subselect +# +create table t1 ( +pk int primary key, +a int +) engine=myisam; +insert into t1 values (1,1), (2,2); +create table t2 ( +pk int primary key, +b int +) engine=myisam; +insert into t2 values (1,1), (2,3); +create table t3 (a int); +insert into t3 values (1),(2); +select a, +(select count(*) from t1, t2 +where t2.pk=t3.a and t1.pk=1) as sq +from t3; +a sq +1 1 +2 1 +select a, +(select count(*) from t1 join t2 on t2.pk=t3.a +where t1.pk=1) as sq +from t3; +a sq +1 1 +2 1 +select a from t3 +where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1); +a +1 +select a from t3 +where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1); +a +1 +drop table t1,t2,t3; # End of 10.2 tests # # Start of 10.4 tests diff --git a/mysql-test/main/subselect.test b/mysql-test/main/subselect.test index be17254202e..d87aba57567 100644 --- a/mysql-test/main/subselect.test +++ b/mysql-test/main/subselect.test @@ -6171,6 +6171,41 @@ SELECT * FROM t t1 RIGHT JOIN t t2 ON (t2.pk = t1.pk) DROP TABLE t; +--echo # +--echo # MDEV-25002: Outer reference in ON clause of subselect +--echo # + +create table t1 ( + pk int primary key, + a int +) engine=myisam; +insert into t1 values (1,1), (2,2); + +create table t2 ( + pk int primary key, + b int +) engine=myisam; +insert into t2 values (1,1), (2,3); + +create table t3 (a int); +insert into t3 values (1),(2); + +select a, + (select count(*) from t1, t2 + where t2.pk=t3.a and t1.pk=1) as sq +from t3; +select a, + (select count(*) from t1 join t2 on t2.pk=t3.a + where t1.pk=1) as sq +from t3; + +select a from t3 + where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1); +select a from t3 + where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1); + +drop table t1,t2,t3; + --echo # End of 10.2 tests diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result index 79c42def277..4452c456022 100644 --- a/mysql-test/main/subselect4.result +++ b/mysql-test/main/subselect4.result @@ -2687,6 +2687,42 @@ f bar DROP TABLE t1, t2; # +# MDEV-23449: alias do not exist and a query do not report an error +# +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5); +SELECT a, b FROM t1 WHERE a IN (SELECT A.a FROM t1 A GROUP BY s.id); +ERROR 42S22: Unknown column 's.id' in 'group statement' +DROP TABLE t1; +# +# MDEV-24519: Server crashes in Charset::set_charset upon SELECT +# +CREATE TABLE t1 (a VARBINARY(8)); +INSERT INTO t1 VALUES ('foo'),('bar'); +CREATE TABLE t2 (b VARBINARY(8)); +EXPLAIN +SELECT a FROM t1 WHERE (a, a) IN (SELECT 'qux', 'qux') AND a = (SELECT MIN(b) FROM t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used +SELECT a FROM t1 WHERE (a, a) IN (SELECT 'qux', 'qux') AND a = (SELECT MIN(b) FROM t2); +a +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b VARBINARY(8)); +EXPLAIN +SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used +SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2); +a +DROP TABLE t1,t2; +# End of 10.2 tests +# # MDEV-18335: Assertion `!error || error == 137' failed in subselect_rowid_merge_engine::init # CREATE TABLE t1 (i1 int,v1 varchar(1),KEY (v1,i1)); @@ -2717,7 +2753,6 @@ Warnings: Warning 1931 Query execution was interrupted. The query examined at least 3020 rows, which exceeds LIMIT ROWS EXAMINED (500). The query result may be incomplete SET join_cache_level= @save_join_cache_level; DROP TABLE t1,t2,t3,t4; -# End of 10.2 tests # # MDEV-21265: IN predicate conversion to IN subquery should be allowed for a broader set of datatype comparison # @@ -2751,6 +2786,67 @@ id select_type table type possible_keys key key_len ref rows Extra set names default; set @@in_predicate_conversion_threshold= @save_in_predicate_conversion_threshold; DROP TABLE t1,t2; +# +# MDEV-24925: Server crashes in Item_subselect::init_expr_cache_tracker +# +CREATE TABLE t1 (id INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +SELECT +1 IN ( +SELECT +(SELECT COUNT(id) +FROM t1 +WHERE t1_outer.id <> id +) AS f +FROM +t1 AS t1_outer +GROUP BY f +); +1 IN ( +SELECT +(SELECT COUNT(id) +FROM t1 +WHERE t1_outer.id <> id +) AS f +FROM +t1 AS t1_outer +GROUP BY f +) +1 +SELECT +1 IN ( +SELECT +(SELECT COUNT(id) +FROM t1 +WHERE t1_outer.id <> id +) AS f +FROM +t1 AS t1_outer +GROUP BY 1 +); +1 IN ( +SELECT +(SELECT COUNT(id) +FROM t1 +WHERE t1_outer.id <> id +) AS f +FROM +t1 AS t1_outer +GROUP BY 1 +) +1 +DROP TABLE t1; +# +# MDEV-24898: Server crashes in st_select_lex::next_select / Item_subselect::is_expensive +# (Testcase) +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); +SELECT 1 IN (SELECT (SELECT a FROM t1) AS x FROM t2 GROUP BY x); +ERROR 21000: Subquery returns more than 1 row +drop table t1,t2; # End of 10.3 tests # # MDEV-19134: EXISTS() slower if ORDER BY is defined diff --git a/mysql-test/main/subselect4.test b/mysql-test/main/subselect4.test index 3a9ad7f715c..a2dfc48ffe2 100644 --- a/mysql-test/main/subselect4.test +++ b/mysql-test/main/subselect4.test @@ -2202,6 +2202,43 @@ SELECT * FROM t2; DROP TABLE t1, t2; --echo # +--echo # MDEV-23449: alias do not exist and a query do not report an error +--echo # + +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5); + +--error ER_BAD_FIELD_ERROR +SELECT a, b FROM t1 WHERE a IN (SELECT A.a FROM t1 A GROUP BY s.id); +DROP TABLE t1; + +--echo # +--echo # MDEV-24519: Server crashes in Charset::set_charset upon SELECT +--echo # + +CREATE TABLE t1 (a VARBINARY(8)); +INSERT INTO t1 VALUES ('foo'),('bar'); +CREATE TABLE t2 (b VARBINARY(8)); + +EXPLAIN +SELECT a FROM t1 WHERE (a, a) IN (SELECT 'qux', 'qux') AND a = (SELECT MIN(b) FROM t2); +SELECT a FROM t1 WHERE (a, a) IN (SELECT 'qux', 'qux') AND a = (SELECT MIN(b) FROM t2); + +DROP TABLE t1,t2; + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b VARBINARY(8)); + +EXPLAIN +SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2); +SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2); + +DROP TABLE t1,t2; + +--echo # End of 10.2 tests + +--echo # --echo # MDEV-18335: Assertion `!error || error == 137' failed in subselect_rowid_merge_engine::init --echo # @@ -2236,9 +2273,6 @@ from t2 join t1 on SET join_cache_level= @save_join_cache_level; DROP TABLE t1,t2,t3,t4; - ---echo # End of 10.2 tests - --echo # --echo # MDEV-21265: IN predicate conversion to IN subquery should be allowed for a broader set of datatype comparison --echo # @@ -2274,6 +2308,51 @@ set names default; set @@in_predicate_conversion_threshold= @save_in_predicate_conversion_threshold; DROP TABLE t1,t2; +--echo # +--echo # MDEV-24925: Server crashes in Item_subselect::init_expr_cache_tracker +--echo # +CREATE TABLE t1 (id INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); + +SELECT + 1 IN ( + SELECT + (SELECT COUNT(id) + FROM t1 + WHERE t1_outer.id <> id + ) AS f + FROM + t1 AS t1_outer + GROUP BY f + ); + +SELECT + 1 IN ( + SELECT + (SELECT COUNT(id) + FROM t1 + WHERE t1_outer.id <> id + ) AS f + FROM + t1 AS t1_outer + GROUP BY 1 + ); + +DROP TABLE t1; + +--echo # +--echo # MDEV-24898: Server crashes in st_select_lex::next_select / Item_subselect::is_expensive +--echo # (Testcase) +--echo # +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); # Optional, fails either way +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); # Optional, fails either way + +--error ER_SUBQUERY_NO_1_ROW +SELECT 1 IN (SELECT (SELECT a FROM t1) AS x FROM t2 GROUP BY x); +drop table t1,t2; + --echo # End of 10.3 tests --echo # diff --git a/mysql-test/main/subselect_exists2in.result b/mysql-test/main/subselect_exists2in.result index e8ef7081b09..6ff518b5a29 100644 --- a/mysql-test/main/subselect_exists2in.result +++ b/mysql-test/main/subselect_exists2in.result @@ -1102,4 +1102,22 @@ U5.`storage_target_id` = V0.`id` ); id drop table t1,t2,t3; +# +# MDEV-25407: EXISTS subquery with correlation in ON expression crashes +# +create table t10(a int primary key); +insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t11(a int primary key); +insert into t11 select a.a + b.a* 10 + c.a * 100 from t10 a, t10 b, t10 c; +create table t1 (a int, b int); +insert into t1 select a,a from t10; +create table t2 (a int, b int); +insert into t2 select a,a from t11; +create table t3 as select * from t2; +explain select * from t1 where exists (select t2.a from t2 left join t3 on (t3.b=t1.b) where t2.a=t1.a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 10 +1 PRIMARY t2 ALL NULL NULL NULL NULL 1000 Using where; Start temporary; Using join buffer (flat, BNL join) +1 PRIMARY t3 ALL NULL NULL NULL NULL 1000 Using where; End temporary; Using join buffer (incremental, BNL join) +drop table t1, t2, t3, t10, t11; set optimizer_switch=default; diff --git a/mysql-test/main/subselect_exists2in.test b/mysql-test/main/subselect_exists2in.test index e27ce57038b..e70d643138b 100644 --- a/mysql-test/main/subselect_exists2in.test +++ b/mysql-test/main/subselect_exists2in.test @@ -941,5 +941,28 @@ WHERE ( drop table t1,t2,t3; +--echo # +--echo # MDEV-25407: EXISTS subquery with correlation in ON expression crashes +--echo # +create table t10(a int primary key); +insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t11(a int primary key); +insert into t11 select a.a + b.a* 10 + c.a * 100 from t10 a, t10 b, t10 c; + +create table t1 (a int, b int); +insert into t1 select a,a from t10; + +create table t2 (a int, b int); +insert into t2 select a,a from t11; + +create table t3 as select * from t2; + + +explain select * from t1 where exists (select t2.a from t2 left join t3 on (t3.b=t1.b) where t2.a=t1.a); + +drop table t1, t2, t3, t10, t11; + + #restore defaults set optimizer_switch=default; diff --git a/mysql-test/main/subselect_mat_cost_bugs.result b/mysql-test/main/subselect_mat_cost_bugs.result index a18c5e608f1..ecceac27b2d 100644 --- a/mysql-test/main/subselect_mat_cost_bugs.result +++ b/mysql-test/main/subselect_mat_cost_bugs.result @@ -189,8 +189,8 @@ SELECT alias2.f2 AS field1 FROM t1 AS alias1 JOIN ( SELECT * FROM t2 ) AS alias2 ON alias2.f3 = alias1.f1 WHERE ( SELECT t2.f2 -FROM t2 JOIN t1 ON t1.f1 -WHERE t1.f1 AND alias2.f10 +FROM t2 JOIN t1 ON (t1.f1>0 or t1.f1<0) +WHERE (t1.f1>0 or t1.f1<0) AND alias2.f10 ) ORDER BY field1 ; id select_type table type possible_keys key key_len ref rows Extra @@ -203,8 +203,8 @@ SELECT alias2.f2 AS field1 FROM t1 AS alias1 JOIN ( SELECT * FROM t2 ) AS alias2 ON alias2.f3 = alias1.f1 WHERE ( SELECT t2.f2 -FROM t2 JOIN t1 ON t1.f1 -WHERE t1.f1 AND alias2.f10 +FROM t2 JOIN t1 ON (t1.f1>0 or t1.f1<0) +WHERE (t1.f1>0 or t1.f1<0) AND alias2.f10 ) ORDER BY field1 ; field1 diff --git a/mysql-test/main/subselect_mat_cost_bugs.test b/mysql-test/main/subselect_mat_cost_bugs.test index 028cdced560..ba1aad06a15 100644 --- a/mysql-test/main/subselect_mat_cost_bugs.test +++ b/mysql-test/main/subselect_mat_cost_bugs.test @@ -217,8 +217,8 @@ SELECT alias2.f2 AS field1 FROM t1 AS alias1 JOIN ( SELECT * FROM t2 ) AS alias2 ON alias2.f3 = alias1.f1 WHERE ( SELECT t2.f2 - FROM t2 JOIN t1 ON t1.f1 - WHERE t1.f1 AND alias2.f10 + FROM t2 JOIN t1 ON (t1.f1>0 or t1.f1<0) + WHERE (t1.f1>0 or t1.f1<0) AND alias2.f10 ) ORDER BY field1 ; @@ -226,8 +226,8 @@ SELECT alias2.f2 AS field1 FROM t1 AS alias1 JOIN ( SELECT * FROM t2 ) AS alias2 ON alias2.f3 = alias1.f1 WHERE ( SELECT t2.f2 - FROM t2 JOIN t1 ON t1.f1 - WHERE t1.f1 AND alias2.f10 + FROM t2 JOIN t1 ON (t1.f1>0 or t1.f1<0) + WHERE (t1.f1>0 or t1.f1<0) AND alias2.f10 ) ORDER BY field1 ; diff --git a/mysql-test/main/subselect_no_exists_to_in.result b/mysql-test/main/subselect_no_exists_to_in.result index 84c415d1ce1..b1432cf0979 100644 --- a/mysql-test/main/subselect_no_exists_to_in.result +++ b/mysql-test/main/subselect_no_exists_to_in.result @@ -7344,6 +7344,44 @@ WHERE (t2.i, t2.pk) NOT IN ( SELECT t3.i, t3.i FROM t t3, t t4 ) AND t1.c = 'foo pk i c pk i c 1 10 foo 1 10 foo DROP TABLE t; +# +# MDEV-25002: Outer reference in ON clause of subselect +# +create table t1 ( +pk int primary key, +a int +) engine=myisam; +insert into t1 values (1,1), (2,2); +create table t2 ( +pk int primary key, +b int +) engine=myisam; +insert into t2 values (1,1), (2,3); +create table t3 (a int); +insert into t3 values (1),(2); +select a, +(select count(*) from t1, t2 +where t2.pk=t3.a and t1.pk=1) as sq +from t3; +a sq +1 1 +2 1 +select a, +(select count(*) from t1 join t2 on t2.pk=t3.a +where t1.pk=1) as sq +from t3; +a sq +1 1 +2 1 +select a from t3 +where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1); +a +1 +select a from t3 +where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1); +a +1 +drop table t1,t2,t3; # End of 10.2 tests # # Start of 10.4 tests diff --git a/mysql-test/main/subselect_no_mat.result b/mysql-test/main/subselect_no_mat.result index 93035e235f7..da60f98bf00 100644 --- a/mysql-test/main/subselect_no_mat.result +++ b/mysql-test/main/subselect_no_mat.result @@ -7337,6 +7337,44 @@ WHERE (t2.i, t2.pk) NOT IN ( SELECT t3.i, t3.i FROM t t3, t t4 ) AND t1.c = 'foo pk i c pk i c 1 10 foo 1 10 foo DROP TABLE t; +# +# MDEV-25002: Outer reference in ON clause of subselect +# +create table t1 ( +pk int primary key, +a int +) engine=myisam; +insert into t1 values (1,1), (2,2); +create table t2 ( +pk int primary key, +b int +) engine=myisam; +insert into t2 values (1,1), (2,3); +create table t3 (a int); +insert into t3 values (1),(2); +select a, +(select count(*) from t1, t2 +where t2.pk=t3.a and t1.pk=1) as sq +from t3; +a sq +1 1 +2 1 +select a, +(select count(*) from t1 join t2 on t2.pk=t3.a +where t1.pk=1) as sq +from t3; +a sq +1 1 +2 1 +select a from t3 +where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1); +a +1 +select a from t3 +where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1); +a +1 +drop table t1,t2,t3; # End of 10.2 tests # # Start of 10.4 tests diff --git a/mysql-test/main/subselect_no_opts.result b/mysql-test/main/subselect_no_opts.result index 09f664d3c28..fb99e237a1c 100644 --- a/mysql-test/main/subselect_no_opts.result +++ b/mysql-test/main/subselect_no_opts.result @@ -7335,6 +7335,44 @@ WHERE (t2.i, t2.pk) NOT IN ( SELECT t3.i, t3.i FROM t t3, t t4 ) AND t1.c = 'foo pk i c pk i c 1 10 foo 1 10 foo DROP TABLE t; +# +# MDEV-25002: Outer reference in ON clause of subselect +# +create table t1 ( +pk int primary key, +a int +) engine=myisam; +insert into t1 values (1,1), (2,2); +create table t2 ( +pk int primary key, +b int +) engine=myisam; +insert into t2 values (1,1), (2,3); +create table t3 (a int); +insert into t3 values (1),(2); +select a, +(select count(*) from t1, t2 +where t2.pk=t3.a and t1.pk=1) as sq +from t3; +a sq +1 1 +2 1 +select a, +(select count(*) from t1 join t2 on t2.pk=t3.a +where t1.pk=1) as sq +from t3; +a sq +1 1 +2 1 +select a from t3 +where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1); +a +1 +select a from t3 +where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1); +a +1 +drop table t1,t2,t3; # End of 10.2 tests # # Start of 10.4 tests diff --git a/mysql-test/main/subselect_no_scache.result b/mysql-test/main/subselect_no_scache.result index 765bb15a3df..4b910009248 100644 --- a/mysql-test/main/subselect_no_scache.result +++ b/mysql-test/main/subselect_no_scache.result @@ -7350,6 +7350,44 @@ WHERE (t2.i, t2.pk) NOT IN ( SELECT t3.i, t3.i FROM t t3, t t4 ) AND t1.c = 'foo pk i c pk i c 1 10 foo 1 10 foo DROP TABLE t; +# +# MDEV-25002: Outer reference in ON clause of subselect +# +create table t1 ( +pk int primary key, +a int +) engine=myisam; +insert into t1 values (1,1), (2,2); +create table t2 ( +pk int primary key, +b int +) engine=myisam; +insert into t2 values (1,1), (2,3); +create table t3 (a int); +insert into t3 values (1),(2); +select a, +(select count(*) from t1, t2 +where t2.pk=t3.a and t1.pk=1) as sq +from t3; +a sq +1 1 +2 1 +select a, +(select count(*) from t1 join t2 on t2.pk=t3.a +where t1.pk=1) as sq +from t3; +a sq +1 1 +2 1 +select a from t3 +where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1); +a +1 +select a from t3 +where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1); +a +1 +drop table t1,t2,t3; # End of 10.2 tests # # Start of 10.4 tests diff --git a/mysql-test/main/subselect_no_semijoin.result b/mysql-test/main/subselect_no_semijoin.result index 97d2f3b058f..f2230718754 100644 --- a/mysql-test/main/subselect_no_semijoin.result +++ b/mysql-test/main/subselect_no_semijoin.result @@ -7335,6 +7335,44 @@ WHERE (t2.i, t2.pk) NOT IN ( SELECT t3.i, t3.i FROM t t3, t t4 ) AND t1.c = 'foo pk i c pk i c 1 10 foo 1 10 foo DROP TABLE t; +# +# MDEV-25002: Outer reference in ON clause of subselect +# +create table t1 ( +pk int primary key, +a int +) engine=myisam; +insert into t1 values (1,1), (2,2); +create table t2 ( +pk int primary key, +b int +) engine=myisam; +insert into t2 values (1,1), (2,3); +create table t3 (a int); +insert into t3 values (1),(2); +select a, +(select count(*) from t1, t2 +where t2.pk=t3.a and t1.pk=1) as sq +from t3; +a sq +1 1 +2 1 +select a, +(select count(*) from t1 join t2 on t2.pk=t3.a +where t1.pk=1) as sq +from t3; +a sq +1 1 +2 1 +select a from t3 +where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1); +a +1 +select a from t3 +where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1); +a +1 +drop table t1,t2,t3; # End of 10.2 tests # # Start of 10.4 tests diff --git a/mysql-test/main/system_mysql_db.result b/mysql-test/main/system_mysql_db.result index 838591b3b4b..37ade694489 100644 --- a/mysql-test/main/system_mysql_db.result +++ b/mysql-test/main/system_mysql_db.result @@ -62,7 +62,7 @@ db CREATE TABLE `db` ( ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges' show create table user; View Create View character_set_client collation_connection -user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci +user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,if(ifnull(json_value(`global_priv`.`Priv`,'$.password_last_changed'),1) = 0,'Y','N') AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci show create table func; Table Create Table func CREATE TABLE `func` ( diff --git a/mysql-test/main/system_mysql_db_507.result b/mysql-test/main/system_mysql_db_507.result index 2d68dc82529..8069405aa3a 100644 --- a/mysql-test/main/system_mysql_db_507.result +++ b/mysql-test/main/system_mysql_db_507.result @@ -214,6 +214,7 @@ alter user user@localhost password expire; show create user user@localhost; CREATE USER for user@localhost CREATE USER `user`@`localhost` PASSWORD EXPIRE +ALTER USER `user`@`localhost` PASSWORD EXPIRE INTERVAL 123 DAY set password for user@localhost= password(''); show create user user@localhost; CREATE USER for user@localhost diff --git a/mysql-test/main/system_mysql_db_fix40123.result b/mysql-test/main/system_mysql_db_fix40123.result index fc9a5763dbd..f76a4b37e31 100644 --- a/mysql-test/main/system_mysql_db_fix40123.result +++ b/mysql-test/main/system_mysql_db_fix40123.result @@ -100,7 +100,7 @@ db CREATE TABLE `db` ( ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges' show create table user; View Create View character_set_client collation_connection -user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci +user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,if(ifnull(json_value(`global_priv`.`Priv`,'$.password_last_changed'),1) = 0,'Y','N') AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci show create table func; Table Create Table func CREATE TABLE `func` ( diff --git a/mysql-test/main/system_mysql_db_fix50030.result b/mysql-test/main/system_mysql_db_fix50030.result index 02047dc4a8c..a9ef62aa5d4 100644 --- a/mysql-test/main/system_mysql_db_fix50030.result +++ b/mysql-test/main/system_mysql_db_fix50030.result @@ -104,7 +104,7 @@ db CREATE TABLE `db` ( ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges' show create table user; View Create View character_set_client collation_connection -user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci +user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,if(ifnull(json_value(`global_priv`.`Priv`,'$.password_last_changed'),1) = 0,'Y','N') AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci show create table func; Table Create Table func CREATE TABLE `func` ( diff --git a/mysql-test/main/system_mysql_db_fix50117.result b/mysql-test/main/system_mysql_db_fix50117.result index 07119cda6c6..1557817fc80 100644 --- a/mysql-test/main/system_mysql_db_fix50117.result +++ b/mysql-test/main/system_mysql_db_fix50117.result @@ -84,7 +84,7 @@ db CREATE TABLE `db` ( ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges' show create table user; View Create View character_set_client collation_connection -user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci +user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,if(ifnull(json_value(`global_priv`.`Priv`,'$.password_last_changed'),1) = 0,'Y','N') AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci show create table func; Table Create Table func CREATE TABLE `func` ( diff --git a/mysql-test/main/table_elim.result b/mysql-test/main/table_elim.result index 41928f28963..b49e7b11ed6 100644 --- a/mysql-test/main/table_elim.result +++ b/mysql-test/main/table_elim.result @@ -544,7 +544,7 @@ drop table t0,t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (f1 int(11), PRIMARY KEY (f1)) ; CREATE TABLE t2 (f4 varchar(1024), KEY (f4)) ; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes INSERT IGNORE INTO t2 VALUES ('xcddwntkbxyorzdv'), ('cnxxcddwntkbxyor'),('r'),('r'), ('did'),('I'),('when'), ('hczkfqjeggivdvac'),('e'),('okay'),('up'); diff --git a/mysql-test/main/table_value_constr.result b/mysql-test/main/table_value_constr.result index 86e8b9cf76d..0914645efbc 100644 --- a/mysql-test/main/table_value_constr.result +++ b/mysql-test/main/table_value_constr.result @@ -748,7 +748,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00 2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1)) `tvc_0`) where 1 +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1)) `tvc_0`) where 1 explain extended select * from t1 where a in (select * from (values (1)) as tvc_0); id select_type table type possible_keys key key_len ref rows filtered Extra @@ -983,7 +983,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00 2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) where 1 +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) where 1 explain extended select * from t1 where a = any (select * from (values (1),(2)) as tvc_0); id select_type table type possible_keys key key_len ref rows filtered Extra @@ -2622,6 +2622,448 @@ ERROR HY000: 'ignore' is not allowed in this context EXECUTE IMMEDIATE 'VALUES (?)' USING DEFAULT; ERROR HY000: 'default' is not allowed in this context # +# MDEV-24675: TVC using subqueries +# +values((select 1)); +(select 1) +1 +values (2), ((select 1)); +2 +2 +1 +values ((select 1)), (2), ((select 3)); +(select 1) +1 +2 +3 +values ((select 1), 2), (3,4), (5, (select 6)); +(select 1) 2 +1 2 +3 4 +5 6 +create table t1 (a int, b int); +insert into t1 values (1,3), (2,3), (3,2), (1,2); +values((select max(a) from t1)); +(select max(a) from t1) +3 +values((select min(b) from t1)); +(select min(b) from t1) +2 +values ((select max(a) from t1), (select min(b) from t1)); +(select max(a) from t1) (select min(b) from t1) +3 2 +values((select * from (select max(b) from t1) as t)); +(select * from (select max(b) from t1) as t) +3 +drop table t1; +# +# MDEV-24618: TVC contains extra parenthesis for row expressions +# in value list +# +create table t1 (a int, b int); +insert into t1 values (1,3), (2,3); +insert into t1 values ((5,4)); +ERROR 21000: Operand should contain 1 column(s) +values ((1,2)); +ERROR 21000: Operand should contain 1 column(s) +select * from (values ((1,2))) dt; +ERROR 21000: Operand should contain 1 column(s) +values (1,2); +1 2 +1 2 +values ((select min(a), max(b) from t1)); +ERROR 21000: Operand should contain 1 column(s) +drop table t1; +# +# MDEV-24840: union of TVCs in IN subquery +# +create table t1 (a int) engine=myisam; +insert into t1 values (3), (7), (1); +select a from t1 where a in (values (7) union values (8)); +a +7 +explain extended select a from t1 where a in (values (7) union values (8)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +4 DEPENDENT SUBQUERY <derived2> ref key0 key0 4 func 2 100.00 +2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +5 DEPENDENT UNION <derived3> ref key0 key0 4 func 2 100.00 +3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where <expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#4 */ select `tvc_0`.`7` from (values (7)) `tvc_0` where <cache>(`test`.`t1`.`a`) = `tvc_0`.`7` union /* select#5 */ select `tvc_0`.`8` from (values (8)) `tvc_0` where <cache>(`test`.`t1`.`a`) = `tvc_0`.`8`))) +prepare stmt from "select a from t1 where a in (values (7) union values (8))"; +execute stmt; +a +7 +execute stmt; +a +7 +deallocate prepare stmt; +select a from t1 where a not in (values (7) union values (8)); +a +3 +1 +explain extended select a from t1 where a not in (values (7) union values (8)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +4 DEPENDENT SUBQUERY <derived2> ALL NULL NULL NULL NULL 2 100.00 Using where +2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +5 DEPENDENT UNION <derived3> ALL NULL NULL NULL NULL 2 100.00 Using where +3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where !<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#4 */ select `tvc_0`.`7` from (values (7)) `tvc_0` where trigcond(<cache>(`test`.`t1`.`a`) = `tvc_0`.`7`) union /* select#5 */ select `tvc_0`.`8` from (values (8)) `tvc_0` where trigcond(<cache>(`test`.`t1`.`a`) = `tvc_0`.`8`)))) +select a from t1 where a < all(values (7) union values (8)); +a +3 +1 +explain extended select a from t1 where a < all(values (7) union values (8)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +4 SUBQUERY <derived2> ALL NULL NULL NULL NULL 2 100.00 +2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +5 UNION <derived3> ALL NULL NULL NULL NULL 2 100.00 +3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where <not>(<in_optimizer>(`test`.`t1`.`a`,<min>(/* select#4 */ select `tvc_0`.`7` from (values (7)) `tvc_0` union /* select#5 */ select `tvc_0`.`8` from (values (8)) `tvc_0`) <= <cache>(`test`.`t1`.`a`))) +select a from t1 where a >= any(values (7) union values (8)); +a +7 +explain extended select a from t1 where a >= any(values (7) union values (8)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +4 SUBQUERY <derived2> ALL NULL NULL NULL NULL 2 100.00 +2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +5 UNION <derived3> ALL NULL NULL NULL NULL 2 100.00 +3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where <nop>(<in_optimizer>(`test`.`t1`.`a`,<min>(/* select#4 */ select `tvc_0`.`7` from (values (7)) `tvc_0` union /* select#5 */ select `tvc_0`.`8` from (values (8)) `tvc_0`) <= <cache>(`test`.`t1`.`a`))) +drop table t1; +# +# MDEV-24934:EXPLAIN for queries based on TVC using subqueries +# +create table t1 (a int); +insert into t1 values (3), (7), (1); +values (8), ((select * from t1 where a between 2 and 4)); +8 +8 +3 +explain values (8), ((select * from t1 where a between 2 and 4)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +values ((select * from t1 where a between 2 and 4)), +((select * from t1 where a > 10)); +(select * from t1 where a between 2 and 4) +3 +NULL +explain values ((select * from t1 where a between 2 and 4)), +((select * from t1 where a > 10)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +3 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +values (10,11), ((select * from t1 where a = 7) + 1, 21); +10 11 +10 11 +8 21 +explain values (10,11), ((select * from t1 where a = 7) + 1, 21); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +drop table t1; +# +# MDEV-24910: TVC containing subquery used as a subselect +# +create table t1 (a int) engine=myisam; +insert into t1 values (3), (7), (1); +create table t2 (b int) engine=myisam; +insert into t2 values (1), (2); +select (values ((select 2))) from t2; +(values ((select 2))) +2 +2 +explain select (values ((select 2))) from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 +4 SUBQUERY <derived2> ALL NULL NULL NULL NULL 2 +2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1249 Select 3 was reduced during optimization +prepare stmt from "select (values ((select 2))) from t2"; +execute stmt; +(values ((select 2))) +2 +2 +execute stmt; +(values ((select 2))) +2 +2 +deallocate prepare stmt; +select (values ((select * from t1 where a > 10))) from t2; +(values ((select * from t1 where a > 10))) +NULL +NULL +explain select (values ((select * from t1 where a > 10))) from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 +4 SUBQUERY <derived2> ALL NULL NULL NULL NULL 2 +2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used +3 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +prepare stmt from "select (values ((select * from t1 where a > 10))) from t2"; +execute stmt; +(values ((select * from t1 where a > 10))) +NULL +NULL +execute stmt; +(values ((select * from t1 where a > 10))) +NULL +NULL +deallocate prepare stmt; +create table t3 (a int); +insert into t3 values +(3), (7), (7), (1), (3), (9), (7), (9), (8), (7), (8); +create view v1 as select count(a) as c from t3 group by a; +select +(values ((select * from t3 where a in (select * from v1)))); +(values ((select * from t3 where a in (select * from v1)))) +1 +explain select +(values ((select * from t3 where a in (select * from v1)))); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +6 SUBQUERY <derived2> ALL NULL NULL NULL NULL 2 +2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used +3 SUBQUERY t3 ALL NULL NULL NULL NULL 11 +3 SUBQUERY <subquery4> eq_ref distinct_key distinct_key 8 func 1 Using where +4 MATERIALIZED <derived5> ALL NULL NULL NULL NULL 11 +5 DERIVED t3 ALL NULL NULL NULL NULL 11 Using temporary; Using filesort +prepare stmt from "select +(values ((select * from t3 where a in (select * from v1))))"; +execute stmt; +(values ((select * from t3 where a in (select * from v1)))) +1 +execute stmt; +(values ((select * from t3 where a in (select * from v1)))) +1 +deallocate prepare stmt; +select +(values ((select * from t3 +where a > 10 and a in (select * from v1)))); +(values ((select * from t3 +where a > 10 and a in (select * from v1)))) +NULL +explain select +(values ((select * from t3 +where a > 10 and a in (select * from v1)))); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +6 SUBQUERY <derived2> ALL NULL NULL NULL NULL 2 +2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used +3 SUBQUERY t3 ALL NULL NULL NULL NULL 11 Using where +3 SUBQUERY <subquery4> eq_ref distinct_key distinct_key 8 func 1 Using where +4 MATERIALIZED <derived5> ALL NULL NULL NULL NULL 11 +5 DERIVED t3 ALL NULL NULL NULL NULL 11 Using temporary; Using filesort +prepare stmt from "select +(values ((select * from t3 +where a > 10 and a in (select * from v1))))"; +execute stmt; +(values ((select * from t3 +where a > 10 and a in (select * from v1)))) +NULL +execute stmt; +(values ((select * from t3 +where a > 10 and a in (select * from v1)))) +NULL +deallocate prepare stmt; +drop view v1; +drop table t1,t2,t3; +# +# MDEV-24919: subselect formed by TVC and used in set function +# +select sum((values(1))); +sum((values(1))) +1 +# +# MDEV-22786: Nested table values constructors +# +values ((values (2))); +(values (2)) +2 +values ((values (2)), (5), (select 4)); +(values (2)) 5 (select 4) +2 5 4 +values ((7), (values (2)), (5), (select 4)); +7 (values (2)) 5 (select 4) +7 2 5 4 +values ((values (2))) union values ((values (3))); +(values (2)) +2 +3 +values ((values (2))), ((values (3))); +(values (2)) +2 +3 +values ((values (2))), ((select 4)), ((values (3))); +(values (2)) +2 +4 +3 +values ((values (4)), (values (5))), ((values (1)), (values (7))); +(values (4)) (values (5)) +4 5 +1 7 +values ((values (4)), (select 5)), ((select 1), (values (7))); +(values (4)) (select 5) +4 5 +1 7 +values ((select 2)) union values ((values (3))); +(select 2) +2 +3 +values ((values (2))) union values((select 3)); +(values (2)) +2 +3 +values ((values (2))) union all values ((values (2))); +(values (2)) +2 +2 +values ((values (4)), (values (5))), ((values (1)), (values (7))) +union +values ((values (4)), (select 5)), ((select 2), (values (8))); +(values (4)) (values (5)) +4 5 +1 7 +2 8 +values ((values (4)), (values (5))), ((values (1)), (values (7))) +union all +values ((values (4)), (select 5)), ((select 2), (values (8))); +(values (4)) (values (5)) +4 5 +1 7 +4 5 +2 8 +values ((values (1) union values (1))); +(values (1) union values (1)) +1 +values ((values (1) union values (1) union values (1))); +(values (1) union values (1) union values (1)) +1 +values ((values ((values (4))))); +(values ((values (4)))) +4 +values ((values ((select 5)))); +(values ((select 5))) +5 +values ((select (values (4))), (values ((values(5))))); +(select (values (4))) (values ((values(5)))) +4 5 +values ((select (values (4))), (values ((select 5)))); +(select (values (4))) (values ((select 5))) +4 5 +values ((select (values (4))), (values ((values(5))))) +union +values ((select (values (4))), (values ((select 7)))); +(select (values (4))) (values ((values(5)))) +4 5 +4 7 +values ((values (2))), ((values ((values (4))))); +(values (2)) +2 +4 +values ((values (2))), ((values ((select 4)))); +(values (2)) +2 +4 +values ((values (2))), ((values ((values (4))))) +union +values ((values (8))), ((values ((select 4)))); +(values (2)) +2 +4 +8 +values ((values (2))), ((values ((values (4))))) +union all +values ((values (8))), ((values ((select 4)))); +(values (2)) +2 +4 +8 +4 +select * from (values ((values (2)))) dt; +(values (2)) +2 +select * from (values ((values (2)), (5), (select 4))) dt; +(values (2)) 5 (select 4) +2 5 4 +select * from (values ((values (2))) union values ((values (3)))) dt; +(values (2)) +2 +3 +select * from (values ((values (2))), ((values (3)))) dt; +(values (2)) +2 +3 +select * from (values ((values (2))), ((values (3)))) dt; +(values (2)) +2 +3 +select * from (values ((values (2))), ((select 4)), ((values (3)))) dt; +(values (2)) +2 +4 +3 +create table t1 (a int); +insert into t1 values (3), (7), (1); +values ((values ((select a from t1 where a=7)))); +(values ((select a from t1 where a=7))) +7 +values ((values ((select (values(2)) from t1 where a=8)))); +(values ((select (values(2)) from t1 where a=8))) +NULL +values ((values ((select a from t1 where a=7)))) +union +values ((values ((select (values(2)) from t1 where a=8)))); +(values ((select a from t1 where a=7))) +7 +NULL +values ((values ((select a from t1 where a in ((values (7))))))); +(values ((select a from t1 where a in ((values (7)))))) +7 +values ((values ((select a from t1 where a in ((values (7), (8))))))); +(values ((select a from t1 where a in ((values (7), (8)))))) +7 +values ((values +((select a from t1 where a in (values (7) union values (8)))))); +(values +((select a from t1 where a in (values (7) union values (8))))) +7 +values ((values ((select (values(2)) from t1 where a=8)))); +(values ((select (values(2)) from t1 where a=8))) +NULL +values ((select (values(2)) from t1 where a<7)); +ERROR 21000: Subquery returns more than 1 row +select * from (values ((values ((select a from t1 where a=7))))) dt; +(values ((select a from t1 where a=7))) +7 +select * from (values ((values ((select (values(2)) from t1 where a=8))))) dt; +(values ((select (values(2)) from t1 where a=8))) +NULL +insert into t1(a) values ((values (2))), ((values (3))); +select * from t1; +a +3 +7 +1 +2 +3 +drop table t1; +End of 10.3 tests +# # MDEV-22610 Crash in INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT)) # VALUES (DEFAULT) UNION VALUES (DEFAULT); @@ -2634,3 +3076,6 @@ ERROR HY000: 'default' is not allowed in this context INSERT INTO t1 (VALUES (IGNORE) UNION VALUES (IGNORE)); ERROR HY000: 'ignore' is not allowed in this context DROP TABLE t1; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/table_value_constr.test b/mysql-test/main/table_value_constr.test index bd5e4d75904..49e1c7c18c6 100644 --- a/mysql-test/main/table_value_constr.test +++ b/mysql-test/main/table_value_constr.test @@ -1354,6 +1354,281 @@ EXECUTE IMMEDIATE 'VALUES (?)' USING IGNORE; --error ER_UNKNOWN_ERROR EXECUTE IMMEDIATE 'VALUES (?)' USING DEFAULT; +--echo # +--echo # MDEV-24675: TVC using subqueries +--echo # + +values((select 1)); + +values (2), ((select 1)); + +values ((select 1)), (2), ((select 3)); + +values ((select 1), 2), (3,4), (5, (select 6)); + +create table t1 (a int, b int); +insert into t1 values (1,3), (2,3), (3,2), (1,2); + +values((select max(a) from t1)); + +values((select min(b) from t1)); + +values ((select max(a) from t1), (select min(b) from t1)); + +values((select * from (select max(b) from t1) as t)); + +drop table t1; + +--echo # +--echo # MDEV-24618: TVC contains extra parenthesis for row expressions +--echo # in value list +--echo # + +create table t1 (a int, b int); +insert into t1 values (1,3), (2,3); +--error ER_OPERAND_COLUMNS +insert into t1 values ((5,4)); + +--error ER_OPERAND_COLUMNS +values ((1,2)); + +--error ER_OPERAND_COLUMNS +select * from (values ((1,2))) dt; + +values (1,2); +--error ER_OPERAND_COLUMNS +values ((select min(a), max(b) from t1)); + +drop table t1; + +--echo # +--echo # MDEV-24840: union of TVCs in IN subquery +--echo # + +create table t1 (a int) engine=myisam; +insert into t1 values (3), (7), (1); + +let $q= +select a from t1 where a in (values (7) union values (8)); +eval $q; +eval explain extended $q; +eval prepare stmt from "$q"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +let $q= +select a from t1 where a not in (values (7) union values (8)); +eval $q; +eval explain extended $q; + +let $q= +select a from t1 where a < all(values (7) union values (8)); +eval $q; +eval explain extended $q; + +let $q= +select a from t1 where a >= any(values (7) union values (8)); +eval $q; +eval explain extended $q; + +drop table t1; + +--echo # +--echo # MDEV-24934:EXPLAIN for queries based on TVC using subqueries +--echo # + +create table t1 (a int); +insert into t1 values (3), (7), (1); + +let $q1= +values (8), ((select * from t1 where a between 2 and 4)); +eval $q1; +eval explain $q1; + +let $q2= +values ((select * from t1 where a between 2 and 4)), + ((select * from t1 where a > 10)); +eval $q2; +eval explain $q2; + +let $q3= +values (10,11), ((select * from t1 where a = 7) + 1, 21); +eval $q3; +eval explain $q3; + +drop table t1; + +--echo # +--echo # MDEV-24910: TVC containing subquery used as a subselect +--echo # + +create table t1 (a int) engine=myisam; +insert into t1 values (3), (7), (1); +create table t2 (b int) engine=myisam; +insert into t2 values (1), (2); + +let $q1= +select (values ((select 2))) from t2; +eval $q1; +eval explain $q1; +eval prepare stmt from "$q1"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +let $q2= +select (values ((select * from t1 where a > 10))) from t2; +eval $q2; +eval explain $q2; +eval prepare stmt from "$q2"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +create table t3 (a int); +insert into t3 values + (3), (7), (7), (1), (3), (9), (7), (9), (8), (7), (8); + +create view v1 as select count(a) as c from t3 group by a; + +let $q3= +select +(values ((select * from t3 where a in (select * from v1)))); +eval $q3; +eval explain $q3; +eval prepare stmt from "$q3"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +let $q4= +select +(values ((select * from t3 + where a > 10 and a in (select * from v1)))); +eval $q4; +eval explain $q4; +eval prepare stmt from "$q4"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +drop view v1; +drop table t1,t2,t3; + +--echo # +--echo # MDEV-24919: subselect formed by TVC and used in set function +--echo # + +select sum((values(1))); + +--echo # +--echo # MDEV-22786: Nested table values constructors +--echo # + +values ((values (2))); + +values ((values (2)), (5), (select 4)); + +values ((7), (values (2)), (5), (select 4)); + +values ((values (2))) union values ((values (3))); + +values ((values (2))), ((values (3))); + +values ((values (2))), ((select 4)), ((values (3))); + +values ((values (4)), (values (5))), ((values (1)), (values (7))); + +values ((values (4)), (select 5)), ((select 1), (values (7))); + +values ((select 2)) union values ((values (3))); + +values ((values (2))) union values((select 3)); + +values ((values (2))) union all values ((values (2))); + +values ((values (4)), (values (5))), ((values (1)), (values (7))) +union +values ((values (4)), (select 5)), ((select 2), (values (8))); + +values ((values (4)), (values (5))), ((values (1)), (values (7))) +union all +values ((values (4)), (select 5)), ((select 2), (values (8))); + +values ((values (1) union values (1))); + +values ((values (1) union values (1) union values (1))); + +values ((values ((values (4))))); + +values ((values ((select 5)))); + +values ((select (values (4))), (values ((values(5))))); + +values ((select (values (4))), (values ((select 5)))); + +values ((select (values (4))), (values ((values(5))))) +union +values ((select (values (4))), (values ((select 7)))); + +values ((values (2))), ((values ((values (4))))); + +values ((values (2))), ((values ((select 4)))); + +values ((values (2))), ((values ((values (4))))) +union +values ((values (8))), ((values ((select 4)))); + +values ((values (2))), ((values ((values (4))))) +union all +values ((values (8))), ((values ((select 4)))); + +select * from (values ((values (2)))) dt; + +select * from (values ((values (2)), (5), (select 4))) dt; + +select * from (values ((values (2))) union values ((values (3)))) dt; + +select * from (values ((values (2))), ((values (3)))) dt; + +select * from (values ((values (2))), ((values (3)))) dt; + +select * from (values ((values (2))), ((select 4)), ((values (3)))) dt; + +create table t1 (a int); +insert into t1 values (3), (7), (1); + +values ((values ((select a from t1 where a=7)))); + +values ((values ((select (values(2)) from t1 where a=8)))); + +values ((values ((select a from t1 where a=7)))) +union +values ((values ((select (values(2)) from t1 where a=8)))); + +values ((values ((select a from t1 where a in ((values (7))))))); + +values ((values ((select a from t1 where a in ((values (7), (8))))))); + +values ((values + ((select a from t1 where a in (values (7) union values (8)))))); + +values ((values ((select (values(2)) from t1 where a=8)))); + +--error ER_SUBQUERY_NO_1_ROW +values ((select (values(2)) from t1 where a<7)); + +select * from (values ((values ((select a from t1 where a=7))))) dt; + +select * from (values ((values ((select (values(2)) from t1 where a=8))))) dt; + +insert into t1(a) values ((values (2))), ((values (3))); +select * from t1; + +drop table t1; + +--echo End of 10.3 tests --echo # --echo # MDEV-22610 Crash in INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT)) @@ -1369,3 +1644,7 @@ INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT)); --error ER_UNKNOWN_ERROR INSERT INTO t1 (VALUES (IGNORE) UNION VALUES (IGNORE)); DROP TABLE t1; + +--echo # +--echo # End of 10.4 tests +--echo # diff --git a/mysql-test/main/type_decimal.result b/mysql-test/main/type_decimal.result index 6e7d7c8b6fe..0228652f74c 100644 --- a/mysql-test/main/type_decimal.result +++ b/mysql-test/main/type_decimal.result @@ -176,9 +176,8 @@ Note 1265 Data truncated for column 'a' at row 2 insert ignore into t1 values ("1e+18446744073709551615"),("1e+18446744073709551616"),("1e-9223372036854775807"),("1e-9223372036854775809"); Warnings: Warning 1264 Out of range value for column 'a' at row 1 -Warning 1366 Incorrect decimal value: '1e+18446744073709551616' for column `test`.`t1`.`a` at row 2 +Warning 1264 Out of range value for column 'a' at row 2 Note 1265 Data truncated for column 'a' at row 3 -Warning 1366 Incorrect decimal value: '1e-9223372036854775809' for column `test`.`t1`.`a` at row 4 insert ignore into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); Warnings: Warning 1265 Data truncated for column 'a' at row 1 @@ -209,7 +208,7 @@ a 99999999.99 0.00 99999999.99 -0.00 +99999999.99 0.00 0.00 123.40 @@ -1078,6 +1077,90 @@ t1 CREATE TABLE `t1` ( DROP TABLE t1; DROP TABLE t1dec102; # +# MDEV-24790 CAST('0e1111111111' AS DECIMAL(38,0)) returns a wrong result +# +SELECT CAST('0e111111111' AS DECIMAL(38,0)) AS a; +a +0 +SELECT CAST('0e1111111111' AS DECIMAL(38,0)) AS a; +a +0 +SELECT CAST('.00000000000000000000000000000000000001e111111111111111111111' AS DECIMAL(38,0)) AS a; +a +99999999999999999999999999999999999999 +Warnings: +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated +Warning 1292 Truncated incorrect DECIMAL value: '.00000000000000000000000000000000000001e111111111111111111111' +Warning 1264 Out of range value for column 'a' at row 1 +CREATE TABLE t1 (str VARCHAR(128), comment VARCHAR(128)); +INSERT INTO t1 VALUES +('0e111111111111111111111', 'Zero mantissa and a huge positive exponent'), +('1e111111111111111111111', 'Non-zero mantissa, huge positive exponent'), +('0e-111111111111111111111', 'Zero mantissa and a huge negative exponent'), +('1e-111111111111111111111', 'Non-zero mantissa and a huge negative exponent'); +BEGIN NOT ATOMIC +DECLARE done INT DEFAULT FALSE; +DECLARE vstr, vcomment VARCHAR(128); +DECLARE cur1 CURSOR FOR SELECT str, comment FROM t1 ORDER BY str; +DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; +OPEN cur1; +read_loop: +LOOP +FETCH cur1 INTO vstr, vcomment; +IF done THEN +LEAVE read_loop; +END IF; +SELECT vstr AS `--------`, vcomment AS `--------`; +SELECT CAST(str AS DECIMAL(38,0)) FROM t1 WHERE str=vstr; +SHOW WARNINGS; +SELECT CAST(CONCAT(str,'garbage') AS DECIMAL(38,0)) FROM t1 WHERE str=vstr; +SHOW WARNINGS; +END LOOP; +END; +$$ +-------- -------- +0e-111111111111111111111 Zero mantissa and a huge negative exponent +CAST(str AS DECIMAL(38,0)) +0 +Level Code Message +CAST(CONCAT(str,'garbage') AS DECIMAL(38,0)) +0 +Level Code Message +Warning 1292 Truncated incorrect DECIMAL value: '0e-111111111111111111111garbage' +-------- -------- +0e111111111111111111111 Zero mantissa and a huge positive exponent +CAST(str AS DECIMAL(38,0)) +0 +Level Code Message +CAST(CONCAT(str,'garbage') AS DECIMAL(38,0)) +0 +Level Code Message +Warning 1292 Truncated incorrect DECIMAL value: '0e111111111111111111111garbage' +-------- -------- +1e-111111111111111111111 Non-zero mantissa and a huge negative exponent +CAST(str AS DECIMAL(38,0)) +0 +Level Code Message +CAST(CONCAT(str,'garbage') AS DECIMAL(38,0)) +0 +Level Code Message +Warning 1292 Truncated incorrect DECIMAL value: '1e-111111111111111111111garbage' +-------- -------- +1e111111111111111111111 Non-zero mantissa, huge positive exponent +CAST(str AS DECIMAL(38,0)) +99999999999999999999999999999999999999 +Level Code Message +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated +Warning 1292 Truncated incorrect DECIMAL value: '1e111111111111111111111' +Warning 1264 Out of range value for column 'CAST(str AS DECIMAL(38,0))' at row 1 +CAST(CONCAT(str,'garbage') AS DECIMAL(38,0)) +99999999999999999999999999999999999999 +Level Code Message +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated +Warning 1292 Truncated incorrect DECIMAL value: '1e111111111111111111111garbage' +Warning 1264 Out of range value for column 'CAST(CONCAT(str,'garbage') AS DECIMAL(38,0))' at row 1 +DROP TABLE t1; +# # End of 10.2 tests # # diff --git a/mysql-test/main/type_decimal.test b/mysql-test/main/type_decimal.test index 4ffbcbd3288..1076592fe62 100644 --- a/mysql-test/main/type_decimal.test +++ b/mysql-test/main/type_decimal.test @@ -670,6 +670,50 @@ DROP TABLE t1; DROP TABLE t1dec102; --echo # +--echo # MDEV-24790 CAST('0e1111111111' AS DECIMAL(38,0)) returns a wrong result +--echo # + +SELECT CAST('0e111111111' AS DECIMAL(38,0)) AS a; +SELECT CAST('0e1111111111' AS DECIMAL(38,0)) AS a; +SELECT CAST('.00000000000000000000000000000000000001e111111111111111111111' AS DECIMAL(38,0)) AS a; + +CREATE TABLE t1 (str VARCHAR(128), comment VARCHAR(128)); +INSERT INTO t1 VALUES +('0e111111111111111111111', 'Zero mantissa and a huge positive exponent'), +('1e111111111111111111111', 'Non-zero mantissa, huge positive exponent'), +('0e-111111111111111111111', 'Zero mantissa and a huge negative exponent'), +('1e-111111111111111111111', 'Non-zero mantissa and a huge negative exponent'); + +# The loop below issues SHOW WARNINGS manually, disable automatic warnings +--disable_warnings +DELIMITER $$; +BEGIN NOT ATOMIC + DECLARE done INT DEFAULT FALSE; + DECLARE vstr, vcomment VARCHAR(128); + DECLARE cur1 CURSOR FOR SELECT str, comment FROM t1 ORDER BY str; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + OPEN cur1; +read_loop: + LOOP + FETCH cur1 INTO vstr, vcomment; + IF done THEN + LEAVE read_loop; + END IF; + SELECT vstr AS `--------`, vcomment AS `--------`; + SELECT CAST(str AS DECIMAL(38,0)) FROM t1 WHERE str=vstr; + SHOW WARNINGS; + SELECT CAST(CONCAT(str,'garbage') AS DECIMAL(38,0)) FROM t1 WHERE str=vstr; + SHOW WARNINGS; + END LOOP; +END; +$$ +DELIMITER ;$$ +--enable_warnings + + +DROP TABLE t1; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/type_year.result b/mysql-test/main/type_year.result index 583a2818e02..26f90757d09 100644 --- a/mysql-test/main/type_year.result +++ b/mysql-test/main/type_year.result @@ -1,4 +1,3 @@ -drop table if exists t1; create table t1 (y year,y2 year(2)); Warnings: Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead @@ -28,6 +27,9 @@ y y2 2001 01 2069 69 drop table t1; +# +# Bug 2335 +# create table t1 (y year); insert ignore into t1 values (now()); Warnings: @@ -36,6 +38,9 @@ select if(y = now(), 1, 0) from t1; if(y = now(), 1, 0) 1 drop table t1; +# +# Bug #27176: Assigning a string to an year column has unexpected results +# create table t1(a year); insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3'); Warnings: @@ -47,7 +52,9 @@ a 2001 2001 drop table t1; -End of 5.0 tests +# +# End of 5.0 tests +# # # Bug #49480: WHERE using YEAR columns returns unexpected results # @@ -373,7 +380,8 @@ Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Pleas Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead DROP TABLE t1; # -End of 5.1 tests +# End of 5.1 tests +# create function y2k() returns int deterministic return 2000; create table t1 (a year(2), b int); Warnings: @@ -456,9 +464,6 @@ DROP TABLE t1; # End of 10.1 tests # # -# Start of 10.2 tests -# -# # MDEV-9392 Copying from DECIMAL to YEAR is not consistent about warnings # CREATE TABLE t1 (a YEAR); @@ -500,6 +505,64 @@ Warnings: Warning 1264 Out of range value for column 'a' at row 1 DROP TABLE t1; # +# Various widths of the YEAR +# +create or replace table t1 (a YEAR(0)); +Warnings: +Note 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a YEAR(1)); +Warnings: +Note 1287 'YEAR(1)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a YEAR(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a YEAR(3)); +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a YEAR(4)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a YEAR(5)); +Warnings: +Note 1287 'YEAR(5)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a YEAR(100)); +Warnings: +Note 1287 'YEAR(100)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +# # End of 10.2 tests # # diff --git a/mysql-test/main/type_year.test b/mysql-test/main/type_year.test index 19692148146..c1231cc3e79 100644 --- a/mysql-test/main/type_year.test +++ b/mysql-test/main/type_year.test @@ -1,9 +1,6 @@ # # Test year # ---disable_warnings -drop table if exists t1; ---enable_warnings create table t1 (y year,y2 year(2)); insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69); @@ -12,24 +9,27 @@ select * from t1 order by y; select * from t1 order by y2; drop table t1; -# -# Bug 2335 -# +--echo # +--echo # Bug 2335 +--echo # create table t1 (y year); insert ignore into t1 values (now()); select if(y = now(), 1, 0) from t1; drop table t1; -# -# Bug #27176: Assigning a string to an year column has unexpected results -# +--echo # +--echo # Bug #27176: Assigning a string to an year column has unexpected results +--echo # + create table t1(a year); insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3'); select * from t1; drop table t1; ---echo End of 5.0 tests +--echo # +--echo # End of 5.0 tests +--echo # --echo # --echo # Bug #49480: WHERE using YEAR columns returns unexpected results @@ -169,8 +169,9 @@ ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2); DROP TABLE t1; --echo # +--echo # End of 5.1 tests +--echo # ---echo End of 5.1 tests # # fun with convert_const_to_int # in some cases 00 is equal to 2000, in others it is not. @@ -230,10 +231,6 @@ DROP TABLE t1; --echo # --echo # ---echo # Start of 10.2 tests ---echo # - ---echo # --echo # MDEV-9392 Copying from DECIMAL to YEAR is not consistent about warnings --echo # CREATE TABLE t1 (a YEAR); @@ -268,6 +265,17 @@ SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR ALTER TABLE t1 MODIFY a YEAR; DROP TABLE t1; +--echo # +--echo # Various widths of the YEAR +--echo # +create or replace table t1 (a YEAR(0)); SHOW CREATE TABLE t1; +create or replace table t1 (a YEAR(1)); SHOW CREATE TABLE t1; +create or replace table t1 (a YEAR(2)); SHOW CREATE TABLE t1; +create or replace table t1 (a YEAR(3)); SHOW CREATE TABLE t1; +create or replace table t1 (a YEAR(4)); SHOW CREATE TABLE t1; +create or replace table t1 (a YEAR(5)); SHOW CREATE TABLE t1; +create or replace table t1 (a YEAR(100)); SHOW CREATE TABLE t1; +drop table t1; --echo # --echo # End of 10.2 tests diff --git a/mysql-test/main/union.result b/mysql-test/main/union.result index ef3aed397ba..52bc3ccb0dc 100644 --- a/mysql-test/main/union.result +++ b/mysql-test/main/union.result @@ -2616,5 +2616,39 @@ Warnings: Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where `test`.`t2`.`a` < 5 except /* select#2 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where `test`.`t3`.`a` < 5 union all /* select#3 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 drop table t1,t2,t3; # +# MDEV-24387: Wrong number of decimal digits in certain UNION/Subqery +# constellation +# +SELECT CAST(1 AS UNSIGNED) UNION ALL SELECT * from (SELECT NULL) t; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def CAST(1 AS UNSIGNED) 246 2 1 Y 32896 0 63 +CAST(1 AS UNSIGNED) +1 +NULL +SELECT CAST(1 AS SIGNED) UNION ALL SELECT * from (SELECT NULL) t; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def CAST(1 AS SIGNED) 3 2 1 Y 32896 0 63 +CAST(1 AS SIGNED) +1 +NULL +SELECT CAST(1 AS SIGNED) UNION ALL SELECT * from (SELECT CAST(1 AS UNSIGNED)) t; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def CAST(1 AS SIGNED) 246 11 1 N 32897 0 63 +CAST(1 AS SIGNED) +1 +1 +SELECT CAST(1 AS UNSIGNED) UNION ALL SELECT NULL; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def CAST(1 AS UNSIGNED) 246 2 1 Y 32896 0 63 +CAST(1 AS UNSIGNED) +1 +NULL +SELECT CAST(1 AS UNSIGNED) UNION ALL SELECT CAST(1 AS SIGNED); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def CAST(1 AS UNSIGNED) 246 2 1 N 32897 0 63 +CAST(1 AS UNSIGNED) +1 +1 +# # End of 10.3 tests # diff --git a/mysql-test/main/union.test b/mysql-test/main/union.test index 33adbb4603d..2e5a04a27f4 100644 --- a/mysql-test/main/union.test +++ b/mysql-test/main/union.test @@ -1866,5 +1866,23 @@ select * from t1 where a > 4; drop table t1,t2,t3; --echo # +--echo # MDEV-24387: Wrong number of decimal digits in certain UNION/Subqery +--echo # constellation +--echo # + +--disable_ps_protocol +--enable_metadata + +SELECT CAST(1 AS UNSIGNED) UNION ALL SELECT * from (SELECT NULL) t; +SELECT CAST(1 AS SIGNED) UNION ALL SELECT * from (SELECT NULL) t; +SELECT CAST(1 AS SIGNED) UNION ALL SELECT * from (SELECT CAST(1 AS UNSIGNED)) t; + +SELECT CAST(1 AS UNSIGNED) UNION ALL SELECT NULL; +SELECT CAST(1 AS UNSIGNED) UNION ALL SELECT CAST(1 AS SIGNED); + +--disable_metadata +--enable_ps_protocol + +--echo # --echo # End of 10.3 tests --echo # diff --git a/mysql-test/main/upgrade_MDEV-23102-1.test b/mysql-test/main/upgrade_MDEV-23102-1.test index 8491ddfffe4..172e0d595b2 100644 --- a/mysql-test/main/upgrade_MDEV-23102-1.test +++ b/mysql-test/main/upgrade_MDEV-23102-1.test @@ -75,7 +75,6 @@ CREATE DEFINER='superuser'@'localhost' SQL SECURITY DEFINER VIEW IF NOT EXISTS u CAST(IFNULL(JSON_VALUE(Priv, '$.max_statement_time'), 0.0) AS DECIMAL(12,6)) AS max_statement_time FROM global_priv; - SET sql_mode=''; DROP PROCEDURE IF EXISTS mysql.AddGeometryColumn; diff --git a/mysql-test/main/upgrade_MDEV-23102-2.test b/mysql-test/main/upgrade_MDEV-23102-2.test index 5ce7682fea6..f2d7ac578e0 100644 --- a/mysql-test/main/upgrade_MDEV-23102-2.test +++ b/mysql-test/main/upgrade_MDEV-23102-2.test @@ -75,7 +75,6 @@ CREATE DEFINER='superuser'@'localhost' SQL SECURITY DEFINER VIEW IF NOT EXISTS u CAST(IFNULL(JSON_VALUE(Priv, '$.max_statement_time'), 0.0) AS DECIMAL(12,6)) AS max_statement_time FROM global_priv; - DROP PROCEDURE IF EXISTS mysql.AddGeometryColumn; DROP PROCEDURE IF EXISTS mysql.DropGeometryColumn; diff --git a/mysql-test/main/upgrade_mdev_24363.result b/mysql-test/main/upgrade_mdev_24363.result new file mode 100644 index 00000000000..d507193088e --- /dev/null +++ b/mysql-test/main/upgrade_mdev_24363.result @@ -0,0 +1,129 @@ +# +# MDEV-24363 10.4: change definition of mysql.user view +# to reflect the correct value from mysql.global_priv +# This change was added because mysql.user view definition +# was already changed when mariadb.sys was introduced, so +# it's decently ok if we change it again to fix mdev-24363 +# +# Test that mysql.user password_expired column +# shows the right value as in mysql.global_priv +# +create user gigi@localhost; +show create user gigi@localhost; +CREATE USER for gigi@localhost +CREATE USER `gigi`@`localhost` +select password_expired from mysql.user where user='gigi' and host='localhost'; +password_expired +N +alter user gigi@localhost password expire; +show create user gigi@localhost; +CREATE USER for gigi@localhost +CREATE USER `gigi`@`localhost` PASSWORD EXPIRE +select password_expired from mysql.user where user='gigi' and host='localhost'; +password_expired +Y +drop user gigi@localhost; +# +# Test that upgrades from 10.4+ versions before this mdev +# correctly drop and recreate the mysql.user view +# +use mysql; +set @def = (select view_definition from information_schema.views where table_name='user' and table_schema='mysql'); +set @trimmed_def = (select trim(trailing 'from `mysql`.`global_priv`' from @def)); +set @newdef = (select concat(@trimmed_def, ", 'N' AS password_expired from mysql.global_priv")); +set @pos = (select instr(@newdef, 'password_expired')); +create or replace view user as select `mysql`.`global_priv`.`Host` AS `Host`,`mysql`.`global_priv`.`User` AS `User`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,if(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.password_last_changed'),1) = 0,'Y','N') AS `abcsword_expired`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` , 'N' AS password_expired from mysql.global_priv;; +create user gigi@localhost; +show create user gigi@localhost; +CREATE USER for gigi@localhost +CREATE USER `gigi`@`localhost` +select password_expired from mysql.user where user='gigi' and host='localhost'; +password_expired +N +alter user gigi@localhost password expire; +show create user gigi@localhost; +CREATE USER for gigi@localhost +CREATE USER `gigi`@`localhost` PASSWORD EXPIRE +select password_expired from mysql.user where user='gigi' and host='localhost'; +password_expired +N +drop user gigi@localhost; +# Run mysql_upgrade +Phase 1/7: Checking and upgrading mysql database +Processing databases +mysql +mysql.column_stats OK +mysql.columns_priv OK +mysql.db OK +mysql.event OK +mysql.func OK +mysql.global_priv OK +mysql.gtid_slave_pos OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.index_stats OK +mysql.innodb_index_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.proxies_priv OK +mysql.roles_mapping OK +mysql.servers OK +mysql.table_stats OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.transaction_registry +Error : Unknown storage engine 'InnoDB' +error : Corrupt + +Repairing tables +mysql.innodb_index_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.transaction_registry +Error : Unknown storage engine 'InnoDB' +error : Corrupt +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +mysql.user OK +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables +Processing databases +information_schema +mtr +mtr.global_suppressions OK +mtr.test_suppressions OK +performance_schema +test +Phase 7/7: Running 'FLUSH PRIVILEGES' +OK +create user gigi@localhost; +show create user gigi@localhost; +CREATE USER for gigi@localhost +CREATE USER `gigi`@`localhost` +select password_expired from mysql.user where user='gigi' and host='localhost'; +password_expired +N +alter user gigi@localhost password expire; +show create user gigi@localhost; +CREATE USER for gigi@localhost +CREATE USER `gigi`@`localhost` PASSWORD EXPIRE +select password_expired from mysql.user where user='gigi' and host='localhost'; +password_expired +Y +drop user gigi@localhost; diff --git a/mysql-test/main/upgrade_mdev_24363.test b/mysql-test/main/upgrade_mdev_24363.test new file mode 100644 index 00000000000..cdb49037a40 --- /dev/null +++ b/mysql-test/main/upgrade_mdev_24363.test @@ -0,0 +1,71 @@ +--echo # +--echo # MDEV-24363 10.4: change definition of mysql.user view +--echo # to reflect the correct value from mysql.global_priv +--echo # This change was added because mysql.user view definition +--echo # was already changed when mariadb.sys was introduced, so +--echo # it's decently ok if we change it again to fix mdev-24363 + +--echo # +--echo # Test that mysql.user password_expired column +--echo # shows the right value as in mysql.global_priv +--echo # + +create user gigi@localhost; +show create user gigi@localhost; +select password_expired from mysql.user where user='gigi' and host='localhost'; + +alter user gigi@localhost password expire; +show create user gigi@localhost; +select password_expired from mysql.user where user='gigi' and host='localhost'; + +drop user gigi@localhost; + +--echo # +--echo # Test that upgrades from 10.4+ versions before this mdev +--echo # correctly drop and recreate the mysql.user view +--echo # + +--source include/mysql_upgrade_preparation.inc + +use mysql; + +# Do all these string operations to replace password_expired definition +# with "'N' as password_expired" and avoid listing in one more test +# all the fields of the user view +set @def = (select view_definition from information_schema.views where table_name='user' and table_schema='mysql'); +set @trimmed_def = (select trim(trailing 'from `mysql`.`global_priv`' from @def)); +set @newdef = (select concat(@trimmed_def, ", 'N' AS password_expired from mysql.global_priv")); +set @pos = (select instr(@newdef, 'password_expired')); +let $viewdef = `select insert(@newdef, @pos, 3, 'abc')`; + +--eval create or replace view user as $viewdef; + +create user gigi@localhost; +show create user gigi@localhost; +select password_expired from mysql.user where user='gigi' and host='localhost'; + +# password should be expired, but mysql.user.password_expired should be 'N' +alter user gigi@localhost password expire; +show create user gigi@localhost; +select password_expired from mysql.user where user='gigi' and host='localhost'; + +drop user gigi@localhost; + +--echo # Run mysql_upgrade +--exec $MYSQL_UPGRADE 2>&1 +let $MYSQLD_DATADIR= `select @@datadir`; +--file_exists $MYSQLD_DATADIR/mysql_upgrade_info +--remove_file $MYSQLD_DATADIR/mysql_upgrade_info + +create user gigi@localhost; +show create user gigi@localhost; +select password_expired from mysql.user where user='gigi' and host='localhost'; + +# mysql.user view should've been recreated by mariadb_upgrade, thus +# password_expired should show 'Y' +alter user gigi@localhost password expire; +show create user gigi@localhost; +select password_expired from mysql.user where user='gigi' and host='localhost'; + +drop user gigi@localhost; + diff --git a/mysql-test/main/user_limits.result b/mysql-test/main/user_limits.result index ffb8bb204a6..acb34754caa 100644 --- a/mysql-test/main/user_limits.result +++ b/mysql-test/main/user_limits.result @@ -186,3 +186,30 @@ connection default; drop user mysqltest_1@localhost; drop table t1; set global max_user_connections= @my_max_user_connections; +# +# End of 10.1 tests +# +# +# MDEV-17852 Altered connection limits for user have no effect +# +create user foo@'%' with max_user_connections 1; +connect con1,localhost,foo; +select current_user(); +current_user() +foo@% +connect(localhost,foo,,test,MYSQL_PORT,MYSQL_SOCK); +connect con2,localhost,foo; +ERROR 42000: User 'foo' has exceeded the 'max_user_connections' resource (current value: 1) +connection default; +alter user foo with max_user_connections 2; +connect con3,localhost,foo; +select current_user(); +current_user() +foo@% +disconnect con3; +disconnect con1; +connection default; +drop user foo@'%'; +# +# End of 10.2 tests +# diff --git a/mysql-test/main/user_limits.test b/mysql-test/main/user_limits.test index ebb4fd4fb88..36524febd8d 100644 --- a/mysql-test/main/user_limits.test +++ b/mysql-test/main/user_limits.test @@ -216,3 +216,29 @@ drop table t1; --source include/wait_until_count_sessions.inc set global max_user_connections= @my_max_user_connections; + +--echo # +--echo # End of 10.1 tests +--echo # + +--echo # +--echo # MDEV-17852 Altered connection limits for user have no effect +--echo # +create user foo@'%' with max_user_connections 1; +--connect con1,localhost,foo +select current_user(); +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +--error ER_USER_LIMIT_REACHED +--connect con2,localhost,foo +--connection default +alter user foo with max_user_connections 2; +--connect con3,localhost,foo +select current_user(); +--disconnect con3 +--disconnect con1 +--connection default +drop user foo@'%'; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/main/userstat.result b/mysql-test/main/userstat.result index 6ba3d0b7811..9152f602304 100644 --- a/mysql-test/main/userstat.result +++ b/mysql-test/main/userstat.result @@ -1,4 +1,3 @@ -DROP TABLE IF EXISTS t1; select variable_value from information_schema.global_status where variable_name="handler_read_key" into @global_read_key; Warnings: Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead @@ -237,3 +236,17 @@ select @@in_transaction; 0 drop table t1; set @@global.general_log=@save_general_log; +# +# MDEV-25242 Server crashes in check_grant upon invoking function with userstat enabled +# +create function f() returns int return (select 1 from performance_schema.threads); +set global userstat= 1; +select f() from information_schema.table_statistics; +ERROR 21000: Subquery returns more than 1 row +select f() from information_schema.index_statistics; +ERROR 21000: Subquery returns more than 1 row +set global userstat= 0; +drop function f; +# +# End of 10.2 tests +# diff --git a/mysql-test/main/userstat.test b/mysql-test/main/userstat.test index 547138cfeaa..6d486810db1 100644 --- a/mysql-test/main/userstat.test +++ b/mysql-test/main/userstat.test @@ -5,10 +5,7 @@ -- source include/have_innodb.inc -- source include/have_log_bin.inc - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings +-- source include/have_perfschema.inc select variable_value from information_schema.global_status where variable_name="handler_read_key" into @global_read_key; show columns from information_schema.client_statistics; @@ -115,5 +112,20 @@ set @@autocommit=1; select @@in_transaction; drop table t1; -# Cleanup set @@global.general_log=@save_general_log; + +--echo # +--echo # MDEV-25242 Server crashes in check_grant upon invoking function with userstat enabled +--echo # +create function f() returns int return (select 1 from performance_schema.threads); +set global userstat= 1; +--error ER_SUBQUERY_NO_1_ROW +select f() from information_schema.table_statistics; +--error ER_SUBQUERY_NO_1_ROW +select f() from information_schema.index_statistics; +set global userstat= 0; +drop function f; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/mysql-test/main/view.result b/mysql-test/main/view.result index 5718fed4464..de4be4efda5 100644 --- a/mysql-test/main/view.result +++ b/mysql-test/main/view.result @@ -6723,6 +6723,72 @@ DROP PROCEDURE sp; DROP VIEW v1; DROP TABLE t1; # +# MDEV-24314: create view with derived table without default database +# +drop database test; +create database db1; +create table db1.t1 (a int); +insert into db1.t1 values (3),(7),(1); +create view db1.v1 as select * from (select * from db1.t1) t; +show create view db1.v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `db1`.`v1` AS select `t`.`a` AS `a` from (select `db1`.`t1`.`a` AS `a` from `db1`.`t1`) `t` latin1 latin1_swedish_ci +select * from db1.v1; +a +3 +7 +1 +drop view db1.v1; +prepare stmt from " +create view db1.v1 as select * from (select * from db1.t1) t; +"; +execute stmt; +deallocate prepare stmt; +show create view db1.v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `db1`.`v1` AS select `t`.`a` AS `a` from (select `db1`.`t1`.`a` AS `a` from `db1`.`t1`) `t` latin1 latin1_swedish_ci +select * from db1.v1; +a +3 +7 +1 +drop view db1.v1; +drop table db1.t1; +drop database db1; +create database test; +use test; +# +# MDEV-16940: update of multi-table view returning error used in SP +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1), (2); +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (2), (3); +CREATE VIEW v1 AS SELECT a, b FROM t1,t2; +CREATE PROCEDURE sp1() UPDATE v1 SET a = 8, b = 9; +CALL sp1; +ERROR HY000: Can not modify more than one base table through a join view 'test.v1' +CALL sp1; +ERROR HY000: Can not modify more than one base table through a join view 'test.v1' +DROP PROCEDURE sp1; +DROP VIEW v1; +DROP TABLE t1, t2; +# +# MDEV-23291: SUM column from a derived table returns invalid values +# +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 VALUES (1,1), (2,2); +CREATE view v1 AS +SELECT a as x, (select x) as y, (select y) as z FROM t1; +SELECT sum(z) FROM (SELECT a as x, (select x) as y, (select y) as z FROM t1) q; +sum(z) +3 +SELECT sum(z) FROM v1; +sum(z) +3 +DROP TABLE t1; +DROP VIEW v1; +# # End of 10.2 tests # # @@ -6758,3 +6824,19 @@ Drop table t1; # # End of 10.3 tests # +# +# MDEV-25206: view specification contains unknown column reference +# +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b int); +INSERT INTO t2 VALUES (2),(3); +CREATE TABLE t3 (c int); +CREATE VIEW v1 AS SELECT * FROM t1 JOIN t2 ON t1.x > t2.b; +ERROR 42S22: Unknown column 't1.x' in 'on clause' +INSERT INTO t3 SELECT * FROM t1 JOIN t2 ON t1.x > t2.b; +ERROR 42S22: Unknown column 't1.x' in 'on clause' +CREATE TABLE t4 AS SELECT * FROM t1 JOIN t2 ON t1.x > t2.b; +ERROR 42S22: Unknown column 't1.x' in 'on clause' +DROP TABLE t1,t2,t3; +# End of 10.4 tests diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test index cf77dd875f2..ca5456930ba 100644 --- a/mysql-test/main/view.test +++ b/mysql-test/main/view.test @@ -6433,6 +6433,74 @@ DROP VIEW v1; DROP TABLE t1; --echo # +--echo # MDEV-24314: create view with derived table without default database +--echo # + +drop database test; + +create database db1; +create table db1.t1 (a int); +insert into db1.t1 values (3),(7),(1); + +create view db1.v1 as select * from (select * from db1.t1) t; +show create view db1.v1; +select * from db1.v1; +drop view db1.v1; + +prepare stmt from " +create view db1.v1 as select * from (select * from db1.t1) t; +"; +execute stmt; +deallocate prepare stmt; +show create view db1.v1; +select * from db1.v1; +drop view db1.v1; + +drop table db1.t1; +drop database db1; + +create database test; +use test; + +--echo # +--echo # MDEV-16940: update of multi-table view returning error used in SP +--echo # + +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1), (2); +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (2), (3); + +CREATE VIEW v1 AS SELECT a, b FROM t1,t2; + +CREATE PROCEDURE sp1() UPDATE v1 SET a = 8, b = 9; + +--error ER_VIEW_MULTIUPDATE +CALL sp1; +--error ER_VIEW_MULTIUPDATE +CALL sp1; + +DROP PROCEDURE sp1; +DROP VIEW v1; +DROP TABLE t1, t2; + +--echo # +--echo # MDEV-23291: SUM column from a derived table returns invalid values +--echo # + +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 VALUES (1,1), (2,2); + +CREATE view v1 AS +SELECT a as x, (select x) as y, (select y) as z FROM t1; + +SELECT sum(z) FROM (SELECT a as x, (select x) as y, (select y) as z FROM t1) q; +SELECT sum(z) FROM v1; + +DROP TABLE t1; +DROP VIEW v1; + +--echo # --echo # End of 10.2 tests --echo # @@ -6474,3 +6542,24 @@ Drop table t1; --echo # --echo # End of 10.3 tests --echo # + +--echo # +--echo # MDEV-25206: view specification contains unknown column reference +--echo # + +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b int); +INSERT INTO t2 VALUES (2),(3); +CREATE TABLE t3 (c int); + +--error ER_BAD_FIELD_ERROR +CREATE VIEW v1 AS SELECT * FROM t1 JOIN t2 ON t1.x > t2.b; +--error ER_BAD_FIELD_ERROR +INSERT INTO t3 SELECT * FROM t1 JOIN t2 ON t1.x > t2.b; +--error ER_BAD_FIELD_ERROR +CREATE TABLE t4 AS SELECT * FROM t1 JOIN t2 ON t1.x > t2.b; + +DROP TABLE t1,t2,t3; + +--echo # End of 10.4 tests diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result index ed10568703c..acc3de96fe8 100644 --- a/mysql-test/main/win.result +++ b/mysql-test/main/win.result @@ -3866,6 +3866,32 @@ NULL DROP VIEW v1; DROP TABLE t1,t2; # +# MDEV-25032 Window functions without column references get removed from ORDER BY +# +create table t1 (id int, score double); +insert into t1 values +(1, 5), +(1, 6), +(1, 6), +(1, 6), +(1, 7), +(1, 8.1), +(1, 9), +(1, 10); +select id, row_number() over () rn +from t1 +order by rn desc; +id rn +1 8 +1 7 +1 6 +1 5 +1 4 +1 3 +1 2 +1 1 +drop table t1; +# # End of 10.2 tests # # diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test index f5ad5e8b778..007e608a0a1 100644 --- a/mysql-test/main/win.test +++ b/mysql-test/main/win.test @@ -2523,6 +2523,26 @@ DROP VIEW v1; DROP TABLE t1,t2; --echo # +--echo # MDEV-25032 Window functions without column references get removed from ORDER BY +--echo # + +create table t1 (id int, score double); +insert into t1 values +(1, 5), +(1, 6), +(1, 6), +(1, 6), +(1, 7), +(1, 8.1), +(1, 9), +(1, 10); +select id, row_number() over () rn +from t1 +order by rn desc; + +drop table t1; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 61195934c39..e4ecc910556 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -48,9 +48,7 @@ BEGIN { "Could not find the lib/ directory \n"; exit(1); } -} -BEGIN { # Check backward compatibility support # By setting the environment variable MTR_VERSION # it's possible to use a previous version of @@ -95,6 +93,7 @@ use My::Tee; use My::Find; use My::SysInfo; use My::CoreDump; +use My::Debugger; use mtr_cases; use mtr_report; use mtr_match; @@ -109,6 +108,9 @@ require "mtr_io.pl"; require "mtr_gprof.pl"; require "mtr_misc.pl"; +my $opt_valgrind; +my $valgrind_reports= 0; + $SIG{INT}= sub { mtr_error("Got ^C signal"); }; $SIG{HUP}= sub { mtr_error("Hangup detected on controlling terminal"); }; @@ -262,28 +264,6 @@ our $opt_gcov; our $opt_gprof; our %gprof_dirs; -our $glob_debugger= 0; -our $opt_gdb; -my $opt_rr; -my $opt_rr_dir; -my @rr_record_args; -our $opt_client_gdb; -my $opt_boot_gdb; -my $opt_boot_rr; -our $opt_dbx; -our $opt_client_dbx; -my $opt_boot_dbx; -our $opt_ddd; -our $opt_client_ddd; -my $opt_boot_ddd; -our $opt_manual_gdb; -our $opt_manual_lldb; -our $opt_manual_dbx; -our $opt_manual_ddd; -our $opt_manual_debug; -our $opt_debugger; -our $opt_client_debugger; - my $config; # The currently running config my $current_config_name; # The currently running config file template @@ -309,51 +289,30 @@ our $opt_report_times= 0; my $opt_sleep; -my $opt_testcase_timeout= $ENV{MTR_TESTCASE_TIMEOUT} || 15; # minutes -my $opt_suite_timeout = $ENV{MTR_SUITE_TIMEOUT} || 360; # minutes -my $opt_shutdown_timeout= $ENV{MTR_SHUTDOWN_TIMEOUT} || 10; # seconds -my $opt_start_timeout = $ENV{MTR_START_TIMEOUT} || 180; # seconds +our $opt_retry= 1; +our $opt_retry_failure= env_or_val(MTR_RETRY_FAILURE => 2); +our $opt_testcase_timeout= $ENV{MTR_TESTCASE_TIMEOUT} || 15; # minutes +our $opt_suite_timeout = $ENV{MTR_SUITE_TIMEOUT} || 360; # minutes +our $opt_shutdown_timeout= $ENV{MTR_SHUTDOWN_TIMEOUT} || 10; # seconds +our $opt_start_timeout = $ENV{MTR_START_TIMEOUT} || 180; # seconds sub suite_timeout { return $opt_suite_timeout * 60; }; my $opt_wait_all; my $opt_user_args; my $opt_repeat= 1; -my $opt_retry= 1; -my $opt_retry_failure= env_or_val(MTR_RETRY_FAILURE => 2); my $opt_reorder= 1; my $opt_force_restart= 0; our $opt_user = "root"; -our $opt_valgrind= 0; -my $opt_valgrind_mysqld= 0; -my $opt_valgrind_mysqltest= 0; -my @valgrind_args; -my $opt_strace= 0; -my $opt_stracer; -my $opt_client_strace = 0; -my @strace_args; -my $opt_valgrind_path; -my $valgrind_reports= 0; -my $opt_callgrind; my %mysqld_logs; my $opt_debug_sync_timeout= 300; # Default timeout for WAIT_FOR actions. my $warn_seconds = 60; my $rebootstrap_re= '--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_]group[-_]home[-_]dir|data[-_]home[-_]dir)|data[-_]file[-_]path|force_rebootstrap'; -sub testcase_timeout ($) { - my ($tinfo)= @_; - if (exists $tinfo->{'case-timeout'}) { - # Return test specific timeout if *longer* that the general timeout - my $test_to= $tinfo->{'case-timeout'}; - $test_to*= 10 if $opt_valgrind; - return $test_to * 60 if $test_to > $opt_testcase_timeout; - } - return $opt_testcase_timeout * 60; -} - +sub testcase_timeout ($) { return $opt_testcase_timeout * 60; } sub check_timeout ($) { return testcase_timeout($_[0]); } our $opt_warnings= 1; @@ -769,9 +728,13 @@ sub run_test_server ($$$) { rename $log_file_name, $log_file_name.".failed"; } - delete($result->{result}); - $result->{retries}= $retries+1; - $result->write_test($sock, 'TESTCASE'); + { + local @$result{'retries', 'result'}; + delete $result->{result}; + $result->{retries}= $retries+1; + $result->write_test($sock, 'TESTCASE'); + } + push(@$completed, $result); next; } } @@ -1006,7 +969,7 @@ sub run_worker ($) { } mark_time_used('restart'); my $valgrind_reports= 0; - if ($opt_valgrind_mysqld) { + if ($opt_valgrind) { $valgrind_reports= valgrind_exit_reports(); print $server "VALGREP\n" if $valgrind_reports; } @@ -1068,8 +1031,6 @@ sub print_global_resfile { resfile_global("debug", $opt_debug ? 1 : 0); resfile_global("gcov", $opt_gcov ? 1 : 0); resfile_global("gprof", $opt_gprof ? 1 : 0); - resfile_global("valgrind", $opt_valgrind ? 1 : 0); - resfile_global("callgrind", $opt_callgrind ? 1 : 0); resfile_global("mem", $opt_mem); resfile_global("tmpdir", $opt_tmpdir); resfile_global("vardir", $opt_vardir); @@ -1159,30 +1120,6 @@ sub command_line_setup { 'debug' => \$opt_debug, 'debug-common' => \$opt_debug_common, 'debug-server' => \$opt_debug_server, - 'gdb=s' => \$opt_gdb, - 'rr' => \$opt_rr, - 'rr-arg=s' => \@rr_record_args, - 'rr-dir=s' => \$opt_rr_dir, - 'client-gdb' => \$opt_client_gdb, - 'manual-gdb' => \$opt_manual_gdb, - 'manual-lldb' => \$opt_manual_lldb, - 'boot-gdb' => \$opt_boot_gdb, - 'boot-rr' => \$opt_boot_rr, - 'manual-debug' => \$opt_manual_debug, - 'ddd' => \$opt_ddd, - 'client-ddd' => \$opt_client_ddd, - 'manual-ddd' => \$opt_manual_ddd, - 'boot-ddd' => \$opt_boot_ddd, - 'dbx' => \$opt_dbx, - 'client-dbx' => \$opt_client_dbx, - 'manual-dbx' => \$opt_manual_dbx, - 'debugger=s' => \$opt_debugger, - 'boot-dbx' => \$opt_boot_dbx, - 'client-debugger=s' => \$opt_client_debugger, - 'strace' => \$opt_strace, - 'strace-option=s' => \@strace_args, - 'client-strace' => \$opt_client_strace, - 'stracer=s' => \$opt_stracer, 'max-save-core=i' => \$opt_max_save_core, 'max-save-datadir=i' => \$opt_max_save_datadir, 'max-test-fail=i' => \$opt_max_test_fail, @@ -1191,23 +1128,6 @@ sub command_line_setup { # Coverage, profiling etc 'gcov' => \$opt_gcov, 'gprof' => \$opt_gprof, - 'valgrind|valgrind-all' => \$opt_valgrind, - 'valgrind-mysqltest' => \$opt_valgrind_mysqltest, - 'valgrind-mysqld' => \$opt_valgrind_mysqld, - 'valgrind-options=s' => sub { - my ($opt, $value)= @_; - # Deprecated option unless it's what we know pushbuild uses - if ($value eq "--gen-suppressions=all --show-reachable=yes") { - push(@valgrind_args, $_) for (split(' ', $value)); - return; - } - die("--valgrind-options=s is deprecated. Use ", - "--valgrind-option=s, to be specified several", - " times if necessary"); - }, - 'valgrind-option=s' => \@valgrind_args, - 'valgrind-path=s' => \$opt_valgrind_path, - 'callgrind' => \$opt_callgrind, 'debug-sync-timeout=i' => \$opt_debug_sync_timeout, # Directories @@ -1257,12 +1177,13 @@ sub command_line_setup { # list-options is internal, not listed in help 'list-options' => \$opt_list_options, 'skip-test-list=s' => \@opt_skip_test_list, - 'xml-report=s' => \$opt_xml_report + 'xml-report=s' => \$opt_xml_report, + + My::Debugger::options() ); # fix options (that take an optional argument and *only* after = sign - my %fixopt = ( '--gdb' => '--gdb=#' ); - @ARGV = map { $fixopt{$_} or $_ } @ARGV; + @ARGV = My::Debugger::fix_options(@ARGV); GetOptions(%options) or usage("Can't read options"); usage("") if $opt_usage; list_options(\%options) if $opt_list_options; @@ -1587,39 +1508,6 @@ sub command_line_setup { { mtr_error("Can't use --extern with --embedded-server"); } - - - if ($opt_gdb) - { - $opt_client_gdb= $opt_gdb; - $opt_gdb= undef; - } - - if ($opt_ddd) - { - $opt_client_ddd= $opt_ddd; - $opt_ddd= undef; - } - - if ($opt_dbx) { - mtr_warning("Silently converting --dbx to --client-dbx in embedded mode"); - $opt_client_dbx= $opt_dbx; - $opt_dbx= undef; - } - - if ($opt_debugger) - { - $opt_client_debugger= $opt_debugger; - $opt_debugger= undef; - } - - if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_lldb || - $opt_manual_ddd || $opt_manual_debug || $opt_debugger || $opt_dbx || - $opt_manual_dbx) - { - mtr_error("You need to use the client debug options for the", - "embedded server. Ex: --client-gdb"); - } } # -------------------------------------------------------------------------- @@ -1640,42 +1528,6 @@ sub command_line_setup { } # -------------------------------------------------------------------------- - # Check debug related options - # -------------------------------------------------------------------------- - if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || $opt_rr || - $opt_manual_gdb || $opt_manual_lldb || $opt_manual_ddd || - $opt_manual_debug || $opt_dbx || $opt_client_dbx || $opt_manual_dbx || - $opt_debugger || $opt_client_debugger ) - { - $ENV{ASAN_OPTIONS}= 'abort_on_error=1:'.($ENV{ASAN_OPTIONS} || ''); - if ( using_extern() ) - { - mtr_error("Can't use --extern when using debugger"); - } - # Indicate that we are using debugger - $glob_debugger= 1; - $opt_retry= 1; - $opt_retry_failure= 1; - # Set one week timeout (check-testcase timeout will be 1/10th) - $opt_testcase_timeout= 7 * 24 * 60; - $opt_suite_timeout= 7 * 24 * 60; - # One day to shutdown - $opt_shutdown_timeout= 24 * 60; - # One day for PID file creation (this is given in seconds not minutes) - $opt_start_timeout= 24 * 60 * 60; - if ($opt_rr && open(my $fh, '<', '/proc/sys/kernel/perf_event_paranoid')) - { - my $perf_event_paranoid= <$fh>; - close $fh; - chomp $perf_event_paranoid; - if ($perf_event_paranoid == 0) - { - mtr_error("rr requires kernel.perf_event_paranoid set to 1"); - } - } - } - - # -------------------------------------------------------------------------- # Modified behavior with --start options # -------------------------------------------------------------------------- if ($opt_start or $opt_start_dirty or $opt_start_exit) { @@ -1736,75 +1588,6 @@ sub command_line_setup { "for option --testsuite-timeout") if ($opt_suite_timeout <= 0); - # -------------------------------------------------------------------------- - # Check valgrind arguments - # -------------------------------------------------------------------------- - if ( $opt_valgrind or $opt_valgrind_path or @valgrind_args) - { - mtr_report("Turning on valgrind for all executables"); - $opt_valgrind= 1; - $opt_valgrind_mysqld= 1; - $opt_valgrind_mysqltest= 1; - } - elsif ( $opt_valgrind_mysqld ) - { - mtr_report("Turning on valgrind for mysqld(s) only"); - $opt_valgrind= 1; - } - elsif ( $opt_valgrind_mysqltest ) - { - mtr_report("Turning on valgrind for mysqltest and mysql_client_test only"); - $opt_valgrind= 1; - } - - if ($opt_valgrind) - { - # Increase the timeouts when running with valgrind - $opt_testcase_timeout*= 10; - $opt_suite_timeout*= 6; - $opt_start_timeout*= 10; - $warn_seconds*= 10; - } - - if ( $opt_callgrind ) - { - mtr_report("Turning on valgrind with callgrind for mysqld(s)"); - $opt_valgrind= 1; - $opt_valgrind_mysqld= 1; - - # Set special valgrind options unless options passed on command line - push(@valgrind_args, "--trace-children=yes") - unless @valgrind_args; - unshift(@valgrind_args, "--tool=callgrind"); - } - - # default to --tool=memcheck - if ($opt_valgrind && ! grep(/^--tool=/i, @valgrind_args)) - { - # Set valgrind_option unless already defined - push(@valgrind_args, ("--show-reachable=yes", "--leak-check=yes", - "--num-callers=16")) - unless @valgrind_args; - unshift(@valgrind_args, "--tool=memcheck"); - } - - if ( $opt_valgrind ) - { - # Make valgrind run in quiet mode so it only print errors - push(@valgrind_args, "--quiet" ); - - push(@valgrind_args, "--suppressions=${glob_mysql_test_dir}/valgrind.supp") - if -f "$glob_mysql_test_dir/valgrind.supp"; - - mtr_report("Running valgrind with options \"", - join(" ", @valgrind_args), "\""); - } - - if (@strace_args || $opt_stracer) - { - $opt_strace=1; - } - if ($opt_debug_common) { $opt_debug= 1; @@ -1948,7 +1731,6 @@ sub collect_mysqld_features { } - sub collect_mysqld_features_from_running_server () { my $mysql= mtr_exe_exists("$path_client_bindir/mysql"); @@ -2019,21 +1801,6 @@ sub executable_setup () { $exe_patch='patch' if `patch -v`; - # - # Check if libtool is available in this distribution/clone - # we need it when valgrinding or debugging non installed binary - # Otherwise valgrind will valgrind the libtool wrapper or bash - # and gdb will not find the real executable to debug - # - if ( -x "../libtool") - { - $exe_libtool= "../libtool"; - if ($opt_valgrind or $glob_debugger or $opt_strace) - { - mtr_report("Using \"$exe_libtool\" when running valgrind, strace or debugger"); - } - } - # Look for the client binaries $exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin"); $exe_mysql= mtr_exe_exists("$path_client_bindir/mysql"); @@ -2158,9 +1925,6 @@ sub mysql_client_test_arguments(){ my $args; mtr_init_args(\$args); - if ( $opt_valgrind_mysqltest ) { - valgrind_arguments($args, \$exe); - } mtr_add_arg($args, "--defaults-file=%s", $path_config_file); mtr_add_arg($args, "--testcase"); mtr_add_arg($args, "--vardir=$opt_vardir"); @@ -2206,6 +1970,8 @@ sub environment_setup { umask(022); + $ENV{'USE_RUNNING_SERVER'}= using_extern(); + my @ld_library_paths; if ($path_client_libdir) @@ -2236,30 +2002,12 @@ sub environment_setup { } } - # -------------------------------------------------------------------------- - # Valgrind need to be run with debug libraries otherwise it's almost - # impossible to add correct supressions, that means if "/usr/lib/debug" - # is available, it should be added to - # LD_LIBRARY_PATH - # - # But pthread is broken in libc6-dbg on Debian <= 3.1 (see Debian - # bug 399035, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=399035), - # so don't change LD_LIBRARY_PATH on that platform. - # -------------------------------------------------------------------------- - my $debug_libraries_path= "/usr/lib/debug"; - my $deb_version; - if ( $opt_valgrind and -d $debug_libraries_path and - (! -e '/etc/debian_version' or - ($deb_version= - mtr_grab_file('/etc/debian_version')) !~ /^[0-9]+\.[0-9]$/ or - $deb_version > 3.1 ) ) - { - push(@ld_library_paths, $debug_libraries_path); - } - $ENV{'LD_LIBRARY_PATH'}= join(":", @ld_library_paths, $ENV{'LD_LIBRARY_PATH'} ? split(':', $ENV{'LD_LIBRARY_PATH'}) : ()); + + My::Debugger::pre_setup(); + mtr_debug("LD_LIBRARY_PATH: $ENV{'LD_LIBRARY_PATH'}"); $ENV{'DYLD_LIBRARY_PATH'}= join(":", @ld_library_paths, @@ -2297,7 +2045,6 @@ sub environment_setup { $ENV{'OPENSSL_CONF'}= $mysqld_variables{'version-ssl-library'} gt 'OpenSSL 1.1.1' ? "$glob_mysql_test_dir/lib/openssl.cnf" : '/dev/null'; - $ENV{'USE_RUNNING_SERVER'}= using_extern(); $ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir; $ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'port'}; $ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir; @@ -2466,10 +2213,6 @@ sub environment_setup { $ENV{INNOBACKUPEX}= "$exe_mariabackup --innobackupex"; - # Create an environment variable to make it possible - # to detect that valgrind is being used from test cases - $ENV{'VALGRIND_TEST'}= $opt_valgrind; - # Add dir of this perl to aid mysqltest in finding perl my $perldir= dirname($^X); my $pathsep= ":"; @@ -3222,6 +2965,7 @@ sub mysql_install_db { mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/"); mtr_add_arg($args, "--core-file"); mtr_add_arg($args, "--console"); + mtr_add_arg($args, "--character-set-server=latin1"); if ( $opt_debug ) { @@ -3272,25 +3016,7 @@ sub mysql_install_db { if (! -e $bootstrap_sql_file) { - if ($opt_boot_gdb) { - gdb_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), - $bootstrap_sql_file); - } - if ($opt_boot_dbx) { - dbx_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), - $bootstrap_sql_file); - } - if ($opt_boot_ddd) { - ddd_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), - $bootstrap_sql_file); - } - if ($opt_boot_rr) { - $args= ["record", @rr_record_args, $exe_mysqld_bootstrap, @$args]; - $exe_mysqld_bootstrap= "rr"; - my $rr_dir= $opt_rr_dir ? $opt_rr_dir : "$opt_vardir/rr.boot"; - $ENV{'_RR_TRACE_DIR'}= $rr_dir; - mkpath($rr_dir); - } + My::Debugger::setup_boot_args(\$args, \$exe_mysqld_bootstrap, $bootstrap_sql_file); my $path_sql= my_find_file($install_basedir, ["mysql", "sql/share", "share/mariadb", @@ -4649,7 +4375,13 @@ sub extract_warning_lines ($$) { qr/InnoDB: Table .*mysql.*innodb_table_stats.* not found./, qr/InnoDB: User stopword table .* does not exist./, qr/Dump thread [0-9]+ last sent to server [0-9]+ binlog file:pos .+/, - qr/Detected table cache mutex contention at instance .* waits. Additional table cache instance cannot be activated: consider raising table_open_cache_instances. Number of active instances/ + qr/Detected table cache mutex contention at instance .* waits. Additional table cache instance cannot be activated: consider raising table_open_cache_instances. Number of active instances/, + + # for UBSAN + qr/decimal\.c.*: runtime error: signed integer overflow/, + # Disable test for UBSAN on dynamically loaded objects + qr/runtime error: member call.*object.*'Handler_share'/, + qr/sql_type\.cc.* runtime error: member call.*object.* 'Type_collection'/, ); my $matched_lines= []; @@ -5034,7 +4766,7 @@ sub after_failure ($) { sub report_failure_and_restart ($) { my $tinfo= shift; - if ($opt_valgrind_mysqld && ($tinfo->{'warnings'} || $tinfo->{'timeout'}) && + if ($opt_valgrind && ($tinfo->{'warnings'} || $tinfo->{'timeout'}) && $opt_core_on_failure == 0) { # In these cases we may want valgrind report from normal termination @@ -5164,12 +4896,6 @@ sub mysqld_arguments ($$$) { # Check if "extra_opt" contains --log-bin my $skip_binlog= not grep /^--(loose-)?log-bin/, @$extra_opts; - # Indicate to mysqld it will be debugged in debugger - if ( $glob_debugger ) - { - mtr_add_arg($args, "--gdb"); - } - my $found_skip_core= 0; foreach my $arg ( @$extra_opts ) { @@ -5218,7 +4944,6 @@ sub mysqld_start ($$) { mtr_verbose(My::Options::toStr("mysqld_start", @$extra_opts)); my $exe= find_mysqld($mysqld->value('basedir')); - my $wait_for_pid_file= 1; mtr_error("Internal error: mysqld should never be started for embedded") if $opt_embedded_server; @@ -5226,15 +4951,6 @@ sub mysqld_start ($$) { my $args; mtr_init_args(\$args); - if ( $opt_valgrind_mysqld and not $opt_gdb and not $opt_manual_gdb ) - { - valgrind_arguments($args, \$exe); - } - if ( $opt_strace) - { - strace_arguments($args, \$exe, $mysqld->name()); - } - mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld')); # Add any additional options from an in-test restart @@ -5258,49 +4974,8 @@ sub mysqld_start ($$) { # options from *.opt and *.combination files. $ENV{'MYSQLD_LAST_CMD'}= "$exe @$args"; - if ( $opt_gdb || $opt_manual_gdb ) - { - gdb_arguments(\$args, \$exe, $mysqld->name()); - } - elsif ( $opt_manual_lldb ) - { - lldb_arguments(\$args, \$exe, $mysqld->name()); - } - elsif ( $opt_ddd || $opt_manual_ddd ) - { - ddd_arguments(\$args, \$exe, $mysqld->name()); - } - elsif ( $opt_dbx || $opt_manual_dbx ) { - dbx_arguments(\$args, \$exe, $mysqld->name()); - } - elsif ( $opt_debugger ) - { - debugger_arguments(\$args, \$exe, $mysqld->name()); - } - elsif ( $opt_manual_debug ) - { - print "\nStart " .$mysqld->name()." in your debugger\n" . - "dir: $glob_mysql_test_dir\n" . - "exe: $exe\n" . - "args: " . join(" ", @$args) . "\n\n" . - "Waiting ....\n"; - - # Indicate the exe should not be started - $exe= undef; - } - elsif ( $opt_rr ) - { - $args= ["record", @rr_record_args, "$exe", @$args]; - $exe= "rr"; - my $rr_dir= $opt_rr_dir ? $opt_rr_dir : "$opt_vardir/rr". $mysqld->after('mysqld'); - $ENV{'_RR_TRACE_DIR'}= $rr_dir; - mkpath($rr_dir); - } - else - { - # Default to not wait until pid file has been created - $wait_for_pid_file= 0; - } + My::Debugger::setup_args(\$args, \$exe, $mysqld->name()); + $ENV{'VALGRIND_TEST'}= $opt_valgrind = int(($exe || '') eq 'valgrind'); # Remove the old pidfile if any unlink($mysqld->value('pid-file')); @@ -5349,11 +5024,8 @@ sub mysqld_start ($$) { mtr_verbose("Started $mysqld->{proc}"); } - if ( $wait_for_pid_file && - !sleep_until_file_created($mysqld->value('pid-file'), - $opt_start_timeout, - $mysqld->{'proc'}, - $warn_seconds)) + if (!sleep_until_file_created($mysqld->value('pid-file'), + $opt_start_timeout, $mysqld->{'proc'}, $warn_seconds)) { my $mname= $mysqld->name(); mtr_error("Failed to start mysqld $mname with command $exe"); @@ -5800,13 +5472,6 @@ sub start_mysqltest ($) { mtr_add_arg($args, "--sleep=%d", $opt_sleep); } - if ( $opt_valgrind ) - { - # We are running server under valgrind, which causes some replication - # test to be much slower, notable rpl_mdev6020. Increase timeout. - mtr_add_arg($args, "--wait-for-pos-timeout=1500"); - } - if ( $opt_ssl ) { # Turn on SSL for _all_ test cases if option --ssl was used @@ -5839,31 +5504,6 @@ sub start_mysqltest ($) { # ---------------------------------------------------------------------- $ENV{'MYSQL_TEST'}= mtr_args2str($exe_mysqltest, @$args); - # ---------------------------------------------------------------------- - # Add arguments that should not go into the MYSQL_TEST env var - # ---------------------------------------------------------------------- - if ( $opt_valgrind_mysqltest ) - { - # Prefix the Valgrind options to the argument list. - # We do this here, since we do not want to Valgrind the nested invocations - # of mysqltest; that would mess up the stderr output causing test failure. - my @args_saved = @$args; - mtr_init_args(\$args); - valgrind_arguments($args, \$exe); - mtr_add_arg($args, "%s", $_) for @args_saved; - } - - # ---------------------------------------------------------------------- - # Prefix the strace options to the argument list. - # ---------------------------------------------------------------------- - if ( $opt_client_strace ) - { - my @args_saved = @$args; - mtr_init_args(\$args); - strace_arguments($args, \$exe, "mysqltest"); - mtr_add_arg($args, "%s", $_) for @args_saved; - } - if ($opt_force > 1) { mtr_add_arg($args, "--continue-on-error"); @@ -5899,21 +5539,7 @@ sub start_mysqltest ($) { } } - if ( $opt_client_gdb ) - { - gdb_arguments(\$args, \$exe, "client"); - } - elsif ( $opt_client_ddd ) - { - ddd_arguments(\$args, \$exe, "client"); - } - if ( $opt_client_dbx ) { - dbx_arguments(\$args, \$exe, "client"); - } - elsif ( $opt_client_debugger ) - { - debugger_arguments(\$args, \$exe, "client"); - } + My::Debugger::setup_client_args(\$args, \$exe); my $proc= My::SafeProcess->new ( @@ -5929,287 +5555,6 @@ sub start_mysqltest ($) { } # -# Modify the exe and args so that program is run in gdb in xterm -# -sub gdb_arguments { - my $args= shift; - my $exe= shift; - my $type= shift; - my $input= shift; - - my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type"; - - # Remove the old gdbinit file - unlink($gdb_init_file); - - # Put $args into a single string - $input = $input ? "< $input" : ""; - - if ($type eq 'client') { - mtr_tofile($gdb_init_file, "set args @$$args $input"); - } elsif ($opt_valgrind_mysqld) { - my $v = $$exe; - my $vargs = []; - valgrind_arguments($vargs, \$v); - mtr_tofile($gdb_init_file, <<EOF); -shell @My::SafeProcess::safe_process_cmd --parent-pid=`pgrep -x gdb` -- $v --vgdb-error=0 @$vargs @$$args & -shell sleep 1 -target remote | /usr/lib64/valgrind/../../bin/vgdb -EOF - } else { - mtr_tofile($gdb_init_file, - join("\n", - "set args @$$args $input", - split /;/, $opt_gdb || "" - )); - } - - if ( $opt_manual_gdb ) - { - print "\nTo start gdb for $type, type in another window:\n"; - print "gdb -cd $glob_mysql_test_dir -x $gdb_init_file $$exe\n"; - - # Indicate the exe should not be started - $$exe= undef; - return; - } - - $$args= []; - mtr_add_arg($$args, "-title"); - mtr_add_arg($$args, "$type"); - mtr_add_arg($$args, "-e"); - - if ( $exe_libtool ) - { - mtr_add_arg($$args, $exe_libtool); - mtr_add_arg($$args, "--mode=execute"); - } - - mtr_add_arg($$args, "gdb"); - mtr_add_arg($$args, "-x"); - mtr_add_arg($$args, "$gdb_init_file"); - mtr_add_arg($$args, "$$exe"); - - $$exe= "xterm"; -} - -# -# Modify the exe and args so that program is run in lldb -# -sub lldb_arguments { - my $args= shift; - my $exe= shift; - my $type= shift; - my $input= shift; - - my $lldb_init_file= "$opt_vardir/tmp/lldbinit.$type"; - unlink($lldb_init_file); - - # Put $args into a single string - my $str= join(" ", @$$args); - $input = $input ? "< $input" : ""; - - # write init file for mysqld or client - mtr_tofile($lldb_init_file, "process launch --stop-at-entry -- $str $input\n"); - - print "\nTo start lldb for $type, type in another window:\n"; - print "cd $glob_mysql_test_dir && lldb -s $lldb_init_file $$exe\n"; - - # Indicate the exe should not be started - $$exe= undef; - return; -} - -# -# Modify the exe and args so that program is run in ddd -# -sub ddd_arguments { - my $args= shift; - my $exe= shift; - my $type= shift; - my $input= shift; - - my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type"; - - # Remove the old gdbinit file - unlink($gdb_init_file); - - # Put $args into a single string - my $str= join(" ", @$$args); - $input = $input ? "< $input" : ""; - - # write init file for mysqld or client - mtr_tofile($gdb_init_file, "file $$exe\nset args $str $input\n"); - - if ( $opt_manual_ddd ) - { - print "\nTo start ddd for $type, type in another window:\n"; - print "ddd -cd $glob_mysql_test_dir -x $gdb_init_file $$exe\n"; - - # Indicate the exe should not be started - $$exe= undef; - return; - } - - my $save_exe= $$exe; - $$args= []; - if ( $exe_libtool ) - { - $$exe= $exe_libtool; - mtr_add_arg($$args, "--mode=execute"); - mtr_add_arg($$args, "ddd"); - } - else - { - $$exe= "ddd"; - } - mtr_add_arg($$args, "--command=$gdb_init_file"); - mtr_add_arg($$args, "$save_exe"); -} - - -# -# Modify the exe and args so that program is run in dbx in xterm -# -sub dbx_arguments { - my $args= shift; - my $exe= shift; - my $type= shift; - my $input= shift; - - # Put $args into a single string - my $str= join " ", @$$args; - my $runline= $input ? "run $str < $input" : "run $str"; - - if ( $opt_manual_dbx ) { - print "\nTo start dbx for $type, type in another window:\n"; - print "cd $glob_mysql_test_dir; dbx -c \"stop in main; " . - "$runline\" $$exe\n"; - - # Indicate the exe should not be started - $$exe= undef; - return; - } - - $$args= []; - mtr_add_arg($$args, "-title"); - mtr_add_arg($$args, "$type"); - mtr_add_arg($$args, "-e"); - - if ( $exe_libtool ) { - mtr_add_arg($$args, $exe_libtool); - mtr_add_arg($$args, "--mode=execute"); - } - - mtr_add_arg($$args, "dbx"); - mtr_add_arg($$args, "-c"); - mtr_add_arg($$args, "stop in main; $runline"); - mtr_add_arg($$args, "$$exe"); - - $$exe= "xterm"; -} - - -# -# Modify the exe and args so that program is run in the selected debugger -# -sub debugger_arguments { - my $args= shift; - my $exe= shift; - my $debugger= $opt_debugger || $opt_client_debugger; - - if ( $debugger =~ /vcexpress|vc|devenv/ ) - { - # vc[express] /debugexe exe arg1 .. argn - - # Add name of the exe and /debugexe before args - unshift(@$$args, "$$exe"); - unshift(@$$args, "/debugexe"); - - # Set exe to debuggername - $$exe= $debugger; - - } - elsif ( $debugger =~ /windbg|vsjitdebugger/ ) - { - # windbg exe arg1 .. argn - - # Add name of the exe before args - unshift(@$$args, "$$exe"); - - # Set exe to debuggername - $$exe= $debugger; - - } - else - { - mtr_error("Unknown argument \"$debugger\" passed to --debugger"); - } -} - -# -# Modify the exe and args so that program is run in valgrind -# -sub valgrind_arguments { - my $args= shift; - my $exe= shift; - - # Ensure the jemalloc works with mysqld - if ($$exe =~ /mysqld/) - { - my %somalloc=( - 'system jemalloc' => 'libjemalloc*', - 'bundled jemalloc' => 'NONE' - ); - my ($syn) = $somalloc{$mysqld_variables{'version-malloc-library'}}; - mtr_add_arg($args, '--soname-synonyms=somalloc=%s', $syn) if $syn; - } - - # Add valgrind options, can be overridden by user - mtr_add_arg($args, '%s', $_) for (@valgrind_args); - - mtr_add_arg($args, $$exe); - - $$exe= $opt_valgrind_path || "valgrind"; - - if ($exe_libtool) - { - # Add "libtool --mode-execute" before the test to execute - # if running in valgrind(to avoid valgrinding bash) - unshift(@$args, "--mode=execute", $$exe); - $$exe= $exe_libtool; - } -} - -# -# Modify the exe and args so that program is run in strace -# -sub strace_arguments { - my $args= shift; - my $exe= shift; - my $mysqld_name= shift; - my $output= sprintf("%s/log/%s.strace", $path_vardir_trace, $mysqld_name); - - mtr_add_arg($args, "-f"); - mtr_add_arg($args, "-o%s", $output); - - # Add strace options - mtr_add_arg($args, '%s', $_) for (@strace_args); - - mtr_add_arg($args, $$exe); - - $$exe= $opt_stracer || "strace"; - - if ($exe_libtool) - { - # Add "libtool --mode-execute" before the test to execute - # if running in valgrind(to avoid valgrinding bash) - unshift(@$args, "--mode=execute", $$exe); - $$exe= $exe_libtool; - } -} - -# # Search server logs for valgrind reports printed at mysqld termination # sub valgrind_exit_reports() { @@ -6290,7 +5635,7 @@ sub usage ($) { local $"= ','; # for @DEFAULT_SUITES below - print <<HERE; + print <<HERE . My::Debugger::help() . <<HERE; $0 [ OPTIONS ] [ TESTCASE ] @@ -6417,32 +5762,11 @@ Options to run test on running server Options for debugging the product - boot-dbx Start bootstrap server in dbx - boot-ddd Start bootstrap server in ddd - boot-gdb Start bootstrap server in gdb - client-dbx Start mysqltest client in dbx - client-ddd Start mysqltest client in ddd - client-debugger=NAME Start mysqltest in the selected debugger - client-gdb Start mysqltest client in gdb - dbx Start the mysqld(s) in dbx - ddd Start the mysqld(s) in ddd debug Dump trace output for all servers and client programs debug-common Same as debug, but sets 'd' debug flags to "query,info,error,enter,exit" debug-server Use debug version of server, but without turning on tracing - debugger=NAME Start mysqld in the selected debugger - gdb[=gdb_arguments] Start the mysqld(s) in gdb - manual-debug Let user manually start mysqld in debugger, before - running test(s) - manual-gdb Let user manually start mysqld in gdb, before running - test(s) - manual-ddd Let user manually start mysqld in ddd, before running - test(s) - manual-dbx Let user manually start mysqld in dbx, before running - test(s) - manual-lldb Let user manually start mysqld in lldb, before running - test(s) max-save-core Limit the number of core files saved (to avoid filling up disks for heavily crashing server). Defaults to $opt_max_save_core. Set its default with @@ -6456,38 +5780,7 @@ Options for debugging the product $opt_max_test_fail, set to 0 for no limit. Set it's default with MTR_MAX_TEST_FAIL core-in-failure Generate a core even if run server is run with valgrind - -Options for valgrind - - valgrind Run the "mysqltest" and "mysqld" executables using - valgrind with default options - valgrind-all Synonym for --valgrind - valgrind-mysqltest Run the "mysqltest" and "mysql_client_test" executable - with valgrind - valgrind-mysqld Run the "mysqld" executable with valgrind - valgrind-options=ARGS Deprecated, use --valgrind-option - valgrind-option=ARGS Option to give valgrind, replaces default option(s), - can be specified more then once - valgrind-path=<EXE> Path to the valgrind executable - callgrind Instruct valgrind to use callgrind - -Options for strace - - strace Run the "mysqld" executables using strace. Default - options are -f -o 'vardir'/log/'mysqld-name'.strace. - client-strace Trace the "mysqltest". - strace-option=ARGS Option to give strace, appends to existing options. - stracer=<EXE> Specify name and path to the trace program to use. - Default is "strace". Example: $0 --stracer=ktrace. - -Options for rr (Record and Replay) - rr Run the "mysqld" executables using rr. Default run - option is "rr record mysqld mysqld_options" - boot-rr Start bootstrap server in rr - rr-arg=ARG Option to give rr record, can be specified more then once - rr-dir=DIR The directory where rr recordings are stored. Defaults - to 'vardir'/rr.0 (rr.boot for bootstrap instance and - rr.1, ..., rr.N for slave instances). +HERE Misc options user=USER User for connecting to mysqld(default: $opt_user) diff --git a/mysql-test/std_data/galera_certs/INFORMATION b/mysql-test/std_data/galera_certs/INFORMATION new file mode 100644 index 00000000000..439ba394e09 --- /dev/null +++ b/mysql-test/std_data/galera_certs/INFORMATION @@ -0,0 +1,2 @@ +WSREP certificates signed with root certificate. +Password used is `galera`. diff --git a/mysql-test/std_data/galera_certs/galera.1.crt b/mysql-test/std_data/galera_certs/galera.1.crt new file mode 100644 index 00000000000..c1c1818a88c --- /dev/null +++ b/mysql-test/std_data/galera_certs/galera.1.crt @@ -0,0 +1,25 @@ +-----BEGIN CERTIFICATE----- +MIIEODCCAiACFG1AlRipIFaH2nn79vsiU6s8yxqwMA0GCSqGSIb3DQEBCwUAMFox +CzAJBgNVBAYTAkZJMREwDwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVsc2lu +a2kxDzANBgNVBAoMBkdhbGVyYTEUMBIGA1UEAwwLZ2FsZXJhLnJvb3QwHhcNMjEw +MjA0MTMxOTU3WhcNMzAxMTA0MTMxOTU3WjBXMQswCQYDVQQGEwJGaTERMA8GA1UE +CAwISGVsc2lua2kxETAPBgNVBAcMCEhlbHNpbmtpMQ8wDQYDVQQKDAZHYWxlcmEx +ETAPBgNVBAMMCGdhbGVyYS4xMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAq1/qI8oopqwSG6TWLSzMOpm5iXilzQ5bM0E440ZVrdPo/OZvAb99yofMFJi9 +uD1zUigHA+PXoJhm0HYTt5VsymByYwKCT8aYC6Sm6a2H82uuS7Ze8JUBdl4ymZCe +f56fYmh3EVu0Kf+rk9uCQGouzwrDNuS+MWxsV+lxVoAA08F19yJdvxehBNlGopqc +Sw6NNa9SISCqjg32oR2RuFzkifV/olPHGl1FSzyzJ/zO2CQYjzT8W+UA/EtnFFCo +XVJzOKHIbzTNKmj/kkX6esBZ7ItmAdGaTlIV6A/OR/wcKxzZBopd9wFSm42x+Dxk +eMPKS7OFhaOypl/PHo1LsSrzKwIDAQABMA0GCSqGSIb3DQEBCwUAA4ICAQApP88p +5jaa26DhqBonGMBwgbnGzzXqrDlE6GX8Z5TffgOQjg7ZmMzdnS50iW5Jj9PcG3PL +VpdxtKnyV/3qKJ40WpRvnUMcghyRB74h44y09Qh013uSpFR4ST7As1kAsRKYU7YP +gc7Bc+rc3fjCOxqwRBIg/mosFCmW7UoogpeGNhuXFgl7ED3pjszAOjbLDxUkaQTj +vbS9nWvtzE68STBdVTct91OIJPY2hNno8trwYqchQOG7wPOH/V+HzQ3jeLdE8AKw +/PouspuE5RJmU9zcRzlKBKUsmjl+zD6nkyEzkfRO/JoDhBB0ReHsxaR+SU42K78n +2H/qGjfhIcWsQVyIaRGqRTPZ6AhRX/04n8RTLHHkG/CLsgBcZnaOvVhraItUAEzC +AQtD9vvF5uyzdmj0uu2TZNHJnbx+NXoNGJOJI2qUISLSdrVkS6qAHIdavypxDZZg +4o5NZz+Jyc7Zq61LxLemKfD0isVsY91610A/1JwCy+Li99Mvng8gAJoP2NX/Cvmv +i0QowP5uRRSL6YmiqRByer9yveSlxR03FvLeFSdftln3eEIyS9/kU74oJ+rOXPus +fuB2ZNFHjmX7iXj3zf1kkpNCc03eaLY6P3+h2Opnqitz/XAT/eSWQ1huMKGm78ih +C3Cd/yrwiA+AfxhYMJHl6CTpEWcJnqZQbPBjug== +-----END CERTIFICATE----- diff --git a/mysql-test/std_data/galera_certs/galera.1.csr b/mysql-test/std_data/galera_certs/galera.1.csr new file mode 100644 index 00000000000..f0c396836f0 --- /dev/null +++ b/mysql-test/std_data/galera_certs/galera.1.csr @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICnDCCAYQCAQAwVzELMAkGA1UEBhMCRmkxETAPBgNVBAgMCEhlbHNpbmtpMREw +DwYDVQQHDAhIZWxzaW5raTEPMA0GA1UECgwGR2FsZXJhMREwDwYDVQQDDAhnYWxl +cmEuMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKtf6iPKKKasEhuk +1i0szDqZuYl4pc0OWzNBOONGVa3T6PzmbwG/fcqHzBSYvbg9c1IoBwPj16CYZtB2 +E7eVbMpgcmMCgk/GmAukpumth/Nrrku2XvCVAXZeMpmQnn+en2JodxFbtCn/q5Pb +gkBqLs8KwzbkvjFsbFfpcVaAANPBdfciXb8XoQTZRqKanEsOjTWvUiEgqo4N9qEd +kbhc5In1f6JTxxpdRUs8syf8ztgkGI80/FvlAPxLZxRQqF1SczihyG80zSpo/5JF ++nrAWeyLZgHRmk5SFegPzkf8HCsc2QaKXfcBUpuNsfg8ZHjDykuzhYWjsqZfzx6N +S7Eq8ysCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQCUyo7S6TThiPiTRbMMu9Pu +/YAK7mcxF3zG5rMzcf4fgaJAuUfE1Ct4y9eJ0k4gPevt37J2AhyTei6yS2ivESie +exc/kztendR1PQmnRlICWa3ErXC1ZBJAVjaOx/S+Ttq5Tp4Bd/X2gvUb5JT+9Xbi +NtxlnISh9cjO9BP7nfsCAbjqBhYT1hmYMlCDkTgHOPRpBQDQlRZ7e5jXDyzHaKzq +yMfX0jo934oq2lkrV68q/9vmW0SrUU0X9GVDVRo8+4wTb1/dHQOcDaFO1LrsklaQ +MqJkffv0tJB249+JkXHMzOZbfUTFn6jVJvMrSAQmOCIgXpswk0qmMM6ipEQkAlKW +-----END CERTIFICATE REQUEST----- diff --git a/mysql-test/std_data/galera_certs/galera.1.key b/mysql-test/std_data/galera_certs/galera.1.key new file mode 100644 index 00000000000..adcd6a396a1 --- /dev/null +++ b/mysql-test/std_data/galera_certs/galera.1.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAq1/qI8oopqwSG6TWLSzMOpm5iXilzQ5bM0E440ZVrdPo/OZv +Ab99yofMFJi9uD1zUigHA+PXoJhm0HYTt5VsymByYwKCT8aYC6Sm6a2H82uuS7Ze +8JUBdl4ymZCef56fYmh3EVu0Kf+rk9uCQGouzwrDNuS+MWxsV+lxVoAA08F19yJd +vxehBNlGopqcSw6NNa9SISCqjg32oR2RuFzkifV/olPHGl1FSzyzJ/zO2CQYjzT8 +W+UA/EtnFFCoXVJzOKHIbzTNKmj/kkX6esBZ7ItmAdGaTlIV6A/OR/wcKxzZBopd +9wFSm42x+DxkeMPKS7OFhaOypl/PHo1LsSrzKwIDAQABAoIBABrfppLIL8m7L/e/ +yIo6/SevVYX2MmHOf4SxFJ+nNuZUVbPa2st2YN5ynxEXxqBumnfmqPr2LqkTXQQR +kBP4zZ+KskVObmreJJem0TnRqYEFgMaEqaymYR1TtjGYmRJAKJRA93L0Y3M2kYxV +Hr7FJ+P1txkTk7OiYfcDN2+uEPMjoIwPTZYqcpw8UggF3zMZosBH3tf4yk/+5Q52 +MilRRjmoOFJSs9617OdgLoXEwQ4sAvg9UecrNR/octMnBUXKq5vWT+L9ub0fxATV +8U+GUiv2gBnHGikbsqfV/7hZZy+R1V6b/hFrpTlTHXhKpM56ownT85tcI2WNVVOR +FkDFXDECgYEA1gkIXzQ1O4wuxEBZCwH3hpzT2qCDou/yA91pQN6sekdxJffz8VJs +5MUmr53vBTD3j57l+iPfa1yApNYEeQDXmiervdLjC0ep3FqyK8qS/J9x86K2E9Bt +R8ElYGEsYoT93pzM7txPEZo3awgHAqmlPQ9mhujBpsR9xBjYi1IrGDkCgYEAzPmj +ezryhMqFosh9OK5tirjGw3T28p+ywIl7wS5/Le32HV6sGsva3UpZhb67SkpCDbpF +ihDV7KHFQqOvZBNSFc8gPvBgFlv4k5IzbU2q1/nO/TzgSnp1sAwlZv4shsiLz7sv +x2ZhR8gPfO7cTS4281rdlhUuAMe79W2FRwm9/oMCgYEAkPSjH9864i5pie5On97g +JeHWtS2amWJKFQYB/7YPN+1kmyNXqit5pmJDdhLPS0PDlhg2hvd+m7aVRY3Qj6bb +XgLaFIBb1krdpmgiXPggHklaIngjOj4hlMQhrSmCpuKNERQ+0tKQFkrMl4djQBFm +4HiqplnCtVBEIOf22Dx5BTkCgYAQssmhsWSucr0+TKz+4B7mbTUsGSxBCceLLega +DcqomDkznVHSAQd8faEbZzVk0PXenm0p2UNEOs2SJzmTootOYYhT+EsrpyRyCTgN +UIV5gM1fDgWLq7xIskSdxlkkRdQ2AR7cVLfaHC8+00q5MumhG6bvohwUTjE+xkRU +TDPhNwKBgQDKmYS+6sUiUim69J1dP/DNCs4fabbOi/uKaAk0HdN1abnxgRROzrPI +0BsD84XrG8/e0JhRiKG3Doq18ejNjfWsuyliHPCoJrTIj4IUq7bFvVbdOD6BQHNw +VzHa3UImlF1LthRqRMV5As+GOF0pRCHeXyihi6KBDEZBG/SKaCp9rw== +-----END RSA PRIVATE KEY----- diff --git a/mysql-test/std_data/galera_certs/galera.2.crt b/mysql-test/std_data/galera_certs/galera.2.crt new file mode 100644 index 00000000000..2d7ebb2d533 --- /dev/null +++ b/mysql-test/std_data/galera_certs/galera.2.crt @@ -0,0 +1,25 @@ +-----BEGIN CERTIFICATE----- +MIIEODCCAiACFG1AlRipIFaH2nn79vsiU6s8yxqxMA0GCSqGSIb3DQEBCwUAMFox +CzAJBgNVBAYTAkZJMREwDwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVsc2lu +a2kxDzANBgNVBAoMBkdhbGVyYTEUMBIGA1UEAwwLZ2FsZXJhLnJvb3QwHhcNMjEw +MjA0MTMyMTMzWhcNMzAxMTA0MTMyMTMzWjBXMQswCQYDVQQGEwJGSTERMA8GA1UE +CAwISGVsc2lua2kxETAPBgNVBAcMCEhlbHNpbmtpMQ8wDQYDVQQKDAZHYWxlcmEx +ETAPBgNVBAMMCGdhbGVyYS4yMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAq0DluHNB6VlRjMlQVhnABzB+wTAsC4DBQBAy/AzCPdEg67pZj1j1UKNitdfO +/FLn6DCLoFhw/z5gFUpev3JzgHcbguOlf3AQA4p9zZn/R/g8fGJtUHolkYXT+V+j ++xUQ8dzdjelu6Xd0kpN9wigtKO4PUd3fzZ7QKen68zQPNEf+KFbSj/Dhk2iokt3N +entl3MpLGJ+FsxPQwm7bagRdn66x7zAeRu4DifYh3i7lWkC+xE+bnB82BrzBHcMh +N6uqdnKSdj078hRj/gcSJFMlOSaWCWoZdHQ7+3gp/bCi/dGywNxOgbsmuHznlUpE +ELbhv6G0m6LzzB1NW7HFctyrNwIDAQABMA0GCSqGSIb3DQEBCwUAA4ICAQAwtXxJ +8ZQw1jZKUo0TP1D17Jdu36x2Tl8YwB+WMGdEvQSuKAnUEL/k4zOB5WI1VlNbJFAF +dgsbHXjYrVCbDEpmN15sYXZ4J2NfGTmHAz38gB+r2LDlWj/+5L+VK+hkwGdbcaPX +cDxm5M66ZbTvCFfozlHRh68/vGKhLnT0Iof3DekP7vaPUlfUUZGFh75vxUW8TM/S +Ii4Tdo5D/gV4J/fUX2VKMKrJIYKcUxk48AFT0acCfzs9Uc5f4YYJ0vMrtGeVR0gl +QLavAk3OW7IVY7trVrb0+qKfVuaxFli2hZN58ug/fpSN4wEMP31UxZ8WihG3xJ4x +9ona+VR023ltpJerLWgHZyvH/HR8QnrQpPJ7y+2XLdI01gIQpYDwHsBBa8EkGjvG +ra5YB07xOxxR4Wfr7/7gZzMvBkRr0wG/96iAfIB/ILYRJX+93gyqaVHS4RZRRQxe +fsOpYOy5wMfPIjQQ4/Zd35NH+Y/dQcYqV+GdbbardXtNbT0tqLQesT3boBpsTxA9 +fkA9RayzTKHGojTv8p/FHh6yusfwa9MMdNsbkikM0YoAOTQwrBe7S9sm17Z6HxWr +A7QqZGxAzAqI6aRRoro6z0KLNjuuiJysCSBqHB3yvPn6bV84UEUreoXFIHINkF/L +B9S5zL+uYnA3X/ozdSmayNpipA3uYqqhUVSG9g== +-----END CERTIFICATE----- diff --git a/mysql-test/std_data/galera_certs/galera.2.csr b/mysql-test/std_data/galera_certs/galera.2.csr new file mode 100644 index 00000000000..0fba110b92a --- /dev/null +++ b/mysql-test/std_data/galera_certs/galera.2.csr @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICnDCCAYQCAQAwVzELMAkGA1UEBhMCRkkxETAPBgNVBAgMCEhlbHNpbmtpMREw +DwYDVQQHDAhIZWxzaW5raTEPMA0GA1UECgwGR2FsZXJhMREwDwYDVQQDDAhnYWxl +cmEuMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKtA5bhzQelZUYzJ +UFYZwAcwfsEwLAuAwUAQMvwMwj3RIOu6WY9Y9VCjYrXXzvxS5+gwi6BYcP8+YBVK +Xr9yc4B3G4LjpX9wEAOKfc2Z/0f4PHxibVB6JZGF0/lfo/sVEPHc3Y3pbul3dJKT +fcIoLSjuD1Hd382e0Cnp+vM0DzRH/ihW0o/w4ZNoqJLdzXp7ZdzKSxifhbMT0MJu +22oEXZ+use8wHkbuA4n2Id4u5VpAvsRPm5wfNga8wR3DITerqnZyknY9O/IUY/4H +EiRTJTkmlglqGXR0O/t4Kf2wov3RssDcToG7Jrh855VKRBC24b+htJui88wdTVux +xXLcqzcCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQB1Je87IIfWW4YTvf1evm4/ +ICxImyQ4T5m3IOPrv9dV/DdxIoNSEfeudjyOmdeXchV5XxlGD2a6JDW4Pmf/gMlU +5E6ySf4yvI/heDM05GdG623Nye41hCAqh9AIBOvhZEFlQ8/eDZFBXT9nZ4PFUshv +7v1KlMNKHq5E3Y2eet3d0wDzE0CYJfkc0yoYX/y1IGVM2Td7/YmsSTz8Xm1OvIfx +hbLzbnYIv4OLfSda/ntFxUy32c8jRxusbbrL4NKE5+eO5Sro1JR/rxRW9DIarp02 +8fzUyf1WhYIGtP/N3ZiZ4jqCsRyj0QmuwIohk33pKtb0APIA+qy8a13QSLUCPuHf +-----END CERTIFICATE REQUEST----- diff --git a/mysql-test/std_data/galera_certs/galera.2.key b/mysql-test/std_data/galera_certs/galera.2.key new file mode 100644 index 00000000000..5b9bf3d0eac --- /dev/null +++ b/mysql-test/std_data/galera_certs/galera.2.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAq0DluHNB6VlRjMlQVhnABzB+wTAsC4DBQBAy/AzCPdEg67pZ +j1j1UKNitdfO/FLn6DCLoFhw/z5gFUpev3JzgHcbguOlf3AQA4p9zZn/R/g8fGJt +UHolkYXT+V+j+xUQ8dzdjelu6Xd0kpN9wigtKO4PUd3fzZ7QKen68zQPNEf+KFbS +j/Dhk2iokt3Nentl3MpLGJ+FsxPQwm7bagRdn66x7zAeRu4DifYh3i7lWkC+xE+b +nB82BrzBHcMhN6uqdnKSdj078hRj/gcSJFMlOSaWCWoZdHQ7+3gp/bCi/dGywNxO +gbsmuHznlUpEELbhv6G0m6LzzB1NW7HFctyrNwIDAQABAoIBAQCAnv9qJ3bLkgAD +43dpE3H8dFnfMxUBlrSOLxx73gFNeHJnWdDGLyQganZK6UlWjdYLt9pGleZYbjqw +AulilM1XIR4SknPMYRhF8JBICW+IWFLlgO9lUDhDMeZhF4oLnGjbnuzwFvDsfIGb +TRdY6d/xK8tpy2C6CJuDv25xlxoMQwJvSIViJd1qyCe4x3PDBvZ3TKMiWXfUGoSg +75Yee6dIryCoWGACTjdiNdJpo99EIMJT8HIGQeBBJuIvSTsAgXMugDlnvUkq98LX +XLJ+Lilx+enUb1WDbwZDMwJd0DlDVZyRVDJwlJRFUEuJvSRfMNKICEynmqJVc/36 +I7BzHNtRAoGBAOOGrH/r46oiSH6vE0VqgPIdlruLDZWoBIW0tVW1wb9E3NzExK53 +WEGy6FETsFGt3cYxtKd5Qy4rD5gfqYrfmDH/bmkK9p69pSjKcSgynABxCqM0DCth +F3EGc5ZGDcA7Xar70NEP9COExFvPpi2bBq+8//OHNKWHe/aTYj3FuvyjAoGBAMCv +ZrUR8NJfxw8Jqygc/L5BBW0gzh8ycHlQQPrpb4j01ncFcjTe1Tsc8BAkHYXZbS7o +h+3JkgzQf7fHJmafKPO3esj2fZqdCoWBqhAf9Wk+9s33rTPo4OXdk22MdII7kV/e +VpUKzdznKQmftleoJDVq6qBDMN9qQy8z5hVVv8xdAoGBAJEVSV3wzyWn4s5VWVaE +SWEaGQnR64Got+mCh7b1xWvvv15PYpNVqsOKD7XTdjU/RxGglG/OVVZVQwZf+j6B +wYzwMjltMkGa8HwISwu06eEmNABJqhDnQolh8ca7OP2BXYMwO8F0CNu1R3i7+l1O +Y38gZ52kc5+xuwxKgvSc51U9AoGAKiq4aUvBzegT4eCVyjN9xAzqqRUSxpT9NC8x +6TcIp4odHPLeKV/Sfhs5Fe8xXsdUM33DsW/5PECskoVMjAyso5k1j6ERn7JaSRk1 +JE46IIwc6roW91MxVFyHFOQ14wIyMC6x9+/jWUJlIqwG9WvgcKgzLFtH6LySc1QC +OA0J6ikCgYAr7JEzFzckFvXNgdUiADnXztchwmjeV/CJZdaHhlVdHmtt0Z7PiWK9 +wRCKwA+wfTW1MeufP/t3l9MqdFx7MjxBbu2aVnd9BEDtGX6pch1pMa7CHyHayDiL +UoD0lPrJ9hLftKkyMO2IL3kWlg5g3cpwVBzMKxNBynzQx7TQxUrAgA== +-----END RSA PRIVATE KEY----- diff --git a/mysql-test/std_data/galera_certs/galera.root.crt b/mysql-test/std_data/galera_certs/galera.root.crt new file mode 100644 index 00000000000..e965d5a26d6 --- /dev/null +++ b/mysql-test/std_data/galera_certs/galera.root.crt @@ -0,0 +1,32 @@ +-----BEGIN CERTIFICATE----- +MIIFlTCCA32gAwIBAgIUKCF88W+48rZzdfgYpE2dXVMGSKgwDQYJKoZIhvcNAQEL +BQAwWjELMAkGA1UEBhMCRkkxETAPBgNVBAgMCEhlbHNpbmtpMREwDwYDVQQHDAhI +ZWxzaW5raTEPMA0GA1UECgwGR2FsZXJhMRQwEgYDVQQDDAtnYWxlcmEucm9vdDAe +Fw0yMTAyMDQxMzE3MDJaFw0yMzExMjUxMzE3MDJaMFoxCzAJBgNVBAYTAkZJMREw +DwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVsc2lua2kxDzANBgNVBAoMBkdh +bGVyYTEUMBIGA1UEAwwLZ2FsZXJhLnJvb3QwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQDKqL45jbaq8RLOj+DeilPcEnBN5gn/y9V3IfZ0BQCd4bR09zLz +7BQKz6QS825Wi56HC155W1xPMR0RYWy3I3owreQtfdGJuYoTKLpRSoqWJgy/FSzR ++Tr34WfpeIj6754YRm7MndWBPVkujPtOWz6EHn+2oUNIpCZAOwXtMrlJzf5GwNBu +4kwkylz0whs3iTS//pZLyqk6MsLI7tebmfi9qyaM0b+C1OKiBRQRIjPON8Htp7Au +GDyOqA4Y9IQlAzZVqy2PP79Ci2FpPF3+01ByWGY6vAIxma2VXS/aNvUvGnuzH8hz +A5xg1+5Fv2kdxffcWLjp5/WSIaTUiBFMBRKswTtfo+vWuVpzXGvlExGHd10m+MhK +Avoqq6N28ql6E5pDDH5k6aZ1eB6nKF6BU4BMa4SUPBX/qz8PMbb5j0+n645Gj/G2 +0DfCQoyHd6sMAZZ9LgTjGB/R6sz74YF72q6xECTCygn5HY3qjvmx0BYlIkQDKKqh +bq2ZmsLLCwtyfUeW144eMhErNZA1MwoJxd8LM0TpJ0nXQdEESf5oS5fMLZnVrxah +dl5QYYMbmyNedNKdwV4idhGCy+Zq7VAX4lBXazI1rD9vQb+oTcPGQiy4i/Vi/g6i +F+XZTdTiaOWPEmvFFGLLUQxKl4w872hJaupqfteqdiZ+3ICVIUI8qnXHmwIDAQAB +o1MwUTAdBgNVHQ4EFgQUs75v/MgjJ5RHGE6+0qdiVo4BwlowHwYDVR0jBBgwFoAU +s75v/MgjJ5RHGE6+0qdiVo4BwlowDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0B +AQsFAAOCAgEAOVhBs28dwwvD5q2r7oVVcxLc+tb8zu4XxpXT1p6hiZYUyPguCh00 +GVdXCgR4JMI/NcyM5fBAbF3S8oK3+9rw2kW09afVV06Qf/8o3nIyOiDl7598tGIP +CCK4QsUW/dGajx5kvhtQ7qce+u9KfFTof6lq2xkYtFBBhmBdSv9A1jAZJMw2x3bc +nr99PS8XZMphS0MIExHKj6Ry5DdYm722zZHyIEiiEGyMViDm2m1iug5r/LPH5Z56 +BjQiH4VP+0y5mevBOUGuH8ID+J9Hu9BeoXLhkv+W2Ljs/S6wqzjinMBqVG+wwe0Y +a8F5pABkl5uX38nMQ7CikSbLxSbn7nRf+sux1sbzqjMldeCSqiv9mI5Ysq97+Ni1 +5qMxNxNc0u/wGRnrXH8fWfxBKPP5moA7DQfVcUWPgDGQwDpA8kn8RlJxFk3g4yaK ++NMwk5MORKyx3tz/A3Yhs9AUXk3okvmQCT2YVSHcKUB8PAU+TaKqbr3wk07Y/tL/ +jFPHS+t3eD91Y05KGUXjdtGi+33zpV0biHmTWAZT78VQowDNvEpTnXhkSx8HGHYR +nqSMU2m2LboHSatY113RYznx0LJ1azczRlJdGs8oyPWLPDD2JCesZaQqGZVRJoms +lK4EzYEb5mZTCRgtgoiO+iKcf6XifuOCrWZXoLm4FlLEfOQ3b8yAFlo= +-----END CERTIFICATE----- diff --git a/mysql-test/std_data/galera_certs/galera.root.key b/mysql-test/std_data/galera_certs/galera.root.key new file mode 100644 index 00000000000..8472f87e714 --- /dev/null +++ b/mysql-test/std_data/galera_certs/galera.root.key @@ -0,0 +1,54 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,F0ACFFE47CF32BB2 + +F5PwhFDgzuaD7ISSmSn3+GpEoWipTwOPjE8ei9LsQ1a/RdcW19kmB9sJojOSVlV6 +CbLeEl/YKkkAZvbupKvpL0i82WTi+V7W9iKNU3M9tN1JE3WNGCYrL16aUrlnXszi +eiNhWzAGxtpXNTv+d9gdgYZ0mHJrDk390tYGRcnrEp8FasL0aI4AnIWrJq9zgHeP +m8K0RxIB6Rp07+SEfsO0pZuGPIkO/qVhIDXYhQrEkap3viPZouH1qzaJNaQXD1ZE +EoP0n/jbX3KuLeep4aGdEGq/eAZx/WUZpZWECOqwZ7HDNFcXj4nZRNQmCpSobEHU +e+9DL+nnmoMtsFG7Jb6S3d8Fxv5DLqm7LTHweZzlkw0pD5sVVMSeb6Xq2Cshxsf2 +htQGZDtxscTimDrLHsNonw1tVBfY0HPpTNNmjyKpa2lmbQ4KQls3A4i9yZaXM1W4 +pkc1Emk0ot+yXZU+SNPeAgAMCf5rygiQtsALYdbkZVpVvziVVBFdav+v9RtwrMfJ +fli6GbAwm2mKXdFlc8SnfbNxKw8v2K26IUZFEzwiE/MxwOR4UBwcNa2JcXKsMGVt +o2pBOJr0dquywV37EV7hu2S6Kgf1nREgksON86REmZoPpzMlCpTf805awdDN/a/K +jJkRrekRinrPaIDfvwQjIhhXYWSVQywJ2nTL6+78SvnKRNmIFDGdmOY7CtsyRvkp +P2Qp+JhzT4VM8x2sApBQiN3S3dSr1D8gmdwKGiLp82GhMIdGNjVpxPSVjCFC3Apu +hvRw3LSJ7iUWLrtsR2yZeDBHh1yDraLYo76qYqvgYDKYa+R1GiJd70t5cDSqgwV9 +EXlnA32VsRrAXdRypGNAq934TSWiO4l+M60bt/K/U41uQHas1gWsGdtWcjCLTylf +YT8G+4QnIrOGJzyKZeIrawu/GtxrK2S5xe0ZAOwYQmJYiIH4TfvdrNX4DNEfGpd/ +CrBULWCvAtgqNrNgpFuV8027yAZWPpG2DSE+Q+XTahxjNUxAI7kkXB/Xxc5KfhSF +BaYHQ2TfTWnwD3K1BNWM4yZ/L4up8UIrXyMdk7q0LofwCTKGOgqzwVaez86gpriL +pphXPYIY9cX9qLBs5YuVGk9ApkbC0VRqmXcCL7OEAzso14ItHVlVU73QSS+I+3sK +sqwb0USLuN7qZUVhtJIyAkK/D+DmNYSg4eqhcMRnJAanD2acmwtAy0HE+YVcQN/X +gEwSOdkf7WkwDshvBPA8rl4YWRxwKxstS0wyPG8rzMZWYYB2xf3nd78NtdzVZSnN +pDUJkUKorCaSuanMvjKS9r+sILzUc1bkO/T//qTY/HtRtl8AffcXIjyJkXb5PSjt +dxq7ktkeESAB9vb+c7nWolMVqxUD+1KpHi1kwR4IuAWtJe4G+82pDc6wLEZjeJMO +nd2NNW/CToWv0YfWonGUDZbOFqee7H0Tioqjni4uQbLcDZJHr6i3wwGIncIENo73 +DqfYEpNT3U6uLSC/cNv3lvIRjVziBEB9f0KgOHt38UIsZ4oJAMV/B63Wfn1nd1g4 +NBdNwO48M2KHbxgwXJxxX1jQOj9+IJiVaGIbpzeeJ3yTKDMfkBKH4eQj2/aAA1zK +pqFRyoBhuviMZ1IeBOVyb3QHJSINry/WiiOKoHLvvFM7KXgygedJwg6k8SHCQCfS +D9RignCNT/O8VhJ4hpzAXbEpeAXJn+AHYGIxL6Fu+0dwDKJjruvcLpVVt9GLLdzX +OBgsK0z9m3hLOf8dfY97jMkRTHtokrA28iheLh6l8rFFesJM8lqFreFRRJMTXeHW +Xwa82PbUdIWygguAlSj035aGUuNRNDZq4Bh4XTVndCDbUfRBlYF9yMduvSqaKsmm +tLJ8V04vDECQpUcAPTCCbTDFoV8/KVDsxMTgZkdiJG/Vv2y8mzy5FPAJBNk/HCcx +E8qc7KF80l+YGQ/IgGzzz9r9DqaXy21FwaiA6TRFth9hXMdzZLVBNfpzZ+dGMJEQ +PAoWUshcNNwAZVU0+GzdQvdckGUcWgnMZpzXswaUmXbMidQ6VQnDTQdj5qIEnrMW +CrIHVs+hhjcGRbGf6DGHQpQbjD9FWX38PVzPpocu1qmLKVTUoFPqm0EqU01SYLFu +S9ntmlOqYJJIR0LbXJvAL7tVKHiK4gR8NMfN2YKPi4Eg3GKTZ5XaSpNPQJnR0ZqP ++sU07jjQTcVuCD8Cx8c9LGXa6PNAwBufk3jrz/vZy8AQEs13aMu3thHhLQWKrgi5 +jVdoLNIqQZJH7aY0YjoaD6if+4uHtRQOqUcJPUyxWnwXx+Y/o+9DrpH5K9V9fcVR +e7Ej8j2Ha4yzZw7M9Uze0unMRQOhE2lbRsP4C6f/TK3izeSlmhG0D/pHfHx9GKbf +S7TPnD0YhUS9TpXX3BEVSXVjIkkbIiC0djq3OI+3PSn/PJqWjCw8pL7JZp5T8J1u +sqyQCge4XjYmmj9Np511tcviq+jmobf0b+WMmxxV21/Au+v2uI/7eAwUyWYIJYny +kcGUDmEZohsFx6hYbRsH+bSEUqC6MuKiUaaqEb97IoR33D3ZajMBchw+Yg0jh/wJ +S8FKEB0NlS00051UnwdsjBKyuOMWT6xH9VVR8W+7t6i0rMDxb4DjP3T+BqjXCT0d +kiHRXRALxotk+WVRC4qRVr0kmFut9bLjlFu2Hlbnpmm7zmJcE3hbkhWjXqDsysp7 +SKJAs+IvYrTMEtURflKiN/n7y6SbXdCXvw+lRTeTjT9h8DiIMsK5vw2SSjWPaQnu +ikCATObciGyro3aImzhaBBY0r/F4Q1KsvLi+xKo+JoDHSVNjNg9SNjQKhyVRFJq/ +quwTP019B5U3ykWj2/i7HV9IBH+nGEUuvpI5esUoIWTvdCkVdAEeSg0vwkJoohbb +l9HjDYyEJxoLhwaR7Mqh+uDxHBK2Kqh8TkIXjdUbXqTRIX6lajzJ/p7owoE48sHa +iWo9tN+4bOabEjPAkEhLy2cLUfWEPjClo8YZelif8cZigKzdSDbxdmyugfFtZfQX +NYwcMYayGBCETNyByLbBjNO+7XPlNcfqQJlFWsGOrzmJdoxtW7CYYqbN8qzhpNox +MSRK7T+eUDFKNjY53lPfUPUFgcXq+9IKicf6cYE8gsI3/5I9vzLk3Lt7ZLXMgFv7 +-----END RSA PRIVATE KEY----- diff --git a/mysql-test/std_data/galera_certs/galera.root.srl b/mysql-test/std_data/galera_certs/galera.root.srl new file mode 100644 index 00000000000..e6c62e06527 --- /dev/null +++ b/mysql-test/std_data/galera_certs/galera.root.srl @@ -0,0 +1 @@ +6D409518A9205687DA79FBF6FB2253AB3CCB1AB1 diff --git a/mysql-test/suite/binlog/disabled.def b/mysql-test/suite/binlog/disabled.def index 424e5549541..888298bbb09 100644 --- a/mysql-test/suite/binlog/disabled.def +++ b/mysql-test/suite/binlog/disabled.def @@ -9,5 +9,3 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -binlog_truncate_innodb : BUG#11764459 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed -binlog_spurious_ddl_errors : BUG#11761680 2013-01-18 astha Fixed on mysql-5.6 and trunk diff --git a/mysql-test/suite/binlog/include/binlog_write_error.inc b/mysql-test/suite/binlog/include/binlog_write_error.inc deleted file mode 100644 index fa3ba087a7e..00000000000 --- a/mysql-test/suite/binlog/include/binlog_write_error.inc +++ /dev/null @@ -1,108 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently binlog and binlog_encryption). -# Please check all dependent tests after modifying it -# - -# -# === Name === -# -# binlog_write_error.test -# -# === Description === -# -# This test case check if the error of writing binlog file is properly -# reported and handled when executing statements. -# -# === Related Bugs === -# -# BUG#37148 -# - -source include/have_log_bin.inc; -source include/have_debug.inc; -source include/have_binlog_format_mixed_or_statement.inc; - ---echo # ---echo # Initialization ---echo # - -disable_warnings; -DROP TABLE IF EXISTS t1, t2; -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; -DROP TRIGGER IF EXISTS tr1; -DROP TRIGGER IF EXISTS tr2; -DROP VIEW IF EXISTS v1, v2; -enable_warnings; - ---echo # ---echo # Test injecting binlog write error when executing queries ---echo # - -let $query= CREATE TABLE t1 (a INT); -source include/binlog_inject_error.inc; - -INSERT INTO t1 VALUES (1),(2),(3); - -let $query= INSERT INTO t1 VALUES (4),(5),(6); -source include/binlog_inject_error.inc; - -let $query= UPDATE t1 set a=a+1; -source include/binlog_inject_error.inc; - -let $query= DELETE FROM t1; -source include/binlog_inject_error.inc; - -let $query= CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (new.a + 100); -source include/binlog_inject_error.inc; - -let $query= DROP TRIGGER tr1; -source include/binlog_inject_error.inc; - -let $query= ALTER TABLE t1 ADD (b INT); -source include/binlog_inject_error.inc; - -let $query= CREATE VIEW v1 AS SELECT a FROM t1; -source include/binlog_inject_error.inc; - -let $query= DROP VIEW v1; -source include/binlog_inject_error.inc; - -let $query= CREATE PROCEDURE p1(OUT rows_cnt INT) SELECT count(*) INTO rows_cnt FROM t1; -source include/binlog_inject_error.inc; - -let $query= DROP PROCEDURE p1; -source include/binlog_inject_error.inc; - -let $query= DROP TABLE t1; -source include/binlog_inject_error.inc; - -let $query= CREATE FUNCTION f1() RETURNS INT return 1; -source include/binlog_inject_error.inc; - -let $query= DROP FUNCTION f1; -source include/binlog_inject_error.inc; - -let $query= CREATE USER user1; -source include/binlog_inject_error.inc; - -let $query= REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1; -source include/binlog_inject_error.inc; - -let $query= DROP USER user1; -source include/binlog_inject_error.inc; - ---echo # ---echo # Cleanup ---echo # - -disable_warnings; -DROP TABLE IF EXISTS t1, t2; -DROP FUNCTION IF EXISTS f1; -DROP PROCEDURE IF EXISTS p1; -DROP TRIGGER IF EXISTS tr1; -DROP VIEW IF EXISTS v1, v2; -enable_warnings; diff --git a/mysql-test/suite/binlog/include/binlog_xa_recover.inc b/mysql-test/suite/binlog/include/binlog_xa_recover.inc deleted file mode 100644 index de2703377cc..00000000000 --- a/mysql-test/suite/binlog/include/binlog_xa_recover.inc +++ /dev/null @@ -1,281 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently binlog and binlog_encryption). -# Please check all dependent tests after modifying it -# - ---source include/have_innodb.inc ---source include/have_debug.inc ---source include/have_debug_sync.inc ---source include/have_binlog_format_row.inc -# Valgrind does not work well with test that crashes the server ---source include/not_valgrind.inc - -# (We do not need to restore these settings, as we crash the server). -SET GLOBAL max_binlog_size= 4096; -SET GLOBAL innodb_flush_log_at_trx_commit= 1; -RESET MASTER; - -CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; -# Insert some data to force a couple binlog rotations (3), so we get some -# normal binlog checkpoints before starting the test. -INSERT INTO t1 VALUES (100, REPEAT("x", 4100)); -# Wait for the master-bin.000002 binlog checkpoint to appear. ---let $wait_for_all= 0 ---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000002" ---let $field= Info ---let $condition= = "master-bin.000002" ---source include/wait_show_condition.inc -INSERT INTO t1 VALUES (101, REPEAT("x", 4100)); ---let $wait_for_all= 0 ---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003" ---let $field= Info ---let $condition= = "master-bin.000003" ---source include/wait_show_condition.inc -INSERT INTO t1 VALUES (102, REPEAT("x", 4100)); ---let $wait_for_all= 0 ---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004" ---let $field= Info ---let $condition= = "master-bin.000004" ---source include/wait_show_condition.inc - -# Now start a bunch of transactions that span multiple binlog -# files. Leave then in the state prepared-but-not-committed in the engine -# and crash the server. Check that crash recovery is able to recover all -# of them. -# -# We use debug_sync to get all the transactions into the prepared state before -# we commit any of them. This is because the prepare step flushes the InnoDB -# redo log - including any commits made before, so recovery would become -# unnecessary, decreasing the value of this test. -# -# We arrange to have con1 with a prepared transaction in master-bin.000004, -# con2 and con3 with a prepared transaction in master-bin.000005, and a new -# empty master-bin.000006. So the latest binlog checkpoint should be -# master-bin.000006. - -connect(con1,localhost,root,,); -# First wait after prepare and before write to binlog. -SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont"; -# Then complete InnoDB commit in memory (but not commit checkpoint / write to -# disk), and hang until crash, leaving a transaction to be XA recovered. -SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever"; -send INSERT INTO t1 VALUES (1, REPEAT("x", 4100)); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con1_wait"; - -connect(con2,localhost,root,,); -SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont"; -SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever"; -send INSERT INTO t1 VALUES (2, NULL); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con2_wait"; - -connect(con3,localhost,root,,); -SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont"; -SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever"; -send INSERT INTO t1 VALUES (3, REPEAT("x", 4100)); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con3_wait"; - -connect(con4,localhost,root,,); -SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont"; -SET SESSION debug_dbug="+d,crash_commit_after_log"; -send INSERT INTO t1 VALUES (4, NULL); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con4_wait"; - -SET DEBUG_SYNC= "now SIGNAL con1_cont"; -SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; -SET DEBUG_SYNC= "now SIGNAL con2_cont"; -SET DEBUG_SYNC= "now WAIT_FOR con2_ready"; -SET DEBUG_SYNC= "now SIGNAL con3_cont"; -SET DEBUG_SYNC= "now WAIT_FOR con3_ready"; - -# Check that everything is committed in binary log. ---source include/show_binary_logs.inc ---let $binlog_file= master-bin.000003 ---let $binlog_start= 4 ---source include/show_binlog_events.inc ---let $binlog_file= master-bin.000004 ---source include/show_binlog_events.inc ---let $binlog_file= master-bin.000005 ---source include/show_binlog_events.inc ---let $binlog_file= master-bin.000006 ---source include/show_binlog_events.inc - - -# Check that server will not purge too much. -PURGE BINARY LOGS TO "master-bin.000006"; ---source include/show_binary_logs.inc - -# Now crash the server with one more transaction in prepared state. ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait-binlog_xa_recover.test -EOF ---error 0,2006,2013 -SET DEBUG_SYNC= "now SIGNAL con4_cont"; -connection con4; ---error 2006,2013 -reap; - ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart-group_commit_binlog_pos.test -EOF - -connection default; ---enable_reconnect ---source include/wait_until_connected_again.inc - -# Check that all transactions are recovered. -SELECT a FROM t1 ORDER BY a; - ---echo Test that with multiple binlog checkpoints, recovery starts from the last one. -SET GLOBAL max_binlog_size= 4096; -SET GLOBAL innodb_flush_log_at_trx_commit= 1; -RESET MASTER; - -# Rotate to binlog master-bin.000003 while delaying binlog checkpoints. -# So we get multiple binlog checkpoints in master-bin.000003. -# Then complete the checkpoints, crash, and check that we only scan -# the necessary binlog file (ie. that we use the _last_ checkpoint). - -connect(con10,localhost,root,,); -SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont"; -send INSERT INTO t1 VALUES (10, REPEAT("x", 4100)); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con10_ready"; - -connect(con11,localhost,root,,); -SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont"; -send INSERT INTO t1 VALUES (11, REPEAT("x", 4100)); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con11_ready"; - -connect(con12,localhost,root,,); -SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont"; -send INSERT INTO t1 VALUES (12, REPEAT("x", 4100)); - -connection default; -SET DEBUG_SYNC= "now WAIT_FOR con12_ready"; -INSERT INTO t1 VALUES (13, NULL); - ---source include/show_binary_logs.inc ---let $binlog_file= master-bin.000004 ---let $binlog_start= 4 ---source include/show_binlog_events.inc - -SET DEBUG_SYNC= "now SIGNAL con10_cont"; -connection con10; -reap; -connection default; - -# We need to sync the test case with the background processing of the -# commit checkpoint, otherwise we get nondeterministic results. -SET @old_dbug= @@global.DEBUG_DBUG; -SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed"; - -SET DEBUG_SYNC= "now SIGNAL con12_cont"; -connection con12; -reap; -connection default; -SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed"; -SET GLOBAL debug_dbug= @old_dbug; - -SET DEBUG_SYNC= "now SIGNAL con11_cont"; -connection con11; -reap; - -connection default; -# Wait for the last (master-bin.000004) binlog checkpoint to appear. ---let $wait_for_all= 0 ---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004" ---let $field= Info ---let $condition= = "master-bin.000004" ---source include/wait_show_condition.inc - ---echo Checking that master-bin.000004 is the last binlog checkpoint ---source include/show_binlog_events.inc - ---echo Now crash the server -# It is not too easy to test XA recovery, as it runs early during server -# startup, before any connections can be made. -# What we do is set a DBUG error insert which will crash if XA recovery -# starts from any other binlog than master-bin.000004 (check the file -# binlog_xa_recover-master.opt). Then we will fail here if XA recovery -# would start from the wrong place. ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait-binlog_xa_recover.test -EOF -SET SESSION debug_dbug="+d,crash_commit_after_log"; ---error 2006,2013 -INSERT INTO t1 VALUES (14, NULL); - ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart-group_commit_binlog_pos.test -EOF - -connection default; ---enable_reconnect ---source include/wait_until_connected_again.inc - -# Check that all transactions are recovered. -SELECT a FROM t1 ORDER BY a; - - ---echo *** Check that recovery works if we crashed early during rotate, before ---echo *** binlog checkpoint event could be written. - -SET GLOBAL max_binlog_size= 4096; -SET GLOBAL innodb_flush_log_at_trx_commit= 1; -RESET MASTER; - -# We need some initial data to reach binlog master-bin.000004. Otherwise -# crash recovery fails due to the error insert used for previous test. -INSERT INTO t1 VALUES (21, REPEAT("x", 4100)); -INSERT INTO t1 VALUES (22, REPEAT("x", 4100)); -# Wait for the master-bin.000003 binlog checkpoint to appear. ---let $wait_for_all= 0 ---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003" ---let $field= Info ---let $condition= = "master-bin.000003" ---source include/wait_show_condition.inc -INSERT INTO t1 VALUES (23, REPEAT("x", 4100)); -# Wait for the last (master-bin.000004) binlog checkpoint to appear. ---let $wait_for_all= 0 ---let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004" ---let $field= Info ---let $condition= = "master-bin.000004" ---source include/wait_show_condition.inc - ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait-binlog_xa_recover.test -EOF -SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event"; ---error 2006,2013 -INSERT INTO t1 VALUES (24, REPEAT("x", 4100)); - ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart-group_commit_binlog_pos.test -EOF - ---enable_reconnect ---source include/wait_until_connected_again.inc - -# Check that all transactions are recovered. -SELECT a FROM t1 ORDER BY a; - ---source include/show_binary_logs.inc ---let $binlog_file= master-bin.000004 ---let $binlog_start= 4 ---source include/show_binlog_events.inc - -# Cleanup -connection default; -DROP TABLE t1; diff --git a/mysql-test/suite/binlog/r/binlog_checkpoint_flush_logs.result b/mysql-test/suite/binlog/r/binlog_checkpoint_flush_logs.result new file mode 100644 index 00000000000..e861f36394c --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_checkpoint_flush_logs.result @@ -0,0 +1,52 @@ +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; +CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; +*** Test that FLUSH LOGS waits if a transaction ordered commit is in progress. +connect con1,localhost,root,,; +SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL con1_ready WAIT_FOR con1_go"; +INSERT INTO t1 VALUES (1, REPEAT("x", 1)); +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; +SET DEBUG_SYNC= "rotate_after_rotate SIGNAL con_flush_ready WAIT_FOR default_go"; +FLUSH LOGS; +connect con2,localhost,root,,; +Trx_1 is not yet committed: +SELECT count(*) as 'ZERO' from t1; +ZERO +0 +Wait for Trx_2 has rotated binlog: +SET DEBUG_SYNC= "now WAIT_FOR con_flush_ready"; +SET DEBUG_SYNC= "now SIGNAL default_go"; +# restart +connection default; +Must be tree logs in the list: +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +master-bin.000003 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000001 # Gtid_list # # [] +master-bin.000001 # Binlog_checkpoint # # master-bin.000001 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1, REPEAT("x", 1)) +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Rotate # # master-bin.000002;pos=POS +Only one Binlog checkpoint must exist and point to master-bin.000001 +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000002 # Gtid_list # # [#-#-#] +master-bin.000002 # Binlog_checkpoint # # master-bin.000001 +SELECT count(*) as 'ONE' from t1; +ONE +1 +connection default; +DROP TABLE t1; +SET debug_sync = 'reset'; diff --git a/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result b/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result index 1a81eee1a58..798bd8ab853 100644 --- a/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result +++ b/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result @@ -1,5 +1,5 @@ SET @old_binlog_format= @@global.binlog_format; -INSTALL PLUGIN example SONAME 'ha_example.so'; +INSTALL PLUGIN example SONAME 'ha_example'; ################################################################################ # Verifies if ER_BINLOG_STMT_MODE_AND_ROW_ENGINE happens by setting the binlog # format to STATEMENT and the transaction isolation level to READ COMMITTED as @@ -18,7 +18,7 @@ ALTER TABLE t_row ADD COLUMN b INT; CREATE TRIGGER trig_row BEFORE INSERT ON t_row FOR EACH ROW INSERT INTO t_stmt VALUES (1); CREATE INDEX i ON t_row(a); CREATE TABLE t_row_new ENGINE = InnoDB SELECT * FROM t_row; -ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED. +ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. DROP TABLE t_row; @@ -36,12 +36,11 @@ DROP TABLE t_row; SET binlog_format = ROW; CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE; ALTER TABLE t_stmt ADD COLUMN b INT; -ERROR 42000: This version of MySQL doesn't yet support 'ALTER TABLE' CREATE TRIGGER trig_stmt BEFORE INSERT ON t_stmt FOR EACH ROW INSERT INTO t_stmt VALUES (1); CREATE INDEX i ON t_stmt(a); ERROR 42000: Too many key parts specified; max 0 parts allowed CREATE TABLE t_stmt_new ENGINE = EXAMPLE SELECT * FROM t_stmt; -ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based logging. +ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based logging DROP TABLE t_stmt; diff --git a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result index d6875ab60e0..a4cd5b4080d 100644 --- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result +++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result @@ -50,3 +50,4 @@ a 400 401 drop table t1; +reset master; diff --git a/mysql-test/suite/binlog/r/binlog_truncate_innodb.result b/mysql-test/suite/binlog/r/binlog_truncate_innodb.result index 8beeeb1a428..87ce8e30dee 100644 --- a/mysql-test/suite/binlog/r/binlog_truncate_innodb.result +++ b/mysql-test/suite/binlog/r/binlog_truncate_innodb.result @@ -7,9 +7,11 @@ INSERT INTO t2 VALUES (1),(2),(3); **** Truncate of empty table shall be logged TRUNCATE TABLE t1; TRUNCATE TABLE t2; -show binlog events from <binlog_start>; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2 DROP TABLE t1,t2; # @@ -18,18 +20,17 @@ DROP TABLE t1,t2; CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1),(2); -# Connection: default BEGIN; INSERT INTO t2 SELECT * FROM t1; -# Connection: truncate +connect truncate,localhost,root,,; TRUNCATE TABLE t1; -# Connection: default +connection default; INSERT INTO t2 SELECT * FROM t1; SELECT COUNT(*) FROM t2; COUNT(*) 4 COMMIT; -# Connection: truncate +connection truncate; # Reaping TRUNCATE TABLE SELECT COUNT(*) FROM t1; COUNT(*) @@ -37,16 +38,20 @@ COUNT(*) SELECT COUNT(*) FROM t2; COUNT(*) 4 -# Connection: default -show binlog events from <binlog_start>; +connection default; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Table_map # # table_id: # (test.t2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Table_map # # table_id: # (test.t2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +disconnect truncate; DROP TABLE t1,t2; # Even though the isolation level might be permissive, truncate # table follows a stricter isolation as its locking is based on @@ -59,9 +64,11 @@ SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; TRUNCATE TABLE t1; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; TRUNCATE TABLE t2; -show binlog events from <binlog_start>; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2 DROP TABLE t1,t2; # @@ -71,18 +78,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1),(2); SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -# Connection: default BEGIN; INSERT INTO t2 SELECT * FROM t1; -# Connection: truncate +connect truncate,localhost,root,,; TRUNCATE TABLE t1; -# Connection: default +connection default; INSERT INTO t2 SELECT * FROM t1; SELECT COUNT(*) FROM t2; COUNT(*) 4 COMMIT; -# Connection: truncate +connection truncate; # Reaping TRUNCATE TABLE SELECT COUNT(*) FROM t1; COUNT(*) @@ -90,16 +96,20 @@ COUNT(*) SELECT COUNT(*) FROM t2; COUNT(*) 4 -# Connection: default -show binlog events from <binlog_start>; +connection default; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Table_map # # table_id: # (test.t2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Table_map # # table_id: # (test.t2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +disconnect truncate; DROP TABLE t1,t2; CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; @@ -109,9 +119,11 @@ SET TRANSACTION ISOLATION LEVEL READ COMMITTED; TRUNCATE TABLE t1; SET TRANSACTION ISOLATION LEVEL READ COMMITTED; TRUNCATE TABLE t2; -show binlog events from <binlog_start>; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2 DROP TABLE t1,t2; # @@ -121,18 +133,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1),(2); SET TRANSACTION ISOLATION LEVEL READ COMMITTED; -# Connection: default BEGIN; INSERT INTO t2 SELECT * FROM t1; -# Connection: truncate +connect truncate,localhost,root,,; TRUNCATE TABLE t1; -# Connection: default +connection default; INSERT INTO t2 SELECT * FROM t1; SELECT COUNT(*) FROM t2; COUNT(*) 4 COMMIT; -# Connection: truncate +connection truncate; # Reaping TRUNCATE TABLE SELECT COUNT(*) FROM t1; COUNT(*) @@ -140,16 +151,20 @@ COUNT(*) SELECT COUNT(*) FROM t2; COUNT(*) 4 -# Connection: default -show binlog events from <binlog_start>; +connection default; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Table_map # # table_id: # (test.t2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Table_map # # table_id: # (test.t2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +disconnect truncate; DROP TABLE t1,t2; CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; @@ -159,9 +174,11 @@ SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; TRUNCATE TABLE t1; SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; TRUNCATE TABLE t2; -show binlog events from <binlog_start>; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2 DROP TABLE t1,t2; # @@ -171,18 +188,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1),(2); SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; -# Connection: default BEGIN; INSERT INTO t2 SELECT * FROM t1; -# Connection: truncate +connect truncate,localhost,root,,; TRUNCATE TABLE t1; -# Connection: default +connection default; INSERT INTO t2 SELECT * FROM t1; SELECT COUNT(*) FROM t2; COUNT(*) 4 COMMIT; -# Connection: truncate +connection truncate; # Reaping TRUNCATE TABLE SELECT COUNT(*) FROM t1; COUNT(*) @@ -190,16 +206,20 @@ COUNT(*) SELECT COUNT(*) FROM t2; COUNT(*) 4 -# Connection: default -show binlog events from <binlog_start>; +connection default; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Table_map # # table_id: # (test.t2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Table_map # # table_id: # (test.t2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +disconnect truncate; DROP TABLE t1,t2; CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; @@ -209,9 +229,11 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; TRUNCATE TABLE t1; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; TRUNCATE TABLE t2; -show binlog events from <binlog_start>; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2 DROP TABLE t1,t2; # @@ -221,18 +243,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1),(2); SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; -# Connection: default BEGIN; INSERT INTO t2 SELECT * FROM t1; -# Connection: truncate +connect truncate,localhost,root,,; TRUNCATE TABLE t1; -# Connection: default +connection default; INSERT INTO t2 SELECT * FROM t1; SELECT COUNT(*) FROM t2; COUNT(*) 4 COMMIT; -# Connection: truncate +connection truncate; # Reaping TRUNCATE TABLE SELECT COUNT(*) FROM t1; COUNT(*) @@ -240,16 +261,20 @@ COUNT(*) SELECT COUNT(*) FROM t2; COUNT(*) 4 -# Connection: default -show binlog events from <binlog_start>; +connection default; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Table_map # # table_id: # (test.t2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Table_map # # table_id: # (test.t2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +disconnect truncate; DROP TABLE t1,t2; SET BINLOG_FORMAT=STATEMENT; RESET MASTER; @@ -261,9 +286,11 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; TRUNCATE TABLE t1; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; TRUNCATE TABLE t2; -show binlog events from <binlog_start>; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2 DROP TABLE t1,t2; # @@ -273,18 +300,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1),(2); SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; -# Connection: default BEGIN; INSERT INTO t2 SELECT * FROM t1; -# Connection: truncate +connect truncate,localhost,root,,; TRUNCATE TABLE t1; -# Connection: default +connection default; INSERT INTO t2 SELECT * FROM t1; SELECT COUNT(*) FROM t2; COUNT(*) 4 COMMIT; -# Connection: truncate +connection truncate; # Reaping TRUNCATE TABLE SELECT COUNT(*) FROM t1; COUNT(*) @@ -292,14 +318,16 @@ COUNT(*) SELECT COUNT(*) FROM t2; COUNT(*) 4 -# Connection: default -show binlog events from <binlog_start>; +connection default; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN +master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +disconnect truncate; DROP TABLE t1,t2; # Truncate is not supported for SBR if the isolation level is # READ UNCOMMITTED or READ COMMITTED. These specific isolation @@ -312,9 +340,11 @@ SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; TRUNCATE TABLE t1; SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; TRUNCATE TABLE t2; -show binlog events from <binlog_start>; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2 DROP TABLE t1,t2; # @@ -324,18 +354,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1),(2); SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; -# Connection: default BEGIN; INSERT INTO t2 SELECT * FROM t1; -# Connection: truncate +connect truncate,localhost,root,,; TRUNCATE TABLE t1; -# Connection: default +connection default; INSERT INTO t2 SELECT * FROM t1; SELECT COUNT(*) FROM t2; COUNT(*) 4 COMMIT; -# Connection: truncate +connection truncate; # Reaping TRUNCATE TABLE SELECT COUNT(*) FROM t1; COUNT(*) @@ -343,14 +372,16 @@ COUNT(*) SELECT COUNT(*) FROM t2; COUNT(*) 4 -# Connection: default -show binlog events from <binlog_start>; +connection default; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN +master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +disconnect truncate; DROP TABLE t1,t2; CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; @@ -360,9 +391,11 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; TRUNCATE TABLE t1; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; TRUNCATE TABLE t2; -show binlog events from <binlog_start>; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2 DROP TABLE t1,t2; # @@ -372,18 +405,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1),(2); SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; -# Connection: default BEGIN; INSERT INTO t2 SELECT * FROM t1; -# Connection: truncate +connect truncate,localhost,root,,; TRUNCATE TABLE t1; -# Connection: default +connection default; INSERT INTO t2 SELECT * FROM t1; SELECT COUNT(*) FROM t2; COUNT(*) 4 COMMIT; -# Connection: truncate +connection truncate; # Reaping TRUNCATE TABLE SELECT COUNT(*) FROM t1; COUNT(*) @@ -391,13 +423,16 @@ COUNT(*) SELECT COUNT(*) FROM t2; COUNT(*) 4 -# Connection: default -show binlog events from <binlog_start>; +connection default; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN +master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1 master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 +disconnect truncate; DROP TABLE t1,t2; -SET BINLOG_FORMAT=@old_binlog_format; +SET @@global.binlog_format = @old_binlog_format; +SET @@session.binlog_format = @old_binlog_format; diff --git a/mysql-test/suite/binlog/r/binlog_write_error.result b/mysql-test/suite/binlog/r/binlog_write_error.result index 6e8a212035a..2ee68465243 100644 --- a/mysql-test/suite/binlog/r/binlog_write_error.result +++ b/mysql-test/suite/binlog/r/binlog_write_error.result @@ -1,15 +1,4 @@ # -# Initialization -# -DROP TABLE IF EXISTS t1, t2; -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; -DROP TRIGGER IF EXISTS tr1; -DROP TRIGGER IF EXISTS tr2; -DROP VIEW IF EXISTS v1, v2; -# # Test injecting binlog write error when executing queries # set @saved_dbug = @@global.debug_dbug; @@ -111,15 +100,13 @@ ERROR HY000: Error writing file 'master-bin' ((errno: #) set @@global.debug_dbug = @saved_dbug; set @saved_dbug = @@global.debug_dbug; SET GLOBAL debug_dbug='d,injecting_fault_writing'; +SET PASSWORD FOR user1=PASSWORD('foobar'); +SET PASSWORD FOR user1=PASSWORD('foobar'); +ERROR HY000: Error writing file 'master-bin' ((errno: #) +set @@global.debug_dbug = @saved_dbug; +set @saved_dbug = @@global.debug_dbug; +SET GLOBAL debug_dbug='d,injecting_fault_writing'; DROP USER user1; DROP USER user1; ERROR HY000: Error writing file 'master-bin' ((errno: #) set @@global.debug_dbug = @saved_dbug; -# -# Cleanup -# -DROP TABLE IF EXISTS t1, t2; -DROP FUNCTION IF EXISTS f1; -DROP PROCEDURE IF EXISTS p1; -DROP TRIGGER IF EXISTS tr1; -DROP VIEW IF EXISTS v1, v2; diff --git a/mysql-test/suite/binlog/r/binlog_xa_recover.result b/mysql-test/suite/binlog/r/binlog_xa_recover.result index 25aa1389b71..f5060fd5160 100644 --- a/mysql-test/suite/binlog/r/binlog_xa_recover.result +++ b/mysql-test/suite/binlog/r/binlog_xa_recover.result @@ -146,29 +146,12 @@ master-bin.000004 # Xid # # COMMIT /* XID */ SET DEBUG_SYNC= "now SIGNAL con10_cont"; connection con10; connection default; -SET @old_dbug= @@global.DEBUG_DBUG; -SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed"; SET DEBUG_SYNC= "now SIGNAL con12_cont"; connection con12; connection default; -SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed"; -SET GLOBAL debug_dbug= @old_dbug; SET DEBUG_SYNC= "now SIGNAL con11_cont"; connection con11; connection default; -Checking that master-bin.000004 is the last binlog checkpoint -include/show_binlog_events.inc -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -master-bin.000004 # Gtid_list # # [#-#-#] -master-bin.000004 # Binlog_checkpoint # # master-bin.000001 -master-bin.000004 # Gtid # # BEGIN GTID #-#-# -master-bin.000004 # Annotate_rows # # INSERT INTO t1 VALUES (13, NULL) -master-bin.000004 # Table_map # # table_id: # (test.t1) -master-bin.000004 # Write_rows_v1 # # table_id: # flags: STMT_END_F -master-bin.000004 # Xid # # COMMIT /* XID */ -master-bin.000004 # Binlog_checkpoint # # master-bin.000002 -master-bin.000004 # Binlog_checkpoint # # master-bin.000004 Now crash the server SET SESSION debug_dbug="+d,crash_commit_after_log"; INSERT INTO t1 VALUES (14, NULL); diff --git a/mysql-test/suite/binlog/t/binlog_checkpoint_flush_logs.test b/mysql-test/suite/binlog/t/binlog_checkpoint_flush_logs.test new file mode 100644 index 00000000000..e21f1eb308d --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_checkpoint_flush_logs.test @@ -0,0 +1,79 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/have_binlog_format_row.inc + +# References: +# +# MDEV-24526 binlog rotate via FLUSH LOGS may obsolate binlog file too eary +# +# The test for MDEV-24526 proves the fixes correct observed race condition +# between a commiting transaction and FLUSH-LOGS. +# The plot. +# Trx_1 (con1) transaction binlogs first +# to yield its turn acquiring LOCK_commit_ordered to Trx_2 and stand +# still waiting of a signal that will never arrive. +# Trx_2 can't acquire it in the fixed version even though +# Trx_3 makes sure Trx_2 has reached a post-rotation execution point +# to signal it to proceed. +# Then the server gets crashed and Trx_1 must recover unlike +# in the OLD buggy version. +# +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; + +CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; + +--echo *** Test that FLUSH LOGS waits if a transaction ordered commit is in progress. + +connect(con1,localhost,root,,); # Trx_1 +# hang before doing acquiring Commit Ordered mutex +SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL con1_ready WAIT_FOR con1_go"; + +--send INSERT INTO t1 VALUES (1, REPEAT("x", 1)) + +connection default; # Trx_2 + +SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; +SET DEBUG_SYNC= "rotate_after_rotate SIGNAL con_flush_ready WAIT_FOR default_go"; +--send FLUSH LOGS + +connect(con2,localhost,root,,); # Trx_3 +--echo Trx_1 is not yet committed: +SELECT count(*) as 'ZERO' from t1; + +--echo Wait for Trx_2 has rotated binlog: +SET DEBUG_SYNC= "now WAIT_FOR con_flush_ready"; +# Useless signal to prove Trx_2 cannot race Trx_1's commit +# even though Trx_1 never received the being waited 'con1_go'. +SET DEBUG_SYNC= "now SIGNAL default_go"; + +--let $shutdown_timeout=0 +--source include/restart_mysqld.inc + +connection default; +--enable_reconnect +--error 0,2013 +--reap + +--echo Must be tree logs in the list: +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000001 +--let $binlog_start= 4 +--source include/show_binlog_events.inc + +--echo Only one Binlog checkpoint must exist and point to master-bin.000001 +--let $binlog_file= master-bin.000002 +--let $binlog_start= 4 +--source include/show_binlog_events.inc + + +# In the buggy server version the following select may have +# resulted with ZERO: +SELECT count(*) as 'ONE' from t1; + +# Clean up. +connection default; + +DROP TABLE t1; +SET debug_sync = 'reset'; diff --git a/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt b/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt deleted file mode 100644 index 627becdbfb5..00000000000 --- a/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb diff --git a/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test b/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test index e64e7838a31..29a860764a9 100644 --- a/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test +++ b/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test @@ -71,7 +71,6 @@ DROP TABLE t_row; SET binlog_format = ROW; CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE; ---error ER_NOT_SUPPORTED_YET ALTER TABLE t_stmt ADD COLUMN b INT; CREATE TRIGGER trig_stmt BEFORE INSERT ON t_stmt FOR EACH ROW INSERT INTO t_stmt VALUES (1); diff --git a/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test b/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test index b2af560fa50..9145afc047f 100644 --- a/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test +++ b/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test @@ -10,3 +10,4 @@ disable_query_log; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); enable_query_log; -- source include/binlog_insert_delayed.test +reset master; diff --git a/mysql-test/suite/binlog/t/binlog_truncate_innodb-master.opt b/mysql-test/suite/binlog/t/binlog_truncate_innodb-master.opt deleted file mode 100644 index 69cc489a969..00000000000 --- a/mysql-test/suite/binlog/t/binlog_truncate_innodb-master.opt +++ /dev/null @@ -1 +0,0 @@ ---loose-innodb
\ No newline at end of file diff --git a/mysql-test/suite/binlog/t/binlog_truncate_innodb.test b/mysql-test/suite/binlog/t/binlog_truncate_innodb.test index 54a32b96ef1..511b82bd717 100644 --- a/mysql-test/suite/binlog/t/binlog_truncate_innodb.test +++ b/mysql-test/suite/binlog/t/binlog_truncate_innodb.test @@ -41,4 +41,5 @@ source include/binlog_truncate.test; let $before_truncate = SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; source include/binlog_truncate.test; -SET BINLOG_FORMAT=@old_binlog_format; +SET @@global.binlog_format = @old_binlog_format; +SET @@session.binlog_format = @old_binlog_format;
\ No newline at end of file diff --git a/mysql-test/suite/binlog/t/binlog_write_error.test b/mysql-test/suite/binlog/t/binlog_write_error.test index d66efb0bcf3..2c55173c2a1 100644 --- a/mysql-test/suite/binlog/t/binlog_write_error.test +++ b/mysql-test/suite/binlog/t/binlog_write_error.test @@ -1 +1,82 @@ ---source include/binlog_write_error.inc +# +# This file is included by binlog_encryption.binlog_write_error +# Please check all dependent tests after modifying it +# + +# +# === Name === +# +# binlog_write_error.test +# +# === Description === +# +# This test case check if the error of writing binlog file is properly +# reported and handled when executing statements. +# +# === Related Bugs === +# +# BUG#37148 +# + +source include/have_debug.inc; +source include/have_binlog_format_mixed_or_statement.inc; + +--echo # +--echo # Test injecting binlog write error when executing queries +--echo # + +let $query= CREATE TABLE t1 (a INT); +source include/binlog_inject_error.inc; + +INSERT INTO t1 VALUES (1),(2),(3); + +let $query= INSERT INTO t1 VALUES (4),(5),(6); +source include/binlog_inject_error.inc; + +let $query= UPDATE t1 set a=a+1; +source include/binlog_inject_error.inc; + +let $query= DELETE FROM t1; +source include/binlog_inject_error.inc; + +let $query= CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (new.a + 100); +source include/binlog_inject_error.inc; + +let $query= DROP TRIGGER tr1; +source include/binlog_inject_error.inc; + +let $query= ALTER TABLE t1 ADD (b INT); +source include/binlog_inject_error.inc; + +let $query= CREATE VIEW v1 AS SELECT a FROM t1; +source include/binlog_inject_error.inc; + +let $query= DROP VIEW v1; +source include/binlog_inject_error.inc; + +let $query= CREATE PROCEDURE p1(OUT rows_cnt INT) SELECT count(*) INTO rows_cnt FROM t1; +source include/binlog_inject_error.inc; + +let $query= DROP PROCEDURE p1; +source include/binlog_inject_error.inc; + +let $query= DROP TABLE t1; +source include/binlog_inject_error.inc; + +let $query= CREATE FUNCTION f1() RETURNS INT return 1; +source include/binlog_inject_error.inc; + +let $query= DROP FUNCTION f1; +source include/binlog_inject_error.inc; + +let $query= CREATE USER user1; +source include/binlog_inject_error.inc; + +let $query= REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1; +source include/binlog_inject_error.inc; + +let $query= SET PASSWORD FOR user1=PASSWORD('foobar'); +source include/binlog_inject_error.inc; + +let $query= DROP USER user1; +source include/binlog_inject_error.inc; diff --git a/mysql-test/suite/binlog/t/binlog_xa_recover-master.opt b/mysql-test/suite/binlog/t/binlog_xa_recover.opt index 3c44f9fad10..3c44f9fad10 100644 --- a/mysql-test/suite/binlog/t/binlog_xa_recover-master.opt +++ b/mysql-test/suite/binlog/t/binlog_xa_recover.opt diff --git a/mysql-test/suite/binlog/t/binlog_xa_recover.test b/mysql-test/suite/binlog/t/binlog_xa_recover.test index 411394d4bef..3b2a7e45392 100644 --- a/mysql-test/suite/binlog/t/binlog_xa_recover.test +++ b/mysql-test/suite/binlog/t/binlog_xa_recover.test @@ -1 +1,277 @@ ---source include/binlog_xa_recover.inc +# +# This include file is used by more than one test suite +# (currently binlog and binlog_encryption). +# Please check all dependent tests after modifying it +# + +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/have_binlog_format_row.inc +--source include/have_perfschema.inc +# Valgrind does not work well with test that crashes the server +--source include/not_valgrind.inc + +# (We do not need to restore these settings, as we crash the server). +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; + +CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; +# Insert some data to force a couple binlog rotations (3), so we get some +# normal binlog checkpoints before starting the test. +INSERT INTO t1 VALUES (100, REPEAT("x", 4100)); +# Wait for the master-bin.000002 binlog checkpoint to appear. +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000002" +--let $field= Info +--let $condition= = "master-bin.000002" +--source include/wait_show_condition.inc +INSERT INTO t1 VALUES (101, REPEAT("x", 4100)); +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003" +--let $field= Info +--let $condition= = "master-bin.000003" +--source include/wait_show_condition.inc +INSERT INTO t1 VALUES (102, REPEAT("x", 4100)); +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004" +--let $field= Info +--let $condition= = "master-bin.000004" +--source include/wait_show_condition.inc + +# Now start a bunch of transactions that span multiple binlog +# files. Leave then in the state prepared-but-not-committed in the engine +# and crash the server. Check that crash recovery is able to recover all +# of them. +# +# We use debug_sync to get all the transactions into the prepared state before +# we commit any of them. This is because the prepare step flushes the InnoDB +# redo log - including any commits made before, so recovery would become +# unnecessary, decreasing the value of this test. +# +# We arrange to have con1 with a prepared transaction in master-bin.000004, +# con2 and con3 with a prepared transaction in master-bin.000005, and a new +# empty master-bin.000006. So the latest binlog checkpoint should be +# master-bin.000006. + +connect(con1,localhost,root,,); +# First wait after prepare and before write to binlog. +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont"; +# Then complete InnoDB commit in memory (but not commit checkpoint / write to +# disk), and hang until crash, leaving a transaction to be XA recovered. +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever"; +send INSERT INTO t1 VALUES (1, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con1_wait"; + +connect(con2,localhost,root,,); +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever"; +send INSERT INTO t1 VALUES (2, NULL); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con2_wait"; + +connect(con3,localhost,root,,); +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever"; +send INSERT INTO t1 VALUES (3, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con3_wait"; + +connect(con4,localhost,root,,); +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont"; +SET SESSION debug_dbug="+d,crash_commit_after_log"; +send INSERT INTO t1 VALUES (4, NULL); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con4_wait"; + +SET DEBUG_SYNC= "now SIGNAL con1_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; +SET DEBUG_SYNC= "now SIGNAL con2_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con2_ready"; +SET DEBUG_SYNC= "now SIGNAL con3_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con3_ready"; + +# Check that everything is committed in binary log. +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000003 +--let $binlog_start= 4 +--source include/show_binlog_events.inc +--let $binlog_file= master-bin.000004 +--source include/show_binlog_events.inc +--let $binlog_file= master-bin.000005 +--source include/show_binlog_events.inc +--let $binlog_file= master-bin.000006 +--source include/show_binlog_events.inc + + +# Check that server will not purge too much. +PURGE BINARY LOGS TO "master-bin.000006"; +--source include/show_binary_logs.inc + +# Now crash the server with one more transaction in prepared state. +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait-binlog_xa_recover.test +EOF +--error 0,2006,2013 +SET DEBUG_SYNC= "now SIGNAL con4_cont"; +connection con4; +--error 2006,2013 +reap; + +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart-group_commit_binlog_pos.test +EOF + +connection default; +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Check that all transactions are recovered. +SELECT a FROM t1 ORDER BY a; + +--echo Test that with multiple binlog checkpoints, recovery starts from the last one. +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; + +# Rotate to binlog master-bin.000003 while delaying binlog checkpoints. +# So we get multiple binlog checkpoints in master-bin.000003. +# Then complete the checkpoints, crash, and check that we only scan +# the necessary binlog file (ie. that we use the _last_ checkpoint). + +connect(con10,localhost,root,,); +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont"; +send INSERT INTO t1 VALUES (10, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con10_ready"; + +connect(con11,localhost,root,,); +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont"; +send INSERT INTO t1 VALUES (11, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con11_ready"; + +connect(con12,localhost,root,,); +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont"; +send INSERT INTO t1 VALUES (12, REPEAT("x", 4100)); + +connection default; +SET DEBUG_SYNC= "now WAIT_FOR con12_ready"; +INSERT INTO t1 VALUES (13, NULL); + +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000004 +--let $binlog_start= 4 +--source include/show_binlog_events.inc + +SET DEBUG_SYNC= "now SIGNAL con10_cont"; +connection con10; +reap; +connection default; + +# We need to sync the test case with the background processing of the +# commit checkpoint, otherwise we get nondeterministic results. +let $wait_condition= select count(*) = 1 from performance_schema.threads where processlist_state = "Waiting for background binlog tasks"; +--source include/wait_condition.inc + +SET DEBUG_SYNC= "now SIGNAL con12_cont"; +connection con12; +reap; +connection default; + +SET DEBUG_SYNC= "now SIGNAL con11_cont"; +connection con11; +reap; + +connection default; +# Wait for the last (master-bin.000004) binlog checkpoint to appear. +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004" +--let $field= Info +--let $condition= = "master-bin.000004" +--source include/wait_show_condition.inc + +--echo Now crash the server +# It is not too easy to test XA recovery, as it runs early during server +# startup, before any connections can be made. +# What we do is set a DBUG error insert which will crash if XA recovery +# starts from any other binlog than master-bin.000004 (check the file +# binlog_xa_recover-master.opt). Then we will fail here if XA recovery +# would start from the wrong place. +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait-binlog_xa_recover.test +EOF +SET SESSION debug_dbug="+d,crash_commit_after_log"; +--error 2006,2013 +INSERT INTO t1 VALUES (14, NULL); + +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart-group_commit_binlog_pos.test +EOF + +connection default; +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Check that all transactions are recovered. +SELECT a FROM t1 ORDER BY a; + + +--echo *** Check that recovery works if we crashed early during rotate, before +--echo *** binlog checkpoint event could be written. + +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; + +# We need some initial data to reach binlog master-bin.000004. Otherwise +# crash recovery fails due to the error insert used for previous test. +INSERT INTO t1 VALUES (21, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (22, REPEAT("x", 4100)); +# Wait for the master-bin.000003 binlog checkpoint to appear. +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003" +--let $field= Info +--let $condition= = "master-bin.000003" +--source include/wait_show_condition.inc +INSERT INTO t1 VALUES (23, REPEAT("x", 4100)); +# Wait for the last (master-bin.000004) binlog checkpoint to appear. +--let $wait_for_all= 0 +--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004" +--let $field= Info +--let $condition= = "master-bin.000004" +--source include/wait_show_condition.inc + +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait-binlog_xa_recover.test +EOF +SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event"; +--error 2006,2013 +INSERT INTO t1 VALUES (24, REPEAT("x", 4100)); + +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart-group_commit_binlog_pos.test +EOF + +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Check that all transactions are recovered. +SELECT a FROM t1 ORDER BY a; + +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000004 +--let $binlog_start= 4 +--source include/show_binlog_events.inc + +# Cleanup +connection default; +DROP TABLE t1; diff --git a/mysql-test/suite/binlog_encryption/binlog_write_error.result b/mysql-test/suite/binlog_encryption/binlog_write_error.result index 6e8a212035a..2ee68465243 100644 --- a/mysql-test/suite/binlog_encryption/binlog_write_error.result +++ b/mysql-test/suite/binlog_encryption/binlog_write_error.result @@ -1,15 +1,4 @@ # -# Initialization -# -DROP TABLE IF EXISTS t1, t2; -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p2; -DROP TRIGGER IF EXISTS tr1; -DROP TRIGGER IF EXISTS tr2; -DROP VIEW IF EXISTS v1, v2; -# # Test injecting binlog write error when executing queries # set @saved_dbug = @@global.debug_dbug; @@ -111,15 +100,13 @@ ERROR HY000: Error writing file 'master-bin' ((errno: #) set @@global.debug_dbug = @saved_dbug; set @saved_dbug = @@global.debug_dbug; SET GLOBAL debug_dbug='d,injecting_fault_writing'; +SET PASSWORD FOR user1=PASSWORD('foobar'); +SET PASSWORD FOR user1=PASSWORD('foobar'); +ERROR HY000: Error writing file 'master-bin' ((errno: #) +set @@global.debug_dbug = @saved_dbug; +set @saved_dbug = @@global.debug_dbug; +SET GLOBAL debug_dbug='d,injecting_fault_writing'; DROP USER user1; DROP USER user1; ERROR HY000: Error writing file 'master-bin' ((errno: #) set @@global.debug_dbug = @saved_dbug; -# -# Cleanup -# -DROP TABLE IF EXISTS t1, t2; -DROP FUNCTION IF EXISTS f1; -DROP PROCEDURE IF EXISTS p1; -DROP TRIGGER IF EXISTS tr1; -DROP VIEW IF EXISTS v1, v2; diff --git a/mysql-test/suite/binlog_encryption/binlog_write_error.test b/mysql-test/suite/binlog_encryption/binlog_write_error.test index 68e59655eab..8add24da984 100644 --- a/mysql-test/suite/binlog_encryption/binlog_write_error.test +++ b/mysql-test/suite/binlog_encryption/binlog_write_error.test @@ -1 +1 @@ ---source suite/binlog/include/binlog_write_error.inc +--source suite/binlog/t/binlog_write_error.test diff --git a/mysql-test/suite/binlog_encryption/binlog_xa_recover-master.opt b/mysql-test/suite/binlog_encryption/binlog_xa_recover-master.opt deleted file mode 100644 index 3c44f9fad10..00000000000 --- a/mysql-test/suite/binlog_encryption/binlog_xa_recover-master.opt +++ /dev/null @@ -1 +0,0 @@ ---skip-stack-trace --skip-core-file --loose-debug-dbug=+d,xa_recover_expect_master_bin_000004 diff --git a/mysql-test/suite/binlog_encryption/binlog_xa_recover.result b/mysql-test/suite/binlog_encryption/binlog_xa_recover.result index af36fe277a1..3e4ed42cf7c 100644 --- a/mysql-test/suite/binlog_encryption/binlog_xa_recover.result +++ b/mysql-test/suite/binlog_encryption/binlog_xa_recover.result @@ -151,30 +151,12 @@ master-bin.000004 # Xid # # COMMIT /* XID */ SET DEBUG_SYNC= "now SIGNAL con10_cont"; connection con10; connection default; -SET @old_dbug= @@global.DEBUG_DBUG; -SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed"; SET DEBUG_SYNC= "now SIGNAL con12_cont"; connection con12; connection default; -SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed"; -SET GLOBAL debug_dbug= @old_dbug; SET DEBUG_SYNC= "now SIGNAL con11_cont"; connection con11; connection default; -Checking that master-bin.000004 is the last binlog checkpoint -include/show_binlog_events.inc -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -master-bin.000004 # Start_encryption # # -master-bin.000004 # Gtid_list # # [#-#-#] -master-bin.000004 # Binlog_checkpoint # # master-bin.000001 -master-bin.000004 # Gtid # # BEGIN GTID #-#-# -master-bin.000004 # Annotate_rows # # INSERT INTO t1 VALUES (13, NULL) -master-bin.000004 # Table_map # # table_id: # (test.t1) -master-bin.000004 # Write_rows_v1 # # table_id: # flags: STMT_END_F -master-bin.000004 # Xid # # COMMIT /* XID */ -master-bin.000004 # Binlog_checkpoint # # master-bin.000002 -master-bin.000004 # Binlog_checkpoint # # master-bin.000004 Now crash the server SET SESSION debug_dbug="+d,crash_commit_after_log"; INSERT INTO t1 VALUES (14, NULL); diff --git a/mysql-test/suite/binlog_encryption/binlog_xa_recover.test b/mysql-test/suite/binlog_encryption/binlog_xa_recover.test index e603ccc30fe..c03adb6aff2 100644 --- a/mysql-test/suite/binlog_encryption/binlog_xa_recover.test +++ b/mysql-test/suite/binlog_encryption/binlog_xa_recover.test @@ -1 +1 @@ ---source suite/binlog/include/binlog_xa_recover.inc +--source suite/binlog/t/binlog_xa_recover.test diff --git a/mysql-test/suite/binlog_encryption/rpl_semi_sync.result b/mysql-test/suite/binlog_encryption/rpl_semi_sync.result index 106efb555d3..d18bd1efda7 100644 --- a/mysql-test/suite/binlog_encryption/rpl_semi_sync.result +++ b/mysql-test/suite/binlog_encryption/rpl_semi_sync.result @@ -164,20 +164,15 @@ connection slave; connection slave; include/stop_slave.inc connection master; +include/kill_binlog_dump_threads.inc set global rpl_semi_sync_master_timeout= 5000; [ master status should be ON ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 0 show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 14 -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 [ semi-sync replication of these transactions will fail ] insert into t1 values (500); [ master status should be OFF ] @@ -235,9 +230,6 @@ max(a) 500 connection master; [ master status should be ON again after slave catches up ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 12 @@ -304,8 +296,6 @@ connection master; create table t1 (a int) engine = ENGINE_TYPE; drop table t1; connection slave; -show status like 'Rpl_relay%'; -Variable_name Value [ test reset master ] connection master; reset master; @@ -321,7 +311,7 @@ Rpl_semi_sync_master_yes_tx 0 connection slave; include/stop_slave.inc reset slave; -connection master; +include/kill_binlog_dump_threads.inc connection slave; include/start_slave.inc connection master; @@ -353,6 +343,7 @@ include/stop_slave.inc reset slave; connection master; reset master; +include/kill_binlog_dump_threads.inc set sql_log_bin=0; grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password'; flush privileges; @@ -403,10 +394,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status OFF connection master; +include/kill_binlog_dump_threads.inc [ Semi-sync status on master should be ON ] -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 show status like 'Rpl_semi_sync_master_status'; Variable_name Value Rpl_semi_sync_master_status ON diff --git a/mysql-test/suite/compat/oracle/r/table_value_constr.result b/mysql-test/suite/compat/oracle/r/table_value_constr.result index 4383845cd87..cb198764538 100644 --- a/mysql-test/suite/compat/oracle/r/table_value_constr.result +++ b/mysql-test/suite/compat/oracle/r/table_value_constr.result @@ -746,7 +746,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00 2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" semi join ((values (1)) "tvc_0") where 1 +Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" semi join ((values (1)) "tvc_0") where 1 explain extended select * from t1 where a in (select * from (values (1)) as tvc_0); id select_type table type possible_keys key key_len ref rows filtered Extra @@ -981,7 +981,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00 2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" semi join ((values (1),(2)) "tvc_0") where 1 +Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" semi join ((values (1),(2)) "tvc_0") where 1 explain extended select * from t1 where a = any (select * from (values (1),(2)) as tvc_0); id select_type table type possible_keys key key_len ref rows filtered Extra diff --git a/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result b/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result index ff42e975b8d..8eac34ab399 100644 --- a/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result +++ b/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result @@ -8,6 +8,8 @@ SET GLOBAL innodb_encrypt_tables = ON; SET GLOBAL innodb_encryption_threads = 4; call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_(crc32|none|innodb)\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"(innodb|none|crc32)\""); SET GLOBAL innodb_checksum_algorithm = innodb; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. SET GLOBAL innodb_default_encryption_key_id=4; SET GLOBAL innodb_checksum_algorithm=crc32; create table tce_crc32(a serial, b blob, index(b(10))) engine=innodb @@ -90,6 +92,8 @@ update tpe_crc32 set b=substr(b,1); ALTER TABLE tp_crc32 IMPORT TABLESPACE; update tp_crc32 set b=substr(b,1); SET GLOBAL innodb_checksum_algorithm=innodb; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. ALTER TABLE tce_crc32 DISCARD TABLESPACE; ALTER TABLE tc_crc32 DISCARD TABLESPACE; ALTER TABLE te_crc32 DISCARD TABLESPACE; @@ -115,6 +119,8 @@ update tpe_crc32 set b=substr(b,1); ALTER TABLE tp_crc32 IMPORT TABLESPACE; update tp_crc32 set b=substr(b,1); SET GLOBAL innodb_checksum_algorithm=none; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. ALTER TABLE tce_crc32 DISCARD TABLESPACE; ALTER TABLE tc_crc32 DISCARD TABLESPACE; ALTER TABLE te_crc32 DISCARD TABLESPACE; @@ -151,6 +157,8 @@ test.tp_crc32 check status OK DROP TABLE tce_crc32, tc_crc32, te_crc32, t_crc32, tpe_crc32, tp_crc32; SET GLOBAL innodb_checksum_algorithm=innodb; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. create table tce_innodb(a serial, b blob, index(b(10))) engine=innodb ROW_FORMAT=COMPRESSED encrypted=yes; create table tc_innodb(a serial, b blob, index(b(10))) engine=innodb @@ -231,6 +239,8 @@ update tpe_innodb set b=substr(b,1); ALTER TABLE tp_innodb IMPORT TABLESPACE; update tp_innodb set b=substr(b,1); SET GLOBAL innodb_checksum_algorithm=innodb; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. ALTER TABLE tce_innodb DISCARD TABLESPACE; ALTER TABLE tc_innodb DISCARD TABLESPACE; ALTER TABLE te_innodb DISCARD TABLESPACE; @@ -256,6 +266,8 @@ update tpe_innodb set b=substr(b,1); ALTER TABLE tp_innodb IMPORT TABLESPACE; update tp_innodb set b=substr(b,1); SET GLOBAL innodb_checksum_algorithm=none; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. ALTER TABLE tce_innodb DISCARD TABLESPACE; ALTER TABLE tc_innodb DISCARD TABLESPACE; ALTER TABLE te_innodb DISCARD TABLESPACE; @@ -292,6 +304,8 @@ test.tp_innodb check status OK DROP TABLE tce_innodb, tc_innodb, te_innodb, t_innodb, tpe_innodb, tp_innodb; SET GLOBAL innodb_checksum_algorithm=none; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. create table tce_none(a serial, b blob, index(b(10))) engine=innodb ROW_FORMAT=COMPRESSED encrypted=yes; create table tc_none(a serial, b blob, index(b(10))) engine=innodb @@ -372,6 +386,8 @@ update tpe_none set b=substr(b,1); ALTER TABLE tp_none IMPORT TABLESPACE; update tp_none set b=substr(b,1); SET GLOBAL innodb_checksum_algorithm=innodb; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. ALTER TABLE tce_none DISCARD TABLESPACE; ALTER TABLE tc_none DISCARD TABLESPACE; ALTER TABLE te_none DISCARD TABLESPACE; @@ -397,6 +413,8 @@ update tpe_none set b=substr(b,1); ALTER TABLE tp_none IMPORT TABLESPACE; update tp_none set b=substr(b,1); SET GLOBAL innodb_checksum_algorithm=none; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. ALTER TABLE tce_none DISCARD TABLESPACE; ALTER TABLE tc_none DISCARD TABLESPACE; ALTER TABLE te_none DISCARD TABLESPACE; diff --git a/mysql-test/suite/encryption/r/innodb_encrypt_freed.result b/mysql-test/suite/encryption/r/innodb_encrypt_freed.result new file mode 100644 index 00000000000..c0d8b770403 --- /dev/null +++ b/mysql-test/suite/encryption/r/innodb_encrypt_freed.result @@ -0,0 +1,100 @@ +SHOW VARIABLES LIKE 'innodb_encrypt%'; +Variable_name Value +innodb_encrypt_log ON +innodb_encrypt_tables ON +innodb_encrypt_temporary_tables OFF +innodb_encryption_rotate_key_age 1 +innodb_encryption_rotation_iops 100 +innodb_encryption_threads 1 +SET GLOBAL innodb_encrypt_tables = ON; +CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null, +f3 int not null, index(f1), index idx_1(f2), +index(f2, f3)) ENGINE=InnoDB; +# Wait max 10 min for key encryption threads to encrypt all spaces +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +NAME +innodb_system +mysql/innodb_index_stats +mysql/innodb_table_stats +mysql/transaction_registry +test/t1 +CREATE TABLE t2 (f1 int not null)engine=innodb; +# restart: --debug=d,ib_log_checkpoint_avoid +SET GLOBAL innodb_log_checkpoint_now=TRUE; +connect con1,localhost,root,,,; +begin; +insert into t2 values(1); +connection default; +set global innodb_encrypt_tables = OFF; +# Wait max 10 min for key encryption threads to decrypt all spaces +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; +NAME +innodb_system +mysql/innodb_index_stats +mysql/innodb_table_stats +mysql/transaction_registry +test/t1 +test/t2 +alter table t1 drop index idx_1; +set global innodb_encrypt_tables = ON; +# Wait max 10 min for key encryption threads to encrypt all spaces +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +NAME +innodb_system +mysql/innodb_index_stats +mysql/innodb_table_stats +mysql/transaction_registry +test/t1 +test/t2 +disconnect con1; +# restart: --debug=d,ib_log_checkpoint_avoid +SET GLOBAL innodb_log_checkpoint_now=TRUE; +drop table t1, t2; +CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null, +f3 int not null, index(f1), index idx_1(f2), +index(f2, f3)) ENGINE=InnoDB; +# Wait max 10 min for key encryption threads to encrypt all spaces +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +NAME +innodb_system +mysql/innodb_index_stats +mysql/innodb_table_stats +mysql/transaction_registry +test/t1 +CREATE TABLE t2 (f1 int not null)engine=innodb; +# restart: --debug=d,ib_log_checkpoint_avoid +SET GLOBAL innodb_log_checkpoint_now=TRUE; +connect con1,localhost,root,,,; +begin; +insert into t2 values(1); +connection default; +set global innodb_encrypt_tables = OFF; +# Wait max 10 min for key encryption threads to decrypt all spaces +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; +NAME +innodb_system +mysql/innodb_index_stats +mysql/innodb_table_stats +mysql/transaction_registry +test/t1 +test/t2 +alter table t1 drop index idx_1; +disconnect con1; +# restart: --debug=d,ib_log_checkpoint_avoid +SET GLOBAL innodb_log_checkpoint_now=TRUE; +connect con1,localhost,root,,,; +begin; +insert into t2 values(1); +connection default; +set global innodb_encrypt_tables = ON; +# Wait max 10 min for key encryption threads to encrypt all spaces +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +NAME +innodb_system +mysql/innodb_index_stats +mysql/innodb_table_stats +mysql/transaction_registry +test/t1 +test/t2 +disconnect con1; +drop table t2, t1; diff --git a/mysql-test/suite/encryption/r/tempfiles_encrypted.result b/mysql-test/suite/encryption/r/tempfiles_encrypted.result index 14c754a76bc..43dcbbc2d70 100644 --- a/mysql-test/suite/encryption/r/tempfiles_encrypted.result +++ b/mysql-test/suite/encryption/r/tempfiles_encrypted.result @@ -3872,6 +3872,32 @@ NULL DROP VIEW v1; DROP TABLE t1,t2; # +# MDEV-25032 Window functions without column references get removed from ORDER BY +# +create table t1 (id int, score double); +insert into t1 values +(1, 5), +(1, 6), +(1, 6), +(1, 6), +(1, 7), +(1, 8.1), +(1, 9), +(1, 10); +select id, row_number() over () rn +from t1 +order by rn desc; +id rn +1 8 +1 7 +1 6 +1 5 +1 4 +1 3 +1 2 +1 1 +drop table t1; +# # End of 10.2 tests # # diff --git a/mysql-test/suite/encryption/t/innodb-discard-import-change.combinations b/mysql-test/suite/encryption/t/innodb-discard-import-change.combinations new file mode 100644 index 00000000000..729380593f3 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-discard-import-change.combinations @@ -0,0 +1,5 @@ +[strict_crc32] +--innodb-checksum-algorithm=strict_crc32 + +[strict_full_crc32] +--innodb-checksum-algorithm=strict_full_crc32 diff --git a/mysql-test/suite/encryption/t/innodb-discard-import.combinations b/mysql-test/suite/encryption/t/innodb-discard-import.combinations new file mode 100644 index 00000000000..729380593f3 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-discard-import.combinations @@ -0,0 +1,5 @@ +[strict_crc32] +--innodb-checksum-algorithm=strict_crc32 + +[strict_full_crc32] +--innodb-checksum-algorithm=strict_full_crc32 diff --git a/mysql-test/suite/encryption/t/innodb_encrypt_freed.opt b/mysql-test/suite/encryption/t/innodb_encrypt_freed.opt new file mode 100644 index 00000000000..f6f932c680d --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb_encrypt_freed.opt @@ -0,0 +1,5 @@ +--innodb-encrypt-tables +--innodb-encrypt-log +--innodb-encryption-threads=1 +--innodb-tablespaces-encryption +--innodb-log-optimize-ddl=OFF diff --git a/mysql-test/suite/encryption/t/innodb_encrypt_freed.test b/mysql-test/suite/encryption/t/innodb_encrypt_freed.test new file mode 100644 index 00000000000..951fc93eef5 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb_encrypt_freed.test @@ -0,0 +1,121 @@ +--source include/have_innodb.inc +--source include/have_example_key_management_plugin.inc +--source include/have_debug.inc +--source include/not_embedded.inc + +SHOW VARIABLES LIKE 'innodb_encrypt%'; + +SET GLOBAL innodb_encrypt_tables = ON; + +CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null, + f3 int not null, index(f1), index idx_1(f2), + index(f2, f3)) ENGINE=InnoDB; +--let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` + +--echo # Wait max 10 min for key encryption threads to encrypt all spaces +--let $wait_timeout= 600 +--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +--source include/wait_condition.inc +--sorted_result +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + +CREATE TABLE t2 (f1 int not null)engine=innodb; +let $restart_parameters="--debug=d,ib_log_checkpoint_avoid"; +--source include/restart_mysqld.inc +SET GLOBAL innodb_log_checkpoint_now=TRUE; + +# Stop the purge +connect(con1,localhost,root,,,); +begin; +insert into t2 values(1); + +connection default; + +--let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` +set global innodb_encrypt_tables = OFF; + +--echo # Wait max 10 min for key encryption threads to decrypt all spaces +--let $wait_timeout= 600 +--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; +--source include/wait_condition.inc +--sorted_result +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; + +# Free the index `idx_1` +alter table t1 drop index idx_1; + +set global innodb_encrypt_tables = ON; + +--echo # Wait max 10 min for key encryption threads to encrypt all spaces +--let $wait_timeout= 600 +--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +--source include/wait_condition.inc +--sorted_result +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + +disconnect con1; +let $shutdown_timeout=0; +--source include/restart_mysqld.inc +SET GLOBAL innodb_log_checkpoint_now=TRUE; + +drop table t1, t2; + +# +# +CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null, + f3 int not null, index(f1), index idx_1(f2), + index(f2, f3)) ENGINE=InnoDB; +--let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` + +--echo # Wait max 10 min for key encryption threads to encrypt all spaces +--let $wait_timeout= 600 +--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +--source include/wait_condition.inc +--sorted_result +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + +CREATE TABLE t2 (f1 int not null)engine=innodb; +--source include/restart_mysqld.inc +SET GLOBAL innodb_log_checkpoint_now=TRUE; + +# Stop the purge +connect(con1,localhost,root,,,); +begin; +insert into t2 values(1); + +connection default; + +--let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` +set global innodb_encrypt_tables = OFF; + +--echo # Wait max 10 min for key encryption threads to decrypt all spaces +--let $wait_timeout= 600 +--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; +--source include/wait_condition.inc +--sorted_result +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; + +# Free the index `idx_1` +alter table t1 drop index idx_1; + +disconnect con1; +--source include/restart_mysqld.inc +SET GLOBAL innodb_log_checkpoint_now=TRUE; + +# Stop the purge +connect(con1,localhost,root,,,); +begin; +insert into t2 values(1); + +connection default; +set global innodb_encrypt_tables = ON; + +--echo # Wait max 10 min for key encryption threads to encrypt all spaces +--let $wait_timeout= 600 +--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +--source include/wait_condition.inc +--sorted_result +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + +disconnect con1; +drop table t2, t1; diff --git a/mysql-test/suite/encryption/t/innodb_encryption.test b/mysql-test/suite/encryption/t/innodb_encryption.test index a1abfb51462..1c8d200458a 100644 --- a/mysql-test/suite/encryption/t/innodb_encryption.test +++ b/mysql-test/suite/encryption/t/innodb_encryption.test @@ -14,7 +14,7 @@ SHOW VARIABLES LIKE 'innodb_encrypt%'; SET GLOBAL innodb_encrypt_tables = ON; ---let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'` +--let $tables_count= `select count(*) + @@global.innodb_undo_tablespaces + 1 from information_schema.tables where engine = 'InnoDB'` --echo # Wait max 10 min for key encryption threads to encrypt all spaces --let $wait_timeout= 600 diff --git a/mysql-test/suite/engines/funcs/disabled.def b/mysql-test/suite/engines/funcs/disabled.def index c43b0c92bc9..e1e2491b4a8 100644 --- a/mysql-test/suite/engines/funcs/disabled.def +++ b/mysql-test/suite/engines/funcs/disabled.def @@ -1,97 +1,4 @@ # List of disabled tests # test name : comment -rpl_redirect : Fails due to bug#49978 -crash_manycolumns_string : Bug#50495 'Row size too large' for plugin, but works for built-in innodb -ix_unique_lob : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value -ix_unique_string_length : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value -rpl_empty_master_crash : Test not applicable in 5.5+ -rpl_REDIRECT : Test not applicable in 5.5+ -rpl_create_database : Result Difference Due To Change In .inc file -rpl_loaddata_m : Result Difference Due To Change In .inc file -rpl_sp_effects : Result Difference Due To Change In .inc file -rpl_variables : Result Difference Due To Change In .inc file -rpl_loaddata_s : Result Difference Due To Change In .inc file -rpl_dual_pos_advance : Result Difference Due To Change In .inc file -rpl000011 : Result Difference Due To Change In .inc file -rpl000013 : Result Difference Due To Change In .inc file -rpl_000015 : Result Difference Due To Change In .inc file -rpl_LD_INFILE : Result Difference Due To Change In .inc file -rpl_alter : Result Difference Due To Change In .inc file -rpl_alter_db : Result Difference Due To Change In .inc file -rpl_alter_db : Result Difference Due To Change In .inc file -rpl_bit : Result Difference Due To Change In .inc file -rpl_bit_npk : Result Difference Due To Change In .inc file -rpl_change_master : Result Difference Due To Change In .inc file -rpl_do_grant : Result Difference Due To Change In .inc file -rpl_drop : Result Difference Due To Change In .inc file -rpl_drop_db : Result Difference Due To Change In .inc file -rpl_flushlog_loop : Result Difference Due To Change In .inc file -rpl_get_lock : Result Difference Due To Change In .inc file -rpl_get_lock : Result Difference Due To Change In .inc file -rpl_insert : Result Difference Due To Change In .inc file -rpl_insert_select : Result Difference Due To Change In .inc file -rpl_loaddata2 : Result Difference Due To Change In .inc file -rpl_loaddatalocal : Result Difference Due To Change In .inc file -rpl_loadfile : Result Difference Due To Change In .inc file -rpl_log_pos : Result Difference Due To Change In .inc file -rpl_many_optimize : Result Difference Due To Change In .inc file -rpl_master_pos_wait : Result Difference Due To Change In .inc file -rpl_misc_functions : Result Difference Due To Change In .inc file -rpl_ps : Result Difference Due To Change In .inc file -rpl_server_id1 : Result Difference Due To Change In .inc file -rpl_session_var : Result Difference Due To Change In .inc file -rpl_sf : Result Difference Due To Change In .inc file -rpl_slave_status : Result Difference Due To Change In .inc file -rpl_sp004 : Result Difference Due To Change In .inc file -rpl_start_stop_slave : Result Difference Due To Change In .inc file -rpl_stm_max_relay_size : Result Difference Due To Change In .inc file -rpl_stm_mystery22 : Result Difference Due To Change In .inc file -rpl_stm_no_op : Result Difference Due To Change In .inc file -rpl_stm_reset_slave : Result Difference Due To Change In .inc file -rpl_temp_table : Result Difference Due To Change In .inc file -rpl_temporary : Result Difference Due To Change In .inc file -rpl_trigger : Result Difference Due To Change In .inc file -rpl_trunc_temp : Result Difference Due To Change In .inc file -rpl_user_variables : Result Difference Due To Change In .inc file -rpl_server_id2 : Result Difference Due To Change In .inc file -rpl000010 : Result Difference Due To Change In .inc file -rpl_init_slave : Result Difference Due To Change In .inc file -rpl_multi_delete2 : Result Difference Due To Change In .inc file -rpl_view : Result Difference Due To Change In .inc file -rpl_ignore_table_update : Result Difference Due To Change In .inc file -rpl_err_ignoredtable : Result Difference Due To Change In .inc file -rpl_multi_update4 : Result Difference Due To Change In .inc file -rpl_multi_delete : Result Difference Due To Change In .inc file -rpl_ignore_grant : Result Difference Due To Change In .inc file -rpl_ignore_revoke : Result Difference Due To Change In .inc file -rpl_free_items : Result Difference Due To Change In .inc file -rpl_replicate_ignore_db : Result Difference Due To Change In .inc file -rpl000017 : Result Difference Due To Change In .inc file -rpl_skip_error : Result Difference Due To Change In .inc file - -rpl_loaddata_s : Test Present in rpl suite as well . Test Fails due to bin log truncation. -rpl_log_pos : Test Present in rpl suite as well . Test Fails due to bin log truncation. -rpl_row_NOW : Result Difference Due To Change In .inc file -rpl_row_USER : Result Difference Due To Change In .inc file -rpl_row_drop : Result Difference Due To Change In .inc file -rpl_row_func001 : Result Difference Due To Change In .inc file -rpl_row_max_relay_size : Result Difference Due To Change In .inc file -rpl_row_reset_slave : Result Difference Due To Change In .inc file -rpl_row_sp001 : Result Difference Due To Change In .inc file -rpl_row_sp005 : Result Difference Due To Change In .inc file -rpl_row_sp008 : Result Difference Due To Change In .inc file -rpl_row_sp009 : Result Difference Due To Change In .inc file -rpl_row_sp010 : Result Difference Due To Change In .inc file -rpl_row_sp011 : Result Difference Due To Change In .inc file -rpl_row_sp012 : Result Difference Due To Change In .inc file -rpl_row_stop_middle : Result Difference Due To Change In .inc file -rpl_row_trig001 : Result Difference Due To Change In .inc file -rpl_row_trig002 : Result Difference Due To Change In .inc file -rpl_row_trig003 : Result Difference Due To Change In .inc file -rpl_row_view01 : Result Difference Due To Change In .inc file -rpl_switch_stm_row_mixed : Result Difference Due To Change In .inc file -rpl_relayspace : Result Difference Due To Change In .inc file -rpl_row_inexist_tbl : Result Difference Due To Change In .inc file -rpl_sp : Result Difference Due To Change In .inc file -rpl_rbr_to_sbr : Result Difference Due To Change In .inc file +crash_manycolumns_string : Bug#50495 'Row size too large' for plugin, but works for built-in innodb [ERROR] InnoDB: Cannot add field `c726` in table `test`.`t1` because after adding it, the row size is 8135 which is greater than maximum allowed size (8126 bytes) for a record on index leaf page diff --git a/mysql-test/suite/engines/funcs/r/crash_manycolumns_string.result b/mysql-test/suite/engines/funcs/r/crash_manycolumns_string.result index 47079e34b38..6a2acb7ec86 100644 --- a/mysql-test/suite/engines/funcs/r/crash_manycolumns_string.result +++ b/mysql-test/suite/engines/funcs/r/crash_manycolumns_string.result @@ -1,5 +1,8 @@ -DROP TABLE IF EXISTS t1; +SET SESSION innodb_strict_mode=off; +call mtr.add_suppression("Row size too large (> 8126)*"); CREATE TABLE t1 (c1 VARCHAR(10),c2 VARCHAR(10),c3 VARCHAR(10),c4 VARCHAR(10),c5 VARCHAR(10),c6 VARCHAR(10),c7 VARCHAR(10),c8 VARCHAR(10),c9 VARCHAR(10),c10 VARCHAR(10),c11 VARCHAR(10),c12 VARCHAR(10),c13 VARCHAR(10),c14 VARCHAR(10),c15 VARCHAR(10),c16 VARCHAR(10),c17 VARCHAR(10),c18 VARCHAR(10),c19 VARCHAR(10),c20 VARCHAR(10),c21 VARCHAR(10),c22 VARCHAR(10),c23 VARCHAR(10),c24 VARCHAR(10),c25 VARCHAR(10),c26 VARCHAR(10),c27 VARCHAR(10),c28 VARCHAR(10),c29 VARCHAR(10),c30 VARCHAR(10),c31 VARCHAR(10),c32 VARCHAR(10),c33 VARCHAR(10),c34 VARCHAR(10),c35 VARCHAR(10),c36 VARCHAR(10),c37 VARCHAR(10),c38 VARCHAR(10),c39 VARCHAR(10),c40 VARCHAR(10),c41 VARCHAR(10),c42 VARCHAR(10),c43 VARCHAR(10),c44 VARCHAR(10),c45 VARCHAR(10),c46 VARCHAR(10),c47 VARCHAR(10),c48 VARCHAR(10),c49 VARCHAR(10),c50 VARCHAR(10),c51 VARCHAR(10),c52 VARCHAR(10),c53 VARCHAR(10),c54 VARCHAR(10),c55 VARCHAR(10),c56 VARCHAR(10),c57 VARCHAR(10),c58 VARCHAR(10),c59 VARCHAR(10),c60 VARCHAR(10),c61 VARCHAR(10),c62 VARCHAR(10),c63 VARCHAR(10),c64 VARCHAR(10),c65 VARCHAR(10),c66 VARCHAR(10),c67 VARCHAR(10),c68 VARCHAR(10),c69 VARCHAR(10),c70 VARCHAR(10),c71 VARCHAR(10),c72 VARCHAR(10),c73 VARCHAR(10),c74 VARCHAR(10),c75 VARCHAR(10),c76 VARCHAR(10),c77 VARCHAR(10),c78 VARCHAR(10),c79 VARCHAR(10),c80 VARCHAR(10),c81 VARCHAR(10),c82 VARCHAR(10),c83 VARCHAR(10),c84 VARCHAR(10),c85 VARCHAR(10),c86 VARCHAR(10),c87 VARCHAR(10),c88 VARCHAR(10),c89 VARCHAR(10),c90 VARCHAR(10),c91 VARCHAR(10),c92 VARCHAR(10),c93 VARCHAR(10),c94 VARCHAR(10),c95 VARCHAR(10),c96 VARCHAR(10),c97 VARCHAR(10),c98 VARCHAR(10),c99 VARCHAR(10),c100 VARCHAR(10),c101 VARCHAR(10),c102 VARCHAR(10),c103 VARCHAR(10),c104 VARCHAR(10),c105 VARCHAR(10),c106 VARCHAR(10),c107 VARCHAR(10),c108 VARCHAR(10),c109 VARCHAR(10),c110 VARCHAR(10),c111 VARCHAR(10),c112 VARCHAR(10),c113 VARCHAR(10),c114 VARCHAR(10),c115 VARCHAR(10),c116 VARCHAR(10),c117 VARCHAR(10),c118 VARCHAR(10),c119 VARCHAR(10),c120 VARCHAR(10),c121 VARCHAR(10),c122 VARCHAR(10),c123 VARCHAR(10),c124 VARCHAR(10),c125 VARCHAR(10),c126 VARCHAR(10),c127 VARCHAR(10),c128 VARCHAR(10),c129 VARCHAR(10),c130 VARCHAR(10),c131 VARCHAR(10),c132 VARCHAR(10),c133 VARCHAR(10),c134 VARCHAR(10),c135 VARCHAR(10),c136 VARCHAR(10),c137 VARCHAR(10),c138 VARCHAR(10),c139 VARCHAR(10),c140 VARCHAR(10),c141 VARCHAR(10),c142 VARCHAR(10),c143 VARCHAR(10),c144 VARCHAR(10),c145 VARCHAR(10),c146 VARCHAR(10),c147 VARCHAR(10),c148 VARCHAR(10),c149 VARCHAR(10),c150 VARCHAR(10),c151 VARCHAR(10),c152 VARCHAR(10),c153 VARCHAR(10),c154 VARCHAR(10),c155 VARCHAR(10),c156 VARCHAR(10),c157 VARCHAR(10),c158 VARCHAR(10),c159 VARCHAR(10),c160 VARCHAR(10),c161 VARCHAR(10),c162 VARCHAR(10),c163 VARCHAR(10),c164 VARCHAR(10),c165 VARCHAR(10),c166 VARCHAR(10),c167 VARCHAR(10),c168 VARCHAR(10),c169 VARCHAR(10),c170 VARCHAR(10),c171 VARCHAR(10),c172 VARCHAR(10),c173 VARCHAR(10),c174 VARCHAR(10),c175 VARCHAR(10),c176 VARCHAR(10),c177 VARCHAR(10),c178 VARCHAR(10),c179 VARCHAR(10),c180 VARCHAR(10),c181 VARCHAR(10),c182 VARCHAR(10),c183 VARCHAR(10),c184 VARCHAR(10),c185 VARCHAR(10),c186 VARCHAR(10),c187 VARCHAR(10),c188 VARCHAR(10),c189 VARCHAR(10),c190 VARCHAR(10),c191 VARCHAR(10),c192 VARCHAR(10),c193 VARCHAR(10),c194 VARCHAR(10),c195 VARCHAR(10),c196 VARCHAR(10),c197 VARCHAR(10),c198 VARCHAR(10),c199 VARCHAR(10),c200 VARCHAR(10),c201 VARCHAR(10),c202 VARCHAR(10),c203 VARCHAR(10),c204 VARCHAR(10),c205 VARCHAR(10),c206 VARCHAR(10),c207 VARCHAR(10),c208 VARCHAR(10),c209 VARCHAR(10),c210 VARCHAR(10),c211 VARCHAR(10),c212 VARCHAR(10),c213 VARCHAR(10),c214 VARCHAR(10),c215 VARCHAR(10),c216 VARCHAR(10),c217 VARCHAR(10),c218 VARCHAR(10),c219 VARCHAR(10),c220 VARCHAR(10),c221 VARCHAR(10),c222 VARCHAR(10),c223 VARCHAR(10),c224 VARCHAR(10),c225 VARCHAR(10),c226 VARCHAR(10),c227 VARCHAR(10),c228 VARCHAR(10),c229 VARCHAR(10),c230 VARCHAR(10),c231 VARCHAR(10),c232 VARCHAR(10),c233 VARCHAR(10),c234 VARCHAR(10),c235 VARCHAR(10),c236 VARCHAR(10),c237 VARCHAR(10),c238 VARCHAR(10),c239 VARCHAR(10),c240 VARCHAR(10),c241 VARCHAR(10),c242 VARCHAR(10),c243 VARCHAR(10),c244 VARCHAR(10),c245 VARCHAR(10),c246 VARCHAR(10),c247 VARCHAR(10),c248 VARCHAR(10),c249 VARCHAR(10),c250 VARCHAR(10),c251 VARCHAR(10),c252 VARCHAR(10),c253 VARCHAR(10),c254 VARCHAR(10),c255 VARCHAR(10),c256 VARCHAR(10),c257 VARCHAR(10),c258 VARCHAR(10),c259 VARCHAR(10),c260 VARCHAR(10),c261 VARCHAR(10),c262 VARCHAR(10),c263 VARCHAR(10),c264 VARCHAR(10),c265 VARCHAR(10),c266 VARCHAR(10),c267 VARCHAR(10),c268 VARCHAR(10),c269 VARCHAR(10),c270 VARCHAR(10),c271 VARCHAR(10),c272 VARCHAR(10),c273 VARCHAR(10),c274 VARCHAR(10),c275 VARCHAR(10),c276 VARCHAR(10),c277 VARCHAR(10),c278 VARCHAR(10),c279 VARCHAR(10),c280 VARCHAR(10),c281 VARCHAR(10),c282 VARCHAR(10),c283 VARCHAR(10),c284 VARCHAR(10),c285 VARCHAR(10),c286 VARCHAR(10),c287 VARCHAR(10),c288 VARCHAR(10),c289 VARCHAR(10),c290 VARCHAR(10),c291 VARCHAR(10),c292 VARCHAR(10),c293 VARCHAR(10),c294 VARCHAR(10),c295 VARCHAR(10),c296 VARCHAR(10),c297 VARCHAR(10),c298 VARCHAR(10),c299 VARCHAR(10),c300 VARCHAR(10),c301 VARCHAR(10),c302 VARCHAR(10),c303 VARCHAR(10),c304 VARCHAR(10),c305 VARCHAR(10),c306 VARCHAR(10),c307 VARCHAR(10),c308 VARCHAR(10),c309 VARCHAR(10),c310 VARCHAR(10),c311 VARCHAR(10),c312 VARCHAR(10),c313 VARCHAR(10),c314 VARCHAR(10),c315 VARCHAR(10),c316 VARCHAR(10),c317 VARCHAR(10),c318 VARCHAR(10),c319 VARCHAR(10),c320 VARCHAR(10),c321 VARCHAR(10),c322 VARCHAR(10),c323 VARCHAR(10),c324 VARCHAR(10),c325 VARCHAR(10),c326 VARCHAR(10),c327 VARCHAR(10),c328 VARCHAR(10),c329 VARCHAR(10),c330 VARCHAR(10),c331 VARCHAR(10),c332 VARCHAR(10),c333 VARCHAR(10),c334 VARCHAR(10),c335 VARCHAR(10),c336 VARCHAR(10),c337 VARCHAR(10),c338 VARCHAR(10),c339 VARCHAR(10),c340 VARCHAR(10),c341 VARCHAR(10),c342 VARCHAR(10),c343 VARCHAR(10),c344 VARCHAR(10),c345 VARCHAR(10),c346 VARCHAR(10),c347 VARCHAR(10),c348 VARCHAR(10),c349 VARCHAR(10),c350 VARCHAR(10),c351 VARCHAR(10),c352 VARCHAR(10),c353 VARCHAR(10),c354 VARCHAR(10),c355 VARCHAR(10),c356 VARCHAR(10),c357 VARCHAR(10),c358 VARCHAR(10),c359 VARCHAR(10),c360 VARCHAR(10),c361 VARCHAR(10),c362 VARCHAR(10),c363 VARCHAR(10),c364 VARCHAR(10),c365 VARCHAR(10),c366 VARCHAR(10),c367 VARCHAR(10),c368 VARCHAR(10),c369 VARCHAR(10),c370 VARCHAR(10),c371 VARCHAR(10),c372 VARCHAR(10),c373 VARCHAR(10),c374 VARCHAR(10),c375 VARCHAR(10),c376 VARCHAR(10),c377 VARCHAR(10),c378 VARCHAR(10),c379 VARCHAR(10),c380 VARCHAR(10),c381 VARCHAR(10),c382 VARCHAR(10),c383 VARCHAR(10),c384 VARCHAR(10),c385 VARCHAR(10),c386 VARCHAR(10),c387 VARCHAR(10),c388 VARCHAR(10),c389 VARCHAR(10),c390 VARCHAR(10),c391 VARCHAR(10),c392 VARCHAR(10),c393 VARCHAR(10),c394 VARCHAR(10),c395 VARCHAR(10),c396 VARCHAR(10),c397 VARCHAR(10),c398 VARCHAR(10),c399 VARCHAR(10),c400 VARCHAR(10),c401 VARCHAR(10),c402 VARCHAR(10),c403 VARCHAR(10),c404 VARCHAR(10),c405 VARCHAR(10),c406 VARCHAR(10),c407 VARCHAR(10),c408 VARCHAR(10),c409 VARCHAR(10),c410 VARCHAR(10),c411 VARCHAR(10),c412 VARCHAR(10),c413 VARCHAR(10),c414 VARCHAR(10),c415 VARCHAR(10),c416 VARCHAR(10),c417 VARCHAR(10),c418 VARCHAR(10),c419 VARCHAR(10),c420 VARCHAR(10),c421 VARCHAR(10),c422 VARCHAR(10),c423 VARCHAR(10),c424 VARCHAR(10),c425 VARCHAR(10),c426 VARCHAR(10),c427 VARCHAR(10),c428 VARCHAR(10),c429 VARCHAR(10),c430 VARCHAR(10),c431 VARCHAR(10),c432 VARCHAR(10),c433 VARCHAR(10),c434 VARCHAR(10),c435 VARCHAR(10),c436 VARCHAR(10),c437 VARCHAR(10),c438 VARCHAR(10),c439 VARCHAR(10),c440 VARCHAR(10),c441 VARCHAR(10),c442 VARCHAR(10),c443 VARCHAR(10),c444 VARCHAR(10),c445 VARCHAR(10),c446 VARCHAR(10),c447 VARCHAR(10),c448 VARCHAR(10),c449 VARCHAR(10),c450 VARCHAR(10),c451 VARCHAR(10),c452 VARCHAR(10),c453 VARCHAR(10),c454 VARCHAR(10),c455 VARCHAR(10),c456 VARCHAR(10),c457 VARCHAR(10),c458 VARCHAR(10),c459 VARCHAR(10),c460 VARCHAR(10),c461 VARCHAR(10),c462 VARCHAR(10),c463 VARCHAR(10),c464 VARCHAR(10),c465 VARCHAR(10),c466 VARCHAR(10),c467 VARCHAR(10),c468 VARCHAR(10),c469 VARCHAR(10),c470 VARCHAR(10),c471 VARCHAR(10),c472 VARCHAR(10),c473 VARCHAR(10),c474 VARCHAR(10),c475 VARCHAR(10),c476 VARCHAR(10),c477 VARCHAR(10),c478 VARCHAR(10),c479 VARCHAR(10),c480 VARCHAR(10),c481 VARCHAR(10),c482 VARCHAR(10),c483 VARCHAR(10),c484 VARCHAR(10),c485 VARCHAR(10),c486 VARCHAR(10),c487 VARCHAR(10),c488 VARCHAR(10),c489 VARCHAR(10),c490 VARCHAR(10),c491 VARCHAR(10),c492 VARCHAR(10),c493 VARCHAR(10),c494 VARCHAR(10),c495 VARCHAR(10),c496 VARCHAR(10),c497 VARCHAR(10),c498 VARCHAR(10),c499 VARCHAR(10),c500 VARCHAR(10),c501 VARCHAR(10),c502 VARCHAR(10),c503 VARCHAR(10),c504 VARCHAR(10),c505 VARCHAR(10),c506 VARCHAR(10),c507 VARCHAR(10),c508 VARCHAR(10),c509 VARCHAR(10),c510 VARCHAR(10),c511 VARCHAR(10),c512 VARCHAR(10),c513 VARCHAR(10),c514 VARCHAR(10),c515 VARCHAR(10),c516 VARCHAR(10),c517 VARCHAR(10),c518 VARCHAR(10),c519 VARCHAR(10),c520 VARCHAR(10),c521 VARCHAR(10),c522 VARCHAR(10),c523 VARCHAR(10),c524 VARCHAR(10),c525 VARCHAR(10),c526 VARCHAR(10),c527 VARCHAR(10),c528 VARCHAR(10),c529 VARCHAR(10),c530 VARCHAR(10),c531 VARCHAR(10),c532 VARCHAR(10),c533 VARCHAR(10),c534 VARCHAR(10),c535 VARCHAR(10),c536 VARCHAR(10),c537 VARCHAR(10),c538 VARCHAR(10),c539 VARCHAR(10),c540 VARCHAR(10),c541 VARCHAR(10),c542 VARCHAR(10),c543 VARCHAR(10),c544 VARCHAR(10),c545 VARCHAR(10),c546 VARCHAR(10),c547 VARCHAR(10),c548 VARCHAR(10),c549 VARCHAR(10),c550 VARCHAR(10),c551 VARCHAR(10),c552 VARCHAR(10),c553 VARCHAR(10),c554 VARCHAR(10),c555 VARCHAR(10),c556 VARCHAR(10),c557 VARCHAR(10),c558 VARCHAR(10),c559 VARCHAR(10),c560 VARCHAR(10),c561 VARCHAR(10),c562 VARCHAR(10),c563 VARCHAR(10),c564 VARCHAR(10),c565 VARCHAR(10),c566 VARCHAR(10),c567 VARCHAR(10),c568 VARCHAR(10),c569 VARCHAR(10),c570 VARCHAR(10),c571 VARCHAR(10),c572 VARCHAR(10),c573 VARCHAR(10),c574 VARCHAR(10),c575 VARCHAR(10),c576 VARCHAR(10),c577 VARCHAR(10),c578 VARCHAR(10),c579 VARCHAR(10),c580 VARCHAR(10),c581 VARCHAR(10),c582 VARCHAR(10),c583 VARCHAR(10),c584 VARCHAR(10),c585 VARCHAR(10),c586 VARCHAR(10),c587 VARCHAR(10),c588 VARCHAR(10),c589 VARCHAR(10),c590 VARCHAR(10),c591 VARCHAR(10),c592 VARCHAR(10),c593 VARCHAR(10),c594 VARCHAR(10),c595 VARCHAR(10),c596 VARCHAR(10),c597 VARCHAR(10),c598 VARCHAR(10),c599 VARCHAR(10),c600 VARCHAR(10),c601 VARCHAR(10),c602 VARCHAR(10),c603 VARCHAR(10),c604 VARCHAR(10),c605 VARCHAR(10),c606 VARCHAR(10),c607 VARCHAR(10),c608 VARCHAR(10),c609 VARCHAR(10),c610 VARCHAR(10),c611 VARCHAR(10),c612 VARCHAR(10),c613 VARCHAR(10),c614 VARCHAR(10),c615 VARCHAR(10),c616 VARCHAR(10),c617 VARCHAR(10),c618 VARCHAR(10),c619 VARCHAR(10),c620 VARCHAR(10),c621 VARCHAR(10),c622 VARCHAR(10),c623 VARCHAR(10),c624 VARCHAR(10),c625 VARCHAR(10),c626 VARCHAR(10),c627 VARCHAR(10),c628 VARCHAR(10),c629 VARCHAR(10),c630 VARCHAR(10),c631 VARCHAR(10),c632 VARCHAR(10),c633 VARCHAR(10),c634 VARCHAR(10),c635 VARCHAR(10),c636 VARCHAR(10),c637 VARCHAR(10),c638 VARCHAR(10),c639 VARCHAR(10),c640 VARCHAR(10),c641 VARCHAR(10),c642 VARCHAR(10),c643 VARCHAR(10),c644 VARCHAR(10),c645 VARCHAR(10),c646 VARCHAR(10),c647 VARCHAR(10),c648 VARCHAR(10),c649 VARCHAR(10),c650 VARCHAR(10),c651 VARCHAR(10),c652 VARCHAR(10),c653 VARCHAR(10),c654 VARCHAR(10),c655 VARCHAR(10),c656 VARCHAR(10),c657 VARCHAR(10),c658 VARCHAR(10),c659 VARCHAR(10),c660 VARCHAR(10),c661 VARCHAR(10),c662 VARCHAR(10),c663 VARCHAR(10),c664 VARCHAR(10),c665 VARCHAR(10),c666 VARCHAR(10),c667 VARCHAR(10),c668 VARCHAR(10),c669 VARCHAR(10),c670 VARCHAR(10),c671 VARCHAR(10),c672 VARCHAR(10),c673 VARCHAR(10),c674 VARCHAR(10),c675 VARCHAR(10),c676 VARCHAR(10),c677 VARCHAR(10),c678 VARCHAR(10),c679 VARCHAR(10),c680 VARCHAR(10),c681 VARCHAR(10),c682 VARCHAR(10),c683 VARCHAR(10),c684 VARCHAR(10),c685 VARCHAR(10),c686 VARCHAR(10),c687 VARCHAR(10),c688 VARCHAR(10),c689 VARCHAR(10),c690 VARCHAR(10),c691 VARCHAR(10),c692 VARCHAR(10),c693 VARCHAR(10),c694 VARCHAR(10),c695 VARCHAR(10),c696 VARCHAR(10),c697 VARCHAR(10),c698 VARCHAR(10),c699 VARCHAR(10),c700 VARCHAR(10),c701 VARCHAR(10),c702 VARCHAR(10),c703 VARCHAR(10),c704 VARCHAR(10),c705 VARCHAR(10),c706 VARCHAR(10),c707 VARCHAR(10),c708 VARCHAR(10),c709 VARCHAR(10),c710 VARCHAR(10),c711 VARCHAR(10),c712 VARCHAR(10),c713 VARCHAR(10),c714 VARCHAR(10),c715 VARCHAR(10),c716 VARCHAR(10),c717 VARCHAR(10),c718 VARCHAR(10),c719 VARCHAR(10),c720 VARCHAR(10),c721 VARCHAR(10),c722 VARCHAR(10),c723 VARCHAR(10),c724 VARCHAR(10),c725 VARCHAR(10),c726 VARCHAR(10),c727 VARCHAR(10),c728 VARCHAR(10),c729 VARCHAR(10),c730 VARCHAR(10),c731 VARCHAR(10),c732 VARCHAR(10),c733 VARCHAR(10),c734 VARCHAR(10),c735 VARCHAR(10),c736 VARCHAR(10),c737 VARCHAR(10),c738 VARCHAR(10),c739 VARCHAR(10),c740 VARCHAR(10),c741 VARCHAR(10),c742 VARCHAR(10),c743 VARCHAR(10),c744 VARCHAR(10),c745 VARCHAR(10),c746 VARCHAR(10),c747 VARCHAR(10),c748 VARCHAR(10),c749 VARCHAR(10),c750 VARCHAR(10),c751 VARCHAR(10),c752 VARCHAR(10),c753 VARCHAR(10),c754 VARCHAR(10),c755 VARCHAR(10),c756 VARCHAR(10),c757 VARCHAR(10),c758 VARCHAR(10),c759 VARCHAR(10),c760 VARCHAR(10),c761 VARCHAR(10),c762 VARCHAR(10),c763 VARCHAR(10),c764 VARCHAR(10),c765 VARCHAR(10),c766 VARCHAR(10),c767 VARCHAR(10),c768 VARCHAR(10),c769 VARCHAR(10),c770 VARCHAR(10),c771 VARCHAR(10),c772 VARCHAR(10),c773 VARCHAR(10),c774 VARCHAR(10),c775 VARCHAR(10),c776 VARCHAR(10),c777 VARCHAR(10),c778 VARCHAR(10),c779 VARCHAR(10),c780 VARCHAR(10),c781 VARCHAR(10),c782 VARCHAR(10),c783 VARCHAR(10),c784 VARCHAR(10),c785 VARCHAR(10),c786 VARCHAR(10),c787 VARCHAR(10),c788 VARCHAR(10),c789 VARCHAR(10),c790 VARCHAR(10),c791 VARCHAR(10),c792 VARCHAR(10),c793 VARCHAR(10),c794 VARCHAR(10),c795 VARCHAR(10),c796 VARCHAR(10),c797 VARCHAR(10),c798 VARCHAR(10),c799 VARCHAR(10),c800 VARCHAR(10),c801 VARCHAR(10),c802 VARCHAR(10),c803 VARCHAR(10),c804 VARCHAR(10),c805 VARCHAR(10),c806 VARCHAR(10),c807 VARCHAR(10),c808 VARCHAR(10),c809 VARCHAR(10),c810 VARCHAR(10),c811 VARCHAR(10),c812 VARCHAR(10),c813 VARCHAR(10),c814 VARCHAR(10),c815 VARCHAR(10),c816 VARCHAR(10),c817 VARCHAR(10),c818 VARCHAR(10),c819 VARCHAR(10),c820 VARCHAR(10),c821 VARCHAR(10),c822 VARCHAR(10),c823 VARCHAR(10),c824 VARCHAR(10),c825 VARCHAR(10),c826 VARCHAR(10),c827 VARCHAR(10),c828 VARCHAR(10),c829 VARCHAR(10),c830 VARCHAR(10),c831 VARCHAR(10),c832 VARCHAR(10),c833 VARCHAR(10),c834 VARCHAR(10),c835 VARCHAR(10),c836 VARCHAR(10),c837 VARCHAR(10),c838 VARCHAR(10),c839 VARCHAR(10),c840 VARCHAR(10),c841 VARCHAR(10),c842 VARCHAR(10),c843 VARCHAR(10),c844 VARCHAR(10),c845 VARCHAR(10),c846 VARCHAR(10),c847 VARCHAR(10),c848 VARCHAR(10),c849 VARCHAR(10),c850 VARCHAR(10),c851 VARCHAR(10),c852 VARCHAR(10),c853 VARCHAR(10),c854 VARCHAR(10),c855 VARCHAR(10),c856 VARCHAR(10),c857 VARCHAR(10),c858 VARCHAR(10),c859 VARCHAR(10),c860 VARCHAR(10),c861 VARCHAR(10),c862 VARCHAR(10),c863 VARCHAR(10),c864 VARCHAR(10),c865 VARCHAR(10),c866 VARCHAR(10),c867 VARCHAR(10),c868 VARCHAR(10),c869 VARCHAR(10),c870 VARCHAR(10),c871 VARCHAR(10),c872 VARCHAR(10),c873 VARCHAR(10),c874 VARCHAR(10),c875 VARCHAR(10),c876 VARCHAR(10),c877 VARCHAR(10),c878 VARCHAR(10),c879 VARCHAR(10),c880 VARCHAR(10),c881 VARCHAR(10),c882 VARCHAR(10),c883 VARCHAR(10),c884 VARCHAR(10),c885 VARCHAR(10),c886 VARCHAR(10),c887 VARCHAR(10),c888 VARCHAR(10),c889 VARCHAR(10),c890 VARCHAR(10),c891 VARCHAR(10),c892 VARCHAR(10),c893 VARCHAR(10),c894 VARCHAR(10),c895 VARCHAR(10),c896 VARCHAR(10),c897 VARCHAR(10),c898 VARCHAR(10),c899 VARCHAR(10),c900 VARCHAR(10),c901 VARCHAR(10),c902 VARCHAR(10),c903 VARCHAR(10),c904 VARCHAR(10),c905 VARCHAR(10),c906 VARCHAR(10),c907 VARCHAR(10),c908 VARCHAR(10),c909 VARCHAR(10),c910 VARCHAR(10),c911 VARCHAR(10),c912 VARCHAR(10),c913 VARCHAR(10),c914 VARCHAR(10),c915 VARCHAR(10),c916 VARCHAR(10),c917 VARCHAR(10),c918 VARCHAR(10),c919 VARCHAR(10),c920 VARCHAR(10),c921 VARCHAR(10),c922 VARCHAR(10),c923 VARCHAR(10),c924 VARCHAR(10),c925 VARCHAR(10),c926 VARCHAR(10),c927 VARCHAR(10),c928 VARCHAR(10),c929 VARCHAR(10),c930 VARCHAR(10),c931 VARCHAR(10),c932 VARCHAR(10),c933 VARCHAR(10),c934 VARCHAR(10),c935 VARCHAR(10),c936 VARCHAR(10),c937 VARCHAR(10),c938 VARCHAR(10),c939 VARCHAR(10),c940 VARCHAR(10),c941 VARCHAR(10),c942 VARCHAR(10),c943 VARCHAR(10),c944 VARCHAR(10),c945 VARCHAR(10),c946 VARCHAR(10),c947 VARCHAR(10),c948 VARCHAR(10),c949 VARCHAR(10),c950 VARCHAR(10),c951 VARCHAR(10),c952 VARCHAR(10),c953 VARCHAR(10),c954 VARCHAR(10),c955 VARCHAR(10),c956 VARCHAR(10),c957 VARCHAR(10),c958 VARCHAR(10),c959 VARCHAR(10),c960 VARCHAR(10),c961 VARCHAR(10),c962 VARCHAR(10),c963 VARCHAR(10),c964 VARCHAR(10),c965 VARCHAR(10),c966 VARCHAR(10),c967 VARCHAR(10),c968 VARCHAR(10),c969 VARCHAR(10),c970 VARCHAR(10),c971 VARCHAR(10),c972 VARCHAR(10),c973 VARCHAR(10),c974 VARCHAR(10),c975 VARCHAR(10),c976 VARCHAR(10),c977 VARCHAR(10),c978 VARCHAR(10),c979 VARCHAR(10),c980 VARCHAR(10),c981 VARCHAR(10),c982 VARCHAR(10),c983 VARCHAR(10),c984 VARCHAR(10),c985 VARCHAR(10),c986 VARCHAR(10),c987 VARCHAR(10),c988 VARCHAR(10),c989 VARCHAR(10),c990 VARCHAR(10),c991 VARCHAR(10),c992 VARCHAR(10),c993 VARCHAR(10),c994 VARCHAR(10),c995 VARCHAR(10),c996 VARCHAR(10),c997 VARCHAR(10),c998 VARCHAR(10),c999 VARCHAR(10),c1000 VARCHAR(10) ) ; +Warnings: +Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. INSERT INTO t1(c1) VALUES('abc'); SELECT * FROM t1; c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 c33 c34 c35 c36 c37 c38 c39 c40 c41 c42 c43 c44 c45 c46 c47 c48 c49 c50 c51 c52 c53 c54 c55 c56 c57 c58 c59 c60 c61 c62 c63 c64 c65 c66 c67 c68 c69 c70 c71 c72 c73 c74 c75 c76 c77 c78 c79 c80 c81 c82 c83 c84 c85 c86 c87 c88 c89 c90 c91 c92 c93 c94 c95 c96 c97 c98 c99 c100 c101 c102 c103 c104 c105 c106 c107 c108 c109 c110 c111 c112 c113 c114 c115 c116 c117 c118 c119 c120 c121 c122 c123 c124 c125 c126 c127 c128 c129 c130 c131 c132 c133 c134 c135 c136 c137 c138 c139 c140 c141 c142 c143 c144 c145 c146 c147 c148 c149 c150 c151 c152 c153 c154 c155 c156 c157 c158 c159 c160 c161 c162 c163 c164 c165 c166 c167 c168 c169 c170 c171 c172 c173 c174 c175 c176 c177 c178 c179 c180 c181 c182 c183 c184 c185 c186 c187 c188 c189 c190 c191 c192 c193 c194 c195 c196 c197 c198 c199 c200 c201 c202 c203 c204 c205 c206 c207 c208 c209 c210 c211 c212 c213 c214 c215 c216 c217 c218 c219 c220 c221 c222 c223 c224 c225 c226 c227 c228 c229 c230 c231 c232 c233 c234 c235 c236 c237 c238 c239 c240 c241 c242 c243 c244 c245 c246 c247 c248 c249 c250 c251 c252 c253 c254 c255 c256 c257 c258 c259 c260 c261 c262 c263 c264 c265 c266 c267 c268 c269 c270 c271 c272 c273 c274 c275 c276 c277 c278 c279 c280 c281 c282 c283 c284 c285 c286 c287 c288 c289 c290 c291 c292 c293 c294 c295 c296 c297 c298 c299 c300 c301 c302 c303 c304 c305 c306 c307 c308 c309 c310 c311 c312 c313 c314 c315 c316 c317 c318 c319 c320 c321 c322 c323 c324 c325 c326 c327 c328 c329 c330 c331 c332 c333 c334 c335 c336 c337 c338 c339 c340 c341 c342 c343 c344 c345 c346 c347 c348 c349 c350 c351 c352 c353 c354 c355 c356 c357 c358 c359 c360 c361 c362 c363 c364 c365 c366 c367 c368 c369 c370 c371 c372 c373 c374 c375 c376 c377 c378 c379 c380 c381 c382 c383 c384 c385 c386 c387 c388 c389 c390 c391 c392 c393 c394 c395 c396 c397 c398 c399 c400 c401 c402 c403 c404 c405 c406 c407 c408 c409 c410 c411 c412 c413 c414 c415 c416 c417 c418 c419 c420 c421 c422 c423 c424 c425 c426 c427 c428 c429 c430 c431 c432 c433 c434 c435 c436 c437 c438 c439 c440 c441 c442 c443 c444 c445 c446 c447 c448 c449 c450 c451 c452 c453 c454 c455 c456 c457 c458 c459 c460 c461 c462 c463 c464 c465 c466 c467 c468 c469 c470 c471 c472 c473 c474 c475 c476 c477 c478 c479 c480 c481 c482 c483 c484 c485 c486 c487 c488 c489 c490 c491 c492 c493 c494 c495 c496 c497 c498 c499 c500 c501 c502 c503 c504 c505 c506 c507 c508 c509 c510 c511 c512 c513 c514 c515 c516 c517 c518 c519 c520 c521 c522 c523 c524 c525 c526 c527 c528 c529 c530 c531 c532 c533 c534 c535 c536 c537 c538 c539 c540 c541 c542 c543 c544 c545 c546 c547 c548 c549 c550 c551 c552 c553 c554 c555 c556 c557 c558 c559 c560 c561 c562 c563 c564 c565 c566 c567 c568 c569 c570 c571 c572 c573 c574 c575 c576 c577 c578 c579 c580 c581 c582 c583 c584 c585 c586 c587 c588 c589 c590 c591 c592 c593 c594 c595 c596 c597 c598 c599 c600 c601 c602 c603 c604 c605 c606 c607 c608 c609 c610 c611 c612 c613 c614 c615 c616 c617 c618 c619 c620 c621 c622 c623 c624 c625 c626 c627 c628 c629 c630 c631 c632 c633 c634 c635 c636 c637 c638 c639 c640 c641 c642 c643 c644 c645 c646 c647 c648 c649 c650 c651 c652 c653 c654 c655 c656 c657 c658 c659 c660 c661 c662 c663 c664 c665 c666 c667 c668 c669 c670 c671 c672 c673 c674 c675 c676 c677 c678 c679 c680 c681 c682 c683 c684 c685 c686 c687 c688 c689 c690 c691 c692 c693 c694 c695 c696 c697 c698 c699 c700 c701 c702 c703 c704 c705 c706 c707 c708 c709 c710 c711 c712 c713 c714 c715 c716 c717 c718 c719 c720 c721 c722 c723 c724 c725 c726 c727 c728 c729 c730 c731 c732 c733 c734 c735 c736 c737 c738 c739 c740 c741 c742 c743 c744 c745 c746 c747 c748 c749 c750 c751 c752 c753 c754 c755 c756 c757 c758 c759 c760 c761 c762 c763 c764 c765 c766 c767 c768 c769 c770 c771 c772 c773 c774 c775 c776 c777 c778 c779 c780 c781 c782 c783 c784 c785 c786 c787 c788 c789 c790 c791 c792 c793 c794 c795 c796 c797 c798 c799 c800 c801 c802 c803 c804 c805 c806 c807 c808 c809 c810 c811 c812 c813 c814 c815 c816 c817 c818 c819 c820 c821 c822 c823 c824 c825 c826 c827 c828 c829 c830 c831 c832 c833 c834 c835 c836 c837 c838 c839 c840 c841 c842 c843 c844 c845 c846 c847 c848 c849 c850 c851 c852 c853 c854 c855 c856 c857 c858 c859 c860 c861 c862 c863 c864 c865 c866 c867 c868 c869 c870 c871 c872 c873 c874 c875 c876 c877 c878 c879 c880 c881 c882 c883 c884 c885 c886 c887 c888 c889 c890 c891 c892 c893 c894 c895 c896 c897 c898 c899 c900 c901 c902 c903 c904 c905 c906 c907 c908 c909 c910 c911 c912 c913 c914 c915 c916 c917 c918 c919 c920 c921 c922 c923 c924 c925 c926 c927 c928 c929 c930 c931 c932 c933 c934 c935 c936 c937 c938 c939 c940 c941 c942 c943 c944 c945 c946 c947 c948 c949 c950 c951 c952 c953 c954 c955 c956 c957 c958 c959 c960 c961 c962 c963 c964 c965 c966 c967 c968 c969 c970 c971 c972 c973 c974 c975 c976 c977 c978 c979 c980 c981 c982 c983 c984 c985 c986 c987 c988 c989 c990 c991 c992 c993 c994 c995 c996 c997 c998 c999 c1000 diff --git a/mysql-test/suite/engines/funcs/r/ix_unique_lob.result b/mysql-test/suite/engines/funcs/r/ix_unique_lob.result index 4554a912906..1b03012a96f 100644 --- a/mysql-test/suite/engines/funcs/r/ix_unique_lob.result +++ b/mysql-test/suite/engines/funcs/r/ix_unique_lob.result @@ -7,7 +7,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` tinyblob, + `c1` tinyblob DEFAULT NULL, UNIQUE KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -21,7 +21,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` blob, + `c1` blob DEFAULT NULL, UNIQUE KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -35,7 +35,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` mediumblob, + `c1` mediumblob DEFAULT NULL, UNIQUE KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -49,7 +49,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` longblob, + `c1` longblob DEFAULT NULL, UNIQUE KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -63,7 +63,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` tinytext, + `c1` tinytext DEFAULT NULL, UNIQUE KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -77,7 +77,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` text, + `c1` text DEFAULT NULL, UNIQUE KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -91,7 +91,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` mediumtext, + `c1` mediumtext DEFAULT NULL, UNIQUE KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; @@ -105,7 +105,7 @@ t4 SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c1` longtext, + `c1` longtext DEFAULT NULL, UNIQUE KEY `i1` (`c1`(100)) ) ENGINE=ENGINE DEFAULT CHARSET=latin1 DROP TABLE t4; diff --git a/mysql-test/suite/engines/funcs/r/rpl000011.result b/mysql-test/suite/engines/funcs/r/rpl000011.result deleted file mode 100644 index dd0fa2fbe74..00000000000 --- a/mysql-test/suite/engines/funcs/r/rpl000011.result +++ /dev/null @@ -1,16 +0,0 @@ -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; -create table t1 (n int); -insert into t1 values(1); -stop slave; -start slave; -insert into t1 values(2); -select * from t1; -n -1 -2 -drop table t1; diff --git a/mysql-test/suite/engines/funcs/r/rpl000017.result b/mysql-test/suite/engines/funcs/r/rpl000017.result deleted file mode 100644 index 1c611357e64..00000000000 --- a/mysql-test/suite/engines/funcs/r/rpl000017.result +++ /dev/null @@ -1,18 +0,0 @@ -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; -stop slave; -grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab'; -grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab'; -start slave; -drop table if exists t1; -create table t1(n int); -insert into t1 values(24); -select * from t1; -n -24 -drop table t1; -delete from mysql.user where user="replicate"; diff --git a/mysql-test/suite/engines/funcs/r/rpl000010.result b/mysql-test/suite/engines/funcs/r/rpl_000010.result index 65191ea411f..ae989f25e1b 100644 --- a/mysql-test/suite/engines/funcs/r/rpl000010.result +++ b/mysql-test/suite/engines/funcs/r/rpl_000010.result @@ -1,14 +1,14 @@ -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; +include/master-slave.inc +[connection master] create table t1 (n int not null auto_increment primary key); insert into t1 values(NULL); insert into t1 values(2); +connection slave; select n from t1; n 1 2 +connection master; drop table t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_000011.result b/mysql-test/suite/engines/funcs/r/rpl_000011.result new file mode 100644 index 00000000000..83bc0c207ce --- /dev/null +++ b/mysql-test/suite/engines/funcs/r/rpl_000011.result @@ -0,0 +1,18 @@ +include/master-slave.inc +[connection master] +create table t1 (n int); +insert into t1 values(1); +connection slave; +include/stop_slave.inc +include/start_slave.inc +connection master; +insert into t1 values(2); +connection slave; +select * from t1; +n +1 +2 +connection master; +drop table t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl000013.result b/mysql-test/suite/engines/funcs/r/rpl_000013.result index 37838bb88e0..87103d7821f 100644 --- a/mysql-test/suite/engines/funcs/r/rpl000013.result +++ b/mysql-test/suite/engines/funcs/r/rpl_000013.result @@ -1,17 +1,19 @@ -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; +include/master-slave.inc +[connection master] create table t2(n int); create temporary table t1 (n int); insert into t1 values(1),(2),(3); insert into t2 select * from t1; +connection master1; create temporary table t1 (n int); insert into t1 values (4),(5); insert into t2 select * from t1 as t10; +disconnect master; +connection slave; +connection master1; insert into t2 values(6); +disconnect master1; +connection slave; select * from t2; n 1 @@ -23,6 +25,9 @@ n show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 +connect master2,localhost,root,,; +connection master2; drop table if exists t1,t2; Warnings: -Note 1051 Unknown table 't1' +Note 1051 Unknown table 'test.t1' +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_000015.result b/mysql-test/suite/engines/funcs/r/rpl_000015.result index bb3620ebc84..56fc002ac53 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_000015.result +++ b/mysql-test/suite/engines/funcs/r/rpl_000015.result @@ -1,192 +1,46 @@ -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; +include/master-slave.inc +[connection master] reset master; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 107 -stop slave; +master-bin.000001 329 +connection slave; +include/stop_slave.inc reset slave; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry # -Master_Log_File -Read_Master_Log_Pos 4 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 0 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave_IO_Running = 'No' +Slave_SQL_Running = 'No' +Last_SQL_Errno = '0' +Last_SQL_Error = '' +Exec_Master_Log_Pos = '0' change master to master_host='127.0.0.1'; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry # -Master_Log_File -Read_Master_Log_Pos 4 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 0 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 1 -change master to master_host='127.0.0.1',master_user='root', +Slave_IO_Running = 'No' +Slave_SQL_Running = 'No' +Last_SQL_Errno = '0' +Last_SQL_Error = '' +Exec_Master_Log_Pos = '0' +change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=MASTER_PORT; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry # -Master_Log_File -Read_Master_Log_Pos 4 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 0 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 1 -start slave; -show slave status; -Slave_IO_State Waiting for master to send event -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos 107 -Relay_Log_File slave-relay-bin.000002 -Relay_Log_Pos 254 -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 107 -Relay_Log_Space 410 -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 1 -drop table if exists t1; +include/start_slave.inc +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_SQL_Errno = '0' +Last_SQL_Error = '' +Exec_Master_Log_Pos = '329' +connection master; create table t1 (n int, PRIMARY KEY(n)); insert into t1 values (10),(45),(90); +connection slave; SELECT * FROM t1 ORDER BY n; -n 10 -n 45 -n 90 +n +10 +45 +90 +connection master; SELECT * FROM t1 ORDER BY n; -n 10 -n 45 -n 90 +n +10 +45 +90 drop table t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl000017.test b/mysql-test/suite/engines/funcs/r/rpl_000017.result index 2ba321cd8c3..d1c453208c7 100644 --- a/mysql-test/suite/engines/funcs/t/rpl000017.test +++ b/mysql-test/suite/engines/funcs/r/rpl_000017.result @@ -1,22 +1,19 @@ -source include/master-slave.inc; +include/master-slave.inc +[connection master] connection slave; -stop slave; connection master; grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab'; grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab'; connection slave; -start slave; +include/start_slave.inc connection master; ---disable_warnings -drop table if exists t1; ---enable_warnings create table t1(n int); insert into t1 values(24); -sync_slave_with_master; +connection slave; select * from t1; +n +24 connection master; drop table t1; delete from mysql.user where user="replicate"; -sync_slave_with_master; - -# End of 4.1 tests +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_LD_INFILE.result b/mysql-test/suite/engines/funcs/r/rpl_LD_INFILE.result index b092dd9e088..7204122b669 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_LD_INFILE.result +++ b/mysql-test/suite/engines/funcs/r/rpl_LD_INFILE.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP TABLE IF EXISTS test.t1; CREATE TABLE test.t1 (a VARCHAR(255), PRIMARY KEY(a)); LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1; @@ -62,6 +59,8 @@ abasements abasement abased abase +connection slave; +connection slave; SELECT * FROM test.t1 ORDER BY a DESC; a aberration @@ -114,4 +113,7 @@ abasements abasement abased abase +connection master; DROP TABLE test.t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_REDIRECT.result b/mysql-test/suite/engines/funcs/r/rpl_REDIRECT.result deleted file mode 100644 index 7a901b65810..00000000000 --- a/mysql-test/suite/engines/funcs/r/rpl_REDIRECT.result +++ /dev/null @@ -1,41 +0,0 @@ -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; -SHOW SLAVE STATUS; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error -SHOW SLAVE HOSTS; -Server_id Host Port Rpl_recovery_rank Master_id -2 127.0.0.1 SLAVE_PORT 0 1 -create table t1 ( n int); -insert into t1 values (1),(2),(3),(4); -insert into t1 values(5); -SELECT * FROM t1 ORDER BY n; -n -1 -2 -3 -4 -5 -SELECT * FROM t1 ORDER BY n; -n -1 -2 -3 -4 -SELECT * FROM t1 ORDER BY n; -n -1 -2 -3 -4 -SELECT * FROM t1 ORDER BY n; -n -1 -2 -3 -4 -5 -drop table t1; diff --git a/mysql-test/suite/engines/funcs/r/rpl_alter,innodb.rdiff b/mysql-test/suite/engines/funcs/r/rpl_alter,innodb.rdiff new file mode 100644 index 00000000000..0c70e2c0cfc --- /dev/null +++ b/mysql-test/suite/engines/funcs/r/rpl_alter,innodb.rdiff @@ -0,0 +1,72 @@ +@@ -29,7 +29,7 @@ + `a` int(10) unsigned NOT NULL, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +-) ENGINE=MyISAM DEFAULT CHARSET=latin1 ++) ENGINE=InnoDB DEFAULT CHARSET=latin1 + insert into t1 (a) values (1),((1<<32)-1); + select * from t1; + a b +@@ -42,7 +42,7 @@ + `a` bigint(20) NOT NULL, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +-) ENGINE=MyISAM DEFAULT CHARSET=latin1 ++) ENGINE=InnoDB DEFAULT CHARSET=latin1 + select * from t1; + a b + 1 NULL +@@ -54,7 +54,7 @@ + `a` int(10) unsigned NOT NULL, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +-) ENGINE=MyISAM DEFAULT CHARSET=latin1 ++) ENGINE=InnoDB DEFAULT CHARSET=latin1 + select * from t1; + a b + 1 NULL +@@ -66,7 +66,7 @@ + `a` bigint(20) unsigned NOT NULL, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +-) ENGINE=MyISAM DEFAULT CHARSET=latin1 ++) ENGINE=InnoDB DEFAULT CHARSET=latin1 + select * from t1; + a b + 1 NULL +@@ -83,7 +83,7 @@ + `a` bigint(20) unsigned NOT NULL, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +-) ENGINE=MyISAM DEFAULT CHARSET=latin1 ++) ENGINE=InnoDB DEFAULT CHARSET=latin1 + connection master; + create table t2 (a int unsigned auto_increment primary key, b int); + show create table t2; +@@ -92,7 +92,7 @@ + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +-) ENGINE=MyISAM DEFAULT CHARSET=latin1 ++) ENGINE=InnoDB DEFAULT CHARSET=latin1 + alter table t2 modify a bigint; + show create table t2; + Table Create Table +@@ -100,7 +100,7 @@ + `a` bigint(20) NOT NULL, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +-) ENGINE=MyISAM DEFAULT CHARSET=latin1 ++) ENGINE=InnoDB DEFAULT CHARSET=latin1 + alter table t2 modify a bigint auto_increment; + show create table t2; + Table Create Table +@@ -108,7 +108,7 @@ + `a` bigint(20) NOT NULL AUTO_INCREMENT, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +-) ENGINE=MyISAM DEFAULT CHARSET=latin1 ++) ENGINE=InnoDB DEFAULT CHARSET=latin1 + drop table t1,t2; + # + # MDEV-8432: Slave cannot replicate signed integer-type values diff --git a/mysql-test/suite/engines/funcs/r/rpl_alter.result b/mysql-test/suite/engines/funcs/r/rpl_alter.result index 6ef5ce3462a..4f709db9624 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_alter.result +++ b/mysql-test/suite/engines/funcs/r/rpl_alter.result @@ -1,10 +1,5 @@ -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; -drop database if exists mysqltest; +include/master-slave.inc +[connection master] create database mysqltest; create table mysqltest.t1 ( n int); alter table mysqltest.t1 add m int; @@ -12,10 +7,126 @@ insert into mysqltest.t1 values (1,2); create table mysqltest.t2 (n int); insert into mysqltest.t2 values (45); rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2; +connection slave; select * from mysqltest.t2; n m 1 2 select * from mysqltest.t3; n 45 +connection master; drop database mysqltest; +connection slave; +connection master; +use test; +# +# Test bug where ALTER TABLE MODIFY didn't replicate properly +# +create table t1 (a int unsigned primary key, b int); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(10) unsigned NOT NULL, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 (a) values (1),((1<<32)-1); +select * from t1; +a b +1 NULL +4294967295 NULL +alter table t1 modify a bigint; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) NOT NULL, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +a b +1 NULL +4294967295 NULL +alter table t1 modify a int unsigned; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(10) unsigned NOT NULL, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +a b +1 NULL +4294967295 NULL +alter table t1 modify a bigint unsigned; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) unsigned NOT NULL, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +a b +1 NULL +4294967295 NULL +connection slave; +use test; +select * from t1; +a b +1 NULL +4294967295 NULL +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) unsigned NOT NULL, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +connection master; +create table t2 (a int unsigned auto_increment primary key, b int); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t2 modify a bigint; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` bigint(20) NOT NULL, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t2 modify a bigint auto_increment; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` bigint(20) NOT NULL AUTO_INCREMENT, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1,t2; +# +# MDEV-8432: Slave cannot replicate signed integer-type values +# with high bit set to 1 +# Test replication when we have int on master and bigint on slave +# +create table t1 (a int unsigned primary key, b int); +connection slave; +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY'; +alter table t1 modify a bigint unsigned; +connection master; +insert into t1 (a) values (1),((1<<32)-1); +connection slave; +select * from t1; +a b +1 NULL +4294967295 NULL +SET GLOBAL SLAVE_TYPE_CONVERSIONS=''; +connection master; +drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_alter_db.result b/mysql-test/suite/engines/funcs/r/rpl_alter_db.result index 80b1a0e983f..56e82712bec 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_alter_db.result +++ b/mysql-test/suite/engines/funcs/r/rpl_alter_db.result @@ -1,9 +1,12 @@ -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; -use mysql; +include/master-slave.inc +[connection master] +==== Verify that alter database does not stop replication ==== +create database temp_db; +use temp_db; alter database collate latin1_bin; -alter database collate latin1_swedish_ci; +connection slave; +==== Clean up ==== +connection master; +drop database temp_db; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_bit.result b/mysql-test/suite/engines/funcs/r/rpl_bit.result index 924de8a65f8..b83faa4a28a 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_bit.result +++ b/mysql-test/suite/engines/funcs/r/rpl_bit.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP TABLE IF EXISTS test.t1; CREATE TABLE test.t1 ( dummyKey INTEGER NOT NULL, @@ -95,6 +92,7 @@ hex(bit3) 15 24 35 +connection slave; SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1; oSupp sSuppD GSuppDf VNotSupp x034 5 5 3 2 1 @@ -135,4 +133,7 @@ hex(bit3) 15 24 35 +connection master; DROP TABLE IF EXISTS test.t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_bit_npk.result b/mysql-test/suite/engines/funcs/r/rpl_bit_npk.result index 9599660f18f..5c7e6fc55b6 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_bit_npk.result +++ b/mysql-test/suite/engines/funcs/r/rpl_bit_npk.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP TABLE IF EXISTS test.t1; CREATE TABLE test.t1 ( dummyKey INTEGER NOT NULL, @@ -98,6 +95,7 @@ hex(bit3) 15 24 35 +connection slave; SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1 ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034; @@ -140,6 +138,7 @@ hex(bit3) 15 24 35 +connection master; CREATE TABLE test.t2 (a INT, b BIT(1)); INSERT INTO test.t2 VALUES (1, b'0'); INSERT INTO test.t2 VALUES (1, b'1'); @@ -156,6 +155,7 @@ SELECT * FROM test.t3 ORDER BY a,b; a b 1 NULL 2 0 +connection slave; SELECT a, hex(b) FROM test.t2 ORDER BY a,b; a hex(b) 1 0 @@ -164,6 +164,9 @@ SELECT * FROM test.t3 ORDER BY a,b; a b 1 NULL 2 0 +connection master; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t3; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_change_master.result b/mysql-test/suite/engines/funcs/r/rpl_change_master.result index c187f16cc83..48cec72d917 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_change_master.result +++ b/mysql-test/suite/engines/funcs/r/rpl_change_master.result @@ -1,26 +1,29 @@ -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; +include/master-slave.inc +[connection master] +call mtr.add_suppression("Slave I/O: The slave I/O thread stops because a fatal error is encountered when it tried to SET @master_binlog_checksum"); +connection master; create table t1(n int); +connection slave; select * from t1; n stop slave sql_thread; +connection master; insert into t1 values(1); insert into t1 values(2); -stop slave; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 192 # None 0 No # No 0 0 1 +connection slave; +include/wait_for_slave_param.inc [Read_Master_Log_Pos] +include/stop_slave.inc change master to master_user='root'; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 192 # None 0 No # No 0 0 1 start slave; select * from t1; n 1 2 +connection master; drop table t1; +connection slave; +connection master; +CHANGE MASTER TO MASTER_USER='root', MASTER_SSL=0, MASTER_SSL_CA='', MASTER_SSL_CERT='', +MASTER_SSL_KEY='', MASTER_SSL_CRL='', MASTER_SSL_CRLPATH=''; +CHANGE MASTER TO MASTER_USER='root', MASTER_PASSWORD='', MASTER_SSL=0; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_create_database.result b/mysql-test/suite/engines/funcs/r/rpl_create_database.result index 15bb939eb57..28c11525d00 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_create_database.result +++ b/mysql-test/suite/engines/funcs/r/rpl_create_database.result @@ -1,13 +1,11 @@ -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; +include/master-slave.inc +[connection master] DROP DATABASE IF EXISTS mysqltest_prometheus; DROP DATABASE IF EXISTS mysqltest_sisyfos; DROP DATABASE IF EXISTS mysqltest_bob; +connection slave; DROP DATABASE IF EXISTS mysqltest_bob; +connection master; CREATE DATABASE mysqltest_prometheus; CREATE DATABASE mysqltest_sisyfos; CREATE DATABASE mysqltest_bob; @@ -20,25 +18,19 @@ INSERT INTO t2 VALUES(2); ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1; USE mysqltest_sisyfos; ALTER DATABASE mysqltest_bob CHARACTER SET latin1; -SHOW DATABASES; -Database -information_schema -mtr +SHOW DATABASES LIKE 'mysql%'; +Database (mysql%) mysql mysqltest_bob mysqltest_prometheus mysqltest_sisyfos -performance_schema -test -SHOW DATABASES; -Database -information_schema -mtr +connection slave; +SHOW DATABASES LIKE 'mysql%'; +Database (mysql%) mysql mysqltest_prometheus mysqltest_sisyfos -performance_schema -test +connection master; DROP DATABASE IF EXISTS mysqltest_sisyfos; USE mysqltest_prometheus; CREATE TABLE t1 (a INT); @@ -46,25 +38,18 @@ INSERT INTO t1 VALUES (1); CREATE DATABASE mysqltest_sisyfos; USE mysqltest_sisyfos; CREATE TABLE t2 (a INT); -SHOW DATABASES; -Database -information_schema -mtr +SHOW DATABASES LIKE 'mysql%'; +Database (mysql%) mysql mysqltest_bob mysqltest_prometheus mysqltest_sisyfos -performance_schema -test -SHOW DATABASES; -Database -information_schema -mtr +connection slave; +SHOW DATABASES LIKE 'mysql%'; +Database (mysql%) mysql mysqltest_prometheus mysqltest_sisyfos -performance_schema -test USE mysqltest_prometheus; SHOW TABLES; Tables_in_mysqltest_prometheus @@ -73,6 +58,9 @@ USE mysqltest_sisyfos; SHOW TABLES; Tables_in_mysqltest_sisyfos t2 +connection master; DROP DATABASE IF EXISTS mysqltest_prometheus; DROP DATABASE IF EXISTS mysqltest_sisyfos; DROP DATABASE IF EXISTS mysqltest_bob; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_do_grant.result b/mysql-test/suite/engines/funcs/r/rpl_do_grant.result index 50d181be0ca..e4b08800287 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_do_grant.result +++ b/mysql-test/suite/engines/funcs/r/rpl_do_grant.result @@ -1,80 +1,320 @@ -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; -delete from mysql.user where user=_binary'rpl_do_grant'; -delete from mysql.db where user=_binary'rpl_do_grant'; -flush privileges; -delete from mysql.user where user=_binary'rpl_ignore_grant'; -delete from mysql.db where user=_binary'rpl_ignore_grant'; -flush privileges; +include/master-slave.inc +[connection master] +connection master; +create user rpl_do_grant@localhost; grant select on *.* to rpl_do_grant@localhost; grant drop on test.* to rpl_do_grant@localhost; +connection slave; show grants for rpl_do_grant@localhost; Grants for rpl_do_grant@localhost -GRANT SELECT ON *.* TO 'rpl_do_grant'@'localhost' -GRANT DROP ON `test`.* TO 'rpl_do_grant'@'localhost' +GRANT SELECT ON *.* TO `rpl_do_grant`@`localhost` +GRANT DROP ON `test`.* TO `rpl_do_grant`@`localhost` +connection master; set password for rpl_do_grant@localhost=password("does it work?"); -select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant'; -password<>_binary'' +connection slave; +select authentication_string<>'' from mysql.user where user='rpl_do_grant'; +authentication_string<>'' 1 -delete from mysql.user where user=_binary'rpl_do_grant'; -delete from mysql.db where user=_binary'rpl_do_grant'; -flush privileges; -delete from mysql.user where user=_binary'rpl_do_grant'; -delete from mysql.db where user=_binary'rpl_do_grant'; +connection master; +update mysql.global_priv set priv=json_remove(priv, '$.authentication_string') where user='rpl_do_grant'; flush privileges; +select authentication_string<>'' from mysql.user where user='rpl_do_grant'; +authentication_string<>'' +0 +set sql_mode='ANSI_QUOTES'; +set password for rpl_do_grant@localhost=password('does it work?'); +set sql_mode=''; +connection slave; +select authentication_string<>'' from mysql.user where user='rpl_do_grant'; +authentication_string<>'' +1 +connection master; +drop user rpl_do_grant@localhost; +connection slave; +connection master; show grants for rpl_do_grant@localhost; ERROR 42000: There is no such grant defined for user 'rpl_do_grant' on host 'localhost' +connection slave; show grants for rpl_do_grant@localhost; ERROR 42000: There is no such grant defined for user 'rpl_do_grant' on host 'localhost' +connection master; create user rpl_do_grant@localhost; show grants for rpl_do_grant@localhost; Grants for rpl_do_grant@localhost -GRANT USAGE ON *.* TO 'rpl_do_grant'@'localhost' +GRANT USAGE ON *.* TO `rpl_do_grant`@`localhost` show grants for rpl_do_grant2@localhost; ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost' +connection slave; show grants for rpl_do_grant@localhost; Grants for rpl_do_grant@localhost -GRANT USAGE ON *.* TO 'rpl_do_grant'@'localhost' +GRANT USAGE ON *.* TO `rpl_do_grant`@`localhost` show grants for rpl_do_grant2@localhost; ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost' +connection master; rename user rpl_do_grant@localhost to rpl_do_grant2@localhost; show grants for rpl_do_grant2@localhost; Grants for rpl_do_grant2@localhost -GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost' +GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost` +connection slave; show grants for rpl_do_grant2@localhost; Grants for rpl_do_grant2@localhost -GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost' +GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost` +connection master; grant DELETE,INSERT on mysqltest1.* to rpl_do_grant2@localhost; show grants for rpl_do_grant2@localhost; Grants for rpl_do_grant2@localhost -GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost' -GRANT INSERT, DELETE ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost' +GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost` +GRANT INSERT, DELETE ON `mysqltest1`.* TO `rpl_do_grant2`@`localhost` +connection slave; show grants for rpl_do_grant2@localhost; Grants for rpl_do_grant2@localhost -GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost' -GRANT INSERT, DELETE ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost' +GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost` +GRANT INSERT, DELETE ON `mysqltest1`.* TO `rpl_do_grant2`@`localhost` +connection master; revoke DELETE on mysqltest1.* from rpl_do_grant2@localhost; show grants for rpl_do_grant2@localhost; Grants for rpl_do_grant2@localhost -GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost' -GRANT INSERT ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost' +GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost` +GRANT INSERT ON `mysqltest1`.* TO `rpl_do_grant2`@`localhost` +connection slave; show grants for rpl_do_grant2@localhost; Grants for rpl_do_grant2@localhost -GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost' -GRANT INSERT ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost' +GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost` +GRANT INSERT ON `mysqltest1`.* TO `rpl_do_grant2`@`localhost` +connection master; revoke all privileges, grant option from rpl_do_grant2@localhost; show grants for rpl_do_grant2@localhost; Grants for rpl_do_grant2@localhost -GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost' +GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost` +connection slave; show grants for rpl_do_grant2@localhost; Grants for rpl_do_grant2@localhost -GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost' +GRANT USAGE ON *.* TO `rpl_do_grant2`@`localhost` +connection master; drop user rpl_do_grant2@localhost; show grants for rpl_do_grant2@localhost; ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost' +connection slave; show grants for rpl_do_grant2@localhost; ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost' +connection master; +call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' error.* 1396"); +connection slave; +connection master; +DROP DATABASE IF EXISTS bug42217_db; +CREATE DATABASE bug42217_db; +GRANT CREATE ROUTINE ON bug42217_db.* TO 'create_rout_db'@'localhost' + IDENTIFIED BY 'create_rout_db' WITH GRANT OPTION; +connection slave; +connection master; +connect create_rout_db_master, localhost, create_rout_db, create_rout_db, bug42217_db,$MASTER_MYPORT,; +connect create_rout_db_slave, localhost, create_rout_db, create_rout_db, bug42217_db, $SLAVE_MYPORT,; +connection create_rout_db_master; +USE bug42217_db; +CREATE FUNCTION upgrade_del_func() RETURNS CHAR(30) +BEGIN +RETURN "INSIDE upgrade_del_func()"; +END// +connection master; +USE bug42217_db; +SELECT * FROM mysql.procs_priv; +Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp +localhost bug42217_db create_rout_db upgrade_del_func FUNCTION create_rout_db@localhost Execute,Alter Routine # +SELECT upgrade_del_func(); +upgrade_del_func() +INSIDE upgrade_del_func() +connection slave; +SELECT * FROM mysql.procs_priv; +Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp +localhost bug42217_db create_rout_db upgrade_del_func FUNCTION create_rout_db@localhost Execute,Alter Routine # +SHOW GRANTS FOR 'create_rout_db'@'localhost'; +Grants for create_rout_db@localhost +GRANT USAGE ON *.* TO `create_rout_db`@`localhost` IDENTIFIED BY PASSWORD '*08792480350CBA057BDE781B9DF183B263934601' +GRANT CREATE ROUTINE ON `bug42217_db`.* TO `create_rout_db`@`localhost` WITH GRANT OPTION +GRANT EXECUTE, ALTER ROUTINE ON FUNCTION `bug42217_db`.`upgrade_del_func` TO `create_rout_db`@`localhost` +USE bug42217_db; +SHOW CREATE FUNCTION upgrade_del_func; +Function sql_mode Create Function character_set_client collation_connection Database Collation +upgrade_del_func STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1 +BEGIN +RETURN "INSIDE upgrade_del_func()"; +END latin1 latin1_swedish_ci latin1_swedish_ci +SELECT upgrade_del_func(); +upgrade_del_func() +INSIDE upgrade_del_func() +"Check whether the definer user will be able to execute the replicated routine on slave" +connection create_rout_db_slave; +USE bug42217_db; +SHOW CREATE FUNCTION upgrade_del_func; +Function sql_mode Create Function character_set_client collation_connection Database Collation +upgrade_del_func STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1 +BEGIN +RETURN "INSIDE upgrade_del_func()"; +END latin1 latin1_swedish_ci latin1_swedish_ci +SELECT upgrade_del_func(); +upgrade_del_func() +INSIDE upgrade_del_func() +connection slave; +DELETE FROM mysql.procs_priv; +FLUSH PRIVILEGES; +USE bug42217_db; +"Can't execute the replicated routine on slave like before after procs privilege is deleted " +SELECT upgrade_del_func(); +ERROR 42000: execute command denied to user 'create_rout_db'@'localhost' for routine 'bug42217_db.upgrade_del_func' +"Test the user who creates a function on master doesn't exist on slave." +"Hence SQL thread ACL_GLOBAL privilege jumps in and no mysql.procs_priv is inserted" +DROP USER 'create_rout_db'@'localhost'; +connection create_rout_db_master; +CREATE FUNCTION upgrade_alter_func() RETURNS CHAR(30) +BEGIN +RETURN "INSIDE upgrade_alter_func()"; +END// +connection master; +SELECT upgrade_alter_func(); +upgrade_alter_func() +INSIDE upgrade_alter_func() +connection slave; +SHOW CREATE FUNCTION upgrade_alter_func; +Function sql_mode Create Function character_set_client collation_connection Database Collation +upgrade_alter_func STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_alter_func`() RETURNS char(30) CHARSET latin1 +BEGIN +RETURN "INSIDE upgrade_alter_func()"; +END latin1 latin1_swedish_ci latin1_swedish_ci +"Should no privilege record for upgrade_alter_func in mysql.procs_priv" +SELECT * FROM mysql.procs_priv; +Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp +SELECT upgrade_alter_func(); +ERROR HY000: The user specified as a definer ('create_rout_db'@'localhost') does not exist +disconnect create_rout_db_master; +disconnect create_rout_db_slave; +connection master; +USE bug42217_db; +DROP FUNCTION upgrade_del_func; +DROP FUNCTION upgrade_alter_func; +DROP DATABASE bug42217_db; +connection slave; +connection master; +SET SQL_LOG_BIN= 0; +DROP USER 'create_rout_db'@'localhost'; +SET SQL_LOG_BIN= 1; +include/rpl_reset.inc +USE test; +######## BUG#49119 ####### +### i) test case from the 'how to repeat section' +connection master; +CREATE TABLE t1(c1 INT); +CREATE PROCEDURE p1() SELECT * FROM t1 | +REVOKE EXECUTE ON PROCEDURE p1 FROM 'root'@'localhost'; +ERROR 42000: There is no such grant defined for user 'root' on host 'localhost' on routine 'p1' +connection slave; +connection master; +DROP TABLE t1; +DROP PROCEDURE p1; +connection slave; +### ii) Test case in which REVOKE partially succeeds +connection master; +include/rpl_reset.inc +connection master; +CREATE TABLE t1(c1 INT); +CREATE PROCEDURE p1() SELECT * FROM t1 | +CREATE USER 'user49119'@'localhost'; +GRANT EXECUTE ON PROCEDURE p1 TO 'user49119'@'localhost'; +############################################################## +### Showing grants for both users: root and user49119 (master) +SHOW GRANTS FOR 'user49119'@'localhost'; +Grants for user49119@localhost +GRANT USAGE ON *.* TO `user49119`@`localhost` +GRANT EXECUTE ON PROCEDURE `test`.`p1` TO `user49119`@`localhost` +SHOW GRANTS FOR CURRENT_USER; +Grants for root@localhost +GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION +GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION +############################################################## +connection slave; +############################################################## +### Showing grants for both users: root and user49119 (master) +SHOW GRANTS FOR 'user49119'@'localhost'; +Grants for user49119@localhost +GRANT USAGE ON *.* TO `user49119`@`localhost` +GRANT EXECUTE ON PROCEDURE `test`.`p1` TO `user49119`@`localhost` +SHOW GRANTS FOR CURRENT_USER; +Grants for root@localhost +GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION +GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION +############################################################## +connection master; +## This statement will make the revoke fail because root has no +## execute grant. However, it will still revoke the grant for +## user49119. +REVOKE EXECUTE ON PROCEDURE p1 FROM 'user49119'@'localhost', 'root'@'localhost'; +ERROR 42000: There is no such grant defined for user 'root' on host 'localhost' on routine 'p1' +############################################################## +### Showing grants for both users: root and user49119 (master) +### after revoke statement failure +SHOW GRANTS FOR 'user49119'@'localhost'; +Grants for user49119@localhost +GRANT USAGE ON *.* TO `user49119`@`localhost` +SHOW GRANTS FOR CURRENT_USER; +Grants for root@localhost +GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION +GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION +############################################################## +connection slave; +############################################################# +### Showing grants for both users: root and user49119 (slave) +### after revoke statement failure (should match +SHOW GRANTS FOR 'user49119'@'localhost'; +Grants for user49119@localhost +GRANT USAGE ON *.* TO `user49119`@`localhost` +SHOW GRANTS FOR CURRENT_USER; +Grants for root@localhost +GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION +GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION +############################################################## +connection master; +DROP TABLE t1; +DROP PROCEDURE p1; +DROP USER 'user49119'@'localhost'; +connection slave; +include/rpl_reset.inc +connection master; +grant all on *.* to foo@"1.2.3.4"; +revoke all privileges, grant option from "foo"; +ERROR HY000: Can't revoke all privileges for one or more of the requested users +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; grant all on *.* to foo@"1.2.3.4" +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; revoke all privileges, grant option from "foo" +connection slave; +include/check_slave_no_error.inc +connection master; +DROP USER foo@"1.2.3.4"; +connection slave; + +# Bug#27606 GRANT statement should be replicated with DEFINER information +include/rpl_reset.inc +connection master; +GRANT SELECT, INSERT ON mysql.user TO user_bug27606@localhost; +SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606'; +Grantor +root@localhost +connection slave; +SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606'; +Grantor +root@localhost +connection master; +REVOKE SELECT ON mysql.user FROM user_bug27606@localhost; +SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606'; +Grantor +root@localhost +connection slave; +SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606'; +Grantor +root@localhost +connection master; +DROP USER user_bug27606@localhost; +select priv into @root_priv from mysql.global_priv where user='root' and host='127.0.0.1'; +update mysql.global_priv set priv=@root_priv where user='root' and host='localhost'; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_drop.result b/mysql-test/suite/engines/funcs/r/rpl_drop.result index b83594c9bb1..74514fe7f61 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_drop.result +++ b/mysql-test/suite/engines/funcs/r/rpl_drop.result @@ -1,10 +1,7 @@ -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; -drop table if exists t1, t2; +include/master-slave.inc +[connection master] create table t1 (a int); drop table t1, t2; -ERROR 42S02: Unknown table 't2' +ERROR 42S02: Unknown table 'test.t2' +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_drop_db.result b/mysql-test/suite/engines/funcs/r/rpl_drop_db.result index b2d56af34bc..3712527afe4 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_drop_db.result +++ b/mysql-test/suite/engines/funcs/r/rpl_drop_db.result @@ -1,29 +1,30 @@ -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; +include/master-slave.inc +[connection master] +connection master; drop database if exists mysqltest1; create database mysqltest1; create table mysqltest1.t1 (n int); insert into mysqltest1.t1 values (1); select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt'; +Warnings: +Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead create table mysqltest1.t2 (n int); create table mysqltest1.t3 (n int); drop database mysqltest1; -ERROR HY000: Error dropping database (can't rmdir './mysqltest1/', errno: 17) +ERROR HY000: Error dropping database (can't rmdir './mysqltest1', errno: 39 "Directory not empty") use mysqltest1; show tables; Tables_in_mysqltest1 drop database mysqltest1; -ERROR HY000: Error dropping database (can't rmdir './mysqltest1/', errno: 17) +ERROR HY000: Error dropping database (can't rmdir './mysqltest1', errno: 39 "Directory not empty") use mysqltest1; show tables; Tables_in_mysqltest1 use test; create table t1 (n int); insert into t1 values (1234); +connection slave; +connection slave; use mysqltest1; show tables; Tables_in_mysqltest1 @@ -31,9 +32,9 @@ use test; select * from t1; n 1234 -drop table t1; -stop slave; -drop database mysqltest1; -drop database mysqltest1; +connection master; use test; drop table t1; +drop database mysqltest1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_dual_pos_advance.result b/mysql-test/suite/engines/funcs/r/rpl_dual_pos_advance.result index 257baa81b74..ed9060f8307 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_dual_pos_advance.result +++ b/mysql-test/suite/engines/funcs/r/rpl_dual_pos_advance.result @@ -1,22 +1,28 @@ -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; +include/master-slave.inc +[connection master] +connection slave; reset master; +connection master; change master to master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root"; -start slave; +include/start_slave.inc +connection slave; create table t1 (n int); +connection master; +connection master; create table t4 (n int); create table t5 (n int); create table t6 (n int); +connection slave; +connection slave; +connection master; show tables; Tables_in_test t1 t4 t5 t6 -stop slave; +include/stop_slave.inc reset slave; drop table t1,t4,t5,t6; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_empty_master_crash.result b/mysql-test/suite/engines/funcs/r/rpl_empty_master_crash.result deleted file mode 100644 index b5e14d3adac..00000000000 --- a/mysql-test/suite/engines/funcs/r/rpl_empty_master_crash.result +++ /dev/null @@ -1,12 +0,0 @@ -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; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error -load table t1 from master; -ERROR 08S01: Error connecting to master: Master is not configured -load table t1 from master; -ERROR HY000: Error from master: 'Table 'test.t1' doesn't exist' diff --git a/mysql-test/suite/engines/funcs/r/rpl_err_ignoredtable.result b/mysql-test/suite/engines/funcs/r/rpl_err_ignoredtable.result index f211d5d9a2f..2017252f5d1 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_err_ignoredtable.result +++ b/mysql-test/suite/engines/funcs/r/rpl_err_ignoredtable.result @@ -1,14 +1,12 @@ -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; +include/master-slave.inc +[connection master] +connection master; create table t1 (a int primary key); create table t4 (a int primary key); insert into t1 values (1),(1); Got one of the listed errors insert into t4 values (1),(2); +connection slave; show tables like 't1'; Tables_in_test (t1) show tables like 't4'; @@ -18,25 +16,36 @@ SELECT * FROM test.t4 ORDER BY a; a 1 2 +connection master; drop table t1; +connection slave; +connection master1; select get_lock('crash_lock%20C', 10); get_lock('crash_lock%20C', 10) 1 +connection master; create table t2 (a int primary key); insert into t2 values(1); create table t3 (id int); insert into t3 values(connection_id()); update t2 set a = a + 1 + get_lock('crash_lock%20C', 10); +connection master1; select (@id := id) - id from t3; (@id := id) - id 0 kill @id; drop table t2,t3; insert into t4 values (3),(4); +connection master; +connection master1; +connection slave; SELECT * FROM test.t4 ORDER BY a; a 1 2 3 4 +connection master1; DROP TABLE test.t4; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result b/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result index 53a521aaf85..527dd8dc983 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result +++ b/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result @@ -1,61 +1,14 @@ -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; -stop slave; +include/master-slave.inc +[connection master] +connection slave; +include/stop_slave.inc change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=MASTER_PORT; -start slave; -stop slave; +include/start_slave.inc +connection master; change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=SLAVE_PORT; -start slave; - -let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%' ; - ---source include/wait_slave_status.inc +include/start_slave.inc flush logs; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port SLAVE_PORT -Connect_Retry 60 -Master_Log_File slave-bin.000001 -Read_Master_Log_Pos 107 -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File slave-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 107 -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 2 -STOP SLAVE; +include/stop_slave.inc +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_free_items.result b/mysql-test/suite/engines/funcs/r/rpl_free_items.result index 91c1e2aa6e5..af7a267266f 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_free_items.result +++ b/mysql-test/suite/engines/funcs/r/rpl_free_items.result @@ -1,10 +1,10 @@ -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; +include/master-slave.inc +[connection master] create table t1 (a int); create table t2 (a int); +connection slave; +connection master; drop table t1; drop table t2; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_get_lock.result b/mysql-test/suite/engines/funcs/r/rpl_get_lock.result index f7c9541bd9f..b852546e1bf 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_get_lock.result +++ b/mysql-test/suite/engines/funcs/r/rpl_get_lock.result @@ -1,17 +1,17 @@ -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; +include/master-slave.inc +[connection master] +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); create table t1(n int); insert into t1 values(get_lock("lock",2)); +disconnect master; +connection master1; select get_lock("lock",2); get_lock("lock",2) 1 select release_lock("lock"); release_lock("lock") 1 +connection slave; select get_lock("lock",3); get_lock("lock",3) 1 @@ -32,4 +32,7 @@ is_free_lock("lock2") select is_free_lock(NULL); is_free_lock(NULL) NULL +connection master1; drop table t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_ignore_grant.result b/mysql-test/suite/engines/funcs/r/rpl_ignore_grant.result index 5169cc8e888..0a5564ac6c0 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_ignore_grant.result +++ b/mysql-test/suite/engines/funcs/r/rpl_ignore_grant.result @@ -1,21 +1,23 @@ -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; +include/master-slave.inc +[connection master] +connection master; +set sql_mode=""; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; +connection slave; +set sql_mode=""; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; +connection master; grant select on *.* to rpl_ignore_grant@localhost; grant drop on test.* to rpl_ignore_grant@localhost; show grants for rpl_ignore_grant@localhost; Grants for rpl_ignore_grant@localhost -GRANT SELECT ON *.* TO 'rpl_ignore_grant'@'localhost' -GRANT DROP ON `test`.* TO 'rpl_ignore_grant'@'localhost' +GRANT SELECT ON *.* TO `rpl_ignore_grant`@`localhost` +GRANT DROP ON `test`.* TO `rpl_ignore_grant`@`localhost` +connection slave; show grants for rpl_ignore_grant@localhost; ERROR 42000: There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost' select count(*) from mysql.user where user=_binary'rpl_ignore_grant'; @@ -25,13 +27,19 @@ select count(*) from mysql.db where user=_binary'rpl_ignore_grant'; count(*) 0 grant select on *.* to rpl_ignore_grant@localhost; +connection master; set password for rpl_ignore_grant@localhost=password("does it work?"); +connection slave; select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant'; password<>_binary'' 0 +connection master; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; +connection slave; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; +connection master; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_ignore_revoke.result b/mysql-test/suite/engines/funcs/r/rpl_ignore_revoke.result index b1ccd2f0442..cc65d9dacfd 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_ignore_revoke.result +++ b/mysql-test/suite/engines/funcs/r/rpl_ignore_revoke.result @@ -1,30 +1,34 @@ -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; +include/master-slave.inc +[connection master] +connection master; grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; revoke select on *.* from 'user_foo'@'%'; select select_priv from mysql.user where user='user_foo' /* master:must be N */; -select_priv +Select_priv N +connection slave; grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; revoke select on *.* from 'user_foo'@'%'; select select_priv from mysql.user where user='user_foo' /* slave:must be N */; -select_priv +Select_priv N grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; select select_priv from mysql.user where user='user_foo' /* slave:must be Y */; -select_priv +Select_priv Y +connection master; revoke select on *.* from 'user_foo'; select select_priv from mysql.user where user='user_foo' /* master:must be N */; -select_priv +Select_priv N +connection slave; select select_priv from mysql.user where user='user_foo' /* slave:must get Y */; -select_priv +Select_priv Y +connection slave; revoke select on *.* FROM 'user_foo'; +connection master; delete from mysql.user where user="user_foo"; +connection slave; delete from mysql.user where user="user_foo"; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_ignore_table_update.result b/mysql-test/suite/engines/funcs/r/rpl_ignore_table_update.result index a88a3c690ed..d4efa2dc42e 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_ignore_table_update.result +++ b/mysql-test/suite/engines/funcs/r/rpl_ignore_table_update.result @@ -1,14 +1,12 @@ -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; +include/master-slave.inc +[connection master] +connection slave; use test; drop table if exists mysqltest_foo; drop table if exists mysqltest_bar; create table mysqltest_foo (n int); insert into mysqltest_foo values(4); +connection master; use test; create table mysqltest_foo (n int); insert into mysqltest_foo values(5); @@ -16,8 +14,12 @@ create table mysqltest_bar (m int); insert into mysqltest_bar values(15); create table t1 (k int); insert into t1 values(55); +connection slave; select mysqltest_foo.n,mysqltest_bar.m,t1.k from mysqltest_foo,mysqltest_bar,t1; n m k 4 15 55 +connection master; drop table mysqltest_foo,mysqltest_bar,t1; +connection slave; drop table mysqltest_foo,mysqltest_bar,t1; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_init_slave.result b/mysql-test/suite/engines/funcs/r/rpl_init_slave.result index 740c918976c..a90de76f139 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_init_slave.result +++ b/mysql-test/suite/engines/funcs/r/rpl_init_slave.result @@ -1,9 +1,11 @@ -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; +include/master-slave.inc +[connection master] +set global max_connections=151; +connection slave; +include/stop_slave.inc +include/start_slave.inc +connection master; +connection slave; show variables like 'init_slave'; Variable_name Value init_slave set global max_connections=500 @@ -11,17 +13,21 @@ show variables like 'max_connections'; Variable_name Value max_connections 500 reset master; +connection master; show variables like 'init_slave'; Variable_name Value init_slave show variables like 'max_connections'; Variable_name Value max_connections 151 +connection slave; set @my_global_init_connect= @@global.init_connect; set global init_connect="set @c=1"; show variables like 'init_connect'; Variable_name Value init_connect set @c=1 -stop slave; +connection master; +connection slave; set global init_connect= @my_global_init_connect; set global max_connections= default; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_insert.result b/mysql-test/suite/engines/funcs/r/rpl_insert.result index b6a97926f73..1e790387e71 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_insert.result +++ b/mysql-test/suite/engines/funcs/r/rpl_insert.result @@ -1,23 +1,25 @@ # # Bug#20821: INSERT DELAYED fails to write some rows to binlog # -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; +include/master-slave.inc +[connection master] CREATE SCHEMA IF NOT EXISTS mysqlslap; USE mysqlslap; -CREATE TABLE t1 (id INT, name VARCHAR(64)); +CREATE TABLE t1 (id INT, name VARCHAR(64)) ENGINE=MyISAM; +connection slave; +connection master; SELECT COUNT(*) FROM mysqlslap.t1; COUNT(*) 5000 +connection slave; SELECT COUNT(*) FROM mysqlslap.t1; COUNT(*) 5000 # # Cleanup # +connection master; USE test; DROP SCHEMA mysqlslap; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_insert_select.result b/mysql-test/suite/engines/funcs/r/rpl_insert_select.result index 1aff39e0026..3c9b31ded56 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_insert_select.result +++ b/mysql-test/suite/engines/funcs/r/rpl_insert_select.result @@ -1,17 +1,21 @@ -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; +include/master-slave.inc +[connection master] +connection master; create table t1 (n int not null primary key); insert into t1 values (1); create table t2 (n int); insert into t2 values (1); insert ignore into t1 select * from t2; +Warnings: +Warning 1062 Duplicate entry '1' for key 'PRIMARY' insert into t1 values (2); +connection slave; +connection slave; select * from t1; n 1 2 +connection master; drop table t1,t2; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_loaddata2.result b/mysql-test/suite/engines/funcs/r/rpl_loaddata2.result index 5e3923616ed..d7a9a5981dc 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_loaddata2.result +++ b/mysql-test/suite/engines/funcs/r/rpl_loaddata2.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] CREATE TABLE t1 (word CHAR(20) NOT NULL); LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1; SELECT * FROM t1 ORDER BY word; @@ -78,6 +74,7 @@ Aberdeen Abernathy aberrant aberration +connection slave; SELECT * FROM t1 ORDER BY word; word Aarhus @@ -150,4 +147,7 @@ Aberdeen Abernathy aberrant aberration +connection master; drop table t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_loaddata_m.result b/mysql-test/suite/engines/funcs/r/rpl_loaddata_m.result index 4639c717cea..8e2bc2f0b1c 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_loaddata_m.result +++ b/mysql-test/suite/engines/funcs/r/rpl_loaddata_m.result @@ -1,10 +1,7 @@ -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; +include/master-slave.inc +[connection master] drop database if exists mysqltest; +connection master; USE test; CREATE TABLE t1(a INT, b INT, UNIQUE(b)); LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE test.t1; @@ -18,6 +15,7 @@ LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE mysqltest.t1; SELECT COUNT(*) FROM mysqltest.t1; COUNT(*) 2 +connection slave; SHOW DATABASES; Database information_schema @@ -36,5 +34,8 @@ t1 SELECT COUNT(*) FROM mysqltest.t1; COUNT(*) 2 +connection master; DROP DATABASE mysqltest; -DROP TABLE test.t1; +DROP TABLE IF EXISTS test.t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result b/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result index 8b2da7ff9a1..1eb37dd4899 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result +++ b/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result @@ -1,15 +1,16 @@ -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; +include/master-slave.inc +[connection master] +connection slave; reset master; +connection master; create table test.t1(a int, b int, unique(b)); load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; +connection slave; select count(*) from test.t1; count(*) 2 -show binlog events from 107; -Log_name Pos Event_type Server_id End_log_pos Info +include/show_binlog_events.inc +connection master; drop table test.t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_loaddatalocal.result b/mysql-test/suite/engines/funcs/r/rpl_loaddatalocal.result index 4dd4289b657..f7034cb7968 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_loaddatalocal.result +++ b/mysql-test/suite/engines/funcs/r/rpl_loaddatalocal.result @@ -1,31 +1,37 @@ -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; +include/master-slave.inc +[connection master] create table t1(a int); select * into outfile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' from t1; truncate table t1; load data local infile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' into table t1; +connection slave; select a,count(*) from t1 group by a; a count(*) 1 10000 +connection master; drop table t1; +connection slave; +connection master; create table t1(a int); insert into t1 values (1), (2), (2), (3); select * into outfile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' from t1; drop table t1; create table t1(a int primary key); load data local infile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' into table t1; +Warnings: +Warning 1062 Duplicate entry '2' for key 'PRIMARY' SELECT * FROM t1 ORDER BY a; a 1 2 3 +connection slave; SELECT * FROM t1 ORDER BY a; a 1 2 3 +connection master; drop table t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_loadfile.result b/mysql-test/suite/engines/funcs/r/rpl_loadfile.result index 7a5a7bc50c9..fb40cbf3220 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_loadfile.result +++ b/mysql-test/suite/engines/funcs/r/rpl_loadfile.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP TABLE IF EXISTS test.t1; CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a)); @@ -119,6 +116,8 @@ Abernathy aberrant aberration +connection slave; +connection slave; SELECT * FROM test.t1 ORDER BY blob_column; a blob_column 1 abase @@ -223,5 +222,8 @@ Abernathy aberrant aberration +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP TABLE test.t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_log_pos.result b/mysql-test/suite/engines/funcs/r/rpl_log_pos.result index df4512fa0ea..7f5f34bf831 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_log_pos.result +++ b/mysql-test/suite/engines/funcs/r/rpl_log_pos.result @@ -1,46 +1,37 @@ -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; +include/master-slave.inc +[connection master] +create table if not exists t1 (n int); +drop table t1; +call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary"); +call mtr.add_suppression ("Error in Log_event::read_log_event"); show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 107 <Binlog_Ignore_DB> -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 107 # # master-bin.000001 Yes Yes 0 0 107 # None 0 No # No 0 0 1 -stop slave; -change master to master_log_pos=107; -start slave; -stop slave; -change master to master_log_pos=107; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 107 # # master-bin.000001 No No 0 0 107 # None 0 No # No 0 0 1 -start slave; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 107 # # master-bin.000001 Yes Yes 0 0 107 # None 0 No # No 0 0 1 -stop slave; -change master to master_log_pos=178; +master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> +connection slave; +include/stop_slave.inc +change master to master_log_pos=MASTER_LOG_POS; start slave; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 178 # # master-bin.000001 No Yes 0 0 178 # None 0 No # No 1236 Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position' 0 1 +include/wait_for_slave_io_error.inc [errno=1236] +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' +include/stop_slave_sql.inc +connection master; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 107 <Binlog_Ignore_DB> +master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> create table if not exists t1 (n int); drop table if exists t1; create table t1 (n int); insert into t1 values (1),(2),(3); -stop slave; -change master to master_log_pos=207; +connection slave; +change master to master_log_pos=MASTER_LOG_POS; start slave; select * from t1 ORDER BY n; n 1 2 3 +connection master; drop table t1; +connection slave; +End of 5.0 tests +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_many_optimize.result b/mysql-test/suite/engines/funcs/r/rpl_many_optimize.result index b2148892591..82b1f685ea8 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_many_optimize.result +++ b/mysql-test/suite/engines/funcs/r/rpl_many_optimize.result @@ -1,9 +1,7 @@ -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; +include/master-slave.inc +[connection master] create table t1 (a int not null auto_increment primary key, b int, key(b)); INSERT INTO t1 (a) VALUES (1),(2); drop table t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_master_pos_wait.result b/mysql-test/suite/engines/funcs/r/rpl_master_pos_wait.result deleted file mode 100644 index ab9b8cdad9d..00000000000 --- a/mysql-test/suite/engines/funcs/r/rpl_master_pos_wait.result +++ /dev/null @@ -1,18 +0,0 @@ -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; -select master_pos_wait('master-bin.999999',0,2); -master_pos_wait('master-bin.999999',0,2) --1 -explain extended select master_pos_wait('master-bin.999999',0,2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select master_pos_wait('master-bin.999999',0,2) AS `master_pos_wait('master-bin.999999',0,2)` -select master_pos_wait('master-bin.999999',0); -stop slave sql_thread; -master_pos_wait('master-bin.999999',0) -NULL diff --git a/mysql-test/suite/engines/funcs/r/rpl_misc_functions.result b/mysql-test/suite/engines/funcs/r/rpl_misc_functions.result index 5003a3e7d65..302cf2351c2 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_misc_functions.result +++ b/mysql-test/suite/engines/funcs/r/rpl_misc_functions.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT'); create table t1(id int, i int, r1 int, r2 int, p varchar(100)); insert into t1 values(1, connection_id(), 0, 0, ""); insert into t1 values(2, 0, rand()*1000, rand()*1000, ""); @@ -13,12 +10,52 @@ delete from t1 where id=6; set sql_log_bin=1; insert into t1 values(3, 0, 0, 0, password('does_this_work?')); insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?')); -select * into outfile '../../tmp/rpl_misc_functions.outfile' from t1; -create table t2 like t1; -load data local infile 'MYSQLTEST_VARDIR/tmp/rpl_misc_functions.outfile' into table t2; +select * into outfile 'rpl_misc_functions.outfile' from t1; +connection slave; +create temporary table t2 like t1; +load data local infile 'MYSQLD_DATADIR/test/rpl_misc_functions.outfile' into table t2; select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p); id i r1 r2 p id i r1 r2 p -stop slave; -drop table t1; -drop table t2; +connection master; drop table t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +col_a DOUBLE DEFAULT NULL); +CREATE PROCEDURE test_replication_sp1() +BEGIN +INSERT INTO t1 (col_a) VALUES (rand()), (rand()); +INSERT INTO t1 (col_a) VALUES (rand()); +END| +CREATE PROCEDURE test_replication_sp2() +BEGIN +CALL test_replication_sp1(); +CALL test_replication_sp1(); +END| +CREATE FUNCTION test_replication_sf() RETURNS DOUBLE DETERMINISTIC +BEGIN +RETURN (rand() + rand()); +END| +CALL test_replication_sp1(); +CALL test_replication_sp2(); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); +connection slave; +select * from t1 into outfile "../../tmp/t1_slave.txt"; +Warnings: +Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead +connection master; +create temporary table t1_slave select * from t1 where 1=0; +load data infile '../../tmp/t1_slave.txt' into table t1_slave; +select count(*) into @aux from t1 join t1_slave using (id) +where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ; +SELECT @aux; +@aux +12 +connection master; +DROP TABLE t1, t1_slave; +DROP PROCEDURE test_replication_sp1; +DROP PROCEDURE test_replication_sp2; +DROP FUNCTION test_replication_sf; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_multi_delete.result b/mysql-test/suite/engines/funcs/r/rpl_multi_delete.result index 4831502eb88..62a0d74225d 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_multi_delete.result +++ b/mysql-test/suite/engines/funcs/r/rpl_multi_delete.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] create table t1 (a int primary key); create table t2 (a int); insert into t1 values (1); @@ -14,9 +10,13 @@ a select * from t2; a 1 +connection slave; select * from t1; a select * from t2; a 1 +connection master; drop table t1,t2; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_multi_delete2.result b/mysql-test/suite/engines/funcs/r/rpl_multi_delete2.result index 8e6a6a3d4d0..0a316ec3452 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_multi_delete2.result +++ b/mysql-test/suite/engines/funcs/r/rpl_multi_delete2.result @@ -1,13 +1,12 @@ -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; +include/master-slave.inc +[connection master] +connection master; set sql_log_bin=0; create database mysqltest_from; set sql_log_bin=1; +connection slave; create database mysqltest_to; +connection master; use mysqltest_from; drop table if exists a; CREATE TABLE a (i INT); @@ -20,10 +19,12 @@ delete alias FROM a alias where alias.i=2; select * from a; i 3 +connection slave; use mysqltest_to; select * from a; i 3 +connection master; create table t1 (a int primary key); create table t2 (a int); insert into t1 values (1); @@ -34,11 +35,15 @@ a select * from t2; a 1 +connection slave; select * from t1; ERROR 42S02: Table 'mysqltest_to.t1' doesn't exist select * from t2; ERROR 42S02: Table 'mysqltest_to.t2' doesn't exist +connection master; set sql_log_bin=0; drop database mysqltest_from; set sql_log_bin=1; +connection slave; drop database mysqltest_to; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_multi_update4.result b/mysql-test/suite/engines/funcs/r/rpl_multi_update4.result index f6dde65a35d..256c1c503ab 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_multi_update4.result +++ b/mysql-test/suite/engines/funcs/r/rpl_multi_update4.result @@ -1,12 +1,11 @@ -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; +include/master-slave.inc +[connection master] +connection master; drop database if exists d1; drop database if exists d2; +connection slave; drop database if exists d2; +connection master; create database d1; create table d1.t0 (id int); create database d2; @@ -17,9 +16,13 @@ insert into t1 values (1), (2), (3), (4), (5); insert into t2 select id + 3 from t1; update t1 join t2 using (id) set t1.id = 0; insert into d1.t0 values (0); +connection slave; use d1; select * from t0 where id=0; id 0 +connection master; drop database d1; drop database d2; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_ps.result b/mysql-test/suite/engines/funcs/r/rpl_ps.result index 73c36af4862..57c2db05811 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_ps.result +++ b/mysql-test/suite/engines/funcs/r/rpl_ps.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] drop table if exists t1; create table t1(n char(30)); prepare stmt1 from 'insert into t1 values (?)'; @@ -19,12 +15,40 @@ set @var2= 'insert into t1 values (concat("from-var-", ?))'; prepare stmt2 from @var2; set @var1='from-master-3'; execute stmt2 using @var1; +connection slave; SELECT * FROM t1 ORDER BY n; n from-master-1 from-master-2-'', from-var-from-master-3 +connection master; drop table t1; +connection slave; stop slave; -reset master; -reset slave; +include/wait_for_slave_to_stop.inc + +######################################################################## +# +# BUG#25843: Changing default database between PREPARE and EXECUTE of +# statement breaks binlog. +# +######################################################################## +connection slave; +START SLAVE; +connection master; +CREATE DATABASE mysqltest1; +CREATE TABLE t1(db_name CHAR(32), db_col_name CHAR(32)); +PREPARE stmt_d_1 FROM 'INSERT INTO t1 VALUES(DATABASE(), @@collation_database)'; +EXECUTE stmt_d_1; +use mysqltest1; +EXECUTE stmt_d_1; +connection slave; +SELECT * FROM t1; +db_name db_col_name +test latin1_swedish_ci +test latin1_swedish_ci +connection master; +DROP DATABASE mysqltest1; +use test; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result b/mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result deleted file mode 100644 index 13f7fbfbdeb..00000000000 --- a/mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result +++ /dev/null @@ -1,55 +0,0 @@ -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; -**** On Master **** -CREATE TABLE t1 (a INT, b LONG); -INSERT INTO t1 VALUES (1,1), (2,2); -INSERT INTO t1 VALUES (3,UUID()), (4,UUID()); -SHOW BINLOG EVENTS; -**** On Slave **** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_PORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 1 -SHOW BINLOG EVENTS; -DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/engines/funcs/r/rpl_relayspace.result b/mysql-test/suite/engines/funcs/r/rpl_relayspace.result index 1f2a739d3e3..90bf18aaa88 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_relayspace.result +++ b/mysql-test/suite/engines/funcs/r/rpl_relayspace.result @@ -1,19 +1,18 @@ -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; -stop slave; +include/master-slave.inc +[connection master] +connection slave; +include/stop_slave.inc +connection master; create table t1 (a int); drop table t1; create table t1 (a int); drop table t1; +connection slave; reset slave; start slave io_thread; -stop slave io_thread; +include/wait_for_slave_param.inc [Slave_IO_State] +include/stop_slave_io.inc reset slave; -start slave; -select master_pos_wait('master-bin.001',200,6)=-1; -master_pos_wait('master-bin.001',200,6)=-1 -0 +include/start_slave.inc +include/assert.inc [Assert that master_pos_wait does not timeout nor it returns NULL] +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_replicate_ignore_db.result b/mysql-test/suite/engines/funcs/r/rpl_replicate_ignore_db.result index 0135804c02d..1192f9860f2 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_replicate_ignore_db.result +++ b/mysql-test/suite/engines/funcs/r/rpl_replicate_ignore_db.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] drop database if exists mysqltest1; drop database if exists mysqltest2; create database mysqltest1; @@ -11,13 +7,19 @@ create database mysqltest2; use mysqltest1; create table t1 (a int); insert into t1 values(1); +connection slave; select * from mysqltest1.t1; ERROR 42S02: Table 'mysqltest1.t1' doesn't exist +connection master; use mysqltest2; create table t1 (a int); insert into t1 values(1); +connection slave; select * from mysqltest2.t1; a 1 +connection master; drop database mysqltest1; drop database mysqltest2; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_NOW.result b/mysql-test/suite/engines/funcs/r/rpl_row_NOW.result index 23f95878608..480ad34ce69 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_NOW.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_NOW.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; create database if not exists mysqltest1; DROP TABLE IF EXISTS mysqltest1.t1; CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, @@ -24,6 +21,10 @@ FOR EACH ROW BEGIN SET new.b = mysqltest1.f1(); END| INSERT INTO mysqltest1.t1 SET n = NULL, a = now(); +connection slave; +connection master; DROP TABLE IF EXISTS mysqltest1.t1; DROP FUNCTION mysqltest1.f1; DROP DATABASE mysqltest1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_USER.result b/mysql-test/suite/engines/funcs/r/rpl_row_USER.result index c4774665307..2771c674f44 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_USER.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_USER.result @@ -1,15 +1,15 @@ -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; +include/master-slave.inc +[connection master] +set local sql_mode=""; +connection master; DROP DATABASE IF EXISTS mysqltest1; CREATE DATABASE mysqltest1; CREATE USER tester IDENTIFIED BY 'test'; GRANT ALL ON mysqltest1.* TO 'tester'@'%' IDENTIFIED BY 'test'; GRANT ALL ON mysqltest1.* TO ''@'localhost%'; FLUSH PRIVILEGES; +connect m_1,localhost,tester,,mysqltest1; +connection m_1; CREATE TABLE mysqltest1.t1 (a INT, users VARCHAR(255), PRIMARY KEY(a)); INSERT INTO mysqltest1.t1 VALUES(1,USER()); INSERT INTO mysqltest1.t1 VALUES(2,CURRENT_USER()); @@ -19,21 +19,26 @@ INSERT INTO mysqltest1.t1 VALUES(3,USER()); INSERT INTO mysqltest1.t1 VALUES(4,CURRENT_USER()); end| CALL mysqltest1.p1(); +connection master; SELECT * FROM mysqltest1.t1 ORDER BY a; a users 1 tester@localhost 2 @localhost% 3 tester@localhost 4 @localhost% +connection slave; SELECT * FROM mysqltest1.t1 ORDER BY a; a users 1 tester@localhost 2 @localhost% 3 tester@localhost 4 @localhost% +connection master; +DROP DATABASE mysqltest1; REVOKE ALL ON mysqltest1.* FROM 'tester'@'%'; REVOKE ALL ON mysqltest1.* FROM ''@'localhost%'; -DROP DATABASE mysqltest1; -DROP USER 'tester'; +DROP USER tester@'%'; DROP USER ''@'localhost%'; FLUSH PRIVILEGES; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_drop.result b/mysql-test/suite/engines/funcs/r/rpl_row_drop.result index d45bbadf7df..8753764e81e 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_drop.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_drop.result @@ -1,10 +1,6 @@ -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; -**** On Master **** +include/master-slave.inc +[connection master] +connection master; CREATE TABLE t1 (a int); CREATE TABLE t2 (a int); CREATE TEMPORARY TABLE t2 (a int, b int); @@ -12,47 +8,48 @@ SHOW TABLES; Tables_in_test t1 t2 -**** On Slave **** +connection slave; SHOW TABLES; Tables_in_test t1 t2 -**** On Master **** +connection master; DROP TABLE t2; SHOW TABLES; Tables_in_test t1 t2 -**** On Slave **** +connection slave; SHOW TABLES; Tables_in_test t1 t2 -**** On Master **** +connection master; CREATE TEMPORARY TABLE t2 (a int, b int); SHOW TABLES; Tables_in_test t1 t2 -**** On Slave **** +connection slave; SHOW TABLES; Tables_in_test t1 t2 -**** On Master **** +connection master; DROP TABLE t1,t2; -SHOW BINLOG EVENTS; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 107 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 107 Query 1 193 use `test`; CREATE TABLE t1 (a int) -master-bin.000001 193 Query 1 279 use `test`; CREATE TABLE t2 (a int) -master-bin.000001 279 Query 1 403 use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */ -master-bin.000001 403 Query 1 527 use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */ -master-bin.000001 527 Query 1 631 use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ SHOW TABLES; Tables_in_test t2 -**** On Slave **** +connection slave; SHOW TABLES; Tables_in_test t2 +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_func001.result b/mysql-test/suite/engines/funcs/r/rpl_row_func001.result index b20f3f724d0..ae05b5cf3c0 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_func001.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_func001.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP FUNCTION test.f1; DROP TABLE IF EXISTS test.t1; create table test.t1 (a int, PRIMARY KEY(a)); @@ -22,9 +19,14 @@ select * from test.t1; a 1 2 +connection slave; +connection slave; select * from test.t1; a 1 2 +connection master; DROP FUNCTION test.f1; DROP TABLE test.t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result b/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result index aff54e01b95..e2bd199ecab 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result @@ -1,14 +1,12 @@ -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; +include/master-slave.inc +[connection master] +connection master; create table t1 (a int not null primary key); insert into t1 values (1); create table t2 (a int); insert into t2 values (1); update t1, t2 set t1.a = 0 where t1.a = t2.a; +connection slave; show tables; Tables_in_test t1 @@ -16,46 +14,14 @@ select * from t1; a 0 drop table t1; +connection master; insert into t1 values (1); -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table test.t2 -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1146 -Last_Error Error executing row event: 'Table 'test.t1' doesn't exist' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 1146 -Last_SQL_Error Error executing row event: 'Table 'test.t1' doesn't exist' -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +connection slave; +call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., error.* 1146"); +include/wait_for_slave_sql_error.inc [errno=1146] +==== Clean up ==== +include/stop_slave_io.inc +RESET SLAVE; +connection master; drop table t1, t2; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_max_relay_size.result b/mysql-test/suite/engines/funcs/r/rpl_row_max_relay_size.result index 547dd8e1541..41d18d7f9fe 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_max_relay_size.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_max_relay_size.result @@ -1,20 +1,19 @@ +include/master-slave.inc +[connection master] +connection slave; 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; -stop slave; +connection master; # # Generate a big enough master's binlog to cause relay log rotations # create table t1 (a int); drop table t1; +connection slave; reset slave; # # Test 1 # -set @my_max_binlog_size= @@global.max_binlog_size; +set @my_max_binlog_size= @@global.max_binlog_size, @my_max_relay_log_size=@@global.max_relay_log_size; set global max_binlog_size=8192; set global max_relay_log_size=8192-1; Warnings: @@ -23,7 +22,7 @@ select @@global.max_relay_log_size; @@global.max_relay_log_size 4096 start slave; -Checking that both slave threads are running. +include/check_slave_is_running.inc # # Test 2 # @@ -33,17 +32,19 @@ set global max_relay_log_size=(5*4096); select @@global.max_relay_log_size; @@global.max_relay_log_size 20480 start slave; -Checking that both slave threads are running. +include/check_slave_is_running.inc # # Test 3: max_relay_log_size = 0 # stop slave; reset slave; set global max_relay_log_size=0; +Warnings: +Warning 1292 Truncated incorrect max_relay_log_size value: '0' select @@global.max_relay_log_size; -@@global.max_relay_log_size 0 +@@global.max_relay_log_size 4096 start slave; -Checking that both slave threads are running. +include/check_slave_is_running.inc # # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # @@ -56,19 +57,27 @@ flush logs; reset slave; start slave; flush logs; +connection master; create table t1 (a int); -Checking that both slave threads are running. +connection slave; +include/check_slave_is_running.inc # # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # flush logs; +connection master; drop table t1; -Checking that both slave threads are running. +connection slave; +include/check_slave_is_running.inc +connection master; flush logs; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB> +connection slave; set global max_binlog_size= @my_max_binlog_size; +set global max_relay_log_size= @my_max_relay_log_size; # # End of 4.1 tests # +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result b/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result index 5499d41bc1f..b9e98d5a97d 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result @@ -1,41 +1,58 @@ -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; -Master_User root -Master_Host 127.0.0.1 +include/master-slave.inc +[connection master] +connection slave; +Master_User = 'root' +Master_Host = '127.0.0.1' include/stop_slave.inc change master to master_user='test'; -Master_User test -Master_Host 127.0.0.1 +Master_User = 'test' +Master_Host = '127.0.0.1' reset slave; -Master_User test -Master_Host 127.0.0.1 +Master_User = 'test' +Master_Host = '127.0.0.1' change master to master_user='root'; include/start_slave.inc -Master_User root -Master_Host 127.0.0.1 +Master_User = 'root' +Master_Host = '127.0.0.1' include/stop_slave.inc reset slave; include/start_slave.inc +connection master; create temporary table t1 (a int); +connection slave; include/stop_slave.inc reset slave; include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 +connection master; +drop temporary table if exists t1; +connection slave; include/stop_slave.inc reset slave; +include/check_slave_no_error.inc change master to master_user='impossible_user_name'; start slave; -stop slave; +include/wait_for_slave_io_error.inc [errno=1045] +include/stop_slave_sql.inc change master to master_user='root'; include/start_slave.inc +include/check_slave_no_error.inc stop slave; change master to master_user='impossible_user_name'; start slave; -stop slave; +include/wait_for_slave_io_error.inc [errno=1045] +include/stop_slave_sql.inc reset slave; +include/check_slave_no_error.inc +change master to master_user='root'; +reset slave; +include/start_slave.inc +include/stop_slave.inc +reset slave all; +start slave; +ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO +CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT; +include/start_slave.inc +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_sp001.result b/mysql-test/suite/engines/funcs/r/rpl_row_sp001.result index 8c26c061376..d37425c43a8 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_sp001.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_sp001.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] <Begin test section 1 (non deterministic SP)> --------------------------------------------- @@ -34,12 +30,14 @@ a t 2 NEW 3 NEW 4 NEW +connection slave; SELECT * FROM t2 ORDER BY a; a t 1 NEW 2 NEW 3 NEW 4 NEW +connection master; call test.p2(1); SELECT * FROM t2 ORDER BY a; a t @@ -47,12 +45,14 @@ a t 2 Tex 3 Tex 4 Tex +connection slave; SELECT * FROM t2 ORDER BY a; a t 1 Tex 2 Tex 3 Tex 4 Tex +connection master; call test.p2(2); SELECT * FROM t2 ORDER BY a; a t @@ -60,12 +60,14 @@ a t 2 SQL 3 SQL 4 SQL +connection slave; SELECT * FROM t2 ORDER BY a; a t 1 SQL 2 SQL 3 SQL 4 SQL +connection master; call test.p2(3); SELECT * FROM t2 ORDER BY a; a t @@ -73,13 +75,17 @@ a t 2 NONE 3 NONE 4 NONE +connection slave; SELECT * FROM t2 ORDER BY a; a t 1 NONE 2 NONE 3 NONE 4 NONE +connection master; DROP PROCEDURE test.p1; DROP PROCEDURE test.p2; DROP TABLE test.t1; DROP TABLE test.t2; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_sp005.result b/mysql-test/suite/engines/funcs/r/rpl_row_sp005.result index 58c53b394b2..8acc2e20202 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_sp005.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_sp005.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t2; @@ -42,9 +39,6 @@ INSERT INTO test.t1 VALUES (4,'MySQL'),(20,'ROCKS'),(11,'Texas'),(10,'kyle'); INSERT INTO test.t2 VALUES (4),(2),(1),(3); UPDATE test.t1 SET id=id+4 WHERE id=4; END| - -< ---- Master selects-- > -------------------------- CALL test.p2(); SELECT * FROM test.t1 ORDER BY id; id data @@ -58,9 +52,7 @@ id2 2 3 4 - -< ---- Slave selects-- > ------------------------- +connection slave; SELECT * FROM test.t1 ORDER BY id; id data 8 MySQL @@ -73,30 +65,28 @@ id2 2 3 4 - -< ---- Master selects-- > -------------------------- +connection master; CALL test.p1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM test.t3 ORDER BY id3; id3 c 1 MySQL 2 kyle 3 Texas 4 ROCKS - -< ---- Slave selects-- > ------------------------- +connection slave; SELECT * FROM test.t3 ORDER BY id3; id3 c 1 MySQL 2 kyle 3 Texas 4 ROCKS +connection master; ALTER PROCEDURE test.p1 MODIFIES SQL DATA; +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t3; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_sp008.result b/mysql-test/suite/engines/funcs/r/rpl_row_sp008.result index 23197964a24..481c9b3f6cc 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_sp008.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_sp008.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP TABLE IF EXISTS test.t2; CREATE TABLE test.t1 (a INT,PRIMARY KEY(a)); @@ -14,21 +11,19 @@ BEGIN SELECT SQL_CALC_FOUND_ROWS * FROM test.t1 LIMIT 1; INSERT INTO test.t2 VALUES(FOUND_ROWS()); END| - -< ---- Master selects-- > -------------------------- CALL test.p1(); a 1 SELECT * FROM test.t2; a 2 - -< ---- Slave selects-- > ------------------------- +connection slave; SELECT * FROM test.t2; a 2 +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_sp009.result b/mysql-test/suite/engines/funcs/r/rpl_row_sp009.result index 35ce0d7b420..d4bcfe9fcb6 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_sp009.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_sp009.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; @@ -53,25 +50,33 @@ SELECT * FROM test.t2 ORDER BY a; a 1 3 +connection slave; SELECT * FROM test.t2 ORDER BY a; a 1 3 +connection master; truncate test.t2; call test.p1('b'); select * from test.t2 ORDER BY a; a 2 4 +connection slave; SELECT * FROM test.t2 ORDER BY a; a 2 4 +connection master; truncate test.t2; SELECT * FROM test.t2 ORDER BY a; a +connection slave; SELECT * FROM test.t2 ORDER BY a; a +connection master; DROP PROCEDURE test.p1; DROP TABLE test.t1; DROP TABLE test.t2; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_sp010.result b/mysql-test/suite/engines/funcs/r/rpl_row_sp010.result index 02567465428..6a15298eddf 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_sp010.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_sp010.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p3; @@ -26,8 +23,10 @@ SELECT * FROM test.t1 ORDER BY a; a 1 2 +connection slave; show tables; Tables_in_test +connection master; CREATE PROCEDURE test.p3() BEGIN INSERT INTO test.t2 VALUES(7); @@ -44,13 +43,17 @@ SELECT * FROM test.t2 ORDER BY a; a 6 7 +connection slave; SELECT * FROM test.t2 ORDER BY a; a 6 7 +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p3; DROP PROCEDURE IF EXISTS test.p4; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_sp011.result b/mysql-test/suite/engines/funcs/r/rpl_row_sp011.result index e35c9f21adb..53a9a964b53 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_sp011.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_sp011.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p3; @@ -58,6 +55,8 @@ ALTER TABLE test.t2 DROP COLUMN to_drop; INSERT INTO test.t2 VALUES ('gone',NULL,'STM',RAND()); END| CALL test.p1(); +connection slave; +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p3; @@ -67,3 +66,5 @@ DROP PROCEDURE IF EXISTS test.p6; DROP PROCEDURE IF EXISTS test.p7; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_sp012.result b/mysql-test/suite/engines/funcs/r/rpl_row_sp012.result index 4aa16cbf6bd..65cc566256a 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_sp012.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_sp012.result @@ -1,12 +1,10 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p3; +create user user1@localhost; grant usage on *.* to user1@localhost; flush privileges; SELECT CURRENT_USER(); @@ -21,9 +19,10 @@ CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1(); GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost; GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost; GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost; - -<******** Master user1 p3 & p2 calls *******> ----------------------------------------------- +set sql_mode=default; +connection slave; +connect muser1,localhost,user1,,; +connection muser1; SELECT CURRENT_USER(); CURRENT_USER() user1@localhost @@ -36,9 +35,9 @@ user1@localhost user1@localhost CALL test.p2(); CURRENT_USER() USER() root@localhost user1@localhost - -<******** Slave user1 p3 & p2 calls *******> ---------------------------------------------- +connect suser1,127.0.0.1,user1,,test,$SLAVE_MYPORT,; +connection master; +connection suser1; SELECT CURRENT_USER(); CURRENT_USER() user1@localhost @@ -51,9 +50,12 @@ user1@localhost user1@localhost CALL test.p2(); CURRENT_USER() USER() root@localhost user1@localhost +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p3; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; -DROP USER 'user1'@'localhost'; +DROP USER user1@localhost; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_stop_middle.result b/mysql-test/suite/engines/funcs/r/rpl_row_stop_middle.result index 46ca5748174..07be1bfebfe 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_stop_middle.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_stop_middle.result @@ -1,11 +1,10 @@ -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; +include/master-slave.inc +[connection master] +connection master; create table t1 (a int not null auto_increment primary key, b int, key(b)); -stop slave; +connection slave; +include/stop_slave.inc +connection master; INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1; @@ -20,7 +19,9 @@ INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1; -start slave; -stop slave; +connection slave; +include/start_slave.inc +include/stop_slave.inc drop table t1; +connection master; drop table t1; diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_trig001.result b/mysql-test/suite/engines/funcs/r/rpl_row_trig001.result index 6665dc6d555..142c6c61865 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_trig001.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_trig001.result @@ -1,14 +1,10 @@ -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; +include/master-slave.inc +[connection master] CREATE TABLE test.t1 (n MEDIUMINT NOT NULL, d DATETIME, PRIMARY KEY(n)); CREATE TABLE test.t2 (n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n)); CREATE TABLE test.t3 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d DATETIME, PRIMARY KEY(n)); INSERT INTO test.t1 VALUES (1,NOW()); -CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW UPDATE test.t1 SET d=NOW() where n = 1;// +CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW UPDATE test.t1 SET d=NOW() where n = 1// CREATE PROCEDURE test.p3() BEGIN INSERT INTO test.t3 (d) VALUES (NOW()); @@ -18,9 +14,15 @@ CREATE PROCEDURE test.p2() BEGIN INSERT INTO test.t2 (f,d) VALUES (RAND(),NOW()); END// +connection slave; +connection master; +connection master; +INSERT INTO test.t1 VALUES (1+1, NOW()); +connection slave; <End test section 2 (Tiggers & SP)> ----------------------------------- +connection master; DROP PROCEDURE test.p2; DROP PROCEDURE test.p3; DROP TRIGGER test.t2_ai; @@ -28,3 +30,5 @@ DROP TRIGGER test.t3_bi_t2; DROP TABLE test.t1; DROP TABLE test.t2; DROP TABLE test.t3; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_trig002.result b/mysql-test/suite/engines/funcs/r/rpl_row_trig002.result index 794104db750..8259edd56df 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_trig002.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_trig002.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP TRIGGER test.t2_ai; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; @@ -20,6 +17,7 @@ id domain 3 earthmotherwear.com 4 yahoo.com 5 example.com +connection slave; SELECT * FROM test.t1 ORDER BY id; id domain 1 example.com @@ -27,6 +25,7 @@ id domain 3 earthmotherwear.com 4 yahoo.com 5 example.com +connection master; INSERT INTO test.t3 VALUES ('Yes', 5, NULL, 'spamfilter','scan_incoming'); INSERT INTO test.t3 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming'); INSERT INTO test.t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming'); @@ -37,6 +36,7 @@ select * from test.t3; value domain_id mailaccount_id program keey No 5 NULL spamfilter scan_incoming Yes 1 NULL spamfilter scan_incoming +connection slave; select * from test.t2; value domain_id mailaccount_id program keey Yes 1 NULL spamfilter scan_incoming @@ -44,6 +44,7 @@ select * from test.t3; value domain_id mailaccount_id program keey No 5 NULL spamfilter scan_incoming Yes 1 NULL spamfilter scan_incoming +connection master; DELETE FROM test.t1 WHERE id = 1; SELECT * FROM test.t1 ORDER BY id; id domain @@ -51,19 +52,24 @@ id domain 3 earthmotherwear.com 4 yahoo.com 5 example.com +connection master; SELECT * FROM test.t1 ORDER BY id; id domain 2 mysql.com 3 earthmotherwear.com 4 yahoo.com 5 example.com +connection slave; SELECT * FROM test.t1 ORDER BY id; id domain 2 mysql.com 3 earthmotherwear.com 4 yahoo.com 5 example.com +connection master; DROP TRIGGER test.t2_ai; DROP TABLE test.t1; DROP TABLE test.t2; DROP TABLE test.t3; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_trig003.result b/mysql-test/suite/engines/funcs/r/rpl_row_trig003.result index 131af933b41..239d5917bc5 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_trig003.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_trig003.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP TRIGGER test.t1_bi; DROP TRIGGER test.t2_ai; DROP TRIGGER test.t1_bu; @@ -69,15 +66,11 @@ INSERT INTO test.t2 VALUES(NULL,0,'Testing MySQL databases is a cool ', 'MySQL C UPDATE test.t1 SET b1 = 0 WHERE b1 = 1; INSERT INTO test.t2 VALUES(NULL,1,'This is an after update test.', 'If this works, total will not be zero on the master or slave',1.4321,5.221,0,YEAR(NOW()),NOW()); UPDATE test.t2 SET b1 = 0 WHERE b1 = 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW()); DELETE FROM test.t1 WHERE id = 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed DELETE FROM test.t2 WHERE id = 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed +connection slave; +connection master; DROP TRIGGER test.t1_bi; DROP TRIGGER test.t2_ai; DROP TRIGGER test.t1_bu; @@ -87,3 +80,5 @@ DROP TRIGGER test.t2_ad; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t3; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_until.result b/mysql-test/suite/engines/funcs/r/rpl_row_until.result index 457d83496bc..82268ce72eb 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_until.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_until.result @@ -6,15 +6,14 @@ INSERT INTO t1 VALUES (1),(2),(3),(4); DROP TABLE t1; CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); INSERT INTO t2 VALUES (1),(2); -connection slave; -connection master; INSERT INTO t2 VALUES (3),(4); DROP TABLE t2; connection slave; include/stop_slave.inc RESET SLAVE; +CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT; connection slave; -START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1 +START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1; include/wait_for_slave_sql_to_stop.inc SELECT * FROM t1; n @@ -23,7 +22,7 @@ n 3 4 include/check_slave_param.inc [Exec_Master_Log_Pos] -START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; +START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291; include/wait_for_slave_sql_to_stop.inc SELECT * FROM t1; n @@ -32,19 +31,12 @@ n 3 4 include/check_slave_param.inc [Exec_Master_Log_Pos] -START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2 -include/wait_for_slave_sql_to_stop.inc -SELECT * FROM t2; -n -1 -2 -include/check_slave_param.inc [Exec_Master_Log_Pos] START SLAVE; include/wait_for_slave_to_start.inc connection master; connection slave; include/stop_slave.inc -START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2 +START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2; include/wait_for_slave_param.inc [Until_Log_Pos] include/wait_for_slave_sql_to_stop.inc include/check_slave_param.inc [Exec_Master_Log_Pos] @@ -58,10 +50,25 @@ START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000009'; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=MASTER_LOG_POS; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL -START SLAVE; START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; -Warnings: -Note 1254 Slave is already running include/stop_slave.inc RESET SLAVE; +include/start_slave.inc +include/rpl_reset.inc +connection master; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +connection slave; +include/stop_slave_sql.inc +connection master; +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +include/sync_slave_io_with_master.inc +start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=relay_log_pos; +include/wait_for_slave_sql_to_stop.inc +include/assert.inc [table t1 should have two rows.] +include/start_slave.inc +connection master; +DROP TABLE t1; +connection slave; include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_view01.result b/mysql-test/suite/engines/funcs/r/rpl_row_view01.result index a4b8d0a05e3..5c9944e75e0 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_view01.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_view01.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; create database if not exists mysqltest1; DROP VIEW IF EXISTS mysqltest1.v1; DROP VIEW IF EXISTS mysqltest1.v2; @@ -35,6 +32,7 @@ a c c2 1 Thank GOD 2 it is 3 Friday TGIF +connection slave; SELECT * FROM mysqltest1.v2; qty price value 3 50 150 @@ -45,6 +43,7 @@ a c c2 1 Thank GOD 2 it is 3 Friday TGIF +connection master; INSERT INTO mysqltest1.t5 SELECT * FROM mysqltest1.v2; INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1; SELECT * FROM mysqltest1.t5 ORDER BY qty; @@ -57,6 +56,7 @@ a c c2 1 Thank GOD 2 it is 3 Friday TGIF +connection slave; SELECT * FROM mysqltest1.t5 ORDER BY qty; qty price total 3 50 150 @@ -67,6 +67,7 @@ a c c2 1 Thank GOD 2 it is 3 Friday TGIF +connection master; INSERT INTO mysqltest1.v4 VALUES (4,'TEST'); SELECT * FROM mysqltest1.t1 ORDER BY a; a c @@ -79,6 +80,7 @@ a c 2 it 3 Friday 4 TEST +connection slave; SELECT * FROM mysqltest1.t1 ORDER BY a; a c 1 Thank @@ -90,6 +92,7 @@ a c 2 it 3 Friday 4 TEST +connection master; DROP VIEW IF EXISTS mysqltest1.v1; DROP VIEW IF EXISTS mysqltest1.v2; DROP VIEW IF EXISTS mysqltest1.v3; @@ -99,3 +102,5 @@ DROP TABLE IF EXISTS mysqltest1.t1; DROP TABLE IF EXISTS mysqltest1.t2; DROP TABLE IF EXISTS mysqltest1.t4; DROP DATABASE mysqltest1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_server_id1.result b/mysql-test/suite/engines/funcs/r/rpl_server_id1.result index 700bc270f07..001d1151843 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_server_id1.result +++ b/mysql-test/suite/engines/funcs/r/rpl_server_id1.result @@ -1,19 +1,21 @@ -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; +include/master-slave.inc +[connection master] +connection slave; create table t1 (n int); reset master; -stop slave; +include/stop_slave.inc change master to master_port=SLAVE_PORT; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id - 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 107 None 0 No NULL No 0 0 1 +Slave_IO_Running = 'No' +Slave_SQL_Running = 'No' +Last_SQL_Errno = '0' +Last_SQL_Error = '' +Exec_Master_Log_Pos = '0' start slave; insert into t1 values (1); -show status like "slave_running"; -Variable_name Value -Slave_running OFF +include/wait_for_slave_param.inc [Last_IO_Errno] +Last_IO_Errno = '1593' +Last_IO_Error = 'Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).' +include/stop_slave.inc +reset slave; +reset master; drop table t1; diff --git a/mysql-test/suite/engines/funcs/r/rpl_server_id2.result b/mysql-test/suite/engines/funcs/r/rpl_server_id2.result index f8d24f70776..74145645920 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_server_id2.result +++ b/mysql-test/suite/engines/funcs/r/rpl_server_id2.result @@ -1,21 +1,38 @@ -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; +include/master-slave.inc +[connection master] +connection slave; create table t1 (n int); reset master; stop slave; +include/wait_for_slave_to_stop.inc change master to master_port=SLAVE_PORT; -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id - 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 107 None 0 No NULL No 0 0 1 start slave; +include/wait_for_slave_to_start.inc insert into t1 values (1); select * from t1; n 1 1 stop slave; +include/wait_for_slave_to_stop.inc +drop table t1; +connection master; +reset master; +create table t1(n int); +create table t2(n int); +connection slave; +change master to master_port=MASTER_PORT; +start slave until master_log_file='master-bin.000001', master_log_pos=UNTIL_POS; +include/wait_for_slave_io_to_start.inc +include/wait_for_slave_sql_to_stop.inc +*** checking until position execution: must be only t1 in the list *** +show tables; +Tables_in_test +t1 +connection slave; +start slave sql_thread; +connection master; drop table t1; +drop table t2; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_session_var.result b/mysql-test/suite/engines/funcs/r/rpl_session_var.result index b5b4b815ade..67863583f8d 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_session_var.result +++ b/mysql-test/suite/engines/funcs/r/rpl_session_var.result @@ -1,12 +1,8 @@ -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; +include/master-slave.inc +[connection master] drop table if exists t1; Warnings: -Note 1051 Unknown table 't1' +Note 1051 Unknown table 'test.t1' create table t1(a varchar(100),b int); set @@session.sql_mode=pipes_as_concat; insert into t1 values('My'||'SQL', 1); @@ -16,10 +12,12 @@ select * from t1 where b<3 order by a; a b 1 2 MySQL 1 +connection slave; select * from t1 where b<3 order by a; a b 1 2 MySQL 1 +connection master; set @@session.sql_mode=ignore_space; insert into t1 values(password ('MySQL'), 3); set @@session.sql_mode=ansi_quotes; @@ -37,7 +35,24 @@ insert into t2 select 2,a from t1 where a is null; select * from t2 order by b; b a 1 1 +connection slave; select * from t2 order by b; b a 1 1 +connection master; drop table t1,t2; +connection slave; +connection master; +CREATE TABLE t1 ( +`id` int(11) NOT NULL auto_increment, +`data` varchar(100), +PRIMARY KEY (`id`) +) ENGINE=MyISAM; +INSERT INTO t1(data) VALUES(SESSION_USER()); +connection slave; +SELECT length(data) < 100 FROM t1; +length(data) < 100 +1 +connection master; +drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_sf.result b/mysql-test/suite/engines/funcs/r/rpl_sf.result index 9cb9c9e8354..e692e31f908 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_sf.result +++ b/mysql-test/suite/engines/funcs/r/rpl_sf.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] set global log_bin_trust_function_creators=0; set binlog_format=STATEMENT; create function fn16456() @@ -27,3 +23,4 @@ set binlog_format=STATEMENT; select fn16456(); ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) drop function fn16456; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_skip_error.result b/mysql-test/suite/engines/funcs/r/rpl_skip_error.result index 248ce5b52c3..98c165e7db0 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_skip_error.result +++ b/mysql-test/suite/engines/funcs/r/rpl_skip_error.result @@ -1,16 +1,18 @@ -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; +include/master-slave.inc +[connection master] create table t1 (n int not null primary key); +connection slave; insert into t1 values (1); +connection master; insert into t1 values (1); insert into t1 values (2),(3); +connection slave; select * from t1 ORDER BY n; n 1 2 3 +connection master; drop table t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_slave_status.result b/mysql-test/suite/engines/funcs/r/rpl_slave_status.result index 0e438d294fd..1c81cec2577 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_slave_status.result +++ b/mysql-test/suite/engines/funcs/r/rpl_slave_status.result @@ -1,63 +1,48 @@ -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; -grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl'; -stop slave; -change master to master_user='rpl',master_password='rpl'; -start slave; -drop table if exists t1; -create table t1 (n int); -insert into t1 values (1); -select * from t1; +include/master-slave.inc +[connection master] +==== Create new replication user ==== +connection master; +GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl'; +connection slave; +include/stop_slave.inc +set @save_relay_log_purge=@@global.relay_log_purge; +set @@global.relay_log_purge=0; +CHANGE MASTER TO master_user='rpl', master_password='rpl'; +select @@global.relay_log_purge; +@@global.relay_log_purge +0 +set @@global.relay_log_purge=1; +CHANGE MASTER TO master_user='rpl', master_password='rpl'; +select @@global.relay_log_purge; +@@global.relay_log_purge +1 +set @@global.relay_log_purge=@save_relay_log_purge; +CHANGE MASTER TO master_user='rpl', master_password='rpl'; +include/start_slave.inc +==== Do replication as new user ==== +connection master; +CREATE TABLE t1 (n INT); +INSERT INTO t1 VALUES (1); +connection slave; +SELECT * FROM t1; n 1 -drop user rpl@127.0.0.1; -flush privileges; -stop slave; -start slave; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User rpl -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Connecting -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master NULL -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 1 -drop table t1; -drop table t1; +==== Delete new replication user ==== +connection master; +DROP USER rpl@127.0.0.1; +FLUSH PRIVILEGES; +connection slave; +==== Restart slave without privileges ===== +include/stop_slave.inc +START SLAVE; +include/wait_for_slave_sql_to_start.inc +include/wait_for_slave_io_to_stop.inc +==== Verify that Slave IO thread stopped with error ==== +include/wait_for_slave_io_error.inc [errno=1045] +==== Cleanup (Note that slave IO thread is not running) ==== +include/stop_slave_sql.inc +CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = ''; +include/rpl_reset.inc +connection master; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.rdiff b/mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.rdiff new file mode 100644 index 00000000000..da41283e42f --- /dev/null +++ b/mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.rdiff @@ -0,0 +1,479 @@ +--- /home/alice/git/10.3/mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.result~ 2021-03-19 17:27:12.935559866 +0100 ++++ /home/alice/git/10.3/mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.reject 2021-03-19 17:27:14.071534938 +0100 +@@ -126,12 +126,15 @@ + show warnings; + Level Code Message + Error 1062 Duplicate entry '20' for key 'a' ++Warning 1196 Some non-transactional changed tables couldn't be rolled back + Note 4094 At line 4 in mysqltest1.foo4 + select * from t2; + a ++20 + connection slave; + select * from t2; + a ++20 + select * from mysql.proc where name="foo4" and db='mysqltest1'; + db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate + mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES DEFINER begin +@@ -171,20 +174,16 @@ + insert into t2 values(fn1(21)); + select * from t1; + a +-15 + 20 + 21 +-5 + select * from t2; + a + 23 + connection slave; + select * from t1; + a +-15 + 20 + 21 +-5 + select * from t2; + a + 23 +@@ -292,13 +291,18 @@ + Warnings: + Error 1062 Duplicate entry '100' for key 'a' + Note 4094 At line 3 in mysqltest1.fn1 ++Warning 1196 Some non-transactional changed tables couldn't be rolled back + select fn1(20); + ERROR 23000: Duplicate entry '20' for key 'a' + select * from t2; + a ++20 ++100 + connection slave; + select * from t2; + a ++20 ++100 + connection con1; + create trigger trg before insert on t1 for each row set new.a= 10; + ERROR 42000: TRIGGER command denied to user 'zedjzlcsjhd'@'localhost' for table 't1' +@@ -472,13 +476,13 @@ + end + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values ( NAME_CONST('b',8)) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (unix_timestamp()) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`() + select * from mysqltest1.t1 +@@ -509,24 +513,24 @@ + end + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (15) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; alter procedure foo4 sql security invoker + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (5) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; delete from t2 +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a) + master-bin.000001 # Gtid # # GTID #-#-# +@@ -537,6 +541,9 @@ + begin + insert into t2 values(20),(20); + end ++master-bin.000001 # Gtid # # BEGIN GTID #-#-# ++master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(20),(20) ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo4 + master-bin.000001 # Gtid # # GTID #-#-# +@@ -557,10 +564,10 @@ + master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(fn1(21)) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; drop function fn1 + master-bin.000001 # Gtid # # GTID #-#-# +@@ -571,10 +578,10 @@ + end + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(fn1()) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11) + NO SQL +@@ -589,7 +596,7 @@ + end + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; delete from t2 +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a) + master-bin.000001 # Gtid # # GTID #-#-# +@@ -601,21 +608,27 @@ + return 10; + end + master-bin.000001 # Gtid # # BEGIN GTID #-#-# ++master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(100) ++master-bin.000001 # Query # # COMMIT ++master-bin.000001 # Gtid # # BEGIN GTID #-#-# ++master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20) ++master-bin.000001 # Query # # COMMIT ++master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10 + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; drop trigger trg + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # GTID #-#-# + master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() + READS SQL DATA +@@ -647,7 +660,7 @@ + master-bin.000001 # Query # # use `test`; create table t1 (a int) + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `test`; insert into t1 (a) values (f1()) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # GTID #-#-# + master-bin.000001 # Query # # use `test`; drop view v1 + master-bin.000001 # Gtid # # GTID #-#-# +@@ -663,7 +676,7 @@ + INSERT INTO t1 VALUES(arg) + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci')) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # GTID #-#-# + master-bin.000001 # Query # # use `test`; DROP PROCEDURE p1 + master-bin.000001 # Gtid # # GTID #-#-# +@@ -697,7 +710,7 @@ + begin end + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest2`; insert into t values ( 1 ) +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + master-bin.000001 # Gtid # # GTID #-#-# + master-bin.000001 # Query # # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) + begin +@@ -706,7 +719,7 @@ + end + master-bin.000001 # Gtid # # BEGIN GTID #-#-# + master-bin.000001 # Query # # use `mysqltest`; SELECT `mysqltest2`.`f1`() +-master-bin.000001 # Xid # # COMMIT /* XID */ ++master-bin.000001 # Query # # COMMIT + connection slave; + set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; + connection master; +@@ -801,19 +814,25 @@ + SET TIMESTAMP=t/*!*/; + insert into t1 values ( NAME_CONST('b',8)) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + START TRANSACTION + /*!*/; + SET TIMESTAMP=t/*!*/; + insert into t1 values (unix_timestamp()) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + START TRANSACTION + /*!*/; + SET TIMESTAMP=t/*!*/; + delete from t1 + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`() + select * from mysqltest1.t1 +@@ -858,21 +877,27 @@ + SET TIMESTAMP=t/*!*/; + insert into t2 values(3) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + START TRANSACTION + /*!*/; + SET TIMESTAMP=t/*!*/; + SET @@session.sql_mode=0/*!*/; + insert into t1 values (15) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + START TRANSACTION + /*!*/; + SET TIMESTAMP=t/*!*/; + SET @@session.sql_mode=1411383296/*!*/; + insert into t2 values(3) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + SET @@session.sql_mode=0/*!*/; + alter procedure foo4 sql security invoker +@@ -883,20 +908,26 @@ + SET @@session.sql_mode=1411383296/*!*/; + insert into t2 values(3) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + START TRANSACTION + /*!*/; + SET TIMESTAMP=t/*!*/; + insert into t1 values (5) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + START TRANSACTION + /*!*/; + SET TIMESTAMP=t/*!*/; + SET @@session.sql_mode=0/*!*/; + delete from t2 + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + alter table t2 add unique (a) + /*!*/; +@@ -910,6 +941,14 @@ + insert into t2 values(20),(20); + end + /*!*/; ++START TRANSACTION ++/*!*/; ++SET TIMESTAMP=t/*!*/; ++insert into t2 values(20),(20) ++/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + drop procedure foo4 + /*!*/; +@@ -943,13 +982,17 @@ + SET TIMESTAMP=t/*!*/; + SELECT `mysqltest1`.`fn1`(20) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + START TRANSACTION + /*!*/; + SET TIMESTAMP=t/*!*/; + insert into t2 values(fn1(21)) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + drop function fn1 + /*!*/; +@@ -965,13 +1008,17 @@ + SET TIMESTAMP=t/*!*/; + delete from t1 + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + START TRANSACTION + /*!*/; + SET TIMESTAMP=t/*!*/; + insert into t1 values(fn1()) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + SET @@session.sql_mode=1411383296/*!*/; + CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11) +@@ -993,7 +1040,9 @@ + SET TIMESTAMP=t/*!*/; + delete from t2 + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + alter table t2 add unique (a) + /*!*/; +@@ -1010,9 +1059,27 @@ + START TRANSACTION + /*!*/; + SET TIMESTAMP=t/*!*/; ++SELECT `mysqltest1`.`fn1`(100) ++/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; ++START TRANSACTION ++/*!*/; ++SET TIMESTAMP=t/*!*/; ++SELECT `mysqltest1`.`fn1`(20) ++/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; ++START TRANSACTION ++/*!*/; ++SET TIMESTAMP=t/*!*/; + delete from t1 + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10 + /*!*/; +@@ -1021,13 +1088,17 @@ + SET TIMESTAMP=t/*!*/; + insert into t1 values (1) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + START TRANSACTION + /*!*/; + SET TIMESTAMP=t/*!*/; + delete from t1 + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + drop trigger trg + /*!*/; +@@ -1036,7 +1107,9 @@ + SET TIMESTAMP=t/*!*/; + insert into t1 values (1) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() + READS SQL DATA +@@ -1081,7 +1154,9 @@ + SET TIMESTAMP=t/*!*/; + insert into t1 (a) values (f1()) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + drop view v1 + /*!*/; +@@ -1106,7 +1181,9 @@ + SET TIMESTAMP=t/*!*/; + INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci')) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + DROP PROCEDURE p1 + /*!*/; +@@ -1158,7 +1235,9 @@ + SET TIMESTAMP=t/*!*/; + insert into t values ( 1 ) + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) + begin +@@ -1172,7 +1251,9 @@ + SET TIMESTAMP=t/*!*/; + SELECT `mysqltest2`.`f1`() + /*!*/; +-COMMIT/*!*/; ++SET TIMESTAMP=t/*!*/; ++COMMIT ++/*!*/; + SET TIMESTAMP=t/*!*/; + drop database mysqltest + /*!*/; diff --git a/mysql-test/suite/engines/funcs/r/rpl_sp.result b/mysql-test/suite/engines/funcs/r/rpl_sp.result index 873ee6b03c5..0e5929bcbd7 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_sp.result +++ b/mysql-test/suite/engines/funcs/r/rpl_sp.result @@ -1,14 +1,13 @@ -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; +include/master-slave.inc +[connection master] +set local sql_mode=''; drop database if exists mysqltest1; create database mysqltest1; use mysqltest1; create table t1 (a varchar(100)); +connection slave; use mysqltest1; +connection master; create procedure foo() begin declare b int; @@ -17,7 +16,7 @@ insert into t1 values (b); insert into t1 values (unix_timestamp()); end| select * from mysql.proc where name='foo' and db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin declare b int; set b = 8; @@ -28,9 +27,10 @@ declare b int; set b = 8; insert into t1 values (b); insert into t1 values (unix_timestamp()); -end +end NONE +connection slave; select * from mysql.proc where name='foo' and db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin declare b int; set b = 8; @@ -41,17 +41,20 @@ declare b int; set b = 8; insert into t1 values (b); insert into t1 values (unix_timestamp()); -end +end NONE +connection master; set timestamp=1000000000; call foo(); select * from t1; a 8 1000000000 +connection slave; select * from t1; a 8 1000000000 +connection master; delete from t1; create procedure foo2() select * from mysqltest1.t1; @@ -70,6 +73,8 @@ grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1; SELECT 1; 1 1 +connect con1,127.0.0.1,zedjzlcsjhd,,mysqltest1,$MASTER_MYPORT,; +connection con1; create procedure foo4() deterministic begin @@ -78,6 +83,7 @@ insert into t1 values (5); end| call foo4(); Got one of the listed errors +connection master; call foo3(); show warnings; Level Code Message @@ -96,6 +102,7 @@ a 3 3 3 +connection slave; select * from t1; a 15 @@ -105,20 +112,41 @@ a 3 3 3 +connection master; +delete from t2; +alter table t2 add unique (a); +drop procedure foo4; +create procedure foo4() +deterministic +begin +insert into t2 values(20),(20); +end| +call foo4(); +ERROR 23000: Duplicate entry '20' for key 'a' +show warnings; +Level Code Message +Error 1062 Duplicate entry '20' for key 'a' +Note 4094 At line 4 in mysqltest1.foo4 +select * from t2; +a +connection slave; +select * from t2; +a select * from mysql.proc where name="foo4" and db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 -mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES INVOKER begin -insert into t2 values(3); -insert into t1 values (5); -end zedjzlcsjhd@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin -insert into t2 values(3); -insert into t1 values (5); -end +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate +mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES DEFINER begin +insert into t2 values(20),(20); +end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +insert into t2 values(20),(20); +end NONE +connection master; drop procedure foo4; select * from mysql.proc where name="foo4" and db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate +connection slave; select * from mysql.proc where name="foo4" and db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate +connection master; drop procedure foo; drop procedure foo2; drop procedure foo3; @@ -143,18 +171,24 @@ fn1(20) insert into t2 values(fn1(21)); select * from t1; a +15 20 21 +5 select * from t2; a 23 +connection slave; select * from t1; a +15 20 21 +5 select * from t2; a 23 +connection master; drop function fn1; create function fn1() returns int @@ -167,6 +201,7 @@ ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA delete from t1; set timestamp=1000000000; insert into t1 values(fn1()); +connection con1; create function fn2() returns int no sql @@ -174,15 +209,21 @@ begin return unix_timestamp(); end| ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) +connection master; +set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; set global log_bin_trust_function_creators=0; set global log_bin_trust_function_creators=1; +connection slave; +set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; set global log_bin_trust_function_creators=1; +connection con1; create function fn2() returns int no sql begin return unix_timestamp(); end| +connection master; create function fn3() returns int not deterministic @@ -194,79 +235,115 @@ select fn3(); fn3() 0 select * from mysql.proc where db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin return unix_timestamp(); end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin return unix_timestamp(); -end +end NONE mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin return unix_timestamp(); -end zedjzlcsjhd@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +end zedjzlcsjhd@localhost # # STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci begin return unix_timestamp(); -end +end NONE mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin return 0; end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin return 0; -end +end NONE select * from t1; a 1000000000 +connection slave; use mysqltest1; select * from t1; a 1000000000 select * from mysql.proc where db='mysqltest1'; -db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 aggregate mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin return unix_timestamp(); end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin return unix_timestamp(); -end +end NONE mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin return unix_timestamp(); -end zedjzlcsjhd@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +end zedjzlcsjhd@localhost # # STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci begin return unix_timestamp(); -end +end NONE mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin return 0; end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin return 0; -end +end NONE +connection master; +delete from t2; +alter table t2 add unique (a); +Warnings: +Note 1831 Duplicate index `a_2`. This is deprecated and will be disallowed in a future release +drop function fn1; +create function fn1(x int) +returns int +begin +insert into t2 values(x),(x); +return 10; +end| +do fn1(100); +Warnings: +Error 1062 Duplicate entry '100' for key 'a' +Note 4094 At line 3 in mysqltest1.fn1 +select fn1(20); +ERROR 23000: Duplicate entry '20' for key 'a' +select * from t2; +a +connection slave; +select * from t2; +a +connection con1; create trigger trg before insert on t1 for each row set new.a= 10; ERROR 42000: TRIGGER command denied to user 'zedjzlcsjhd'@'localhost' for table 't1' +connection master; delete from t1; create trigger trg before insert on t1 for each row set new.a= 10; insert into t1 values (1); select * from t1; a 10 +connection slave; select * from t1; a 10 +connection master; delete from t1; drop trigger trg; insert into t1 values (1); select * from t1; a 1 +connection slave; select * from t1; a 1 +connection master; create procedure foo() not deterministic reads sql data select * from t1; +connection slave; call foo(); a 1 +connection master; drop procedure foo; +connection slave; +connection master; drop function fn1; drop database mysqltest1; drop user "zedjzlcsjhd"@127.0.0.1; use test; +connection slave; use test; +connection master; drop function if exists f1; create function f1() returns int reads sql data begin @@ -285,9 +362,12 @@ a 1 drop view v1; drop function f1; +connection slave; +connection slave; select * from t1; a 1 +connection master; DROP PROCEDURE IF EXISTS p1; DROP TABLE IF EXISTS t1; CREATE TABLE t1(col VARCHAR(10)); @@ -297,21 +377,23 @@ CALL p1('test'); SELECT * FROM t1; col test +connection slave; SELECT * FROM t1; col test +connection master; DROP PROCEDURE p1; ---> Test for BUG#20438 ---> Preparing environment... ----> connection: master +connection master; DROP PROCEDURE IF EXISTS p1; DROP FUNCTION IF EXISTS f1; ---> Synchronizing slave with master... - ----> connection: master +connection slave; +connection master; ---> Creating procedure... /*!50003 CREATE PROCEDURE p1() SET @a = 1 */; @@ -328,7 +410,7 @@ f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) RETURN 0 latin1 latin1_swedish_ci latin1_swedish_ci ---> Synchronizing slave with master... ----> connection: master +connection slave; ---> Checking on slave... SHOW CREATE PROCEDURE p1; @@ -339,17 +421,17 @@ SHOW CREATE FUNCTION f1; Function sql_mode Create Function character_set_client collation_connection Database Collation f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) RETURN 0 latin1 latin1_swedish_ci latin1_swedish_ci - ----> connection: master +connection master; ---> Cleaning up... DROP PROCEDURE p1; DROP FUNCTION f1; +connection slave; +connection master; +connection master; drop table t1; -set global log_bin_trust_function_creators=0; -set global log_bin_trust_function_creators=0; -End of 5.0 tests -reset master; +connection slave; +connection master; drop database if exists mysqltest; drop database if exists mysqltest2; create database mysqltest; @@ -360,6 +442,871 @@ create procedure mysqltest.test() begin end; insert into t values ( 1 ); create procedure `\\`.test() begin end; ERROR 42000: Unknown database '\\' +connection master; +create function f1 () returns int +begin +insert into t values (1); +return 0; +end| +connection slave; +connection master; +use mysqltest; +set @a:= mysqltest2.f1(); +connection slave; +connection master; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # drop database if exists mysqltest1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # create database mysqltest1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a varchar(100)) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() +begin +declare b int; +set b = 8; +insert into t1 values (b); +insert into t1 values (unix_timestamp()); +end +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values ( NAME_CONST('b',8)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (unix_timestamp()) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`() +select * from mysqltest1.t1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; alter procedure foo2 contains sql +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; create table t1 (a int) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; create table t2 like t1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo3`() + DETERMINISTIC +insert into t1 values (15) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` PROCEDURE `foo4`() + DETERMINISTIC +begin +insert into t2 values(3); +insert into t1 values (5); +end +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (15) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; alter procedure foo4 sql security invoker +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (5) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; delete from t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo4 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo4`() + DETERMINISTIC +begin +insert into t2 values(20),(20); +end +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo4 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo2 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo3 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11) + DETERMINISTIC +begin +insert into t1 values (x); +return x+2; +end +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; delete t1,t2 from t1,t2 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(fn1(21)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; drop function fn1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`() RETURNS int(11) + NO SQL +begin +return unix_timestamp(); +end +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(fn1()) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11) + NO SQL +begin +return unix_timestamp(); +end +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS int(11) + READS SQL DATA +begin +return 0; +end +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; delete from t2 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; drop function fn1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11) +begin +insert into t2 values(x),(x); +return 10; +end +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10 +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; drop trigger trg +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() + READS SQL DATA +select * from t1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest1`; drop function fn1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # drop database mysqltest1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # drop user "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; drop function if exists f1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) + READS SQL DATA +begin +declare var integer; +declare c cursor for select a from v1; +open c; +fetch c into var; +close c; +return var; +end +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 as a +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; insert into t1 (a) values (f1()) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; drop view v1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; drop function f1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS p1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(col VARCHAR(10)) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10)) +INSERT INTO t1 VALUES(arg) +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci')) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP PROCEDURE p1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS p1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP FUNCTION IF EXISTS f1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +SET @a = 1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +RETURN 0 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP PROCEDURE p1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP FUNCTION f1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # drop database if exists mysqltest +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # drop database if exists mysqltest2 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # create database mysqltest +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # create database mysqltest2 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest2`; create table t ( t integer ) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltest`.`test`() +begin end +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest2`; insert into t values ( 1 ) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +begin +insert into t values (1); +return 0; +end +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mysqltest`; SELECT `mysqltest2`.`f1`() +master-bin.000001 # Xid # # COMMIT /* XID */ +connection slave; +set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; +connection master; +set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; drop database mysqltest; drop database mysqltest2; -End of 5.1 tests +connection slave; +connection master; +use test; +/*!50001 create procedure `mysqltestbug36570_p1`() */ +begin +select 1; +end| +use mysql| +create procedure test.` mysqltestbug36570_p2`(/*!50001 a int*/)`label`: +begin +select a; +end| +/*!50001 create function test.mysqltestbug36570_f1() */ +returns int +/*!50001 deterministic */ +begin +return 3; +end| +use test| +show procedure status like '%mysqltestbug36570%'; +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test mysqltestbug36570_p2 PROCEDURE root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci +test mysqltestbug36570_p1 PROCEDURE root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci +show create procedure ` mysqltestbug36570_p2`; +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation + mysqltestbug36570_p2 CREATE DEFINER=`root`@`localhost` PROCEDURE ` mysqltestbug36570_p2`( a int) +`label`: +begin +select a; +end latin1 latin1_swedish_ci latin1_swedish_ci +connection slave; +connection slave; +show procedure status like '%mysqltestbug36570%'; +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test mysqltestbug36570_p2 PROCEDURE root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci +test mysqltestbug36570_p1 PROCEDURE root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci +show create procedure ` mysqltestbug36570_p2`; +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation + mysqltestbug36570_p2 CREATE DEFINER=`root`@`localhost` PROCEDURE ` mysqltestbug36570_p2`( a int) +`label`: +begin +select a; +end latin1 latin1_swedish_ci latin1_swedish_ci +call ` mysqltestbug36570_p2`(42); +a +42 +show function status like '%mysqltestbug36570%'; +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +test mysqltestbug36570_f1 FUNCTION root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci +connection master; +flush logs; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET TIMESTAMP=t/*!*/; +SET @@session.pseudo_thread_id=999999999/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.lc_time_names=0/*!*/; +SET @@session.collation_database=DEFAULT/*!*/; +drop database if exists mysqltest1 +/*!*/; +SET TIMESTAMP=t/*!*/; +create database mysqltest1 +/*!*/; +use `mysqltest1`/*!*/; +SET TIMESTAMP=t/*!*/; +create table t1 (a varchar(100)) +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() +begin +declare b int; +set b = 8; +insert into t1 values (b); +insert into t1 values (unix_timestamp()); +end +/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +insert into t1 values ( NAME_CONST('b',8)) +/*!*/; +COMMIT/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +insert into t1 values (unix_timestamp()) +/*!*/; +COMMIT/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +delete from t1 +/*!*/; +COMMIT/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`() +select * from mysqltest1.t1 +/*!*/; +SET TIMESTAMP=t/*!*/; +alter procedure foo2 contains sql +/*!*/; +SET TIMESTAMP=t/*!*/; +DROP TABLE `t1` /* generated by server */ +/*!*/; +SET TIMESTAMP=t/*!*/; +create table t1 (a int) +/*!*/; +SET TIMESTAMP=t/*!*/; +create table t2 like t1 +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` PROCEDURE `foo3`() + DETERMINISTIC +insert into t1 values (15) +/*!*/; +SET TIMESTAMP=t/*!*/; +grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1 +/*!*/; +SET TIMESTAMP=t/*!*/; +grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1 +/*!*/; +SET TIMESTAMP=t/*!*/; +grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1 +/*!*/; +SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=1411383296/*!*/; +CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` PROCEDURE `foo4`() + DETERMINISTIC +begin +insert into t2 values(3); +insert into t1 values (5); +end +/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +insert into t2 values(3) +/*!*/; +COMMIT/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=0/*!*/; +insert into t1 values (15) +/*!*/; +COMMIT/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=1411383296/*!*/; +insert into t2 values(3) +/*!*/; +COMMIT/*!*/; +SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=0/*!*/; +alter procedure foo4 sql security invoker +/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=1411383296/*!*/; +insert into t2 values(3) +/*!*/; +COMMIT/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +insert into t1 values (5) +/*!*/; +COMMIT/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=0/*!*/; +delete from t2 +/*!*/; +COMMIT/*!*/; +SET TIMESTAMP=t/*!*/; +alter table t2 add unique (a) +/*!*/; +SET TIMESTAMP=t/*!*/; +drop procedure foo4 +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` PROCEDURE `foo4`() + DETERMINISTIC +begin +insert into t2 values(20),(20); +end +/*!*/; +SET TIMESTAMP=t/*!*/; +drop procedure foo4 +/*!*/; +SET TIMESTAMP=t/*!*/; +drop procedure foo +/*!*/; +SET TIMESTAMP=t/*!*/; +drop procedure foo2 +/*!*/; +SET TIMESTAMP=t/*!*/; +drop procedure foo3 +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11) + DETERMINISTIC +begin +insert into t1 values (x); +return x+2; +end +/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +delete t1,t2 from t1,t2 +/*!*/; +SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +SELECT `mysqltest1`.`fn1`(20) +/*!*/; +COMMIT/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +insert into t2 values(fn1(21)) +/*!*/; +COMMIT/*!*/; +SET TIMESTAMP=t/*!*/; +drop function fn1 +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`() RETURNS int(11) + NO SQL +begin +return unix_timestamp(); +end +/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +delete from t1 +/*!*/; +COMMIT/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +insert into t1 values(fn1()) +/*!*/; +COMMIT/*!*/; +SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=1411383296/*!*/; +CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11) + NO SQL +begin +return unix_timestamp(); +end +/*!*/; +SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=0/*!*/; +CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS int(11) + READS SQL DATA +begin +return 0; +end +/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +delete from t2 +/*!*/; +COMMIT/*!*/; +SET TIMESTAMP=t/*!*/; +alter table t2 add unique (a) +/*!*/; +SET TIMESTAMP=t/*!*/; +drop function fn1 +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11) +begin +insert into t2 values(x),(x); +return 10; +end +/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +delete from t1 +/*!*/; +COMMIT/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10 +/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +insert into t1 values (1) +/*!*/; +COMMIT/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +delete from t1 +/*!*/; +COMMIT/*!*/; +SET TIMESTAMP=t/*!*/; +drop trigger trg +/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +insert into t1 values (1) +/*!*/; +COMMIT/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() + READS SQL DATA +select * from t1 +/*!*/; +SET TIMESTAMP=t/*!*/; +drop procedure foo +/*!*/; +SET TIMESTAMP=t/*!*/; +drop function fn1 +/*!*/; +SET TIMESTAMP=t/*!*/; +drop database mysqltest1 +/*!*/; +SET TIMESTAMP=t/*!*/; +drop user "zedjzlcsjhd"@127.0.0.1 +/*!*/; +use `test`/*!*/; +SET TIMESTAMP=t/*!*/; +drop function if exists f1 +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) + READS SQL DATA +begin +declare var integer; +declare c cursor for select a from v1; +open c; +fetch c into var; +close c; +return var; +end +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 as a +/*!*/; +SET TIMESTAMP=t/*!*/; +create table t1 (a int) +/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +insert into t1 (a) values (f1()) +/*!*/; +COMMIT/*!*/; +SET TIMESTAMP=t/*!*/; +drop view v1 +/*!*/; +SET TIMESTAMP=t/*!*/; +drop function f1 +/*!*/; +SET TIMESTAMP=t/*!*/; +DROP PROCEDURE IF EXISTS p1 +/*!*/; +SET TIMESTAMP=t/*!*/; +DROP TABLE IF EXISTS `t1` /* generated by server */ +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE TABLE t1(col VARCHAR(10)) +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10)) +INSERT INTO t1 VALUES(arg) +/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci')) +/*!*/; +COMMIT/*!*/; +SET TIMESTAMP=t/*!*/; +DROP PROCEDURE p1 +/*!*/; +SET TIMESTAMP=t/*!*/; +DROP PROCEDURE IF EXISTS p1 +/*!*/; +SET TIMESTAMP=t/*!*/; +DROP FUNCTION IF EXISTS f1 +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +SET @a = 1 +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +RETURN 0 +/*!*/; +SET TIMESTAMP=t/*!*/; +DROP PROCEDURE p1 +/*!*/; +SET TIMESTAMP=t/*!*/; +DROP FUNCTION f1 +/*!*/; +SET TIMESTAMP=t/*!*/; +DROP TABLE `t1` /* generated by server */ +/*!*/; +SET TIMESTAMP=t/*!*/; +drop database if exists mysqltest +/*!*/; +SET TIMESTAMP=t/*!*/; +drop database if exists mysqltest2 +/*!*/; +SET TIMESTAMP=t/*!*/; +create database mysqltest +/*!*/; +SET TIMESTAMP=t/*!*/; +create database mysqltest2 +/*!*/; +use `mysqltest2`/*!*/; +SET TIMESTAMP=t/*!*/; +create table t ( t integer ) +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltest`.`test`() +begin end +/*!*/; +START TRANSACTION +/*!*/; +SET TIMESTAMP=t/*!*/; +insert into t values ( 1 ) +/*!*/; +COMMIT/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +begin +insert into t values (1); +return 0; +end +/*!*/; +START TRANSACTION +/*!*/; +use `mysqltest`/*!*/; +SET TIMESTAMP=t/*!*/; +SELECT `mysqltest2`.`f1`() +/*!*/; +COMMIT/*!*/; +SET TIMESTAMP=t/*!*/; +drop database mysqltest +/*!*/; +SET TIMESTAMP=t/*!*/; +drop database mysqltest2 +/*!*/; +use `test`/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltestbug36570_p1`() +begin +select 1; +end +/*!*/; +use `mysql`/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` PROCEDURE `test`.` mysqltestbug36570_p2`( a int) +`label`: +begin +select a; +end +/*!*/; +SET TIMESTAMP=t/*!*/; +CREATE DEFINER=`root`@`localhost` FUNCTION `test`.`mysqltestbug36570_f1`() RETURNS int(11) + DETERMINISTIC +begin +return 3; +end +/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; +use test; +drop procedure mysqltestbug36570_p1; +drop procedure ` mysqltestbug36570_p2`; +drop function mysqltestbug36570_f1; +End of 5.0 tests +# End of 5.1 tests +# +# Test Bug#30977 Concurrent statement using stored +# function and DROP FUNCTION breaks SBR. +# +# Demonstrate that stored function DDL can not go through, +# or, worse yet, make its way into the binary log, while +# the stored function is in use. +# For that, try to insert a result of a stored function +# into a table. Block the insert in the beginning, waiting +# on a table lock. While insert is blocked, attempt to +# drop the routine. Verify that this attempt +# blocks and waits for INSERT to complete. Commit and +# reap the chain of events. Master and slave must contain +# identical data. Statements in the binrary log must be +# consistent with data in the table. +# +connection default; +drop table if exists t1, t2; +drop function if exists t1; +create table t1 (a int); +create table t2 (a int) as select 1 as a; +create function f1() returns int deterministic return (select max(a) from t2); +lock table t2 write; +connection master; +# Sending 'insert into t1 (a) values (f1())'... +insert into t1 (a) values (f1()); +connection master1; +# Waitng for 'insert into t1 ...' to get blocked on table lock... +# Sending 'drop function f1'. It will wait till insert finishes. +drop function f1;; +connection default; +# Check that 'drop function f1' gets blocked. +# Now let's let 'insert' go through... +unlock tables; +connection master; +# Reaping 'insert into t1 (a) values (f1())'... +connection master1; +# Reaping 'drop function f1' +connection master; +select * from t1; +a +1 +connection slave; +connection slave; +select * from t1; +a +1 +connection master; +drop table t1, t2; +drop function f1; +ERROR 42000: FUNCTION test.f1 does not exist +# +# Bug #11918 Can't use a declared variable in LIMIT clause +# +include/rpl_reset.inc +create table t1 (c1 int); +insert into t1 (c1) values +(1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +create procedure p1(p1 integer) +delete from t1 limit p1; +set @save_binlog_format=@@session.binlog_format; +set @@session.binlog_format=STATEMENT; +call p1(NULL); +call p1(0); +call p1(1); +call p1(2); +call p1(3); +select * from t1; +c1 +7 +8 +9 +10 +connection slave; +connection slave; +select * from t1; +c1 +7 +8 +9 +10 +connection master; +call p1(-1); +select * from t1; +c1 +connection slave; +connection slave; +select * from t1; +c1 +connection master; +# Cleanup +set @@session.binlog_format=@save_binlog_format; +drop table t1; +drop procedure p1; +# End of 5.5 tests. +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_sp004.result b/mysql-test/suite/engines/funcs/r/rpl_sp004.result index 1c0ed3cc50a..72f0428ce0f 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_sp004.result +++ b/mysql-test/suite/engines/funcs/r/rpl_sp004.result @@ -1,9 +1,6 @@ -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; +include/master-slave.inc +[connection master] +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t2; @@ -38,6 +35,7 @@ a 2 3 8 +connection slave; SELECT * FROM test.t1 ORDER BY a; a 1 @@ -50,15 +48,18 @@ a 2 3 8 +connection master; CALL test.p2(); USE test; SHOW TABLES; Tables_in_test t3 +connection slave; USE test; SHOW TABLES; Tables_in_test t3 +connection master; CALL test.p1(); Warnings: Note 1050 Table 't3' already exists @@ -74,6 +75,7 @@ a 2 3 8 +connection slave; SELECT * FROM test.t1 ORDER BY a; a 1 @@ -86,8 +88,11 @@ a 2 3 8 +connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t3; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_sp_effects.result b/mysql-test/suite/engines/funcs/r/rpl_sp_effects.result index 97cc0a78a23..d6890f22b02 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_sp_effects.result +++ b/mysql-test/suite/engines/funcs/r/rpl_sp_effects.result @@ -1,9 +1,7 @@ -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; +include/master-slave.inc +[connection master] +connection master; +SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; drop procedure if exists p1; drop procedure if exists p2; drop function if exists f1; @@ -20,6 +18,8 @@ set spv=spv+1; end while; end// call p1(); +connection slave; +connection slave; SELECT * FROM t1 ORDER BY a; a 1 @@ -27,6 +27,7 @@ a 3 4 5 +connection master; SELECT * FROM t1 ORDER BY a; a 1 @@ -43,9 +44,12 @@ call p2(); SELECT * FROM t2 ORDER BY a; a 4 +connection slave; +connection slave; SELECT * FROM t2 ORDER BY a; a 4 +connection master; drop procedure p1; drop procedure p2; drop table t2; @@ -104,6 +108,8 @@ master: 7 master: 8 master: 10 master: 11 +connection slave; +connection slave; SELECT 'slave:',a FROM t1 ORDER BY a; slave: a slave: 1 @@ -120,6 +126,7 @@ slave: 7 slave: 8 slave: 10 slave: 11 +connection master; drop procedure p1; delete from t1; delete from t2; @@ -134,10 +141,13 @@ SELECT 'master:',a FROM t1 ORDER BY a; master: a master: 1 master: 2 +connection slave; +connection slave; SELECT 'slave:',a FROM t1 ORDER BY a; slave: a slave: 1 slave: 2 +connection master; drop view v1; delete from t1; prepare s1 from 'select f1(?)'; @@ -148,9 +158,12 @@ f1(?) SELECT 'master:',a FROM t1 ORDER BY a; master: a master: 123 +connection slave; +connection slave; SELECT 'slave:',a FROM t1 ORDER BY a; slave: a slave: 123 +connection master; delete from t1; create procedure p1(spv int) begin @@ -169,12 +182,15 @@ master: 6 master: 6 master: 15 master: 15 +connection slave; +connection slave; SELECT 'slave:',a FROM t1 ORDER BY a; slave: a slave: 6 slave: 6 slave: 15 slave: 15 +connection master; drop procedure p1; drop function f1; drop table t1,t2; @@ -220,6 +236,8 @@ master 100 master 101 master 101 master 102 +connection slave; +connection slave; SELECT 'slave', a FROM t1 ORDER BY a; slave a slave 10 @@ -231,7 +249,73 @@ slave 100 slave 101 slave 101 slave 102 +connection master; drop table t1; drop function f1; drop function f2; drop procedure p1; +connection slave; +connection master; +create table t2 (b BIT(7)); +create procedure sp_bug26199(bitvalue BIT(7)) +begin +insert into t2 set b = bitvalue; +end // +create function sf_bug26199(b BIT(7)) returns int +begin +insert into t2 values(b); +return 0; +end// +call sp_bug26199(b'1110'); +call sp_bug26199('\0'); +select sf_bug26199(b'1111111'); +sf_bug26199(b'1111111') +0 +SET STATEMENT sql_mode = '' FOR +select sf_bug26199(b'101111111'); +sf_bug26199(b'101111111') +0 +Warnings: +Warning 1264 Out of range value for column 'b' at row 1 +select sf_bug26199('\''); +sf_bug26199('\'') +0 +select hex(b) from t2; +hex(b) +E +0 +7F +7F +27 +connection slave; +select hex(b) from t2; +hex(b) +E +0 +7F +7F +27 +connection master; +drop table t2; +drop procedure sp_bug26199; +drop function sf_bug26199; +SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; +connection slave; +set names utf8; +CREATE FUNCTION f() RETURNS timestamp DETERMINISTIC +BEGIN RETURN '2012-12-21 12:12:12'; END | +CREATE PROCEDURE p(t timestamp) +BEGIN +SET @t = t; +PREPARE stmt FROM " + UPDATE t1 SET a = @t WHERE '2012-12-31 08:00:00' < f() "; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +END | +create table t1 (a timestamp); +call p('2012-12-31 08:00:00'); +drop table t1; +drop procedure p; +drop function f; +end of the tests +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_start_stop_slave.result b/mysql-test/suite/engines/funcs/r/rpl_start_stop_slave.result index 1fcb586d1fb..48c5e548fd2 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_start_stop_slave.result +++ b/mysql-test/suite/engines/funcs/r/rpl_start_stop_slave.result @@ -1,12 +1,17 @@ -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; -stop slave; +include/master-slave.inc +[connection master] +connection slave; +include/stop_slave.inc +connection master; create table t1(n int); -start slave; -stop slave io_thread; +connection slave; +include/start_slave.inc +include/stop_slave_io.inc start slave io_thread; +include/wait_for_slave_io_to_start.inc +connection master; +connection slave; +connection master; drop table t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_stm_max_relay_size.result b/mysql-test/suite/engines/funcs/r/rpl_stm_max_relay_size.result index 547dd8e1541..41d18d7f9fe 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_stm_max_relay_size.result +++ b/mysql-test/suite/engines/funcs/r/rpl_stm_max_relay_size.result @@ -1,20 +1,19 @@ +include/master-slave.inc +[connection master] +connection slave; 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; -stop slave; +connection master; # # Generate a big enough master's binlog to cause relay log rotations # create table t1 (a int); drop table t1; +connection slave; reset slave; # # Test 1 # -set @my_max_binlog_size= @@global.max_binlog_size; +set @my_max_binlog_size= @@global.max_binlog_size, @my_max_relay_log_size=@@global.max_relay_log_size; set global max_binlog_size=8192; set global max_relay_log_size=8192-1; Warnings: @@ -23,7 +22,7 @@ select @@global.max_relay_log_size; @@global.max_relay_log_size 4096 start slave; -Checking that both slave threads are running. +include/check_slave_is_running.inc # # Test 2 # @@ -33,17 +32,19 @@ set global max_relay_log_size=(5*4096); select @@global.max_relay_log_size; @@global.max_relay_log_size 20480 start slave; -Checking that both slave threads are running. +include/check_slave_is_running.inc # # Test 3: max_relay_log_size = 0 # stop slave; reset slave; set global max_relay_log_size=0; +Warnings: +Warning 1292 Truncated incorrect max_relay_log_size value: '0' select @@global.max_relay_log_size; -@@global.max_relay_log_size 0 +@@global.max_relay_log_size 4096 start slave; -Checking that both slave threads are running. +include/check_slave_is_running.inc # # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # @@ -56,19 +57,27 @@ flush logs; reset slave; start slave; flush logs; +connection master; create table t1 (a int); -Checking that both slave threads are running. +connection slave; +include/check_slave_is_running.inc # # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # flush logs; +connection master; drop table t1; -Checking that both slave threads are running. +connection slave; +include/check_slave_is_running.inc +connection master; flush logs; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB> +connection slave; set global max_binlog_size= @my_max_binlog_size; +set global max_relay_log_size= @my_max_relay_log_size; # # End of 4.1 tests # +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_stm_mystery22.result b/mysql-test/suite/engines/funcs/r/rpl_stm_mystery22.result index ea34b308ec2..0d99235e45c 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_stm_mystery22.result +++ b/mysql-test/suite/engines/funcs/r/rpl_stm_mystery22.result @@ -1,20 +1,20 @@ -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; +include/master-slave.inc +[connection master] create table t1(n int auto_increment primary key, s char(10)); +connection slave; insert into t1 values (2,'old'); +connection master; insert into t1 values(NULL,'new'); insert into t1 values(NULL,'new'); +connection slave; select * from t1 order by n; n s 1 new 2 old delete from t1 where n = 2; -start slave; -stop slave; +include/start_slave.inc +include/stop_slave.inc +connection master; create table t2(n int); drop table t2; insert into t1 values(NULL,'new'); @@ -22,10 +22,14 @@ set sql_log_bin=0; insert into t1 values(NULL,'new'); set sql_log_bin=1; delete from t1 where n=4; -start slave; +connection slave; +include/start_slave.inc select * from t1 order by n; n s 1 new 2 new 3 new +connection master; drop table t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_stm_no_op.result b/mysql-test/suite/engines/funcs/r/rpl_stm_no_op.result index 5a253d61fcb..2505660f863 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_stm_no_op.result +++ b/mysql-test/suite/engines/funcs/r/rpl_stm_no_op.result @@ -1,52 +1,71 @@ -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; +include/master-slave.inc +[connection master] +connection slave; create database mysqltest; +connection master; drop database if exists mysqltest; Warnings: Note 1008 Can't drop database 'mysqltest'; database doesn't exist +connection slave; show tables from mysqltest; ERROR 42000: Unknown database 'mysqltest' +connection slave; create table t1 (a int); +connection master; drop table if exists t1; Warnings: -Note 1051 Unknown table 't1' +Note 1051 Unknown table 'test.t1' +connection slave; select * from t1; ERROR 42S02: Table 'test.t1' doesn't exist +connection master; create table t1 (a int, b int); +connection slave; insert into t1 values(1,1); +connection master; delete from t1; +connection slave; select * from t1; a b insert into t1 values(1,1); +connection master; insert into t1 values(2,1); update t1 set a=2; +connection slave; select * from t1; a b 2 1 2 1 +connection master; create table t2 (a int, b int); delete from t1; insert into t1 values(1,1); insert into t2 values(1,1); +connection slave; update t1 set a=2; +connection master; UPDATE t1, t2 SET t1.a = t2.a; +connection slave; select * from t1; a b 1 1 select * from t2; a b 1 1 +connection master; delete from t1; delete from t2; +connection slave; insert into t1 values(1,1); insert into t2 values(1,1); +connection master; DELETE t1.*, t2.* from t1, t2; +connection slave; select * from t1; a b select * from t2; a b +connection master; drop table t1, t2; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result b/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result index c6c2c525098..1ba2d1b624b 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result +++ b/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result @@ -1,41 +1,58 @@ -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; -Master_User root -Master_Host 127.0.0.1 +include/master-slave.inc +[connection master] +connection slave; +Master_User = 'root' +Master_Host = '127.0.0.1' include/stop_slave.inc change master to master_user='test'; -Master_User test -Master_Host 127.0.0.1 +Master_User = 'test' +Master_Host = '127.0.0.1' reset slave; -Master_User test -Master_Host 127.0.0.1 +Master_User = 'test' +Master_Host = '127.0.0.1' change master to master_user='root'; include/start_slave.inc -Master_User root -Master_Host 127.0.0.1 +Master_User = 'root' +Master_Host = '127.0.0.1' include/stop_slave.inc reset slave; include/start_slave.inc +connection master; create temporary table t1 (a int); +connection slave; include/stop_slave.inc reset slave; include/start_slave.inc show status like 'slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 1 +connection master; +drop temporary table if exists t1; +connection slave; include/stop_slave.inc reset slave; +include/check_slave_no_error.inc change master to master_user='impossible_user_name'; start slave; -stop slave; +include/wait_for_slave_io_error.inc [errno=1045] +include/stop_slave_sql.inc change master to master_user='root'; include/start_slave.inc +include/check_slave_no_error.inc stop slave; change master to master_user='impossible_user_name'; start slave; -stop slave; +include/wait_for_slave_io_error.inc [errno=1045] +include/stop_slave_sql.inc reset slave; +include/check_slave_no_error.inc +change master to master_user='root'; +reset slave; +include/start_slave.inc +include/stop_slave.inc +reset slave all; +start slave; +ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO +CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT; +include/start_slave.inc +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result index b0d92f3ca3f..936f604be2e 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result +++ b/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result @@ -1,15 +1,36 @@ -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; -set @saved_binlog_format = @@global.binlog_format; +include/master-slave.inc +[connection master] +connection slave; +connection master; drop database if exists mysqltest1; create database mysqltest1; use mysqltest1; +set @my_binlog_format= @@global.binlog_format; +set session binlog_format=mixed; +show session variables like "binlog_format%"; +Variable_name Value +binlog_format MIXED +set session binlog_format=statement; +show session variables like "binlog_format%"; +Variable_name Value +binlog_format STATEMENT set session binlog_format=row; -set global binlog_format=row; +show session variables like "binlog_format%"; +Variable_name Value +binlog_format ROW +set global binlog_format=DEFAULT; +show global variables like "binlog_format%"; +Variable_name Value +binlog_format MIXED +set global binlog_format=MIXED; +show global variables like "binlog_format%"; +Variable_name Value +binlog_format MIXED +set global binlog_format=STATEMENT; +show global variables like "binlog_format%"; +Variable_name Value +binlog_format STATEMENT +set global binlog_format=ROW; show global variables like "binlog_format%"; Variable_name Value binlog_format ROW @@ -68,11 +89,11 @@ execute stmt1 using @string; deallocate prepare stmt1; insert into t1 values("for_10_"); insert into t1 select "yesterday_11_"; -set binlog_format=default; +set binlog_format=statement; select @@global.binlog_format, @@session.binlog_format; @@global.binlog_format @@session.binlog_format STATEMENT STATEMENT -set global binlog_format=default; +set global binlog_format=statement; select @@global.binlog_format, @@session.binlog_format; @@global.binlog_format @@session.binlog_format STATEMENT STATEMENT @@ -87,11 +108,11 @@ execute stmt1 using @string; deallocate prepare stmt1; insert into t1 values("for_15_"); insert into t1 select "yesterday_16_"; -set binlog_format=mixed; +set global binlog_format=mixed; select @@global.binlog_format, @@session.binlog_format; @@global.binlog_format @@session.binlog_format -STATEMENT MIXED -set global binlog_format=mixed; +MIXED STATEMENT +set binlog_format=default; select @@global.binlog_format, @@session.binlog_format; @@global.binlog_format @@session.binlog_format MIXED MIXED @@ -112,11 +133,15 @@ execute stmt1 using @string; deallocate prepare stmt1; insert into t1 values(concat("for_23_",UUID())); insert into t1 select "yesterday_24_"; -create table t2 select rpad(UUID(),100,' '); +create table t2 ENGINE=MyISAM select rpad(UUID(),100,' '); create table t3 select 1 union select UUID(); +SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3); +SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3); -insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4); +Warnings: +Warning 1292 Truncated incorrect datetime value: '3' +insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4); create procedure foo() begin insert into t1 values("work_25_"); @@ -228,6 +253,14 @@ begin set NEW.data = concat(NEW.data,UUID()); end| insert into t11 values("try_560_"); +insert delayed into t2 values("delay_1_"); +insert delayed into t2 values(concat("delay_2_",UUID())); +insert delayed into t2 values("delay_6_"); +insert delayed into t2 values(rand()); +set @a=2.345; +insert delayed into t2 values(@a); +connection slave; +connection master; create table t20 select * from t1; create table t21 select * from t2; create table t22 select * from t3; @@ -244,14 +277,18 @@ end| select f("try_41_"); f("try_41_") 1 +connection slave; use mysqltest1; insert into t2 values(2,null),(3,null),(4,null); delete from t2 where a>=2; +connection master; select f("try_42_"); f("try_42_") 1 +connection slave; insert into t2 values(3,null),(4,null); delete from t2 where a>=3; +connection master; prepare stmt1 from 'select f(?)'; set @string="try_43_"; insert into t1 values(null,"try_44_"); @@ -259,6 +296,8 @@ execute stmt1 using @string; f(?) 1 deallocate prepare stmt1; +connection slave; +connection master; create table t12 select * from t1; drop table t1; create table t1 (a int, b varchar(100), key(a)); @@ -284,12 +323,16 @@ end| select f1("try_46_"),f2("try_47_"); f1("try_46_") f2("try_47_") 1 1 +connection slave; insert into t2 values(2,null),(3,null),(4,null); delete from t2 where a>=2; +connection master; select f1("try_48_"),f2("try_49_"); f1("try_48_") f2("try_49_") 1 1 insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_"))); +connection slave; +connection master; drop function f2; create function f2 (x varchar(100)) returns int deterministic begin @@ -301,6 +344,8 @@ end| select f1("try_53_"),f2("try_54_"); f1("try_53_") f2("try_54_") 1 3 +connection slave; +connection master; drop function f2; create trigger t1_bi before insert on t1 for each row begin @@ -309,12 +354,16 @@ end| insert into t1 values(null,"try_56_"); alter table t1 modify a int, drop primary key; insert into t1 values(null,"try_57_"); +connection slave; +connection master; CREATE TEMPORARY TABLE t15 SELECT UUID(); create table t16 like t15; INSERT INTO t16 SELECT * FROM t15; insert into t16 values("try_65_"); drop table t15; insert into t16 values("try_66_"); +connection slave; +connection master; select count(*) from t1; count(*) 7 @@ -338,7 +387,7 @@ count(*) 66 select count(*) from t21; count(*) -14 +19 select count(*) from t22; count(*) 2 @@ -354,6 +403,8 @@ count(*) select count(*) from t16; count(*) 3 +connection slave; +connection master; DROP TABLE IF EXISTS t11; SET SESSION BINLOG_FORMAT=STATEMENT; CREATE TABLE t11 (song VARCHAR(255)); @@ -366,17 +417,44 @@ UNLOCK TABLES; SELECT * FROM t11; song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict song Careful With That Axe, Eugene +connection slave; USE mysqltest1; SELECT * FROM t11; song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict song Careful With That Axe, Eugene +connection master; DROP TABLE IF EXISTS t12; SET SESSION BINLOG_FORMAT=MIXED; CREATE TABLE t12 (data LONG); LOCK TABLES t12 WRITE; INSERT INTO t12 VALUES(UUID()); UNLOCK TABLES; -show binlog events; -show binlog events; +connection slave; +connection master; +CREATE FUNCTION my_user() +RETURNS CHAR(64) +BEGIN +DECLARE user CHAR(64); +SELECT USER() INTO user; +RETURN user; +END $$ +CREATE FUNCTION my_current_user() +RETURNS CHAR(64) +BEGIN +DECLARE user CHAR(64); +SELECT CURRENT_USER() INTO user; +RETURN user; +END $$ +DROP TABLE IF EXISTS t13; +CREATE TABLE t13 (data CHAR(64)); +INSERT INTO t13 VALUES (USER()); +INSERT INTO t13 VALUES (my_user()); +INSERT INTO t13 VALUES (CURRENT_USER()); +INSERT INTO t13 VALUES (my_current_user()); +connection slave; +connection master; drop database mysqltest1; -set global binlog_format= @saved_binlog_format; +connection slave; +connection master; +set global binlog_format =@my_binlog_format; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_temp_table.result b/mysql-test/suite/engines/funcs/r/rpl_temp_table.result index e4ca31d8908..ff3e52f77b5 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_temp_table.result +++ b/mysql-test/suite/engines/funcs/r/rpl_temp_table.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] create table t2 (n int, PRIMARY KEY(n)); create temporary table t1 (n int); create temporary table t3 (n int not null); @@ -15,10 +11,16 @@ insert into t3 values (1010); insert into t2 select * from t3; drop table if exists t3; insert into t2 values (1012); +connection master1; create temporary table t1 (n int); insert into t1 values (4),(5); insert into t2 select * from t1; +disconnect master; +connection slave; +connection master1; insert into t2 values(61); +disconnect master1; +connection slave; select * from t2; n 1 @@ -43,6 +45,19 @@ sum(n) show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 +*** MDEV-8016: Replication aborts on DROP /*!40005 TEMPORARY */ TABLE IF EXISTS *** +connect master2,localhost,root,,; +INSERT INTO t2 VALUES (2000), (2001); +CREATE FUNCTION f() RETURNS INTEGER RETURN 1; +CREATE TEMPORARY TABLE t3 AS SELECT f() AS col FROM t2; +disconnect master2; +connection default; +connection slave; +connect master2,localhost,root,,; +connection master2; drop table if exists t1,t2; Warnings: -Note 1051 Unknown table 't1' +Note 1051 Unknown table 'test.t1' +drop function f; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_temporary.result b/mysql-test/suite/engines/funcs/r/rpl_temporary.result index 27def773a30..e2999cdd225 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_temporary.result +++ b/mysql-test/suite/engines/funcs/r/rpl_temporary.result @@ -1,11 +1,43 @@ -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; +SET sql_log_bin = 0; +SET sql_log_bin = 1; +include/master-slave.inc +[connection master] +connection slave; reset master; -CREATE USER ''@localhost; +connection master; +DROP TABLE IF EXISTS t1; +CREATE TEMPORARY TABLE t1 (a char(1)); +INSERT INTO t1 VALUES ('a'); +connection slave; +include/stop_slave.inc +include/start_slave.inc +connection master; +INSERT INTO t1 VALUES ('b'); +connection slave; +connection master; +DROP TABLE IF EXISTS t1; +CREATE TEMPORARY TABLE `t1`(`a` tinyint,`b` char(1))engine=myisam; +INSERT IGNORE INTO `t1` set `a`=128,`b`='128'; +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1265 Data truncated for column 'b' at row 1 +connection slave; +include/stop_slave.inc +include/start_slave.inc +connection master; +INSERT IGNORE INTO `t1` set `a`=128,`b`='128'; +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1265 Data truncated for column 'b' at row 1 +connection slave; +connection master; +DROP TABLE t1; +connection slave; +connection master; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connect con3,localhost,zedjzlcsjhd,,; +connection con3; SET @save_select_limit=@@session.sql_select_limit; SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100; ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation @@ -17,20 +49,33 @@ ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) fo SELECT @@session.sql_select_limit = @save_select_limit; @@session.sql_select_limit = @save_select_limit 1 +connection con2; +SET @save_conn_id= connection_id(); SET @@session.pseudo_thread_id=100; SET @@session.pseudo_thread_id=connection_id(); +SET @@session.pseudo_thread_id=@save_conn_id; SET @@session.sql_log_bin=0; SET @@session.sql_log_bin=1; +connection con3; drop table if exists t1,t2; create table t1(f int); create table t2(f int); insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +SELECT COUNT(*) FROM t1; +COUNT(*) +10 +connection con1; create temporary table t3(f int); insert into t3 select * from t1 where f<6; +connection con2; create temporary table t3(f int); +connection con1; insert into t2 select count(*) from t3; +connection con2; insert into t3 select * from t1 where f>=4; +connection con1; drop temporary table t3; +connection con2; insert into t2 select count(*) from t3; drop temporary table t3; select * from t2 ORDER BY f; @@ -75,15 +120,22 @@ f 7 drop table t1,t2; create temporary table t3 (f int); +connection slave; +connection master; create temporary table t4 (f int); create table t5 (f int); -select id from information_schema.processlist where command='Binlog Dump' into @id; -kill @id; +connection slave; +stop slave; +connection master; insert into t5 select * from t4; +connection slave; +start slave; select * from t5 /* must be 1 after reconnection */; f +connection master; drop temporary table t4; drop table t5; +connection con1; set @@session.pseudo_thread_id=100; create temporary table t101 (id int); create temporary table t102 (id int); @@ -95,14 +147,99 @@ set @@session.pseudo_thread_id=300; create temporary table t301 (id int); create temporary table t302 (id int); create temporary table `#sql_not_user_table303` (id int); -DROP USER ''@localhost; +disconnect con1; +connection master; create table t1(f int); insert into t1 values (1); +connection slave; select * from t1 /* must be 1 */; f 1 +connection master; drop table t1; +connection slave; select * from t1; a 1 +connection master; drop table t1; +connection slave; +include/stop_slave.inc +connection master; +include/rpl_reset.inc +-- Bug#43748 +-- make a user on the slave that can list but not kill system threads. +connection slave; +FLUSH PRIVILEGES; +GRANT USAGE ON *.* TO user43748@127.0.0.1 IDENTIFIED BY 'meow'; +GRANT PROCESS ON *.* TO user43748@127.0.0.1; +-- try to KILL system-thread as that non-privileged user (on slave). +connect cont43748,127.0.0.1,user43748,meow,test,$SLAVE_MYPORT,; +connection cont43748; +SELECT id INTO @id FROM information_schema.processlist WHERE user='system user' LIMIT 1; +KILL @id; +Got one of the listed errors +disconnect cont43748; +-- throw out test-user on slave. +connection slave; +DROP USER user43748@127.0.0.1; +# +# MDEV-10216: Assertion `strcmp(share->unique_file_name,filename) || +# share->last_version' failed in myisam/mi_open.c:67: test_if_reopen +# +connection master; +CREATE TEMPORARY TABLE t1(i INT PRIMARY KEY) ENGINE=MYISAM; +INSERT INTO t1 VALUES(1); +SELECT COUNT(*)=1 FROM t1; +COUNT(*)=1 +1 +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +COUNT(*)=1 +1 +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +LOCK TABLES t1 WRITE; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +COUNT(*)=1 +1 +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; +LOCK TABLES t1 READ; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +COUNT(*)=1 +1 +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; +FLUSH TABLES WITH READ LOCK; +ALTER TABLE t1 RENAME t2; +SELECT COUNT(*)=1 FROM t2; +COUNT(*)=1 +1 +ALTER TABLE t2 RENAME t1; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; +ALTER TABLE t1 RENAME t2, LOCK SHARED; +ALTER TABLE t2 RENAME t1, LOCK EXCLUSIVE; +DROP TABLE t1; +# +# MDEV-10320: NO-OP ALTER TABLE on temporary tables getting logged +# under row binlog format +# +connection master; +CREATE TEMPORARY TABLE t1(i INT PRIMARY KEY) ENGINE=MYISAM; +ALTER TABLE t1; +ALTER TABLE t1 ADD COLUMN IF NOT EXISTS I INT; +Warnings: +Note 1060 Duplicate column name 'I' +DROP TABLE t1; +End of 5.1 tests +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_trigger.result b/mysql-test/suite/engines/funcs/r/rpl_trigger.result index 7c7cda1f581..b5b88670fc6 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_trigger.result +++ b/mysql-test/suite/engines/funcs/r/rpl_trigger.result @@ -1,12 +1,6 @@ -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; -DROP TABLE IF EXISTS t1; -DROP TABLE IF EXISTS t2; -DROP TABLE IF EXISTS t3; +include/master-slave.inc +[connection master] +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null); create table t2 (a int auto_increment, primary key (a), b int); create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null); @@ -22,8 +16,10 @@ insert into t3 values(100,"log",0,0,0); SET @@RAND_SEED1=658490765, @@RAND_SEED2=635893186; insert into t1 values(1,1,rand()),(NULL,2,rand()); insert into t2 (b) values(last_insert_id()); -insert into t2 values(3,0),(NULL,0); -insert into t2 values(NULL,0),(500,0); +insert into t2 values(3,0); +insert into t2 values(NULL,0); +insert into t2 values(NULL,0); +insert into t2 values(500,0); select a,b, truncate(rand_value,4) from t1; a b truncate(rand_value,4) 1 1 0.4320 @@ -39,14 +35,13 @@ select a,name, old_a, old_b, truncate(rand_value,4) from t3; a name old_a old_b truncate(rand_value,4) 100 log 0 0 0.0000 101 t1 1 1 0.3203 -102 t1 0 2 0.5666 +102 t1 NULL 2 0.5666 103 t2 1 2 0.9164 104 t2 3 0 0.8826 105 t2 4 0 0.6635 106 t2 5 0 0.6699 107 t2 500 0 0.3593 - ---- On slave -- +connection slave; select a,b, truncate(rand_value,4) from t1; a b truncate(rand_value,4) 1 1 0.4320 @@ -62,16 +57,20 @@ select a,name, old_a, old_b, truncate(rand_value,4) from t3; a name old_a old_b truncate(rand_value,4) 100 log 0 0 0.0000 101 t1 1 1 0.3203 -102 t1 0 2 0.5666 +102 t1 NULL 2 0.5666 103 t2 1 2 0.9164 104 t2 3 0 0.8826 105 t2 4 0 0.6635 106 t2 5 0 0.6699 107 t2 500 0 0.3593 +connection master; drop table t1,t2,t3; +connect con2,localhost,root,,; +connection con2; select get_lock("bug12480",2); get_lock("bug12480",2) 1 +connection default; create table t1 (a datetime,b datetime, c datetime); drop function if exists bug12480; create function bug12480() returns datetime @@ -91,40 +90,33 @@ select a=b && a=c from t1; a=b && a=c 1 SELECT routine_name, definer -FROM information_schema.routines; +FROM information_schema.routines +WHERE routine_name = 'bug12480'; routine_name definer -add_suppression root@localhost -check_testcase root@localhost -check_warnings root@localhost -force_restart root@localhost bug12480 root@localhost SELECT trigger_name, definer -FROM information_schema.triggers; +FROM information_schema.triggers +WHERE trigger_name = 't1_first'; trigger_name definer -gs_insert root@localhost -ts_insert root@localhost t1_first root@localhost - ---- On slave -- +connection slave; SELECT routine_name, definer -FROM information_schema.routines; +FROM information_schema.routines +WHERE routine_name = 'bug12480'; routine_name definer -add_suppression root@localhost -check_testcase root@localhost -check_warnings root@localhost -force_restart root@localhost bug12480 root@localhost SELECT trigger_name, definer -FROM information_schema.triggers; +FROM information_schema.triggers +WHERE trigger_name = 't1_first'; trigger_name definer -gs_insert root@localhost -ts_insert root@localhost t1_first root@localhost select a=b && a=c from t1; a=b && a=c 1 test 1 +connection master; +disconnect con2; truncate table t1; drop trigger t1_first; insert into t1 values ("2003-03-03","2003-03-03","2003-03-03"),(bug12480(),bug12480(),bug12480()),(now(),now(),now()); @@ -144,6 +136,8 @@ end| create database other; use other; insert into test.t1 values (1); +connection slave; +connection master; use test; drop table t1,t2; drop database other; @@ -151,14 +145,18 @@ test case for BUG#13227 ------------------- 10 ------------------- +connection master; drop table if exists t110; +connection slave; drop table if exists t210,t310; +connection master; create table t110 (f1 int) /* 2 replicate */; insert into t110 values (-5); insert into t110 values (-4); insert into t110 values (-3); insert into t110 values (-2); insert into t110 values (-1); +connection slave; select * from t110; f1 -5 @@ -198,11 +196,13 @@ f1 SELECT * from t310 /* must be f3 5*100 */; f3 500 +connection master; UPDATE t110 SET f1=5 where f1=-5; UPDATE t110 SET f1=4 where f1=-4; UPDATE t110 SET f1=3 where f1=-3; UPDATE t110 SET f1=2 where f1=-2; UPDATE t110 SET f1=1 where f1=-1; +connection slave; SELECT * from t110 /* must be f1 5 ... 1 */; f1 5 @@ -219,18 +219,25 @@ f3 100 drop trigger trg110; drop table t210,t310; +connection master; drop table t110; +connection slave; +connection master; ------------------- 9 ------------------- +connection master; drop table if exists t19; +connection slave; drop table if exists t29,t39; +connection master; create table t19 (f1 int) /* 2 replicate */; insert into t19 values (-5); insert into t19 values (-4); insert into t19 values (-3); insert into t19 values (-2); insert into t19 values (-1); +connection slave; select * from t19; f1 -5 @@ -270,11 +277,13 @@ f1 SELECT * from t39 /* must be f3 5*100 */; f3 500 +connection master; UPDATE t19 SET f1=5 where f1=-5; UPDATE t19 SET f1=4 where f1=-4; UPDATE t19 SET f1=3 where f1=-3; UPDATE t19 SET f1=2 where f1=-2; UPDATE t19 SET f1=1 where f1=-1; +connection slave; SELECT * from t19 /* must be f1 5 ... 1 */; f1 5 @@ -291,18 +300,25 @@ f3 100 drop trigger trg19; drop table t29,t39; +connection master; drop table t19; +connection slave; +connection master; ------------------- 8 ------------------- +connection master; drop table if exists t18; +connection slave; drop table if exists t28,t38; +connection master; create table t18 (f1 int) /* 2 replicate */; insert into t18 values (-5); insert into t18 values (-4); insert into t18 values (-3); insert into t18 values (-2); insert into t18 values (-1); +connection slave; select * from t18; f1 -5 @@ -342,11 +358,13 @@ f1 SELECT * from t38 /* must be f3 5*100 */; f3 500 +connection master; UPDATE t18 SET f1=5 where f1=-5; UPDATE t18 SET f1=4 where f1=-4; UPDATE t18 SET f1=3 where f1=-3; UPDATE t18 SET f1=2 where f1=-2; UPDATE t18 SET f1=1 where f1=-1; +connection slave; SELECT * from t18 /* must be f1 5 ... 1 */; f1 5 @@ -363,18 +381,25 @@ f3 100 drop trigger trg18; drop table t28,t38; +connection master; drop table t18; +connection slave; +connection master; ------------------- 7 ------------------- +connection master; drop table if exists t17; +connection slave; drop table if exists t27,t37; +connection master; create table t17 (f1 int) /* 2 replicate */; insert into t17 values (-5); insert into t17 values (-4); insert into t17 values (-3); insert into t17 values (-2); insert into t17 values (-1); +connection slave; select * from t17; f1 -5 @@ -414,11 +439,13 @@ f1 SELECT * from t37 /* must be f3 5*100 */; f3 500 +connection master; UPDATE t17 SET f1=5 where f1=-5; UPDATE t17 SET f1=4 where f1=-4; UPDATE t17 SET f1=3 where f1=-3; UPDATE t17 SET f1=2 where f1=-2; UPDATE t17 SET f1=1 where f1=-1; +connection slave; SELECT * from t17 /* must be f1 5 ... 1 */; f1 5 @@ -435,18 +462,25 @@ f3 100 drop trigger trg17; drop table t27,t37; +connection master; drop table t17; +connection slave; +connection master; ------------------- 6 ------------------- +connection master; drop table if exists t16; +connection slave; drop table if exists t26,t36; +connection master; create table t16 (f1 int) /* 2 replicate */; insert into t16 values (-5); insert into t16 values (-4); insert into t16 values (-3); insert into t16 values (-2); insert into t16 values (-1); +connection slave; select * from t16; f1 -5 @@ -486,11 +520,13 @@ f1 SELECT * from t36 /* must be f3 5*100 */; f3 500 +connection master; UPDATE t16 SET f1=5 where f1=-5; UPDATE t16 SET f1=4 where f1=-4; UPDATE t16 SET f1=3 where f1=-3; UPDATE t16 SET f1=2 where f1=-2; UPDATE t16 SET f1=1 where f1=-1; +connection slave; SELECT * from t16 /* must be f1 5 ... 1 */; f1 5 @@ -507,18 +543,25 @@ f3 100 drop trigger trg16; drop table t26,t36; +connection master; drop table t16; +connection slave; +connection master; ------------------- 5 ------------------- +connection master; drop table if exists t15; +connection slave; drop table if exists t25,t35; +connection master; create table t15 (f1 int) /* 2 replicate */; insert into t15 values (-5); insert into t15 values (-4); insert into t15 values (-3); insert into t15 values (-2); insert into t15 values (-1); +connection slave; select * from t15; f1 -5 @@ -558,11 +601,13 @@ f1 SELECT * from t35 /* must be f3 5*100 */; f3 500 +connection master; UPDATE t15 SET f1=5 where f1=-5; UPDATE t15 SET f1=4 where f1=-4; UPDATE t15 SET f1=3 where f1=-3; UPDATE t15 SET f1=2 where f1=-2; UPDATE t15 SET f1=1 where f1=-1; +connection slave; SELECT * from t15 /* must be f1 5 ... 1 */; f1 5 @@ -579,18 +624,25 @@ f3 100 drop trigger trg15; drop table t25,t35; +connection master; drop table t15; +connection slave; +connection master; ------------------- 4 ------------------- +connection master; drop table if exists t14; +connection slave; drop table if exists t24,t34; +connection master; create table t14 (f1 int) /* 2 replicate */; insert into t14 values (-5); insert into t14 values (-4); insert into t14 values (-3); insert into t14 values (-2); insert into t14 values (-1); +connection slave; select * from t14; f1 -5 @@ -630,11 +682,13 @@ f1 SELECT * from t34 /* must be f3 5*100 */; f3 500 +connection master; UPDATE t14 SET f1=5 where f1=-5; UPDATE t14 SET f1=4 where f1=-4; UPDATE t14 SET f1=3 where f1=-3; UPDATE t14 SET f1=2 where f1=-2; UPDATE t14 SET f1=1 where f1=-1; +connection slave; SELECT * from t14 /* must be f1 5 ... 1 */; f1 5 @@ -651,18 +705,25 @@ f3 100 drop trigger trg14; drop table t24,t34; +connection master; drop table t14; +connection slave; +connection master; ------------------- 3 ------------------- +connection master; drop table if exists t13; +connection slave; drop table if exists t23,t33; +connection master; create table t13 (f1 int) /* 2 replicate */; insert into t13 values (-5); insert into t13 values (-4); insert into t13 values (-3); insert into t13 values (-2); insert into t13 values (-1); +connection slave; select * from t13; f1 -5 @@ -702,11 +763,13 @@ f1 SELECT * from t33 /* must be f3 5*100 */; f3 500 +connection master; UPDATE t13 SET f1=5 where f1=-5; UPDATE t13 SET f1=4 where f1=-4; UPDATE t13 SET f1=3 where f1=-3; UPDATE t13 SET f1=2 where f1=-2; UPDATE t13 SET f1=1 where f1=-1; +connection slave; SELECT * from t13 /* must be f1 5 ... 1 */; f1 5 @@ -723,18 +786,25 @@ f3 100 drop trigger trg13; drop table t23,t33; +connection master; drop table t13; +connection slave; +connection master; ------------------- 2 ------------------- +connection master; drop table if exists t12; +connection slave; drop table if exists t22,t32; +connection master; create table t12 (f1 int) /* 2 replicate */; insert into t12 values (-5); insert into t12 values (-4); insert into t12 values (-3); insert into t12 values (-2); insert into t12 values (-1); +connection slave; select * from t12; f1 -5 @@ -774,11 +844,13 @@ f1 SELECT * from t32 /* must be f3 5*100 */; f3 500 +connection master; UPDATE t12 SET f1=5 where f1=-5; UPDATE t12 SET f1=4 where f1=-4; UPDATE t12 SET f1=3 where f1=-3; UPDATE t12 SET f1=2 where f1=-2; UPDATE t12 SET f1=1 where f1=-1; +connection slave; SELECT * from t12 /* must be f1 5 ... 1 */; f1 5 @@ -795,18 +867,25 @@ f3 100 drop trigger trg12; drop table t22,t32; +connection master; drop table t12; +connection slave; +connection master; ------------------- 1 ------------------- +connection master; drop table if exists t11; +connection slave; drop table if exists t21,t31; +connection master; create table t11 (f1 int) /* 2 replicate */; insert into t11 values (-5); insert into t11 values (-4); insert into t11 values (-3); insert into t11 values (-2); insert into t11 values (-1); +connection slave; select * from t11; f1 -5 @@ -846,11 +925,13 @@ f1 SELECT * from t31 /* must be f3 5*100 */; f3 500 +connection master; UPDATE t11 SET f1=5 where f1=-5; UPDATE t11 SET f1=4 where f1=-4; UPDATE t11 SET f1=3 where f1=-3; UPDATE t11 SET f1=2 where f1=-2; UPDATE t11 SET f1=1 where f1=-1; +connection slave; SELECT * from t11 /* must be f1 5 ... 1 */; f1 5 @@ -867,11 +948,20 @@ f3 100 drop trigger trg11; drop table t21,t31; +connection master; drop table t11; -STOP SLAVE; +connection slave; +connection master; +connection slave; +include/stop_slave.inc +connection master; FLUSH LOGS; +include/rpl_stop_server.inc [server_number=1] +include/rpl_start_server.inc [server_number=1] +--> Master binlog: Server ver: 5.0.16-debug-log, Binlog ver: 4 +connection slave; RESET SLAVE; -START SLAVE; +include/start_slave.inc SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0; MASTER_POS_WAIT('master-bin.000001', 513) >= 0 1 @@ -881,7 +971,7 @@ t1 t2 SHOW TRIGGERS; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -trg1 INSERT t1 INSERT INTO t2 VALUES(CURRENT_USER()) AFTER NULL latin1 latin1_swedish_ci latin1_swedish_ci +trg1 INSERT t1 INSERT INTO t2 VALUES(CURRENT_USER()) AFTER # latin1 latin1_swedish_ci latin1_swedish_ci SELECT * FROM t1; c 1 @@ -900,25 +990,28 @@ root@localhost DROP TRIGGER trg1; DROP TABLE t1; DROP TABLE t2; -STOP SLAVE; +include/stop_slave.inc RESET SLAVE; +connection master; SHOW TABLES LIKE 't_'; Tables_in_test (t_) SHOW TRIGGERS; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation RESET MASTER; -START SLAVE; +connection slave; +include/start_slave.inc ---> Test for BUG#20438 ---> Preparing environment... ----> connection: master +connection master; DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; ---> Synchronizing slave with master... +connection slave; ----> connection: master +connection master; ---> Creating objects... CREATE TABLE t1(c INT); @@ -939,7 +1032,7 @@ c 10 ---> Synchronizing slave with master... ----> connection: master +connection slave; ---> Checking on slave... SELECT * FROM t1; @@ -949,11 +1042,14 @@ SELECT * FROM t2; c 10 ----> connection: master +connection master; ---> Cleaning up... DROP TABLE t1; DROP TABLE t2; +connection slave; +connection master; +connection master; drop table if exists t1; create table t1(a int, b varchar(50)); drop trigger not_a_trigger; @@ -975,11 +1071,15 @@ a b 1 In trigger t1_bi 2 b 3 c +connection slave; select * from t1; a b 1 In trigger t1_bi 2 b 3 c +connection master; drop table if exists t1,t11; Warnings: -Note 1051 Unknown table 't11' +Note 1051 Unknown table 'test.t11' +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_trunc_temp.result b/mysql-test/suite/engines/funcs/r/rpl_trunc_temp.result index 44624a38875..35cd91d795b 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_trunc_temp.result +++ b/mysql-test/suite/engines/funcs/r/rpl_trunc_temp.result @@ -1,22 +1,26 @@ -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; +include/master-slave.inc +[connection master] create temporary table t1 (n int); insert into t1 values(1); +connection slave; show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 1 +connection master; delete from t1; +connection slave; show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 1 +connection master; truncate t1; +connection slave; show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 1 +disconnect master; +connection slave; show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_user_variables.result b/mysql-test/suite/engines/funcs/r/rpl_user_variables.result index ed0d2782394..0efdbff5522 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_user_variables.result +++ b/mysql-test/suite/engines/funcs/r/rpl_user_variables.result @@ -1,10 +1,8 @@ -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; +include/master-slave.inc +[connection master] +connection slave; reset master; +connection master; create table t1(n char(30)); set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1; set @s1:='This is a test', @r1:=12.5, @r2:=-12.5; @@ -23,6 +21,7 @@ set @a:=5; insert into t1 values (@a),(@a); select * from t1 where n = '<nonexistant>'; n +connection master1; insert into t1 values (@a),(@a),(@a*5); SELECT * FROM t1 ORDER BY n; n @@ -51,6 +50,7 @@ abcn1 abcn1n2 abc\def This is a test +connection slave; SELECT * FROM t1 ORDER BY n; n NULL @@ -78,6 +78,235 @@ abcn1 abcn1n2 abc\def This is a test +connection master; insert into t1 select * FROM (select @var1 union select @var2) AS t2; drop table t1; -stop slave; +End of 4.1 tests. +DROP TABLE IF EXISTS t20; +DROP TABLE IF EXISTS t21; +DROP PROCEDURE IF EXISTS test.insert; +CREATE TABLE t20 (a VARCHAR(20)); +CREATE TABLE t21 (a VARCHAR(20)); +CREATE PROCEDURE test.insert() +BEGIN +IF (@VAR) +THEN +INSERT INTO test.t20 VALUES ('SP_TRUE'); +ELSE +INSERT INTO test.t20 VALUES ('SP_FALSE'); +END IF; +END| +CREATE TRIGGER test.insert_bi BEFORE INSERT +ON test.t20 FOR EACH ROW +BEGIN +IF (@VAR) +THEN +INSERT INTO test.t21 VALUES ('TRIG_TRUE'); +ELSE +INSERT INTO test.t21 VALUES ('TRIG_FALSE'); +END IF; +END| +connection slave; +connection master; +SET @VAR=0; +CALL test.insert(); +SET @VAR=1; +CALL test.insert(); +Check the tables for correct data +SELECT * FROM t20; +a +SP_FALSE +SP_TRUE +SELECT * FROM t21; +a +TRIG_FALSE +TRIG_TRUE +connection slave; +Check the tables for correct data and it matches master +SELECT * FROM t20; +a +SP_FALSE +SP_TRUE +SELECT * FROM t21; +a +TRIG_FALSE +TRIG_TRUE +connection master; +DROP TABLE t20; +DROP TABLE t21; +DROP PROCEDURE test.insert; +DROP TABLE IF EXISTS t1; +DROP FUNCTION IF EXISTS test.square; +CREATE TABLE t1 (i INT); +CREATE FUNCTION test.square() RETURNS INTEGER DETERMINISTIC RETURN +(@var * @var); +SET @var = 1; +INSERT INTO t1 VALUES (square()); +SET @var = 2; +INSERT INTO t1 VALUES (square()); +SET @var = 3; +INSERT INTO t1 VALUES (square()); +SET @var = 4; +INSERT INTO t1 VALUES (square()); +SET @var = 5; +INSERT INTO t1 VALUES (square()); +Retrieve the values from the table +SELECT * FROM t1; +i +1 +4 +9 +16 +25 +connection slave; +Retrieve the values from the table and verify they are the same as on master +SELECT * FROM t1; +i +1 +4 +9 +16 +25 +connection master; +DROP TABLE t1; +DROP FUNCTION test.square; +DROP TABLE IF EXISTS t1; +DROP FUNCTION IF EXISTS f1; +DROP FUNCTION IF EXISTS f2; +CREATE TABLE t1(a int); +CREATE FUNCTION f1() returns int deterministic BEGIN +return @a; +END | +CREATE FUNCTION f2() returns int deterministic BEGIN +IF (@b > 0) then +SET @c = (@a + @b); +else +SET @c = (@a - 1); +END if; +return @c; +END | +connection slave; +connection master; +SET @a=500; +INSERT INTO t1 values(f1()); +SET @b = 125; +SET @c = 1; +INSERT INTO t1 values(f2()); +Retrieve the values from the table +connection slave; +connection master; +SELECT * from t1; +a +500 +625 +connection slave; +Check the tables for correct data and it matches master +SELECT * from t1; +a +500 +625 +connection master; +DROP TABLE t1; +DROP FUNCTION f1; +DROP FUNCTION f2; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +CREATE TABLE t1 (i int); +CREATE TABLE t2 (k int); +CREATE trigger t1_bi before INSERT on t1 for each row BEGIN +INSERT INTO t2 values (@a); +SET @a:=42; +INSERT INTO t2 values (@a); +END | +connection slave; +connection master; +SET @a:=100; +INSERT INTO t1 values (5); +Check to see that data was inserted correctly in both tables +SELECT * from t1; +i +5 +SELECT * from t2; +k +100 +42 +connection slave; +Check the tables for correct data and it matches master +SELECT * from t1; +i +5 +SELECT * from t2; +k +100 +42 +connection master; +drop table t1, t2; +connection master; +create table t1(a int, b int); +prepare s1 from 'insert into t1 values (@x:=@x+1, ?)'; +set @x=1; +execute s1 using @x; +select * from t1; +a b +2 1 +connection slave; +connection slave; +select * from t1; +a b +2 1 +connection master; +drop table t1; +connection master; +create table t1(a int); +insert into t1 values (1),(2); +prepare s1 from 'insert into t1 select a from t1 limit ?'; +set @x='1.1'; +execute s1 using @x; +select * from t1; +a +1 +2 +1 +connection slave; +connection slave; +select * from t1; +a +1 +2 +1 +connection master; +drop table t1; +End of 5.0 tests. +DROP FUNCTION IF EXISTS f1; +DROP FUNCTION IF EXISTS f2; +CREATE TABLE t1 (i INT); +CREATE FUNCTION f1() RETURNS INT RETURN @a; +CREATE +FUNCTION f2() RETURNS INT BEGIN +INSERT INTO t1 VALUES (10 + @a); +RETURN 0; +END| +connection slave; +connection master; +SET @a:=123; +SELECT f1(), f2(); +f1() f2() +123 0 +Check to see that data was inserted correctly +INSERT INTO t1 VALUES(f1()); +SELECT * FROM t1; +i +133 +123 +connection slave; +Check the table for correct data and it matches master +SELECT * FROM t1; +i +133 +123 +connection master; +DROP FUNCTION f1; +DROP FUNCTION f2; +DROP TABLE t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_variables.result b/mysql-test/suite/engines/funcs/r/rpl_variables.result index 6a9af27179e..547c324fdf8 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_variables.result +++ b/mysql-test/suite/engines/funcs/r/rpl_variables.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] set @my_slave_net_timeout =@@global.slave_net_timeout; set @my_sql_slave_skip_counter =@@global.sql_slave_skip_counter; set global slave_net_timeout=100; @@ -19,3 +15,4 @@ Variable_name Value slave_skip_errors 3,100,137,643,1752 set global slave_net_timeout=@my_slave_net_timeout; set global sql_slave_skip_counter=@my_sql_slave_skip_counter; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/r/rpl_view.result b/mysql-test/suite/engines/funcs/r/rpl_view.result index 00d9bfbf380..68a149720b0 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_view.result +++ b/mysql-test/suite/engines/funcs/r/rpl_view.result @@ -1,12 +1,10 @@ -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; +include/master-slave.inc +[connection master] drop table if exists t1,v1; drop view if exists t1,v1; +connection slave; reset master; +connection master; create table t1 (a int); insert into t1 values (1); create view v1 as select a from t1; @@ -15,45 +13,57 @@ select * from v1 order by a; a 1 2 +connection slave; select * from v1 order by a; a 1 2 +connection master; update v1 set a=3 where a=1; select * from v1 order by a; a 2 3 +connection slave; select * from v1 order by a; a 2 3 +connection master; delete from v1 where a=2; select * from v1 order by a; a 3 +connection slave; select * from v1 order by a; a 3 +connection master; alter view v1 as select a as b from t1; +connection slave; select * from v1 order by 1; b 3 +connection master; drop view v1; +connection slave; select * from v1 order by a; ERROR 42S02: Table 'test.v1' doesn't exist +connection master; drop table t1; +connection slave; ---> Test for BUG#20438 ---> Preparing environment... ----> connection: master +connection master; DROP TABLE IF EXISTS t1; DROP VIEW IF EXISTS v1; ---> Synchronizing slave with master... +connection slave; ----> connection: master +connection master; ---> Creating objects... CREATE TABLE t1(c INT); @@ -68,21 +78,22 @@ c 1 ---> Synchronizing slave with master... ----> connection: master - ----> Checking on slave... +connection slave; SELECT * FROM t1; c 1 - ----> connection: master +connection master; ---> Cleaning up... DROP VIEW v1; DROP TABLE t1; +connection slave; +connection master; +connection master; create table t1(a int, b int); insert into t1 values (1, 1), (1, 2), (1, 3); create view v1(a, b) as select a, sum(b) from t1 group by a; +connection slave; explain v1; Field Type Null Key Default Extra a int(11) YES NULL @@ -93,6 +104,35 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI select * from v1; a b 1 6 +connection master; drop table t1; drop view v1; +connection slave; +connection master; +CREATE TABLE t1(a INT); +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE VIEW v1 AS SELECT * FROM t1; +ERROR 42S01: Table 'v1' already exists +DROP VIEW v1; +DROP TABLE t1; +connection slave; +connection master; +CREATE TABLE t1 (a INT); +# create view as output from mysqldump 10.11 (5.0.62) +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` < 3) */ +/*!50002 WITH CASCADED CHECK OPTION */; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3 WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci +connection slave; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3 WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci +connection master; +DROP VIEW v1; +DROP TABLE t1; +connection slave; End of 5.0 tests +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl000010-slave.opt b/mysql-test/suite/engines/funcs/t/rpl000010-slave.opt deleted file mode 100644 index 0dbfb311e33..00000000000 --- a/mysql-test/suite/engines/funcs/t/rpl000010-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---disconnect-slave-event-count=2 diff --git a/mysql-test/suite/engines/funcs/t/rpl000010.test b/mysql-test/suite/engines/funcs/t/rpl000010.test deleted file mode 100644 index 261b9148774..00000000000 --- a/mysql-test/suite/engines/funcs/t/rpl000010.test +++ /dev/null @@ -1,19 +0,0 @@ -# This tests the offset off by 22 mystery bug -# Must run slave with --disconnect-slave-event-count=1 --master-connect-retry=1 - -source include/master-slave.inc; - -create table t1 (n int not null auto_increment primary key); -insert into t1 values(NULL); -insert into t1 values(2); -save_master_pos; -connection slave; -sync_with_master; -select n from t1; -connection master; -drop table t1; -save_master_pos; -connection slave; -sync_with_master; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl000011.test b/mysql-test/suite/engines/funcs/t/rpl000011.test deleted file mode 100644 index 32f6227f7c5..00000000000 --- a/mysql-test/suite/engines/funcs/t/rpl000011.test +++ /dev/null @@ -1,17 +0,0 @@ -source include/master-slave.inc; - -create table t1 (n int); -insert into t1 values(1); -sync_slave_with_master; -stop slave; -start slave; -connection master; -insert into t1 values(2); -#let slave catch up -sync_slave_with_master; -select * from t1; -connection master; -drop table t1; -sync_slave_with_master; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl000013.test b/mysql-test/suite/engines/funcs/t/rpl000013.test deleted file mode 100644 index 2c727107563..00000000000 --- a/mysql-test/suite/engines/funcs/t/rpl000013.test +++ /dev/null @@ -1,61 +0,0 @@ -# This test is to verify that DROP TEMPORARY TABLE -# is automatically binlogged and sent to slave -# when a temp table is dropped by disconnection -# of a master's conection. -# So it does not apply to row-based, where we neither need -# nor do this automatic binlogging. And if we run this test -# in row-based, it hangs waiting for an offset which is never -# reached (the "sync_with_master 1"), logically. - ---source include/have_binlog_format_mixed_or_statement.inc -source include/master-slave.inc; -save_master_pos; -connection slave; -sync_with_master; -connection master; - ---disable_query_log -CALL mtr.add_suppression(" Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); ---enable_query_log - -create table t2(n int); -create temporary table t1 (n int); -insert into t1 values(1),(2),(3); ---disable_warnings -insert into t2 select * from t1; ---enable_warnings -connection master1; -create temporary table t1 (n int); -insert into t1 values (4),(5); ---disable_warnings -insert into t2 select * from t1 as t10; ---enable_warnings -save_master_pos; -disconnect master; -connection slave; -#add 1 to catch drop table -sync_with_master 1; -connection master1; -insert into t2 values(6); -save_master_pos; -disconnect master1; -connection slave; -# same trick to go one more event -sync_with_master 1; -select * from t2; -show status like 'Slave_open_temp_tables'; -# -# Clean up -# -connect (master2,localhost,root,,); -connection master2; - -# We will get a warning for t1 as this is a temporary table that doesn't -# exist in this connection. - -drop table if exists t1,t2; -save_master_pos; -connection slave; -sync_with_master; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl000017-slave.opt b/mysql-test/suite/engines/funcs/t/rpl000017-slave.opt deleted file mode 100644 index 58a964c90d0..00000000000 --- a/mysql-test/suite/engines/funcs/t/rpl000017-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---skip-slave-start diff --git a/mysql-test/suite/engines/funcs/t/rpl_000010.test b/mysql-test/suite/engines/funcs/t/rpl_000010.test new file mode 100644 index 00000000000..155b54572e3 --- /dev/null +++ b/mysql-test/suite/engines/funcs/t/rpl_000010.test @@ -0,0 +1,2 @@ +--source suite/rpl/t/rpl_000010.test + diff --git a/mysql-test/suite/engines/funcs/t/rpl_000011.test b/mysql-test/suite/engines/funcs/t/rpl_000011.test new file mode 100644 index 00000000000..f7fc0f4a310 --- /dev/null +++ b/mysql-test/suite/engines/funcs/t/rpl_000011.test @@ -0,0 +1,18 @@ +--source include/master-slave.inc + +create table t1 (n int); +insert into t1 values(1); +--sync_slave_with_master +--source include/stop_slave.inc +--source include/start_slave.inc +connection master; +insert into t1 values(2); +#let slave catch up +--sync_slave_with_master +select * from t1; +connection master; +drop table t1; +--sync_slave_with_master + +# End of 4.1 tests +--source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_000013.test b/mysql-test/suite/engines/funcs/t/rpl_000013.test new file mode 100644 index 00000000000..c2f6c114ad6 --- /dev/null +++ b/mysql-test/suite/engines/funcs/t/rpl_000013.test @@ -0,0 +1,2 @@ +--source suite/rpl/t/rpl_000013.test + diff --git a/mysql-test/suite/engines/funcs/t/rpl_000015.test b/mysql-test/suite/engines/funcs/t/rpl_000015.test index 817ed6f407c..8996affe667 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_000015.test +++ b/mysql-test/suite/engines/funcs/t/rpl_000015.test @@ -3,49 +3,36 @@ # Change Date: 2006-01-17 # Change: added order by in select ##################### -source include/master-slave.inc; +--source include/master-slave.inc reset master; show master status; save_master_pos; connection slave; -stop slave; +--source include/stop_slave.inc reset slave; ---vertical_results ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 5 # 8 # 9 # 23 # 33 # -show slave status; +--let $status_items= Slave_IO_Running, Slave_SQL_Running, Last_SQL_Errno, Last_SQL_Error, Exec_Master_Log_Pos +--source include/show_slave_status.inc change master to master_host='127.0.0.1'; # The following needs to be cleaned up when change master is fixed ---vertical_results ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 5 # 8 # 9 # 23 # 33 # -show slave status; +--source include/show_slave_status.inc --replace_result $MASTER_MYPORT MASTER_PORT -eval change master to master_host='127.0.0.1',master_user='root', - master_password='',master_port=$MASTER_MYPORT; ---vertical_results ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 5 # 8 # 9 # 23 # 33 # -show slave status; -start slave; +eval change master to master_host='127.0.0.1',master_user='root', +master_password='',master_port=$MASTER_MYPORT; +--source include/start_slave.inc sync_with_master; ---vertical_results ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 5 # 8 # 9 # 23 # 33 # ---replace_column 33 # -show slave status; +--source include/show_slave_status.inc + connection master; ---disable_warnings -drop table if exists t1; ---enable_warnings + create table t1 (n int, PRIMARY KEY(n)); insert into t1 values (10),(45),(90); -sync_slave_with_master; -connection slave; +--sync_slave_with_master + SELECT * FROM t1 ORDER BY n; connection master; SELECT * FROM t1 ORDER BY n; drop table t1; -sync_slave_with_master; +--sync_slave_with_master +--source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_000017.test b/mysql-test/suite/engines/funcs/t/rpl_000017.test new file mode 100644 index 00000000000..f498ce10a58 --- /dev/null +++ b/mysql-test/suite/engines/funcs/t/rpl_000017.test @@ -0,0 +1,2 @@ +--source suite/rpl/t/rpl_000017.test + diff --git a/mysql-test/suite/engines/funcs/t/rpl_LD_INFILE.test b/mysql-test/suite/engines/funcs/t/rpl_LD_INFILE.test index ae647ed6648..e896d62a0ab 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_LD_INFILE.test +++ b/mysql-test/suite/engines/funcs/t/rpl_LD_INFILE.test @@ -1,38 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/18/2005 # -############################################################################# -# TEST: To test the LOAD DATA INFILE in rbr # -############################################################################# - -# Includes --- source include/master-slave.inc - -# Begin clean up test section ---disable_warnings -connection master; -DROP TABLE IF EXISTS test.t1; ---enable_warnings - -# Section 1 test -CREATE TABLE test.t1 (a VARCHAR(255), PRIMARY KEY(a)); -LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1; -DELETE FROM test.t1 WHERE a = 'abashed'; -DELETE FROM test.t1; -LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1; - - -SELECT * FROM test.t1 ORDER BY a DESC; -save_master_pos; -sync_slave_with_master; -connection slave; -SELECT * FROM test.t1 ORDER BY a DESC; - -# Cleanup -#show binlog events; -connection master; -DROP TABLE test.t1; -sync_slave_with_master; - -# End of 5.0 test case +--source suite/rpl/t/rpl_LD_INFILE.test diff --git a/mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test b/mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test deleted file mode 100644 index 078d1048794..00000000000 --- a/mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test +++ /dev/null @@ -1,47 +0,0 @@ -# -# Test of automatic redirection of queries to master/slave. -# - -source include/master-slave.inc; -# We disable this for now as PS doesn't handle redirection ---disable_ps_protocol - -#first, make sure the slave has had enough time to register -save_master_pos; -connection slave; -sync_with_master; - -#discover slaves -connection master; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 16 # 23 # 33 # -SHOW SLAVE STATUS; ---replace_result $SLAVE_MYPORT SLAVE_PORT -SHOW SLAVE HOSTS; -rpl_probe; - -#turn on master/slave query direction auto-magic -enable_rpl_parse; -create table t1 ( n int); -insert into t1 values (1),(2),(3),(4); -disable_rpl_parse; -save_master_pos; -connection slave; -sync_with_master; -insert into t1 values(5); -connection master; -enable_rpl_parse; -# The first of the queries will be sent to the slave, the second to the master. -SELECT * FROM t1 ORDER BY n; -SELECT * FROM t1 ORDER BY n; -disable_rpl_parse; -SELECT * FROM t1 ORDER BY n; -connection slave; -SELECT * FROM t1 ORDER BY n; - -# Cleanup -connection master; -drop table t1; -sync_slave_with_master; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_alter.test b/mysql-test/suite/engines/funcs/t/rpl_alter.test index 576376a0264..12360f5a3e8 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_alter.test +++ b/mysql-test/suite/engines/funcs/t/rpl_alter.test @@ -1,24 +1,2 @@ -source include/master-slave.inc; ---disable_warnings -drop database if exists mysqltest; ---enable_warnings -create database mysqltest; +--source suite/rpl/t/rpl_alter.test -create table mysqltest.t1 ( n int); -alter table mysqltest.t1 add m int; -insert into mysqltest.t1 values (1,2); -create table mysqltest.t2 (n int); -insert into mysqltest.t2 values (45); -rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2; -save_master_pos; -connection slave; -sync_with_master; -select * from mysqltest.t2; -select * from mysqltest.t3; -connection master; -drop database mysqltest; -save_master_pos; -connection slave; -sync_with_master; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_alter_db.test b/mysql-test/suite/engines/funcs/t/rpl_alter_db.test index 17ba06ce063..097eaf9071b 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_alter_db.test +++ b/mysql-test/suite/engines/funcs/t/rpl_alter_db.test @@ -1,12 +1,2 @@ -source include/master-slave.inc; -connection master; -use mysql; # to be different from initial `test' db of mysqltest client -alter database collate latin1_bin; -save_master_pos; +--source suite/rpl/t/rpl_alter_db.test -connection slave; -sync_with_master; - -# Restoring to the original state -connection master; -alter database collate latin1_swedish_ci; diff --git a/mysql-test/suite/engines/funcs/t/rpl_bit.test b/mysql-test/suite/engines/funcs/t/rpl_bit.test index 7f85313ae4c..822fae57f68 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_bit.test +++ b/mysql-test/suite/engines/funcs/t/rpl_bit.test @@ -1,93 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Sept/15/2005 # -############################################################################# -# Test: To test the replication of the bit field # -############################################################################# -# Change Author: JBM -# Change Date: 2006-01-16 -########## +--source suite/rpl/t/rpl_bit.test --- source include/master-slave.inc - - -# Begin clean up test section -connection master; ---disable_warnings -DROP TABLE IF EXISTS test.t1; ---enable_warnings -# End of cleanup - -# Begin test section 1 - -CREATE TABLE test.t1 ( - dummyKey INTEGER NOT NULL, - f01 TINYINT, - f10 TINYINT, - f12 TINYINT, - f15 TINYINT, - f16 TINYINT, - f7 TINYINT, - f9 TINYINT, - f29 TINYINT, - f0 TINYINT, - fA1 TINYINT, - C32 TINYINT, - A42 TINYINT, - CA3 TINYINT, - A044 TINYINT, - f001 TINYINT, - A3002 TINYINT, - fC003 TINYINT, - CA300 TINYINT, - A305 TINYINT, - CA321 TINYINT, - r001 TINYINT, - bit1 BIT(6), - bit2 BIT(6), - bit3 BIT(6), - State1 TINYINT, - State2 TINYINT, - State3 TINYINT, - State4 TINYINT, - SubState TINYINT, - gState TINYINT, - oSupp TINYINT, - tSupp TINYINT, - sSuppD TINYINT, - mSuppf TINYINT, - GSuppDf TINYINT, - VNotSupp TINYINT, - x034 TINYINT, -PRIMARY KEY USING HASH (dummyKey) ); - -LOCK TABLES test.t1 WRITE; -INSERT INTO test.t1 VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'111110',b'110101',4,5,5,5,5,5,5,5,5,5,3,2,1); -INSERT INTO test.t1 VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'100100',4,5,5,5,5,5,5,5,5,5,3,2,1); -INSERT INTO test.t1 VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'101010',b'010101',4,5,5,5,5,5,5,5,5,5,3,2,1); -INSERT INTO test.t1 VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'101010',b'111111',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1); -INSERT INTO test.t1 VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1); -INSERT INTO test.t1 VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1); -INSERT INTO test.t1 VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1); -INSERT INTO test.t1 VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1); -UNLOCK TABLES; - - -SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1; -SELECT hex(bit1) FROM test.t1 ORDER BY bit1; -SELECT hex(bit2) from test.t1 ORDER BY bit2; -SELECT hex(bit3) from test.t1 ORDER BY bit3; -save_master_pos; - -connection slave; -sync_with_master; -SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1; -SELECT hex(bit1) FROM test.t1 ORDER BY bit1; -SELECT hex(bit2) from test.t1 ORDER BY bit2; -SELECT hex(bit3) from test.t1 ORDER BY bit3; - -connection master; -DROP TABLE IF EXISTS test.t1; -sync_slave_with_master; - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_bit_npk.test b/mysql-test/suite/engines/funcs/t/rpl_bit_npk.test index 12b587919f9..d2214ada074 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_bit_npk.test +++ b/mysql-test/suite/engines/funcs/t/rpl_bit_npk.test @@ -1,116 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Sept/15/2005 # -############################################################################# -# Test: To test the replication of the bit field # -############################################################################# +--source suite/rpl/t/rpl_bit_npk.test --- source include/master-slave.inc - - -# Begin clean up test section -connection master; ---disable_warnings -DROP TABLE IF EXISTS test.t1; ---enable_warnings -# End of cleanup - -# Begin test section 1 - -CREATE TABLE test.t1 ( - dummyKey INTEGER NOT NULL, - f01 TINYINT, - f10 TINYINT, - f12 TINYINT, - f15 TINYINT, - f16 TINYINT, - f7 TINYINT, - f9 TINYINT, - f29 TINYINT, - f0 TINYINT, - fA1 TINYINT, - C32 TINYINT, - A42 TINYINT, - CA3 TINYINT, - A044 TINYINT, - f001 TINYINT, - A3002 TINYINT, - fC003 TINYINT, - CA300 TINYINT, - A305 TINYINT, - CA321 TINYINT, - r001 TINYINT, - bit1 BIT(6), - bit2 BIT(6), - bit3 BIT(6), - State1 TINYINT, - State2 TINYINT, - State3 TINYINT, - State4 TINYINT, - SubState TINYINT, - gState TINYINT, - oSupp TINYINT, - tSupp TINYINT, - sSuppD TINYINT, - mSuppf TINYINT, - GSuppDf TINYINT, - VNotSupp TINYINT, - x034 TINYINT); - -LOCK TABLES test.t1 WRITE; -INSERT INTO test.t1 VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'111110',b'110101',4,5,5,5,5,5,5,5,5,5,3,NULL,1); -INSERT INTO test.t1 VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'100100',4,5,5,5,5,5,5,5,5,5,3,2,1); -INSERT INTO test.t1 VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'101010',b'010101',4,5,5,5,5,5,5,5,5,5,3,2,1); -INSERT INTO test.t1 VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'101010',b'111111',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1); -INSERT INTO test.t1 VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'0',1,1,4,5,5,5,5,5,5,5,5,5,3,2,1); -INSERT INTO test.t1 VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1); -INSERT INTO test.t1 VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1); -INSERT INTO test.t1 VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1); -UNLOCK TABLES; - -UPDATE test.t1 set x034 = 50 where bit3 = b'000000'; -UPDATE test.t1 set VNotSupp = 33 where bit1 = b'0'; -SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 - FROM test.t1 - ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034; -SELECT hex(bit1) from test.t1 ORDER BY bit1; -SELECT hex(bit2) from test.t1 ORDER BY bit2; -SELECT hex(bit3) from test.t1 ORDER BY bit3; -save_master_pos; - -connection slave; -sync_with_master; -SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 - FROM test.t1 - ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034; -SELECT hex(bit1) from test.t1 ORDER BY bit1; -SELECT hex(bit2) from test.t1 ORDER BY bit2; -SELECT hex(bit3) from test.t1 ORDER BY bit3; - -connection master; -CREATE TABLE test.t2 (a INT, b BIT(1)); -INSERT INTO test.t2 VALUES (1, b'0'); -INSERT INTO test.t2 VALUES (1, b'1'); -UPDATE test.t2 SET a = 2 WHERE b = b'1'; - -CREATE TABLE test.t3 (a INT, b INT); -INSERT INTO test.t3 VALUES (1, NULL); -INSERT INTO test.t3 VALUES (1, 0); -UPDATE test.t3 SET a = 2 WHERE b = 0; - -SELECT a, hex(b) FROM test.t2 ORDER BY a,b; -SELECT * FROM test.t3 ORDER BY a,b; -save_master_pos; - -connection slave; -sync_with_master; -SELECT a, hex(b) FROM test.t2 ORDER BY a,b; -SELECT * FROM test.t3 ORDER BY a,b; - -connection master; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; -DROP TABLE IF EXISTS test.t3; -sync_slave_with_master; - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_change_master.test b/mysql-test/suite/engines/funcs/t/rpl_change_master.test index c031464c95e..e7e70bd2ac6 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_change_master.test +++ b/mysql-test/suite/engines/funcs/t/rpl_change_master.test @@ -1,37 +1,2 @@ -# Verify that after CHANGE MASTER, replication (I/O thread and SQL -# thread) restart from where SQL thread left, not from where -# I/O thread left (some old bug fixed in 4.0.17) +--source suite/rpl/t/rpl_change_master.test -source include/master-slave.inc; - -connection master; -# Make SQL slave thread advance a bit -create table t1(n int); -sync_slave_with_master; -select * from t1; -# Now stop it and make I/O slave thread be ahead -stop slave sql_thread; -connection master; -insert into t1 values(1); -insert into t1 values(2); -save_master_pos; -connection slave; ---real_sleep 3 # wait for I/O thread to have read updates -stop slave; ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 23 # 33 # -show slave status; -change master to master_user='root'; ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 23 # 33 # -show slave status; -start slave; -sync_with_master; -select * from t1; -connection master; -drop table t1; -save_master_pos; -connection slave; -sync_with_master; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_create_database.test b/mysql-test/suite/engines/funcs/t/rpl_create_database.test index 70cff8daca2..8690de2a604 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_create_database.test +++ b/mysql-test/suite/engines/funcs/t/rpl_create_database.test @@ -1,72 +1,2 @@ -# -# Tests for replication of statements that manipulate databases. -# -# For this test file, we have a number of databases. All databases -# with "greek" names will be replicated on the slave, while other names -# (e.g., american) will not be replicated. -# +--source suite/rpl/t/rpl_create_database.test -source include/master-slave.inc; - -# Bug#6391 (binlog-do-db rules ignored) -# In this case, 'mysqltest_bob' should not be replicated to the slave. ---disable_warnings -DROP DATABASE IF EXISTS mysqltest_prometheus; -DROP DATABASE IF EXISTS mysqltest_sisyfos; -DROP DATABASE IF EXISTS mysqltest_bob; -sync_slave_with_master; -# This database is not replicated -DROP DATABASE IF EXISTS mysqltest_bob; ---enable_warnings - -connection master; -CREATE DATABASE mysqltest_prometheus; -CREATE DATABASE mysqltest_sisyfos; -CREATE DATABASE mysqltest_bob; - -USE mysqltest_sisyfos; -# These should be replicated -CREATE TABLE t1 (b int); -INSERT INTO t1 VALUES(1); - -USE mysqltest_bob; -# These should *not* be replicated -CREATE TABLE t2 (b int); -INSERT INTO t2 VALUES(2); - -# Current database is now 'mysqltest_bob' -# The following should be replicated -ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1; - -USE mysqltest_sisyfos; -# The following should *not* be replicated -ALTER DATABASE mysqltest_bob CHARACTER SET latin1; - -SHOW DATABASES; -sync_slave_with_master; -SHOW DATABASES; - -connection master; -DROP DATABASE IF EXISTS mysqltest_sisyfos; -USE mysqltest_prometheus; -CREATE TABLE t1 (a INT); -INSERT INTO t1 VALUES (1); -CREATE DATABASE mysqltest_sisyfos; -USE mysqltest_sisyfos; -CREATE TABLE t2 (a INT); -let $VERSION=`select version()`; -SHOW DATABASES; -sync_slave_with_master; -SHOW DATABASES; -USE mysqltest_prometheus; -SHOW TABLES; -USE mysqltest_sisyfos; -SHOW TABLES; - -connection master; -DROP DATABASE IF EXISTS mysqltest_prometheus; -DROP DATABASE IF EXISTS mysqltest_sisyfos; -DROP DATABASE IF EXISTS mysqltest_bob; -sync_slave_with_master; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_do_grant.test b/mysql-test/suite/engines/funcs/t/rpl_do_grant.test index 4e398114269..95e90ce1bc3 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_do_grant.test +++ b/mysql-test/suite/engines/funcs/t/rpl_do_grant.test @@ -1,98 +1,2 @@ -# Works in statement-based and row-based binlogging. -# Test that GRANT and other user management commands are replicated to the slave +--source suite/rpl/t/rpl_do_grant.test --- source include/master-slave.inc - -# do not be influenced by other tests. -connection master; -delete from mysql.user where user=_binary'rpl_do_grant'; -delete from mysql.db where user=_binary'rpl_do_grant'; -flush privileges; -save_master_pos; -connection slave; -sync_with_master; -# if these DELETE did nothing on the master, we need to do them manually on the -# slave. -delete from mysql.user where user=_binary'rpl_ignore_grant'; -delete from mysql.db where user=_binary'rpl_ignore_grant'; -flush privileges; - -# test replication of GRANT -connection master; -grant select on *.* to rpl_do_grant@localhost; -grant drop on test.* to rpl_do_grant@localhost; -save_master_pos; -connection slave; -sync_with_master; -show grants for rpl_do_grant@localhost; - -# test replication of SET PASSWORD -connection master; -set password for rpl_do_grant@localhost=password("does it work?"); -save_master_pos; -connection slave; -sync_with_master; -select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant'; - -# clear what we have done, to not influence other tests. -connection master; -delete from mysql.user where user=_binary'rpl_do_grant'; -delete from mysql.db where user=_binary'rpl_do_grant'; -flush privileges; -sync_slave_with_master; -# The mysql database is not replicated, so we have to do the deletes -# manually on the slave as well. -delete from mysql.user where user=_binary'rpl_do_grant'; -delete from mysql.db where user=_binary'rpl_do_grant'; -flush privileges; - -# End of 4.1 tests - -connection master; ---error 1141 -show grants for rpl_do_grant@localhost; -connection slave; ---error 1141 -show grants for rpl_do_grant@localhost; - -connection master; -create user rpl_do_grant@localhost; -show grants for rpl_do_grant@localhost; ---error 1141 -show grants for rpl_do_grant2@localhost; -sync_slave_with_master; -show grants for rpl_do_grant@localhost; ---error 1141 -show grants for rpl_do_grant2@localhost; - -connection master; -rename user rpl_do_grant@localhost to rpl_do_grant2@localhost; -show grants for rpl_do_grant2@localhost; -sync_slave_with_master; -show grants for rpl_do_grant2@localhost; - -connection master; -grant DELETE,INSERT on mysqltest1.* to rpl_do_grant2@localhost; -show grants for rpl_do_grant2@localhost; -sync_slave_with_master; -show grants for rpl_do_grant2@localhost; - -connection master; -revoke DELETE on mysqltest1.* from rpl_do_grant2@localhost; -show grants for rpl_do_grant2@localhost; -sync_slave_with_master; -show grants for rpl_do_grant2@localhost; - -connection master; -revoke all privileges, grant option from rpl_do_grant2@localhost; -show grants for rpl_do_grant2@localhost; -sync_slave_with_master; -show grants for rpl_do_grant2@localhost; - -connection master; -drop user rpl_do_grant2@localhost; ---error 1141 -show grants for rpl_do_grant2@localhost; -sync_slave_with_master; ---error 1141 -show grants for rpl_do_grant2@localhost; diff --git a/mysql-test/suite/engines/funcs/t/rpl_drop.test b/mysql-test/suite/engines/funcs/t/rpl_drop.test index b38007a755f..7dda6987502 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_drop.test +++ b/mysql-test/suite/engines/funcs/t/rpl_drop.test @@ -1,16 +1,2 @@ -# Testcase for BUG#4552 (DROP on two tables, one of which does not -# exist, must be binlogged with a non-zero error code) -source include/master-slave.inc; ---disable_warnings -drop table if exists t1, t2; ---enable_warnings -create table t1 (a int); ---error 1051 -drop table t1, t2; -save_master_pos; -connection slave; -sync_with_master; - -# End of 4.1 tests - +--source suite/rpl/t/rpl_drop.test diff --git a/mysql-test/suite/engines/funcs/t/rpl_drop_db.test b/mysql-test/suite/engines/funcs/t/rpl_drop_db.test index fb26cc20f8a..54d5300be14 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_drop_db.test +++ b/mysql-test/suite/engines/funcs/t/rpl_drop_db.test @@ -1,61 +1,2 @@ -# test case for BUG#4680 -- if there are extra files in the db directory -# dropping the db on the master causes replication problems +--source suite/rpl/t/rpl_drop_db.test --- source include/master-slave.inc -connection master; - ---disable_warnings -drop database if exists mysqltest1; ---enable_warnings -create database mysqltest1; -create table mysqltest1.t1 (n int); -insert into mysqltest1.t1 values (1); -select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt'; -create table mysqltest1.t2 (n int); -create table mysqltest1.t3 (n int); ---replace_result \\ / ---error 1010 -drop database mysqltest1; -use mysqltest1; -show tables; - -# test the branch of the code that deals with the query buffer overflow - ---disable_query_log -let $1=50; -while ($1) -{ - eval create table mysqltest1.mysqltest_long_table_name$1 (n int); - dec $1; -} ---enable_query_log - ---replace_result \\ / ---error 1010 -drop database mysqltest1; -use mysqltest1; -show tables; -use test; -create table t1 (n int); -insert into t1 values (1234); -sync_slave_with_master; - -connection slave; -use mysqltest1; -show tables; -use test; -select * from t1; -drop table t1; - -#cleanup -connection slave; -stop slave; -drop database mysqltest1; - -connection master; -# Remove the "extra" file created above ---remove_file $MYSQLTEST_VARDIR/mysqld.1/data/mysqltest1/f1.txt -drop database mysqltest1; - -use test; -drop table t1; diff --git a/mysql-test/suite/engines/funcs/t/rpl_dual_pos_advance.test b/mysql-test/suite/engines/funcs/t/rpl_dual_pos_advance.test index 518fa9df885..bf5e84152bc 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_dual_pos_advance.test +++ b/mysql-test/suite/engines/funcs/t/rpl_dual_pos_advance.test @@ -6,7 +6,7 @@ # of their server id). # It also will test BUG#13861. -source include/master-slave.inc; +--source include/master-slave.inc # set up "dual head" @@ -18,7 +18,7 @@ connection master; --replace_result $SLAVE_MYPORT SLAVE_PORT eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root"; -start slave; +--source include/start_slave.inc # now we test it @@ -68,7 +68,7 @@ sync_with_master; # show tables; -# start slave; +# --source include/start_slave.inc # BUG#13023 is that Exec_master_log_pos may stay too low "forever": @@ -78,9 +78,7 @@ create table t4 (n int); # create 3 ignored events create table t5 (n int); create table t6 (n int); -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master connection slave; @@ -97,12 +95,11 @@ show tables; # cleanup -stop slave; +--source include/stop_slave.inc reset slave; drop table t1,t4,t5,t6; # add t2 and t3 later -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master # End of 4.1 tests +--source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test b/mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test deleted file mode 100644 index 707d1eca8c2..00000000000 --- a/mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test +++ /dev/null @@ -1,15 +0,0 @@ -source include/master-slave.inc; - ---replace_column 1 # 8 # 9 # 16 # 23 # 33 # -show slave status; - -# -# Load table should not succeed on the master as this is not a slave -# ---error 1218 -load table t1 from master; -connection slave; ---error 1188 -load table t1 from master; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test b/mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test index adf1526a657..1459b24799e 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test +++ b/mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test @@ -1,68 +1,2 @@ -# Test for -# Bug #797: If a query is ignored on slave (replicate-ignore-table) the slave -# still checks that it has the same error as on the master. -########################################################################## +--source suite/rpl/t/rpl_err_ignoredtable.test --- source include/master-slave.inc - ---disable_query_log -call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); ---enable_query_log - -connection master; -create table t1 (a int primary key); -create table t4 (a int primary key); -# generate an error that goes to the binlog ---error 1022, 1062, 1582 -insert into t1 values (1),(1); -insert into t4 values (1),(2); -save_master_pos; -connection slave; -# as the t1 table is ignored on the slave, the slave should be able to sync -sync_with_master; -# check that the table has been ignored, because otherwise the test is nonsense -show tables like 't1'; -show tables like 't4'; -SELECT * FROM test.t4 ORDER BY a; -connection master; -drop table t1; -save_master_pos; -connection slave; -sync_with_master; - -# Now test that even critical errors (connection killed) -# are ignored if rules allow it. -# The "kill" idea was copied from rpl000001.test. - -connection master1; -select get_lock('crash_lock%20C', 10); - -connection master; -create table t2 (a int primary key); -insert into t2 values(1); -create table t3 (id int); -insert into t3 values(connection_id()); -send update t2 set a = a + 1 + get_lock('crash_lock%20C', 10); - -connection master1; -real_sleep 2; -select (@id := id) - id from t3; -kill @id; -drop table t2,t3; -insert into t4 values (3),(4); -connection master; ---error 0,1053,2013,1317 -reap; -connection master1; -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM test.t4 ORDER BY a; - -connection master1; -DROP TABLE test.t4; -save_master_pos; -connection slave; -sync_with_master; -# End of 4.1 tests -# Adding comment for force manual merge 5.0 -> wl1012. delete me if needed diff --git a/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test b/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test index 2e481f5e5e7..b4742246264 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test +++ b/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test @@ -6,31 +6,22 @@ # Start replication master -> slave # connection slave; ---disable_warnings -stop slave; ---enable_warnings + +--source include/stop_slave.inc + --replace_result $MASTER_MYPORT MASTER_PORT eval change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=$MASTER_MYPORT; -start slave; - +--source include/start_slave.inc # # Start replication slave -> master # connection master; ---disable_warnings -stop slave; ---enable_warnings + --replace_result $SLAVE_MYPORT SLAVE_PORT eval change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=$SLAVE_MYPORT; -start slave; - -# -# Wait for start of slave IO and SQL threads -# -let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%'; --- source $MYSQL_TEST_DIR/suite/engines/funcs/t/wait_slave_status.inc +--source include/start_slave.inc # # Flush logs of slave @@ -41,8 +32,6 @@ sleep 5; # # Show status of slave # ---replace_result $SLAVE_MYPORT SLAVE_PORT ---replace_column 1 # 8 # 9 # 16 # 23 # 33 # ---vertical_results -SHOW SLAVE STATUS; -STOP SLAVE; +--let $status_items= Slave_IO_Running, Slave_SQL_Running, Last_SQL_Errno, Last_SQL_Error, Exec_Master_Log_Pos +--source include/stop_slave.inc +--source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_free_items.test b/mysql-test/suite/engines/funcs/t/rpl_free_items.test index 043e84160b8..31d65396d36 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_free_items.test +++ b/mysql-test/suite/engines/funcs/t/rpl_free_items.test @@ -1,22 +1,2 @@ -source include/master-slave.inc; -create table t1 (a int); -create table t2 (a int); -disable_query_log; -SET @query="INSERT INTO t2 SELECT * FROM t1 WHERE a REGEXP \"0\""; -let $1 = 2000; -while ($1) -{ - eval SET @query=concat(@query, " OR a REGEXP '$1'"); - dec $1; -} -let $1=`select @query`; -eval $1; -enable_query_log; -# I have seen the slave crash either now or at shutdown -sync_slave_with_master; -connection master; -drop table t1; -drop table t2; -sync_slave_with_master; +--source suite/rpl/t/rpl_free_items.test -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_get_lock.test b/mysql-test/suite/engines/funcs/t/rpl_get_lock.test index c57e9313899..a9265c7f864 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_get_lock.test +++ b/mysql-test/suite/engines/funcs/t/rpl_get_lock.test @@ -1,49 +1,2 @@ -source include/master-slave.inc; +--source suite/rpl/t/rpl_get_lock.test ---disable_query_log -call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); ---enable_query_log - -create table t1(n int); ---disable_warnings -insert into t1 values(get_lock("lock",2)); ---enable_warnings -dirty_close master; -connection master1; -select get_lock("lock",2); - -select release_lock("lock"); -#ignore -disable_query_log; -let $1=2000; -while ($1) -{ - do get_lock("lock",2); - do release_lock("lock"); - dec $1; -} -enable_query_log; -save_master_pos; -connection slave; -sync_with_master; -select get_lock("lock",3); -select * from t1; -# There is no point in testing REPLICATIION of the IS_*_LOCK -# functions; slave does not run with the same concurrency context as -# master (generally in slave we can't know that on master this lock -# was already held by another connection and so that the the -# get_lock() we're replicating timed out on master hence returned 0, -# or that the is_free_lock() we're playing returned 0 etc. -# But here all we do is test these functions outside of replication. -select is_free_lock("lock"), is_used_lock("lock") = connection_id(); -explain extended select is_free_lock("lock"), is_used_lock("lock"); -# Check lock functions -select is_free_lock("lock2"); -select is_free_lock(NULL); -connection master1; -drop table t1; -save_master_pos; -connection slave; -sync_with_master; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_ignore_grant.test b/mysql-test/suite/engines/funcs/t/rpl_ignore_grant.test index 2e6e2ce9a31..234fec3361e 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_ignore_grant.test +++ b/mysql-test/suite/engines/funcs/t/rpl_ignore_grant.test @@ -1,59 +1,2 @@ -# Test that GRANT is not replicated to the slave -# when --replicate-wild-ignore-table=mysql.% -# In BUG#980, this test would _randomly_ fail. +--source suite/rpl/t/rpl_ignore_grant.test -source include/master-slave.inc; - -# do not be influenced by other tests. -connection master; -delete from mysql.user where user=_binary'rpl_ignore_grant'; -delete from mysql.db where user=_binary'rpl_ignore_grant'; -flush privileges; -save_master_pos; -connection slave; -sync_with_master; -# as these DELETE were not replicated, we need to do them manually on the -# slave. -delete from mysql.user where user=_binary'rpl_ignore_grant'; -delete from mysql.db where user=_binary'rpl_ignore_grant'; -flush privileges; - -# test non-replication of GRANT -connection master; -grant select on *.* to rpl_ignore_grant@localhost; -grant drop on test.* to rpl_ignore_grant@localhost; -show grants for rpl_ignore_grant@localhost; -save_master_pos; -connection slave; -sync_with_master; ---error 1141 #("no such grant for user") -show grants for rpl_ignore_grant@localhost; -# check it another way -select count(*) from mysql.user where user=_binary'rpl_ignore_grant'; -select count(*) from mysql.db where user=_binary'rpl_ignore_grant'; - -# test non-replication of SET PASSWORD -# first force creation of the user on slave (because as the user does not exist -# on slave, the SET PASSWORD may be replicated but silently do nothing; this is -# not what we want; we want it to be not-replicated). -grant select on *.* to rpl_ignore_grant@localhost; -connection master; -set password for rpl_ignore_grant@localhost=password("does it work?"); -save_master_pos; -connection slave; -sync_with_master; -select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant'; - -# clear what we have done, to not influence other tests. -connection master; -delete from mysql.user where user=_binary'rpl_ignore_grant'; -delete from mysql.db where user=_binary'rpl_ignore_grant'; -flush privileges; -save_master_pos; -connection slave; -sync_with_master; -delete from mysql.user where user=_binary'rpl_ignore_grant'; -delete from mysql.db where user=_binary'rpl_ignore_grant'; -flush privileges; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_ignore_revoke.test b/mysql-test/suite/engines/funcs/t/rpl_ignore_revoke.test index 00171605a92..1a981652645 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_ignore_revoke.test +++ b/mysql-test/suite/engines/funcs/t/rpl_ignore_revoke.test @@ -1,51 +1,2 @@ -# test verifies that REVOKE must not be replicated when -# slave server starts with --replicate-wild-ignore-table=mysql.% -# the option is set in rpl_ignore_revoke-slave.opt -# The first part of BUG#9483 for GRANT is checked by -# existed specific rpl_ignore_grant test case (BUG#980) +--source suite/rpl/t/rpl_ignore_revoke.test - -source include/master-slave.inc; - -### CLEAN-UP: create an account and manually duplicate it on the slave - -connection master; -grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; -revoke select on *.* from 'user_foo'@'%'; -select select_priv from mysql.user where user='user_foo' /* master:must be N */; - -sync_slave_with_master; -#connection slave; -grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; -revoke select on *.* from 'user_foo'@'%'; -select select_priv from mysql.user where user='user_foo' /* slave:must be N */; - - -### TEST - -#connection slave; -grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; -select select_priv from mysql.user where user='user_foo' /* slave:must be Y */; - -connection master; -revoke select on *.* from 'user_foo'; -select select_priv from mysql.user where user='user_foo' /* master:must be N */; - -sync_slave_with_master; -#connection slave; -select select_priv from mysql.user where user='user_foo' /* slave:must get Y */; - -### CLEAN-UP - -connection slave; ---disable_abort_on_error -revoke select on *.* FROM 'user_foo'; ---enable_abort_on_error - -connection master; -delete from mysql.user where user="user_foo"; -sync_slave_with_master; - -# Since changes to mysql.* are ignored, the revoke need to -# be done on slave as well -delete from mysql.user where user="user_foo"; diff --git a/mysql-test/suite/engines/funcs/t/rpl_ignore_table_update.test b/mysql-test/suite/engines/funcs/t/rpl_ignore_table_update.test index fe030f90411..9ace16dd247 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_ignore_table_update.test +++ b/mysql-test/suite/engines/funcs/t/rpl_ignore_table_update.test @@ -1,38 +1,2 @@ -# This one assumes we are ignoring updates on table mysqltest_foo, but doing -# the ones on all other tables +--source suite/rpl/t/rpl_ignore_table_update.test -source include/master-slave.inc; -connection slave; - -# -# For this test we must be in the test database -# -use test; - ---disable_warnings -drop table if exists mysqltest_foo; -drop table if exists mysqltest_bar; ---enable_warnings - -create table mysqltest_foo (n int); -insert into mysqltest_foo values(4); -connection master; -use test; -create table mysqltest_foo (n int); -insert into mysqltest_foo values(5); -create table mysqltest_bar (m int); -insert into mysqltest_bar values(15); -create table t1 (k int); -insert into t1 values(55); -save_master_pos; -connection slave; -sync_with_master; -select mysqltest_foo.n,mysqltest_bar.m,t1.k from mysqltest_foo,mysqltest_bar,t1; -connection master; -drop table mysqltest_foo,mysqltest_bar,t1; -save_master_pos; -connection slave; -sync_with_master; -drop table mysqltest_foo,mysqltest_bar,t1; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_init_slave.test b/mysql-test/suite/engines/funcs/t/rpl_init_slave.test index 139b4902e12..85869ffbb99 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_init_slave.test +++ b/mysql-test/suite/engines/funcs/t/rpl_init_slave.test @@ -1,34 +1,2 @@ -source include/master-slave.inc; +--source suite/rpl/t/rpl_init_slave.test -# -# Test of init_slave variable -# - -save_master_pos; -connection slave; -sleep 1; -show variables like 'init_slave'; -show variables like 'max_connections'; -sync_with_master; -reset master; -connection master; -show variables like 'init_slave'; -show variables like 'max_connections'; -save_master_pos; -connection slave; -sync_with_master; -# Save variable value -set @my_global_init_connect= @@global.init_connect; -set global init_connect="set @c=1"; -show variables like 'init_connect'; -connection master; -save_master_pos; -connection slave; -sync_with_master; -stop slave; - -# Restore changed global variable -set global init_connect= @my_global_init_connect; -set global max_connections= default; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_insert.test b/mysql-test/suite/engines/funcs/t/rpl_insert.test index f57a6e226d1..1a5d5ecba54 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_insert.test +++ b/mysql-test/suite/engines/funcs/t/rpl_insert.test @@ -1,44 +1,2 @@ ---echo # ---echo # Bug#20821: INSERT DELAYED fails to write some rows to binlog ---echo # +--source suite/rpl/t/rpl_insert.test ---source include/not_embedded.inc ---source include/not_windows.inc ---source include/master-slave.inc - ---disable_warnings -CREATE SCHEMA IF NOT EXISTS mysqlslap; -USE mysqlslap; ---enable_warnings - -CREATE TABLE t1 (id INT, name VARCHAR(64)); - -let $query = "INSERT INTO t1 VALUES (1, 'Dr. No'), (2, 'From Russia With Love'), (3, 'Goldfinger'), (4, 'Thunderball'), (5, 'You Only Live Twice')"; ---exec $MYSQL_SLAP --silent --concurrency=5 --iterations=200 --query=$query --delimiter=";" - -# Wait until all the 5000 inserts has been inserted into the table ---disable_query_log -let $counter= 300; # Max 30 seconds wait -while (`select count(*)!=5000 from mysqlslap.t1`) -{ - sleep 0.1; - dec $counter; - if (!$counter) - { - Number of records in t1 didnt reach 5000; - } -} ---enable_query_log - -SELECT COUNT(*) FROM mysqlslap.t1; -sync_slave_with_master; -SELECT COUNT(*) FROM mysqlslap.t1; - ---echo # ---echo # Cleanup ---echo # - -connection master; -USE test; -DROP SCHEMA mysqlslap; -sync_slave_with_master; diff --git a/mysql-test/suite/engines/funcs/t/rpl_insert_select.test b/mysql-test/suite/engines/funcs/t/rpl_insert_select.test index 677be526982..bc9ec9da636 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_insert_select.test +++ b/mysql-test/suite/engines/funcs/t/rpl_insert_select.test @@ -1,6 +1,6 @@ # Testcase for BUG#10456 - INSERT INTO ... SELECT violating a primary key # breaks replication - +-- source include/have_binlog_format_mixed_or_row.inc -- source include/master-slave.inc connection master; @@ -10,10 +10,11 @@ create table t2 (n int); insert into t2 values (1); insert ignore into t1 select * from t2; insert into t1 values (2); -sync_slave_with_master; +--sync_slave_with_master connection slave; select * from t1; connection master; drop table t1,t2; -sync_slave_with_master; +--sync_slave_with_master +--source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_loaddata2.test b/mysql-test/suite/engines/funcs/t/rpl_loaddata2.test index 439c2b48ca5..b357054b4db 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_loaddata2.test +++ b/mysql-test/suite/engines/funcs/t/rpl_loaddata2.test @@ -3,7 +3,7 @@ CREATE TABLE t1 (word CHAR(20) NOT NULL); LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1; SELECT * FROM t1 ORDER BY word; -sync_slave_with_master; +--sync_slave_with_master # Check SELECT * FROM t1 ORDER BY word; @@ -11,4 +11,5 @@ SELECT * FROM t1 ORDER BY word; # Cleanup connection master; drop table t1; -sync_slave_with_master; +--sync_slave_with_master +--source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_loaddata_m.test b/mysql-test/suite/engines/funcs/t/rpl_loaddata_m.test index 42c3ad99f33..901c40b5079 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_loaddata_m.test +++ b/mysql-test/suite/engines/funcs/t/rpl_loaddata_m.test @@ -1,52 +1,2 @@ -# See if the master logs LOAD DATA INFILE correctly when binlog_*_db rules -# exist. -# This is for BUG#1100 (LOAD DATA INFILE was half-logged). -###################################################### -# Change Author: JBM -# Change Date: 2005-12-22 -# Change: Test rewritten to remove show binlog events -# and to test the option better + Cleanup -###################################################### --- source include/master-slave.inc +--source suite/rpl/t/rpl_loaddata_m.test ---disable_warnings -drop database if exists mysqltest; ---enable_warnings - -connection master; -# 'test' database should be ignored by the slave -USE test; -CREATE TABLE t1(a INT, b INT, UNIQUE(b)); -LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE test.t1; -SELECT COUNT(*) FROM test.t1; - -# 'mysqltest' database should NOT be ignored by the slave -CREATE DATABASE mysqltest; -USE mysqltest; -CREATE TABLE t1(a INT, b INT, UNIQUE(b)); -LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE mysqltest.t1; -SELECT COUNT(*) FROM mysqltest.t1; - -# Now lets check the slave to see what we have :-) -save_master_pos; -connection slave; -sync_with_master; - -SHOW DATABASES; - -USE test; -SHOW TABLES; - -USE mysqltest; -SHOW TABLES; -SELECT COUNT(*) FROM mysqltest.t1; - -#show binlog events; - -# Cleanup -connection master; -DROP DATABASE mysqltest; -DROP TABLE test.t1; -sync_slave_with_master; - -# End of test diff --git a/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test b/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test index a06df3bbfc9..7521f62403e 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test +++ b/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test @@ -1,30 +1,2 @@ -# See if the slave logs (in its own binlog, with --log-slave-updates) a -# replicated LOAD DATA INFILE correctly when it has binlog_*_db rules. -# This is for BUG#1100 (LOAD DATA INFILE was half-logged). +--source suite/rpl/t/rpl_loaddata_s.test --- source include/have_binlog_format_mixed_or_statement.inc --- source include/master-slave.inc - -connection slave; -# Not sure why we connect to slave and then try to reset master, but I will leave it [JBM] -reset master; - -connection master; -# 'test' is the current database -create table test.t1(a int, b int, unique(b)); -load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; - -# Test logging on slave; - -save_master_pos; -connection slave; -sync_with_master; -select count(*) from test.t1; # check that LOAD was replicated ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 107; # should be nothing - -# Cleanup -connection master; -drop table test.t1; -sync_slave_with_master; diff --git a/mysql-test/suite/engines/funcs/t/rpl_loaddatalocal.test b/mysql-test/suite/engines/funcs/t/rpl_loaddatalocal.test index e272be3c13b..36e863c4573 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_loaddatalocal.test +++ b/mysql-test/suite/engines/funcs/t/rpl_loaddatalocal.test @@ -6,7 +6,7 @@ # only the first 4KB, 8KB or 16KB usually. # - the loaded file's first line was not written entirely to the # master's binlog (1st char was absent) -source include/master-slave.inc; +--source include/master-slave.inc create table t1(a int); let $1=10000; @@ -26,15 +26,11 @@ truncate table t1; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval load data local infile '$MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' into table t1; remove_file $MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile; -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master select a,count(*) from t1 group by a; connection master; drop table t1; -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master # End of 4.1 tests @@ -54,12 +50,9 @@ create table t1(a int primary key); eval load data local infile '$MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' into table t1; remove_file $MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile; SELECT * FROM t1 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master SELECT * FROM t1 ORDER BY a; connection master; drop table t1; -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master +--source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_loadfile.test b/mysql-test/suite/engines/funcs/t/rpl_loadfile.test index 26235d89016..26829b265f1 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_loadfile.test +++ b/mysql-test/suite/engines/funcs/t/rpl_loadfile.test @@ -41,7 +41,7 @@ CALL test.p1(); --enable_warnings SELECT * FROM test.t1 ORDER BY blob_column; save_master_pos; -sync_slave_with_master; +--sync_slave_with_master connection slave; SELECT * FROM test.t1 ORDER BY blob_column; @@ -49,6 +49,6 @@ SELECT * FROM test.t1 ORDER BY blob_column; connection master; DROP PROCEDURE IF EXISTS test.p1; DROP TABLE test.t1; -sync_slave_with_master; - +--sync_slave_with_master +--source include/rpl_end.inc # End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_log_pos.test b/mysql-test/suite/engines/funcs/t/rpl_log_pos.test index 22deee6b5f3..53b38d9a2de 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_log_pos.test +++ b/mysql-test/suite/engines/funcs/t/rpl_log_pos.test @@ -1,58 +1,2 @@ -########## -# Change Author: JBM -# Change Date: 2006-01-16 -########## +--source suite/rpl/t/rpl_log_pos.test -# -# Testing of setting slave to wrong log position with master_log_pos -# - -# Passes with rbr no problem, removed statement include [jbm] - -source include/master-slave.inc; ---replace_column 3 <Binlog_Ignore_DB> -show master status; -sync_slave_with_master; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # -show slave status; -stop slave; -change master to master_log_pos=107; -start slave; -sleep 5; -stop slave; -change master to master_log_pos=107; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # -show slave status; -start slave; -sleep 5; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # -show slave status; -stop slave; -change master to master_log_pos=178; -start slave; -sleep 2; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # -show slave status; -connection master; ---replace_column 3 <Binlog_Ignore_DB> -show master status; -create table if not exists t1 (n int); -drop table if exists t1; -create table t1 (n int); -insert into t1 values (1),(2),(3); -save_master_pos; -connection slave; -stop slave; -change master to master_log_pos=207; -start slave; -sync_with_master; -select * from t1 ORDER BY n; -connection master; -drop table t1; -sync_slave_with_master; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_many_optimize.test b/mysql-test/suite/engines/funcs/t/rpl_many_optimize.test index 91fab0b27a8..337cc1b36be 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_many_optimize.test +++ b/mysql-test/suite/engines/funcs/t/rpl_many_optimize.test @@ -1,22 +1,2 @@ -# Test for BUG#7658 "optimize crashes slave thread (1 in 1000)]" +--source suite/rpl/t/rpl_many_optimize.test -source include/master-slave.inc; - -create table t1 (a int not null auto_increment primary key, b int, key(b)); -INSERT INTO t1 (a) VALUES (1),(2); -# Now many OPTIMIZE to test if we crash (BUG#7658) -let $1=300; -disable_query_log; -disable_result_log; -while ($1) -{ - eval OPTIMIZE TABLE t1; - dec $1; -} -enable_result_log; -enable_query_log; -drop table t1; -# Bug was that slave segfaulted after ~ a hundred of OPTIMIZE (or ANALYZE) -sync_slave_with_master; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_master_pos_wait.test b/mysql-test/suite/engines/funcs/t/rpl_master_pos_wait.test deleted file mode 100644 index 893c8746efc..00000000000 --- a/mysql-test/suite/engines/funcs/t/rpl_master_pos_wait.test +++ /dev/null @@ -1,18 +0,0 @@ -# See if master_pos_wait(,,timeout) -# Terminates with "timeout expired" (-1) -source include/master-slave.inc; -save_master_pos; -connection slave; -sync_with_master; -# Ask for a master log that has certainly not been reached yet -# timeout= 2 seconds -select master_pos_wait('master-bin.999999',0,2); -explain extended select master_pos_wait('master-bin.999999',0,2); -# Testcase for bug 651 (master_pos_wait() hangs if slave idle and STOP SLAVE). -send select master_pos_wait('master-bin.999999',0); -connection slave1; -stop slave sql_thread; -connection slave; -reap; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_misc_functions.test b/mysql-test/suite/engines/funcs/t/rpl_misc_functions.test index 6e4bedf7371..2f0786a9271 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_misc_functions.test +++ b/mysql-test/suite/engines/funcs/t/rpl_misc_functions.test @@ -1,46 +1,2 @@ -# -# Test of replicating some difficult functions -# -source include/master-slave.inc; +--source suite/rpl/t/rpl_misc_functions.test ---disable_query_log -call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); ---enable_query_log - -create table t1(id int, i int, r1 int, r2 int, p varchar(100)); -insert into t1 values(1, connection_id(), 0, 0, ""); -# don't put rand and password in the same query, to see if they replicate -# independently -# Pure rand test ---disable_warnings -insert into t1 values(2, 0, rand()*1000, rand()*1000, ""); ---enable_warnings -# change the rand suite on the master (we do this because otherwise password() -# benefits from the fact that the above rand() is well replicated : -# it picks the same sequence element, which hides a possible bug in password() replication. -set sql_log_bin=0; -insert into t1 values(6, 0, rand(), rand(), ""); -delete from t1 where id=6; -set sql_log_bin=1; -# Pure password test -insert into t1 values(3, 0, 0, 0, password('does_this_work?')); -# "altogether now" ---disable_warnings -insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?')); ---enable_warnings -select * into outfile '../../tmp/rpl_misc_functions.outfile' from t1; -sync_slave_with_master; -create table t2 like t1; -# read the values from the master table ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -eval load data local infile '$MYSQLTEST_VARDIR/tmp/rpl_misc_functions.outfile' into table t2; -# compare them with the replica; the SELECT below should return no row -select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p); -stop slave; -drop table t1; -drop table t2; - -connection master; -drop table t1; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_multi_delete.test b/mysql-test/suite/engines/funcs/t/rpl_multi_delete.test index a251cbf8833..53347fbf127 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_multi_delete.test +++ b/mysql-test/suite/engines/funcs/t/rpl_multi_delete.test @@ -1,26 +1,2 @@ -source include/master-slave.inc; -create table t1 (a int primary key); -create table t2 (a int); +--source suite/rpl/t/rpl_multi_delete.test -insert into t1 values (1); -insert into t2 values (1); - - -delete t1.* from t1, t2 where t1.a = t2.a; - -save_master_pos; -select * from t1; -select * from t2; - -connection slave; -sync_with_master; -select * from t1; -select * from t2; - -connection master; -drop table t1,t2; -save_master_pos; -connection slave; -sync_with_master; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_multi_delete2.test b/mysql-test/suite/engines/funcs/t/rpl_multi_delete2.test index e91fad1872a..17df048f930 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_multi_delete2.test +++ b/mysql-test/suite/engines/funcs/t/rpl_multi_delete2.test @@ -1,68 +1,2 @@ -#multi delete replication bugs - - -source include/master-slave.inc; - -#BUG#11139 - improper wild-table and table rules -#checking for multi deletes with an alias - -connection master; -set sql_log_bin=0; -create database mysqltest_from; -set sql_log_bin=1; - -connection slave; -create database mysqltest_to; - - -connection master; -use mysqltest_from; ---disable_warnings -drop table if exists a; ---enable_warnings -CREATE TABLE a (i INT); -INSERT INTO a VALUES(1); -DELETE alias FROM a alias WHERE alias.i=1; -SELECT * FROM a; -insert into a values(2),(3); -delete alias FROM a alias where alias.i=2; -select * from a; -save_master_pos; -connection slave; - -use mysqltest_to; -sync_with_master; -select * from a; - -# BUG#3461 -connection master; -create table t1 (a int primary key); -create table t2 (a int); - -insert into t1 values (1); -insert into t2 values (1); - -delete t1.* from t1, t2 where t1.a = t2.a; - -save_master_pos; -select * from t1; -select * from t2; - -connection slave; -# BUG#3461 would cause sync to fail -sync_with_master; -error 1146; -select * from t1; -error 1146; -select * from t2; - -# cleanup -connection master; -set sql_log_bin=0; -drop database mysqltest_from; -set sql_log_bin=1; -connection slave; -drop database mysqltest_to; - -# End of 4.1 tests +--source suite/rpl/t/rpl_multi_delete2.test diff --git a/mysql-test/suite/engines/funcs/t/rpl_multi_update4.test b/mysql-test/suite/engines/funcs/t/rpl_multi_update4.test index 4991a385f6f..5538e6cba77 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_multi_update4.test +++ b/mysql-test/suite/engines/funcs/t/rpl_multi_update4.test @@ -1,45 +1,2 @@ -# Let's verify that multi-update is not always skipped by slave if -# some replicate-* rules exist. -# (BUG#15699) +--source suite/rpl/t/rpl_multi_update4.test -source include/master-slave.inc; - -### Clean-up - -connection master; ---disable_warnings -drop database if exists d1; -drop database if exists d2; - -connection slave; -drop database if exists d2; ---enable_warnings - -### Do on master - -connection master; -create database d1; # accepted by slave -create table d1.t0 (id int); -create database d2; # ignored by slave -use d2; -create table t1 (id int); -create table t2 (id int); -insert into t1 values (1), (2), (3), (4), (5); -insert into t2 select id + 3 from t1; -# a problematic query which must be filter out by slave -update t1 join t2 using (id) set t1.id = 0; -insert into d1.t0 values (0); # replication works - -### Check on slave - -sync_slave_with_master; -use d1; -select * from t0 where id=0; # must find - -### Clean-up -connection master; -drop database d1; -drop database d2; -sync_slave_with_master; - -# End of test diff --git a/mysql-test/suite/engines/funcs/t/rpl_ps.test b/mysql-test/suite/engines/funcs/t/rpl_ps.test index 09c7b779f65..d40c5737912 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_ps.test +++ b/mysql-test/suite/engines/funcs/t/rpl_ps.test @@ -1,49 +1,2 @@ -# -# Test of replicating user variables -# -########################################################### -source include/master-slave.inc; +--source suite/rpl/t/rpl_ps.test -#save_master_pos; -#connection slave; -#sync_with_master; -#reset master; -#connection master; - ---disable_warnings -drop table if exists t1; ---enable_warnings - -create table t1(n char(30)); - -prepare stmt1 from 'insert into t1 values (?)'; -set @var1= "from-master-1"; -execute stmt1 using @var1; -set @var1= "from-master-2-'',"; -execute stmt1 using @var1; -SELECT * FROM t1 ORDER BY n; - -set @var2= 'insert into t1 values (concat("from-var-", ?))'; -prepare stmt2 from @var2; -set @var1='from-master-3'; -execute stmt2 using @var1; - -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM t1 ORDER BY n; - -connection master; - -drop table t1; - -save_master_pos; -connection slave; -sync_with_master; -stop slave; - -# End of 4.1 tests - -reset master; -reset slave; -disconnect master; diff --git a/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test b/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test deleted file mode 100644 index f4e6239c679..00000000000 --- a/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test +++ /dev/null @@ -1,47 +0,0 @@ --- source include/have_binlog_format_mixed.inc --- source include/master-slave.inc - -# Test that the slave temporarily switches to ROW when seeing row -# events when it is in MIXED mode - ---echo **** On Master **** -CREATE TABLE t1 (a INT, b LONG); -INSERT INTO t1 VALUES (1,1), (2,2); -INSERT INTO t1 VALUES (3,UUID()), (4,UUID()); -let $VERSION=`select version()`; ---replace_result $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -# Different number of binlog events are generated by different engines ---disable_result_log -SHOW BINLOG EVENTS; ---enable_result_log -sync_slave_with_master; ---echo **** On Slave **** ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical SHOW SLAVE STATUS ---replace_result $VERSION VERSION ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -# Different number of binlog events are generated by different engines ---disable_result_log -SHOW BINLOG EVENTS; ---enable_result_log ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql - -connection master; -DROP TABLE IF EXISTS t1; - -# Let's compare. Note: If they match test will pass, if they do not match -# the test will show that the diff statement failed and not reject file -# will be created. You will need to go to the mysql-test dir and diff -# the files your self to see what is not matching - -diff_files $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql; - -# If all is good, we can remove the files - -remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql; -remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql; diff --git a/mysql-test/suite/engines/funcs/t/rpl_relayspace.test b/mysql-test/suite/engines/funcs/t/rpl_relayspace.test index 70315c14f34..5c60f57b496 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_relayspace.test +++ b/mysql-test/suite/engines/funcs/t/rpl_relayspace.test @@ -1,34 +1,2 @@ -# The slave is started with relay_log_space_limit=10 bytes, -# to force the deadlock after one event. +--source suite/rpl/t/rpl_relayspace.test -source include/master-slave.inc; -connection slave; -stop slave; -connection master; -# This will generate a master's binlog > 10 bytes -create table t1 (a int); -drop table t1; -create table t1 (a int); -drop table t1; -connection slave; -reset slave; -start slave io_thread; -# Give the I/O thread time to block. -sleep 2; -# A bug caused the I/O thread to refuse stopping. -stop slave io_thread; -reset slave; -start slave; -# The I/O thread stops filling the relay log when -# it's >10b. And the SQL thread cannot purge this relay log -# as purge is done only when the SQL thread switches to another -# relay log, which does not exist here. -# So we should have a deadlock. -# if it is not resolved automatically we'll detect -# it with master_pos_wait that waits for farther than 1Ob; -# it will timeout after 10 seconds; -# also the slave will probably not cooperate to shutdown -# (as 2 threads are locked) -select master_pos_wait('master-bin.001',200,6)=-1; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_replicate_ignore_db.test b/mysql-test/suite/engines/funcs/t/rpl_replicate_ignore_db.test index bcfef919fad..edadb14a3ee 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_replicate_ignore_db.test +++ b/mysql-test/suite/engines/funcs/t/rpl_replicate_ignore_db.test @@ -1,30 +1,2 @@ -# see if --replicate-ignore-db works +--source suite/rpl/t/rpl_replicate_ignore_db.test ---source include/master-slave.inc - ---disable_warnings -drop database if exists mysqltest1; -drop database if exists mysqltest2; ---enable_warnings -create database mysqltest1; -create database mysqltest2; - -use mysqltest1; -create table t1 (a int); -insert into t1 values(1); -sync_slave_with_master; ---error 1146 -select * from mysqltest1.t1; - -connection master; -use mysqltest2; -create table t1 (a int); -insert into t1 values(1); -sync_slave_with_master; -select * from mysqltest2.t1; - -# cleanup -connection master; -drop database mysqltest1; -drop database mysqltest2; -sync_slave_with_master; diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_NOW.test b/mysql-test/suite/engines/funcs/t/rpl_row_NOW.test index bf9576ae11b..b909062b8cc 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_NOW.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_NOW.test @@ -1,74 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/18/2005 # -# Updated 08/30/2005 Added dumps and diff # -############################################################################# -#TEST: Taken and modfied from http://bugs.mysql.com/bug.php?id=12480 # -############################################################################# +--source suite/rpl/t/rpl_row_NOW.test -# Includes --- source include/have_binlog_format_row.inc --- source include/master-slave.inc - - -# Begin clean up test section -connection master; ---disable_warnings -create database if not exists mysqltest1; -DROP TABLE IF EXISTS mysqltest1.t1; ---enable_warnings - - -# Begin test section 1 -CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, - a TIMESTAMP DEFAULT '2005-05-05 01:01:01', - b TIMESTAMP DEFAULT '2005-05-05 01:01:01', - PRIMARY KEY(n)); -delimiter |; -CREATE FUNCTION mysqltest1.f1() RETURNS TIMESTAMP -BEGIN - DECLARE v1 INT DEFAULT 300; - WHILE v1 > 0 DO - SET v1 = v1 - 1; - END WHILE; - RETURN NOW(); -END| -delimiter ;| - -INSERT INTO mysqltest1.t1 VALUES(NULL,NOW(),mysqltest1.f1()); - -delimiter |; -CREATE TRIGGER mysqltest1.trig1 BEFORE INSERT ON mysqltest1.t1 -FOR EACH ROW BEGIN - SET new.b = mysqltest1.f1(); -END| -delimiter ;| - -INSERT INTO mysqltest1.t1 SET n = NULL, a = now(); - -sync_slave_with_master; - -connection master; - ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/NOW_master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/NOW_slave.sql - -# lets cleanup -DROP TABLE IF EXISTS mysqltest1.t1; -DROP FUNCTION mysqltest1.f1; - -# Lets compare. Note: If they match test will pass, if they do not match -# the test will show that the diff statement failed and not reject file -# will be created. You will need to go to the mysql-test dir and diff -# the files your self to see what is not matching :-) The failed dump -# files will be located in $MYSQLTEST_VARDIR/tmp - -diff_files $MYSQLTEST_VARDIR/tmp/NOW_master.sql $MYSQLTEST_VARDIR/tmp/NOW_slave.sql; - -# If all is good, when can cleanup our dump files. -remove_file $MYSQLTEST_VARDIR/tmp/NOW_master.sql; -remove_file $MYSQLTEST_VARDIR/tmp/NOW_slave.sql; - -DROP DATABASE mysqltest1; -sync_slave_with_master; -# End of 5.1 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_USER.test b/mysql-test/suite/engines/funcs/t/rpl_row_USER.test index c3639d05c48..e48b25293fa 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_USER.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_USER.test @@ -1,57 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/18/2005 # -############################################################################# -# TEST: To test the UUID() in rbr # -############################################################################# -# Change Author: JBM -# Change Date: 2006-01-16 -########## +--source suite/rpl/t/rpl_row_USER.test -# Includes --- source include/have_binlog_format_row.inc --- source include/master-slave.inc - -# Begin clean up test section -connection master; ---disable_warnings -DROP DATABASE IF EXISTS mysqltest1; -CREATE DATABASE mysqltest1; ---enable_warnings - -# Section 1 test -CREATE USER tester IDENTIFIED BY 'test'; -GRANT ALL ON mysqltest1.* TO 'tester'@'%' IDENTIFIED BY 'test'; -GRANT ALL ON mysqltest1.* TO ''@'localhost%'; -FLUSH PRIVILEGES; -connect (m_1,localhost,tester,,mysqltest1); - -connection m_1; -CREATE TABLE mysqltest1.t1 (a INT, users VARCHAR(255), PRIMARY KEY(a)); -INSERT INTO mysqltest1.t1 VALUES(1,USER()); -INSERT INTO mysqltest1.t1 VALUES(2,CURRENT_USER()); -delimiter |; -create procedure mysqltest1.p1() -begin - INSERT INTO mysqltest1.t1 VALUES(3,USER()); - INSERT INTO mysqltest1.t1 VALUES(4,CURRENT_USER()); -end| -delimiter ;| - -CALL mysqltest1.p1(); -connection master; -SELECT * FROM mysqltest1.t1 ORDER BY a; -sync_slave_with_master; -SELECT * FROM mysqltest1.t1 ORDER BY a; - -connection master; -# Lets cleanup - -REVOKE ALL ON mysqltest1.* FROM 'tester'@'%'; -REVOKE ALL ON mysqltest1.* FROM ''@'localhost%'; -DROP DATABASE mysqltest1; -DROP USER 'tester'; -DROP USER ''@'localhost%'; -FLUSH PRIVILEGES; - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_drop.test b/mysql-test/suite/engines/funcs/t/rpl_row_drop.test index 20c217a7c3a..35090d7f32f 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_drop.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_drop.test @@ -1,48 +1,2 @@ --- source include/have_binlog_format_row.inc --- source include/master-slave.inc +--source suite/rpl/t/rpl_row_drop.test -# Bug#12415: DROP of temporary table on master stops slave -connection master; ---echo **** On Master **** -CREATE TABLE t1 (a int); -CREATE TABLE t2 (a int); -CREATE TEMPORARY TABLE t2 (a int, b int); -SHOW TABLES; -sync_slave_with_master; ---echo **** On Slave **** -SHOW TABLES; -connection master; ---echo **** On Master **** -DROP TABLE t2; # Dropping the temporary table -SHOW TABLES; -sync_slave_with_master; ---echo **** On Slave **** -SHOW TABLES; # There should be two tables on the slave - -connection master; ---echo **** On Master **** -CREATE TEMPORARY TABLE t2 (a int, b int); -SHOW TABLES; -sync_slave_with_master; ---echo **** On Slave **** -SHOW TABLES; -connection master; ---echo **** On Master **** -# Should drop the non-temporary table t1 and the temporary table t2 -DROP TABLE t1,t2; -let $VERSION=`select version()`; ---replace_result $VERSION VERSION ---replace_regex /table_id: [0-9]+/table_id: #/ -SHOW BINLOG EVENTS; -SHOW TABLES; -sync_slave_with_master; ---echo **** On Slave **** -SHOW TABLES; - ---disable_query_log ---disable_warnings -connection master; -DROP TABLE IF EXISTS t2; -sync_slave_with_master; ---enable_warnings ---enable_query_log diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_func001.test b/mysql-test/suite/engines/funcs/t/rpl_row_func001.test index 53fb55118e6..7671d9947c1 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_func001.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_func001.test @@ -1,57 +1,2 @@ -############################################################################# -# This test is being created to test out the non deterministic items with # -# row based replication. # -# Original Author: JBM # -# Original Date: Aug/10/2005 # -# Update: 08/29/2005 change name to initails # -############################################################################# +--source suite/rpl/t/rpl_row_func001.test -# Includes --- source include/have_binlog_format_row.inc --- source include/master-slave.inc - - -# Begin clean up test section -connection master; ---disable_warnings ---error 0,1305 -DROP FUNCTION test.f1; -DROP TABLE IF EXISTS test.t1; - - ---enable_warnings - -# Section 1 test from bug #12487 Uses stored function to insert rows to see what is replicated. - -create table test.t1 (a int, PRIMARY KEY(a)); - -delimiter //; -create function test.f1(i int) returns int -begin -insert into test.t1 values(i); -return 0; -end// -delimiter ;// - -select test.f1(1); -select test.f1(2); -select * from test.t1; - -save_master_pos; -sync_slave_with_master; -connection slave; -#show create table test.t1; -select * from test.t1; - -connection master; - -#Used for debugging -#show binlog events; - -# Cleanup - -DROP FUNCTION test.f1; -DROP TABLE test.t1; -sync_slave_with_master; - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test b/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test index 736071a8ece..793b94e63a6 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test @@ -2,7 +2,7 @@ # not have --source include/have_binlog_format_row.inc -source include/master-slave.inc; +--source include/master-slave.inc connection master; create table t1 (a int not null primary key); @@ -11,7 +11,7 @@ create table t2 (a int); insert into t2 values (1); update t1, t2 set t1.a = 0 where t1.a = t2.a; -sync_slave_with_master; +--sync_slave_with_master # t2 should not have been replicated # t1 should have been properly updated show tables; @@ -23,13 +23,16 @@ insert into t1 values (1); connection slave; # slave should have stopped because can't find table t1 -wait_for_slave_to_stop; -# see if we have a good error message: ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # ---vertical_results -show slave status; +# 1146 = ER_NO_SUCH_TABLE +call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., error.* 1146"); +--let $slave_sql_errno= 1146 +--source include/wait_for_slave_sql_error.inc + +--echo ==== Clean up ==== +--source include/stop_slave_io.inc +RESET SLAVE; -# cleanup connection master; drop table t1, t2; +--let $rpl_only_running_threads= 1 +--source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_max_relay_size.test b/mysql-test/suite/engines/funcs/t/rpl_row_max_relay_size.test index 6df58122051..f7098d0d7bf 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_max_relay_size.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_max_relay_size.test @@ -4,6 +4,6 @@ # Test of manual relay log rotation with FLUSH LOGS. # Requires statement logging -source include/have_binlog_format_row.inc; +--source include/have_binlog_format_row.inc -source suite/rpl/include/rpl_max_relay_size.test; +--source suite/rpl/include/rpl_max_relay_size.test diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_sp001.test b/mysql-test/suite/engines/funcs/t/rpl_row_sp001.test index ae6116bea4e..0610ef0274a 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_sp001.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_sp001.test @@ -1,146 +1,2 @@ -############################################################################# -# This test is being created to test out the non deterministic items with # -# row based replication. # -# Original Author: JBM # -# Original Date: Aug/09/2005 # -# Updated: Aug/29/2005 -############################################################################# -# Test: Includes two stored procedure tests. First test uses SP to insert # -# values from RAND() and NOW() into a table. # -# The second test uses SP with CASE structure to decide what to text # -# to update a given table with. # -############################################################################ +--source suite/rpl/t/rpl_row_sp001.test -# Includes --- source include/have_binlog_format_row.inc --- source include/master-slave.inc - --- disable_query_log --- disable_result_log - -# Begin clean up test section -connection master; ---disable_warnings -DROP PROCEDURE IF EXISTS test.p1; -DROP PROCEDURE IF EXISTS test.p2; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; - --- enable_query_log --- enable_result_log - -# Begin test section 1 for non deterministic SP -let $message=<Begin test section 1 (non deterministic SP)>; ---source include/show_msg.inc - -create table test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n)); - -delimiter //; -create procedure test.p1() -begin - INSERT INTO test.t1 (f,d) VALUES (RAND(),NOW()); -end// -delimiter ;// - -# show binlog events; - --- disable_query_log --- disable_result_log -let $1=10; -while ($1) -{ - call test.p1(); - sleep 1; - dec $1; -} --- enable_result_log --- enable_query_log - -## Used for debugging -#show binlog events; -#select * from test.t1; -#sync_slave_with_master; -#select * from test.t1; -#connection master; - -let $message=<End test section 1 (non deterministic SP)>; ---source include/show_msg.inc - - -CREATE TABLE test.t2 (a INT NOT NULL AUTO_INCREMENT, t CHAR(4), PRIMARY KEY(a)); - -delimiter //; -CREATE PROCEDURE test.p2(n int) -begin -CASE n -WHEN 1 THEN - UPDATE test.t2 set t ='Tex'; -WHEN 2 THEN - UPDATE test.t2 set t ='SQL'; -ELSE - UPDATE test.t2 set t ='NONE'; -END CASE; -end// -delimiter ;// - -INSERT INTO test.t2 VALUES(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW'); - -SELECT * FROM t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM t2 ORDER BY a; - -connection master; -call test.p2(1); -SELECT * FROM t2 ORDER BY a; -sync_slave_with_master; -SELECT * FROM t2 ORDER BY a; - - -connection master; -call test.p2(2); -SELECT * FROM t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM t2 ORDER BY a; - -connection master; -call test.p2(3); -SELECT * FROM t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM t2 ORDER BY a; - -##Used for debugging -#show binlog events; - -# time to dump the databases and so we can see if they match - ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp001_master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp001_slave.sql - -# First lets cleanup - -connection master; -DROP PROCEDURE test.p1; -DROP PROCEDURE test.p2; -DROP TABLE test.t1; -DROP TABLE test.t2; -sync_slave_with_master; - -# Lets compare. Note: If they match test will pass, if they do not match -# the test will show that the diff statement failed and not reject file -# will be created. You will need to go to the mysql-test dir and diff -# the files your self to see what is not matching :-) Failed dump files -# will be located in $MYSQLTEST_VARDIR/tmp - -diff_files $MYSQLTEST_VARDIR/tmp/sp001_master.sql $MYSQLTEST_VARDIR/tmp/sp001_slave.sql; - -# If all is good, when can cleanup our dump files. -remove_file $MYSQLTEST_VARDIR/tmp/sp001_master.sql; -remove_file $MYSQLTEST_VARDIR/tmp/sp001_slave.sql; - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_sp005.test b/mysql-test/suite/engines/funcs/t/rpl_row_sp005.test index d8a5aacc5e6..a304dbe009b 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_sp005.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_sp005.test @@ -1,108 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/15/2005 # -# Updated: Aug/29/2005: Removed sleeps # -############################################################################# -# Test: Tests SPs with cursors, flow logic, and alter sp. In addition the # -# tests SPs with insert and update operations. # -############################################################################# +--source suite/rpl/t/rpl_row_sp005.test -# Includes --- source include/have_binlog_format_row.inc --- source include/master-slave.inc - - -# Begin clean up test section -connection master; ---disable_warnings -DROP PROCEDURE IF EXISTS test.p1; -DROP PROCEDURE IF EXISTS test.p2; -DROP TABLE IF EXISTS test.t2; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t3; ---enable_warnings -# End of cleanup - -# Begin test section 1 -CREATE TABLE IF NOT EXISTS test.t1(id INT, data CHAR(16),PRIMARY KEY(id)); -CREATE TABLE IF NOT EXISTS test.t2(id2 INT,PRIMARY KEY(id2)); -CREATE TABLE IF NOT EXISTS test.t3(id3 INT,PRIMARY KEY(id3), c CHAR(16)); - -delimiter |; -CREATE PROCEDURE test.p1() -BEGIN -DECLARE done INT DEFAULT 0; - DECLARE spa CHAR(16); - DECLARE spb,spc INT; - DECLARE cur1 CURSOR FOR SELECT id,data FROM test.t1 ORDER BY id; - DECLARE cur2 CURSOR FOR SELECT id2 FROM test.t2 ORDER BY id2; - DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1; - - OPEN cur1; - OPEN cur2; - - REPEAT - FETCH cur1 INTO spb, spa; - FETCH cur2 INTO spc; - IF NOT done THEN - IF spb < spc THEN - INSERT INTO test.t3 VALUES (spb,spa); - ELSE - INSERT INTO test.t3 VALUES (spc,spa); - END IF; - END IF; - UNTIL done END REPEAT; - - CLOSE cur1; - CLOSE cur2; -END| -CREATE PROCEDURE test.p2() -BEGIN - INSERT INTO test.t1 VALUES (4,'MySQL'),(20,'ROCKS'),(11,'Texas'),(10,'kyle'); - INSERT INTO test.t2 VALUES (4),(2),(1),(3); - UPDATE test.t1 SET id=id+4 WHERE id=4; -END| -delimiter ;| - -let $message=< ---- Master selects-- >; ---source include/show_msg.inc -CALL test.p2(); -SELECT * FROM test.t1 ORDER BY id; -SELECT * FROM test.t2 ORDER BY id2; - -let $message=< ---- Slave selects-- >; ---source include/show_msg.inc -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM test.t1 ORDER BY id; -SELECT * FROM test.t2 ORDER BY id2; - -let $message=< ---- Master selects-- >; ---source include/show_msg.inc -connection master; -CALL test.p1(); -sleep 6; -SELECT * FROM test.t3 ORDER BY id3; - -let $message=< ---- Slave selects-- >; ---source include/show_msg.inc -connection slave; -SELECT * FROM test.t3 ORDER BY id3; - -connection master; - -ALTER PROCEDURE test.p1 MODIFIES SQL DATA; -#show binlog events; - -# Cleanup - -connection master; -DROP PROCEDURE IF EXISTS test.p1; -DROP PROCEDURE IF EXISTS test.p2; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; -DROP TABLE IF EXISTS test.t3; -sync_slave_with_master; - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_sp008.test b/mysql-test/suite/engines/funcs/t/rpl_row_sp008.test index b1295820c99..3cc0ed26ea2 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_sp008.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_sp008.test @@ -1,57 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/15/2005 # -# Update: 08/29/2005 Remove sleep # -############################################################################# -# TEST: Use SQL_CALC_FOUND_ROWS and insert results into a table inside a sp # -############################################################################# +--source suite/rpl/t/rpl_row_sp008.test - -# Includes --- source include/have_binlog_format_row.inc --- source include/master-slave.inc - -# Begin clean up test section -connection master; ---disable_warnings -DROP PROCEDURE IF EXISTS test.p1; -DROP TABLE IF EXISTS test.t2; ---enable_warnings -# End of cleanup - - - -# Begin test section 1 -CREATE TABLE test.t1 (a INT,PRIMARY KEY(a)); -CREATE TABLE test.t2 (a INT,PRIMARY KEY(a)); -INSERT INTO test.t1 VALUES(1),(2); - -delimiter |; -CREATE PROCEDURE test.p1() -BEGIN - SELECT SQL_CALC_FOUND_ROWS * FROM test.t1 LIMIT 1; - INSERT INTO test.t2 VALUES(FOUND_ROWS()); -END| -delimiter ;| - -let $message=< ---- Master selects-- >; ---source include/show_msg.inc -CALL test.p1(); -SELECT * FROM test.t2; - -let $message=< ---- Slave selects-- >; ---source include/show_msg.inc -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM test.t2; - -# Cleanup - -connection master; -DROP PROCEDURE IF EXISTS test.p1; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; -sync_slave_with_master; - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_sp009.test b/mysql-test/suite/engines/funcs/t/rpl_row_sp009.test index 505ed582ba9..56b42a0953d 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_sp009.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_sp009.test @@ -1,102 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/18/2005 # -# Updated: 08/29/2005 removed sleeps and added master pos save and snyc # -############################################################################# -#TEST: Taken and modfied from http://bugs.mysql.com/bug.php?id=12168 # -############################################################################# +--source suite/rpl/t/rpl_row_sp009.test -# Includes --- source include/have_binlog_format_row.inc --- source include/master-slave.inc - - -# Begin clean up test section -connection master; ---disable_warnings -DROP PROCEDURE IF EXISTS test.p1; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; - - -# Begin test section 1 -CREATE TABLE test.t1 (a INT, PRIMARY KEY(a)); -INSERT INTO test.t1 VALUES (1),(2),(3),(4); -CREATE TABLE test.t2 (a INT, PRIMARY KEY(a)); - -delimiter |; -CREATE PROCEDURE test.p1 (arg1 CHAR(1)) -BEGIN - DECLARE b, c INT; - IF arg1 = 'a' THEN - BEGIN - DECLARE cur1 CURSOR FOR SELECT A FROM test.t1 WHERE a % 2; - DECLARE continue handler for not found set b = 1; - SET b = 0; - OPEN cur1; - c1_repeat: REPEAT - FETCH cur1 INTO c; - IF (b = 1) THEN - LEAVE c1_repeat; - END IF; - - INSERT INTO test.t2 VALUES (c); - UNTIL b = 1 - END REPEAT; - CLOSE cur1; - END; - END IF; - IF arg1 = 'b' THEN - BEGIN - DECLARE cur2 CURSOR FOR SELECT a FROM test.t1 WHERE NOT a % 2; - DECLARE continue handler for not found set b = 1; - SET b = 0; - OPEN cur2; - c2_repeat: REPEAT - FETCH cur2 INTO c; - IF (b = 1) THEN - LEAVE c2_repeat; - END IF; - - INSERT INTO test.t2 VALUES (c); - UNTIL b = 1 - END REPEAT; - CLOSE cur2; - END; - END IF; -END| -delimiter ;| - -CALL test.p1('a'); -SELECT * FROM test.t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM test.t2 ORDER BY a; -connection master; -truncate test.t2; - -# this next call fails, but should not -call test.p1('b'); -select * from test.t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM test.t2 ORDER BY a; - -connection master; -truncate test.t2; -SELECT * FROM test.t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM test.t2 ORDER BY a; - -# Cleanup -connection master; -DROP PROCEDURE test.p1; -DROP TABLE test.t1; -DROP TABLE test.t2; -sync_slave_with_master; - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_sp010.test b/mysql-test/suite/engines/funcs/t/rpl_row_sp010.test index 28b82217517..a52fc311315 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_sp010.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_sp010.test @@ -1,80 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/18/2005 # -# Update: 08/29/2005 remove sleep added master pos save and sync # -############################################################################# -#TEST: Taken and modfied from http://bugs.mysql.com/bug.php?id=11126 # -############################################################################# +--source suite/rpl/t/rpl_row_sp010.test -# Includes --- source include/have_binlog_format_row.inc --- source include/master-slave.inc - - -# Begin clean up test section -connection master; ---disable_warnings -DROP PROCEDURE IF EXISTS test.p1; -DROP PROCEDURE IF EXISTS test.p2; -DROP PROCEDURE IF EXISTS test.p3; -DROP PROCEDURE IF EXISTS test.p4; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; - - -# Begin test section 1 -delimiter |; -CREATE PROCEDURE test.p1() -BEGIN - INSERT INTO test.t1 VALUES(2); -END| -CREATE PROCEDURE test.p2() -BEGIN - DROP TEMPORARY TABLE IF EXISTS test.t1; - CREATE TEMPORARY TABLE test.t1 (a int, PRIMARY KEY(a)); - INSERT INTO test.t1 VALUES(1); - CALL test.p1(); -END| -delimiter ;| -CALL test.p2(); -SELECT * FROM test.t1 ORDER BY a; - -save_master_pos; -connection slave; -sync_with_master; -show tables; - -connection master; -delimiter |; -CREATE PROCEDURE test.p3() -BEGIN - INSERT INTO test.t2 VALUES(7); -END| -CREATE PROCEDURE test.p4() -BEGIN - DROP TABLE IF EXISTS test.t2; - CREATE TABLE test.t2 (a int, PRIMARY KEY(a)); - INSERT INTO test.t2 VALUES(6); - CALL test.p3(); -END| -delimiter ;| -CALL test.p4(); -SELECT * FROM test.t2 ORDER BY a; - -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM test.t2 ORDER BY a; - -# Cleanup -connection master; -#show binlog events; -DROP PROCEDURE IF EXISTS test.p1; -DROP PROCEDURE IF EXISTS test.p2; -DROP PROCEDURE IF EXISTS test.p3; -DROP PROCEDURE IF EXISTS test.p4; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; -sync_slave_with_master; - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_sp011.test b/mysql-test/suite/engines/funcs/t/rpl_row_sp011.test index 1c24904dd5a..c24282c8f16 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_sp011.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_sp011.test @@ -1,111 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/18/2005 # -# Updated: 08/29/2005 turned on diff and commented out debug SQL statements# -############################################################################# -#TEST: SP to test alter table and nested SP calls # -############################################################################# +--source suite/rpl/t/rpl_row_sp011.test -# Includes --- source include/have_binlog_format_row.inc --- source include/master-slave.inc - - -# Begin clean up test section -connection master; ---disable_warnings -DROP PROCEDURE IF EXISTS test.p1; -DROP PROCEDURE IF EXISTS test.p2; -DROP PROCEDURE IF EXISTS test.p3; -DROP PROCEDURE IF EXISTS test.p4; -DROP PROCEDURE IF EXISTS test.p5; -DROP PROCEDURE IF EXISTS test.p6; -DROP PROCEDURE IF EXISTS test.p7; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; - - -# Begin test section 1 -CREATE TABLE test.t1 (a int, PRIMARY KEY(a)); -INSERT INTO test.t1 VALUES (1); - -delimiter |; -CREATE PROCEDURE test.p1() -BEGIN - ALTER TABLE test.t1 ADD COLUMN b CHAR(4) AFTER a; - UPDATE test.t1 SET b = 'rbr' WHERE a = 1; - CALL test.p2(); -END| -CREATE PROCEDURE test.p2() -BEGIN - ALTER TABLE test.t1 ADD COLUMN f FLOAT AFTER b; - UPDATE test.t1 SET f = RAND() WHERE a = 1; - CALL test.p3(); -END| -CREATE PROCEDURE test.p3() -BEGIN - ALTER TABLE test.t1 RENAME test.t2; - CALL test.p4(); -END| -CREATE PROCEDURE test.p4() -BEGIN - ALTER TABLE test.t2 ADD INDEX (f); - ALTER TABLE test.t2 CHANGE a a INT UNSIGNED NOT NULL AUTO_INCREMENT; - INSERT INTO test.t2 VALUES (NULL,'TEST',RAND()); - CALL test.p5(); -END| -CREATE PROCEDURE test.p5() -BEGIN - ALTER TABLE test.t2 ORDER BY f; - INSERT INTO test.t2 VALUES (NULL,'STM',RAND()); - CALL test.p6(); -END| -CREATE PROCEDURE test.p6() -BEGIN - ALTER TABLE test.t2 ADD COLUMN b2 CHAR(4) FIRST; - ALTER TABLE test.t2 ADD COLUMN to_drop BIT(8) AFTER b2; - INSERT INTO test.t2 VALUES ('new',1,NULL,'STM',RAND()); - CALL test.p7(); -END| -CREATE PROCEDURE test.p7() -BEGIN - ALTER TABLE test.t2 DROP COLUMN to_drop; - INSERT INTO test.t2 VALUES ('gone',NULL,'STM',RAND()); -END| -delimiter ;| -CALL test.p1(); - -#SELECT * FROM test.t2; -sync_slave_with_master; -#SELECT * FROM test.t2; - ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp011_master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp011_slave.sql - -# Cleanup -connection master; -#show binlog events; -DROP PROCEDURE IF EXISTS test.p1; -DROP PROCEDURE IF EXISTS test.p2; -DROP PROCEDURE IF EXISTS test.p3; -DROP PROCEDURE IF EXISTS test.p4; -DROP PROCEDURE IF EXISTS test.p5; -DROP PROCEDURE IF EXISTS test.p6; -DROP PROCEDURE IF EXISTS test.p7; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; -sync_slave_with_master; - -# Lets compare. Note: If they match test will pass, if they do not match -# the test will show that the diff statement failed and not reject file -# will be created. You will need to go to the mysql-test dir and diff -# the files your self to see what is not matching :-) Failed test -# Will leave dump files in $MYSQLTEST_VARDIR/tmp - -diff_files $MYSQLTEST_VARDIR/tmp/sp011_master.sql $MYSQLTEST_VARDIR/tmp/sp011_slave.sql; - -# If all is good, when can cleanup our dump files. -remove_file $MYSQLTEST_VARDIR/tmp/sp011_master.sql; -remove_file $MYSQLTEST_VARDIR/tmp/sp011_slave.sql; - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_sp012.test b/mysql-test/suite/engines/funcs/t/rpl_row_sp012.test index f3963c7537a..f23e5c905a6 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_sp012.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_sp012.test @@ -1,75 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/22/2005 # -# Update: 08/29/2005 Added save pos and sync # -############################################################################# -#TEST: SP to test security and current_user and user # -############################################################################# - - -# Includes --- source include/have_binlog_format_row.inc --- source include/not_embedded.inc --- source include/master-slave.inc - - -# Begin clean up test section -connection master; ---disable_warnings -DROP PROCEDURE IF EXISTS test.p1; -DROP PROCEDURE IF EXISTS test.p2; -DROP PROCEDURE IF EXISTS test.p3; - - -# Begin test section 1 -# Create user user1 with no particular access rights -grant usage on *.* to user1@localhost; -flush privileges; - -SELECT CURRENT_USER(); -SELECT USER(); -CREATE PROCEDURE test.p1 () SQL SECURITY INVOKER SELECT CURRENT_USER(), USER(); -CREATE PROCEDURE test.p2 () SQL SECURITY DEFINER CALL test.p1(); -CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1(); -GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost; -GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost; -GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost; - -# Need to wait for the rights to be applied at the slave -sync_slave_with_master; - -let $message=<******** Master user1 p3 & p2 calls *******>; ---source include/show_msg.inc -connect (muser1,localhost,user1,,); -connection muser1; -SELECT CURRENT_USER(); -SELECT USER(); -CALL test.p3(); -CALL test.p2(); - -let $message=<******** Slave user1 p3 & p2 calls *******>; ---source include/show_msg.inc -connect (suser1,127.0.0.1,user1,,test,$SLAVE_MYPORT,); - -connection master; -save_master_pos; -connection suser1; -sync_with_master; - -SELECT CURRENT_USER(); -SELECT USER(); -CALL test.p3(); -CALL test.p2(); - -# Cleanup -connection master; -DROP PROCEDURE IF EXISTS test.p1; -DROP PROCEDURE IF EXISTS test.p3; -DROP PROCEDURE IF EXISTS test.p2; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; -DROP USER 'user1'@'localhost'; -sync_slave_with_master; - -# End of 5.0 test case +--source suite/rpl/t/rpl_row_sp012.test diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_stop_middle.test b/mysql-test/suite/engines/funcs/t/rpl_row_stop_middle.test index da363736100..397bc9a1d61 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_stop_middle.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_stop_middle.test @@ -9,8 +9,8 @@ connection master; create table t1 (a int not null auto_increment primary key, b int, key(b)); -sync_slave_with_master; -stop slave; +--sync_slave_with_master +--source include/stop_slave.inc connection master; INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); INSERT INTO t1 (a) SELECT null FROM t1; @@ -28,13 +28,13 @@ INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1; connection slave; -start slave; +--source include/start_slave.inc # hope one second is not enough for slave to reach the last # Rows_log_event, so that test actually tests something. real_sleep 1; -stop slave; +--source include/stop_slave.inc # see if slave hangs on DROP TABLE diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_trig001.test b/mysql-test/suite/engines/funcs/t/rpl_row_trig001.test index 7b1fca2d6a1..77fd9fbf90e 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_trig001.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_trig001.test @@ -1,100 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/09/2005 # -############################################################################# -# TEST: Use after insert and before inset triggers and stored procdures to # -# Update and insert data # -############################################################################# +--source suite/rpl/t/rpl_row_trig001.test -# Includes --- source include/have_binlog_format_row.inc --- source include/master-slave.inc - --- disable_query_log --- disable_result_log - -# Begin clean up test section -connection master; ---disable_warnings -DROP PROCEDURE IF EXISTS test.p2; -DROP PROCEDURE IF EXISTS test.p3; ---error 0,1360 -DROP TRIGGER test.t2_ai; ---error 0,1360 -DROP TRIGGER test.t3_bi_t2; ---error 0,1360 -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; -DROP TABLE IF EXISTS test.t3; - - -# test section 1, lets add a trigger to the mix. Taken from bug #12280 -let $message=<Begin test section 1 (Tiggers & SP)>; ---source include/show_msg.inc - -CREATE TABLE test.t1 (n MEDIUMINT NOT NULL, d DATETIME, PRIMARY KEY(n)); -CREATE TABLE test.t2 (n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n)); -CREATE TABLE test.t3 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d DATETIME, PRIMARY KEY(n)); - -INSERT INTO test.t1 VALUES (1,NOW()); - -delimiter //; -CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW UPDATE test.t1 SET d=NOW() where n = 1;// -CREATE PROCEDURE test.p3() -BEGIN - INSERT INTO test.t3 (d) VALUES (NOW()); -END// -CREATE TRIGGER test.t3_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW CALL test.p3()// -CREATE PROCEDURE test.p2() -BEGIN - INSERT INTO test.t2 (f,d) VALUES (RAND(),NOW()); -END// -delimiter ;// - --- disable_query_log --- disable_result_log -let $1=10; -while ($1) -{ - CALL test.p2(); - sleep 1; - dec $1; -} --- enable_result_log --- enable_query_log - -#show binlog events; -#select * from test.t2; -#select * from test.t3; -#connection slave; -#select * from test.t2; -#select * from test.t3; - -let $message=<End test section 2 (Tiggers & SP)>; ---source include/show_msg.inc - -# time to dump the databases and so we can see if they match - ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/trig001_master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/trig001_slave.sql - -# Cleanup -connection master; -DROP PROCEDURE test.p2; -DROP PROCEDURE test.p3; -DROP TRIGGER test.t2_ai; -DROP TRIGGER test.t3_bi_t2; -DROP TABLE test.t1; -DROP TABLE test.t2; -DROP TABLE test.t3; -sync_slave_with_master; - -# Lets compare. Note: If they match test will pass, if they do not match -# the test will show that the diff statement failed and not reject file -# will be created. You will need to go to the mysql-test dir and diff -# the files your self to see what is not matching :-) Failed tests -# will leave dump files in $MYSQLTEST_VARDIR/tmp - -diff_files $MYSQLTEST_VARDIR/tmp/trig001_master.sql $MYSQLTEST_VARDIR/tmp/trig001_slave.sql; - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_trig002.test b/mysql-test/suite/engines/funcs/t/rpl_row_trig002.test index 44b7d8b1dc2..8b7342c32a1 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_trig002.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_trig002.test @@ -1,82 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/14/2005 # -# Updated: 08/29/2005 added save master pos and sync with master # -############################################################################# -# TEST: Taken and modified from BUG#12048 After Insert updates replication # -############################################################################# +--source suite/rpl/t/rpl_row_trig002.test -# Includes --- source include/have_binlog_format_row.inc --- source include/master-slave.inc - -#-- disable_query_log -#-- disable_result_log - -# Begin clean up test section -connection master; ---disable_warnings ---error 0,1360 -DROP TRIGGER test.t2_ai; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; -DROP TABLE IF EXISTS test.t3; ---enable_warnings - -# test section 1, Taken from bug #12408 - -CREATE TABLE test.t2 (value CHAR(30),domain_id INT, mailaccount_id INT, program CHAR(30),keey CHAR(30),PRIMARY KEY(domain_id)); - -CREATE TABLE test.t3 (value CHAR(30),domain_id INT, mailaccount_id INT, program CHAR(30),keey CHAR(30),PRIMARY KEY(domain_id)); - -CREATE TABLE test.t1 (id INT,domain CHAR(30),PRIMARY KEY(id)); - -delimiter |; -CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW UPDATE test.t3 ms, test.t1 d SET ms.value='No' WHERE ms.domain_id = (SELECT max(id) FROM test.t1 WHERE domain='example.com') AND ms.mailaccount_id IS NULL AND ms.program='spamfilter' AND ms.keey='scan_incoming'| -delimiter ;| - -INSERT INTO test.t1 VALUES (1, 'example.com'),(2, 'mysql.com'),(3, 'earthmotherwear.com'), (4, 'yahoo.com'),(5, 'example.com'); - -SELECT * FROM test.t1 ORDER BY id; -#show binlog events; -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM test.t1 ORDER BY id; -connection master; - -INSERT INTO test.t3 VALUES ('Yes', 5, NULL, 'spamfilter','scan_incoming'); -INSERT INTO test.t3 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming'); -INSERT INTO test.t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming'); - -select * from test.t2; ---sorted_result -select * from test.t3; -save_master_pos; -connection slave; -sync_with_master; -select * from test.t2; ---sorted_result -select * from test.t3; -connection master; - -DELETE FROM test.t1 WHERE id = 1; - -SELECT * FROM test.t1 ORDER BY id; -connection master; -SELECT * FROM test.t1 ORDER BY id; -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM test.t1 ORDER BY id; - -# Cleanup -connection master; -#show binlog events; -DROP TRIGGER test.t2_ai; -DROP TABLE test.t1; -DROP TABLE test.t2; -DROP TABLE test.t3; -sync_slave_with_master; - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_trig003.test b/mysql-test/suite/engines/funcs/t/rpl_row_trig003.test index 4a1bbc5ca89..2bb581995d0 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_trig003.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_trig003.test @@ -1,152 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/16/2005 # -# Updated: 8/29/2005 Remove sleep calls add dump and diff # -############################################################################# -# TEST: This test includes all trigger types. BEFORE/AFTER INSERT, UPDATE & # -# DELETE. In addition, includes cursor, bit, varchar, flow control, # -# looping, ROUND(), NOW(), YEAR(), TIMESTAMP # -############################################################################# +--source suite/rpl/t/rpl_row_trig003.test -# Includes --- source include/have_binlog_format_row.inc --- source include/master-slave.inc - -#-- disable_query_log -#-- disable_result_log - -# Begin clean up test section -connection master; ---disable_warnings ---error 0,1360 -DROP TRIGGER test.t1_bi; ---error 0,1360 -DROP TRIGGER test.t2_ai; ---error 0,1360 -DROP TRIGGER test.t1_bu; ---error 0,1360 -DROP TRIGGER test.t2_au; ---error 0,1360 -DROP TRIGGER test.t1_bd; ---error 0,1360 -DROP TRIGGER test.t2_ad; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; -DROP TABLE IF EXISTS test.t3; ---enable_warnings - -# test section 1 - -CREATE TABLE test.t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id)); -CREATE TABLE test.t2 (id MEDIUMINT NOT NULL AUTO_INCREMENT, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id)); -CREATE TABLE test.t3 (id MEDIUMINT NOT NULL AUTO_INCREMENT, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id)); - -# Note Most of these cause the slave to core or do not produce desired results. Currently commenting out the ones not working until they are fixed. - -delimiter |; -CREATE TRIGGER test.t1_bi BEFORE INSERT ON test.t1 FOR EACH ROW UPDATE test.t3 SET b1=1 and y=YEAR(NOW())| -CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW BEGIN - INSERT INTO test.t3 VALUES(NULL,0,'MySQL Replication team rocks!', 'Dark beer in prague is #1',12345.34,12.51,0,1965,NOW()); - UPDATE test.t3 SET f = ROUND(f); -END| -CREATE TRIGGER test.t1_bu BEFORE UPDATE on test.t1 FOR EACH ROW BEGIN - UPDATE test.t3 SET y = '2000'; - INSERT INTO test.t3 VALUES(NULL,1,'Testing MySQL databases before update ', 'Insert should work',621.43, 0105.21,0,1974,NOW()); -END| -CREATE TRIGGER test.t2_au AFTER UPDATE on test.t2 FOR EACH ROW BEGIN - DECLARE done INT DEFAULT 0; - DECLARE a DECIMAL(10,4); - DECLARE b FLOAT; - DECLARE num MEDIUMINT; - DECLARE cur1 CURSOR FOR SELECT t2.id, t2.d, t2.f FROM test.t2; - DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1; - - OPEN cur1; - - REPEAT - FETCH cur1 INTO num, a, b; - IF NOT done THEN - UPDATE test.t3 SET total =(a*b) WHERE ID = num; - END IF; - UNTIL done END REPEAT; - CLOSE cur1; -END| -CREATE TRIGGER test.t1_bd BEFORE DELETE on test.t1 FOR EACH ROW BEGIN - DECLARE done INT DEFAULT 0; - DECLARE a BIT(8); - DECLARE b VARCHAR(255); - DECLARE c CHAR(255); - DECLARE d DECIMAL(10,4); - DECLARE e FLOAT; - DECLARE f BIGINT UNSIGNED; - DECLARE g YEAR; - DECLARE h TIMESTAMP; - DECLARE cur1 CURSOR FOR SELECT t1.b1, t1.vc, t1.bc, t1.d, t1.f, t1.total, t1.y, t1.t FROM test.t1; - DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1; - - OPEN cur1; - - REPEAT - FETCH cur1 INTO a, b, c, d, e, f, g, h; - IF NOT done THEN - INSERT INTO test.t3 VALUES(NULL, a, b, c, d, e, f, g, h); - END IF; - UNTIL done END REPEAT; - CLOSE cur1; -END| -CREATE TRIGGER test.t2_ad AFTER DELETE ON test.t2 FOR EACH ROW - DELETE FROM test.t1| -delimiter ;| - -INSERT INTO test.t1 VALUES(NULL,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer',654321.4321,15.21,0,1965,NOW()); -INSERT INTO test.t2 VALUES(NULL,0,'Testing MySQL databases is a cool ', 'MySQL Customers ROCK!',654321.4321,1.24521,0,YEAR(NOW()),NOW()); - -UPDATE test.t1 SET b1 = 0 WHERE b1 = 1; - -INSERT INTO test.t2 VALUES(NULL,1,'This is an after update test.', 'If this works, total will not be zero on the master or slave',1.4321,5.221,0,YEAR(NOW()),NOW()); -UPDATE test.t2 SET b1 = 0 WHERE b1 = 1; - -INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW()); - -# To make sure BUG#14698 is gone, we sleep 2 seconds before calling trigger -# (with the bug in, that caused differences in TIMESTAMP columns). -# We just need to let the machine's clock advance, it's not -# to do synchronization, so real_sleep is good. -real_sleep 2; - -DELETE FROM test.t1 WHERE id = 1; - -DELETE FROM test.t2 WHERE id = 1; - -save_master_pos; -connection slave; -sync_with_master; -connection master; - -# time to dump the databases and so we can see if they match - ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/trg003_master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/trg003_slave.sql - -# cleanup ---disable_warnings ---error 0,1360 -DROP TRIGGER test.t1_bi; ---error 0,1360 -DROP TRIGGER test.t2_ai; ---error 0,1360 -DROP TRIGGER test.t1_bu; ---error 0,1360 -DROP TRIGGER test.t2_au; ---error 0,1360 -DROP TRIGGER test.t1_bd; ---error 0,1360 -DROP TRIGGER test.t2_ad; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; -DROP TABLE IF EXISTS test.t3; ---enable_warnings - -diff_files $MYSQLTEST_VARDIR/tmp/trg003_master.sql $MYSQLTEST_VARDIR/tmp/trg003_slave.sql; - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_until.test b/mysql-test/suite/engines/funcs/t/rpl_row_until.test index 7f8b0000042..d919bf7773b 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_until.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_until.test @@ -1,126 +1,2 @@ --- source include/have_binlog_format_row.inc --- source include/master-slave.inc +--source suite/rpl/t/rpl_row_until.test -# Note: The test is dependent on binlog positions - -# Create some events on master -connection master; -CREATE TABLE t1(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); -INSERT INTO t1 VALUES (1),(2),(3),(4); -DROP TABLE t1; -# Save master log position for query DROP TABLE t1 -save_master_pos; -let $master_pos_drop_t1= query_get_value(SHOW BINLOG EVENTS, Pos, 11); -let $master_log_file= query_get_value(SHOW BINLOG EVENTS, Log_name, 11); - -CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); -# Save master log position for query CREATE TABLE t2 -save_master_pos; -let $master_pos_create_t2= query_get_value(SHOW BINLOG EVENTS, Pos, 12); - -INSERT INTO t2 VALUES (1),(2); -save_master_pos; -# Save master log position for query INSERT INTO t2 VALUES (1),(2); -let $master_pos_insert1_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 19); -sync_slave_with_master; - -# Save relay log position for query INSERT INTO t2 VALUES (1),(2); -let $relay_pos_insert1_t2= query_get_value(show slave status, Relay_Log_Pos, 1); - -connection master; -INSERT INTO t2 VALUES (3),(4); -DROP TABLE t2; -# Save master log position for query DROP TABLE t2; -let $master_pos_drop_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 26); -sync_slave_with_master; - ---source include/stop_slave.inc -# Reset slave. -RESET SLAVE; ---disable_query_log -eval CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT; ---enable_query_log - -# Try to replicate all queries until drop of t1 -connection slave; -echo START SLAVE UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=master_pos_drop_t1; ---disable_query_log -eval START SLAVE UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_drop_t1; ---enable_query_log ---source include/wait_for_slave_sql_to_stop.inc - -# Here table should be still not deleted -SELECT * FROM t1; ---let $slave_param= Exec_Master_Log_Pos ---let $slave_param_value= $master_pos_drop_t1 ---source include/check_slave_param.inc - -# This should fail right after start ---replace_result 291 MASTER_LOG_POS -START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291; ---source include/wait_for_slave_sql_to_stop.inc -# again this table should be still not deleted -SELECT * FROM t1; - ---let $slave_param= Exec_Master_Log_Pos ---let $slave_param_value= $master_pos_drop_t1 ---source include/check_slave_param.inc - -# Try replicate all up to and not including the second insert to t2; -echo START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2; ---disable_query_log -eval START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=$relay_pos_insert1_t2; ---enable_query_log ---source include/wait_for_slave_sql_to_stop.inc -SELECT * FROM t2; - ---let $slave_param= Exec_Master_Log_Pos ---let $slave_param_value= $master_pos_insert1_t2 ---source include/check_slave_param.inc - -# clean up -START SLAVE; ---source include/wait_for_slave_to_start.inc -connection master; -sync_slave_with_master; ---source include/stop_slave.inc - -# This should stop immediately as we are already there -echo START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=master_pos_create_t2; ---disable_query_log -eval START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_create_t2; ---enable_query_log -let $slave_param= Until_Log_Pos; -let $slave_param_value= $master_pos_create_t2; ---source include/wait_for_slave_param.inc ---source include/wait_for_slave_sql_to_stop.inc -# here the sql slave thread should be stopped ---let $slave_param= Exec_Master_Log_Pos ---let $slave_param_value= $master_pos_drop_t2 ---source include/check_slave_param.inc - -#testing various error conditions ---replace_result 561 MASTER_LOG_POS ---error 1277 -START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=561; ---replace_result 561 MASTER_LOG_POS 12 RELAY_LOG_POS ---error 1277 -START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=561, RELAY_LOG_POS=12; ---error 1277 -START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001'; ---error 1277 -START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000009'; ---replace_result 561 MASTER_LOG_POS ---error 1277 -START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=561; -# Warning should be given for second command -START SLAVE; ---replace_result 740 MASTER_LOG_POS -START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740; - ---source include/stop_slave.inc -# Clear slave IO error. -RESET SLAVE; - ---let $rpl_only_running_threads= 1 ---source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_view01.test b/mysql-test/suite/engines/funcs/t/rpl_row_view01.test index 1ccfcb4eb27..6d58666f883 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_view01.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_view01.test @@ -1,82 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/19/2005 # -# Updated: 08/29/2005 Remove sleeps # -############################################################################# -#TEST: row based replication of views # -############################################################################# -# Includes --- source include/have_binlog_format_row.inc --- source include/master-slave.inc - -# Begin clean up test section -connection master; ---disable_warnings -create database if not exists mysqltest1; -DROP VIEW IF EXISTS mysqltest1.v1; -DROP VIEW IF EXISTS mysqltest1.v2; -DROP VIEW IF EXISTS mysqltest1.v3; -DROP VIEW IF EXISTS mysqltest1.v4; -DROP TABLE IF EXISTS mysqltest1.t3; -DROP TABLE IF EXISTS mysqltest1.t1; -DROP TABLE IF EXISTS mysqltest1.t2; -DROP TABLE IF EXISTS mysqltest1.t4; - -# Begin test section 1 -CREATE TABLE mysqltest1.t1 (a INT, c CHAR(6),PRIMARY KEY(a)); -CREATE TABLE mysqltest1.t2 (a INT, c CHAR(6),PRIMARY KEY(a)); -CREATE TABLE mysqltest1.t3 (a INT, c CHAR(6), c2 CHAR(6), PRIMARY KEY(a)); -CREATE TABLE mysqltest1.t4 (a INT, qty INT, price INT,PRIMARY KEY(a)); -CREATE TABLE mysqltest1.t5 (qty INT, price INT, total INT, PRIMARY KEY(qty)); -INSERT INTO mysqltest1.t1 VALUES (1,'Thank'),(2,'it'),(3,'Friday'); -INSERT INTO mysqltest1.t2 VALUES (1,'GOD'),(2,'is'),(3,'TGIF'); -INSERT INTO mysqltest1.t4 VALUES(1, 3, 50),(2, 18, 3),(4, 4, 4); - - -CREATE VIEW mysqltest1.v2 AS SELECT qty, price, qty*price AS value FROM mysqltest1.t4 ORDER BY qty; -CREATE VIEW mysqltest1.v1 AS SELECT t1.a, t1.c, t2.c as c2 FROM mysqltest1.t1 as t1, mysqltest1.t2 AS t2 WHERE mysqltest1.t1.a = mysqltest1.t2.a ORDER BY a; -CREATE VIEW mysqltest1.v3 AS SELECT * FROM mysqltest1.t1; -CREATE VIEW mysqltest1.v4 AS SELECT * FROM mysqltest1.v3 WHERE a > 1 WITH LOCAL CHECK OPTION; - - -SELECT * FROM mysqltest1.v2; -SELECT * FROM mysqltest1.v1; -sync_slave_with_master; -SELECT * FROM mysqltest1.v2; -SELECT * FROM mysqltest1.v1; -connection master; - -INSERT INTO mysqltest1.t5 SELECT * FROM mysqltest1.v2; -INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1; - -SELECT * FROM mysqltest1.t5 ORDER BY qty; -SELECT * FROM mysqltest1.t3 ORDER BY a; -sync_slave_with_master; -SELECT * FROM mysqltest1.t5 ORDER BY qty; -SELECT * FROM mysqltest1.t3 ORDER BY a; -connection master; - -INSERT INTO mysqltest1.v4 VALUES (4,'TEST'); - -SELECT * FROM mysqltest1.t1 ORDER BY a; -SELECT * FROM mysqltest1.v4 ORDER BY a; -sync_slave_with_master; -SELECT * FROM mysqltest1.t1 ORDER BY a; -SELECT * FROM mysqltest1.v4 ORDER BY a; - -connection master; - -# lets cleanup -DROP VIEW IF EXISTS mysqltest1.v1; -DROP VIEW IF EXISTS mysqltest1.v2; -DROP VIEW IF EXISTS mysqltest1.v3; -DROP VIEW IF EXISTS mysqltest1.v4; -DROP TABLE IF EXISTS mysqltest1.t3; -DROP TABLE IF EXISTS mysqltest1.t1; -DROP TABLE IF EXISTS mysqltest1.t2; -DROP TABLE IF EXISTS mysqltest1.t4; -DROP DATABASE mysqltest1; -sync_slave_with_master; - -# End of 5.1 test case +--source suite/rpl/t/rpl_row_view01.test diff --git a/mysql-test/suite/engines/funcs/t/rpl_server_id1.test b/mysql-test/suite/engines/funcs/t/rpl_server_id1.test index 71310750b60..1412db46d3a 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_server_id1.test +++ b/mysql-test/suite/engines/funcs/t/rpl_server_id1.test @@ -4,23 +4,28 @@ # ignored, which has caught our customers), unless # --replicate-same-server-id. -source include/master-slave.inc; +--source include/master-slave.inc connection slave; create table t1 (n int); reset master; # replicate ourselves -stop slave; +--source include/stop_slave.inc --replace_result $SLAVE_MYPORT SLAVE_PORT eval change master to master_port=$SLAVE_MYPORT; ---replace_result $SLAVE_MYPORT SLAVE_PORT ---replace_column 16 # 18 # -show slave status; +--let $status_items= Slave_IO_Running, Slave_SQL_Running, Last_SQL_Errno, Last_SQL_Error, Exec_Master_Log_Pos +--source include/show_slave_status.inc start slave; insert into t1 values (1); -# can't MASTER_POS_WAIT(), it does not work in this weird setup -# (when slave is its own master without --replicate-same-server-id) -sleep 2; # enough time for the event to be replicated (it should not) -show status like "slave_running"; -drop table t1; -# End of 4.1 tests +--let $slave_param=Last_IO_Errno +--let $slave_param_value=1593 +--source include/wait_for_slave_param.inc + +--let $slave_field_result_replace= / at [0-9]*/ at XXX/ +--let $status_items= Last_IO_Errno, Last_IO_Error +--source include/show_slave_status.inc + +--source include/stop_slave.inc +reset slave; +reset master; +drop table t1; diff --git a/mysql-test/suite/engines/funcs/t/rpl_server_id2.test b/mysql-test/suite/engines/funcs/t/rpl_server_id2.test index 0f2eb560d18..8d48746ba5e 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_server_id2.test +++ b/mysql-test/suite/engines/funcs/t/rpl_server_id2.test @@ -1,26 +1,2 @@ -# This test checks that a slave DOES execute queries originating -# from itself, if running with --replicate-same-server-id. +--source suite/rpl/t/rpl_server_id2.test -source include/master-slave.inc; -connection slave; -create table t1 (n int); -reset master; -# replicate ourselves -stop slave; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval change master to master_port=$SLAVE_MYPORT; ---replace_result $SLAVE_MYPORT SLAVE_PORT ---replace_column 18 # -show slave status; -start slave; -insert into t1 values (1); -save_master_pos; -sync_with_master; -select * from t1; # check that indeed 2 were inserted -# We stop the slave before cleaning up otherwise we'll get -# 'drop table t1' executed twice, so an error in the slave.err -# (not critical). -stop slave; -drop table t1; - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_session_var.test b/mysql-test/suite/engines/funcs/t/rpl_session_var.test index a6f4b496a23..f1686e107b6 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_session_var.test +++ b/mysql-test/suite/engines/funcs/t/rpl_session_var.test @@ -1,42 +1,2 @@ -# Replication of session variables. -# FOREIGN_KEY_CHECKS is tested in rpl_insert_id.test +--source suite/rpl/t/rpl_session_var.test -source include/master-slave.inc; -drop table if exists t1; -create table t1(a varchar(100),b int); -set @@session.sql_mode=pipes_as_concat; -insert into t1 values('My'||'SQL', 1); -set @@session.sql_mode=default; -insert into t1 values('1'||'2', 2); -select * from t1 where b<3 order by a; -save_master_pos; -connection slave; -sync_with_master; -select * from t1 where b<3 order by a; -connection master; -# if the slave does the next sync_with_master fine, then it means it accepts the -# two lines of ANSI syntax below, which is what we want to check. -set @@session.sql_mode=ignore_space; -insert into t1 values(password ('MySQL'), 3); -set @@session.sql_mode=ansi_quotes; -create table "t2" ("a" int); -drop table t1, t2; -set @@session.sql_mode=default; -create table t1(a int auto_increment primary key); -create table t2(b int, a int); -set @@session.sql_auto_is_null=1; -insert into t1 values(null); -insert into t2 select 1,a from t1 where a is null; -set @@session.sql_auto_is_null=0; -insert into t1 values(null); -insert into t2 select 2,a from t1 where a is null; -select * from t2 order by b; -save_master_pos; -connection slave; -sync_with_master; -select * from t2 order by b; -connection master; -drop table t1,t2; -save_master_pos; -connection slave; -sync_with_master; diff --git a/mysql-test/suite/engines/funcs/t/rpl_sf.test b/mysql-test/suite/engines/funcs/t/rpl_sf.test index 6a741d80172..7ce6dc002ae 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_sf.test +++ b/mysql-test/suite/engines/funcs/t/rpl_sf.test @@ -1,5 +1,5 @@ # Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR -source include/master-slave.inc; +--source include/master-slave.inc # save status let $oblf=`select @@SESSION.BINLOG_FORMAT`; @@ -66,3 +66,4 @@ drop function fn16456; eval set binlog_format=$oblf; eval set global log_bin_trust_function_creators=$otfc; --enable_query_log +--source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_skip_error.test b/mysql-test/suite/engines/funcs/t/rpl_skip_error.test index ff81e2f010e..083dfaa2075 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_skip_error.test +++ b/mysql-test/suite/engines/funcs/t/rpl_skip_error.test @@ -2,12 +2,10 @@ # 2006-02-07 By JBM: Added order by ######################################### # Note that errors are ignored by opt file. -source include/master-slave.inc; +--source include/master-slave.inc create table t1 (n int not null primary key); -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master insert into t1 values (1); connection master; # Here we expect (ignored) error, since 1 is already in slave table @@ -16,14 +14,13 @@ insert into t1 values (1); # These should work fine insert into t1 values (2),(3); -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master select * from t1 ORDER BY n; # Cleanup connection master; drop table t1; -sync_slave_with_master; +--sync_slave_with_master # End of 4.1 tests +--source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_slave_status.test b/mysql-test/suite/engines/funcs/t/rpl_slave_status.test index b3d6e49e215..677d95117fc 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_slave_status.test +++ b/mysql-test/suite/engines/funcs/t/rpl_slave_status.test @@ -1,58 +1,2 @@ ---source include/master-slave.inc +--source suite/rpl/t/rpl_slave_status.test -############################################################################ -# Test case for BUG#10780 -# -# REQUIREMENT -# A slave without replication privileges should have Slave_IO_Running = No - -# 1. Create new replication user -connection master; -grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl'; - -connection slave; -stop slave; -change master to master_user='rpl',master_password='rpl'; -start slave; - -# 2. Do replication as new user -connection master; ---disable_warnings -drop table if exists t1; ---enable_warnings -create table t1 (n int); -insert into t1 values (1); -save_master_pos; -connection slave; -sync_with_master; -select * from t1; - -# 3. Delete new replication user -connection master; -drop user rpl@127.0.0.1; -sleep 1; -flush privileges; -connection slave; - -# 4. Restart slave without privileges -# (slave.err will contain access denied error for this START SLAVE command) -stop slave; -start slave; - -# 5. Make sure Slave_IO_Running = No ---replace_result $MASTER_MYPORT MASTER_MYPORT -# Column 1 is replaced, since the output can be either -# "Connecting to master" or "Waiting for master update" ---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 35 # 36 # ---vertical_results -show slave status; - -# Cleanup (Note that slave IO thread is not running) -connection slave; -drop table t1; -connection master; -drop table t1; - -# end of test case for BUG#10780 - -# end of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_sp.test b/mysql-test/suite/engines/funcs/t/rpl_sp.test index ad2cc29375b..773062275c9 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_sp.test +++ b/mysql-test/suite/engines/funcs/t/rpl_sp.test @@ -1,496 +1,2 @@ -# row-based and statement have expected binlog difference in result files - -# Test of replication of stored procedures (WL#2146 for MySQL 5.0) -# Modified by WL#2971. - -source include/have_binlog_format_mixed.inc; -source include/master-slave.inc; - -# we need a db != test, where we don't have automatic grants ---disable_warnings -drop database if exists mysqltest1; ---enable_warnings -create database mysqltest1; -use mysqltest1; -create table t1 (a varchar(100)); -sync_slave_with_master; -use mysqltest1; - -# ********************** PART 1 : STORED PROCEDURES *************** - -# Does the same proc as on master get inserted into mysql.proc ? -# (same definer, same properties...) - -connection master; - -delimiter |; - -# Stored procedures don't have the limitations that functions have -# regarding binlogging: it's ok to create a procedure as not -# deterministic and updating data, while it's not ok to create such a -# function. We test this. - -create procedure foo() -begin - declare b int; - set b = 8; - insert into t1 values (b); - insert into t1 values (unix_timestamp()); -end| -delimiter ;| - -# we replace columns having times -# (even with fixed timestamp displayed time may changed based on TZ) ---replace_result localhost.localdomain localhost 127.0.0.1 localhost ---replace_column 13 # 14 # -select * from mysql.proc where name='foo' and db='mysqltest1'; -sync_slave_with_master; -# You will notice in the result that the definer does not match what -# it is on master, it is a known bug on which Alik is working ---replace_result localhost.localdomain localhost 127.0.0.1 localhost ---replace_column 13 # 14 # -select * from mysql.proc where name='foo' and db='mysqltest1'; - -connection master; -# see if timestamp used in SP on slave is same as on master -set timestamp=1000000000; -call foo(); -select * from t1; -sync_slave_with_master; -select * from t1; - -# Now a SP which is not updating tables - -connection master; -delete from t1; -create procedure foo2() - select * from mysqltest1.t1; -call foo2(); - -# check that this is allowed (it's not for functions): -alter procedure foo2 contains sql; - -# SP with definer's right - -drop table t1; -create table t1 (a int); -create table t2 like t1; - -create procedure foo3() - deterministic - insert into t1 values (15); - -# let's create a non-privileged user -grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1; -grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1; -grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1; - -# ToDo: BUG#14931: There is a race between the last grant binlogging, and -# the binlogging in the new connection made below, causing sporadic test -# failures due to switched statement order in binlog. To fix this we do -# SELECT 1 in the first connection before starting the second, ensuring -# that binlogging is done in the expected order. -# Please remove this SELECT 1 when BUG#14931 is fixed. -SELECT 1; - -connect (con1,127.0.0.1,zedjzlcsjhd,,mysqltest1,$MASTER_MYPORT,); -connection con1; - -# this routine will fail in the second INSERT because of privileges -delimiter |; -create procedure foo4() - deterministic - begin - insert into t2 values(3); - insert into t1 values (5); - end| - -delimiter ;| - -# I add ,0 so that it does not print the error in the test output, -# because this error is hostname-dependent ---error 1142,0 -call foo4(); # invoker has no INSERT grant on table t1 => failure - -connection master; -call foo3(); # success (definer == root) -show warnings; - ---error 1142,0 -call foo4(); # definer's rights => failure - -# we test replication of ALTER PROCEDURE -alter procedure foo4 sql security invoker; -call foo4(); # invoker's rights => success -show warnings; - -# Note that half-failed procedure calls are ok with binlogging; -# if we compare t2 on master and slave we see they are identical: - -select * from t1; -select * from t2; -sync_slave_with_master; -select * from t1; -select * from t2; - -# Test of DROP PROCEDURE - ---replace_result localhost.localdomain localhost 127.0.0.1 localhost ---replace_column 13 # 14 # -select * from mysql.proc where name="foo4" and db='mysqltest1'; -connection master; -drop procedure foo4; -select * from mysql.proc where name="foo4" and db='mysqltest1'; -sync_slave_with_master; -select * from mysql.proc where name="foo4" and db='mysqltest1'; - -# ********************** PART 2 : FUNCTIONS *************** - -connection master; -drop procedure foo; -drop procedure foo2; -drop procedure foo3; - -delimiter |; -# check that needs "deterministic" ---error 1418 -create function fn1(x int) - returns int -begin - insert into t1 values (x); - return x+2; -end| -create function fn1(x int) - returns int - deterministic -begin - insert into t1 values (x); - return x+2; -end| - -delimiter ;| -delete t1,t2 from t1,t2; -select fn1(20); -insert into t2 values(fn1(21)); ---sorted_result -select * from t1; -select * from t2; -sync_slave_with_master; ---sorted_result -select * from t1; -select * from t2; - -connection master; -delimiter |; - -drop function fn1; - -create function fn1() - returns int - no sql -begin - return unix_timestamp(); -end| - -delimiter ;| -# check that needs "deterministic" ---error 1418 -alter function fn1 contains sql; - -delete from t1; -set timestamp=1000000000; -insert into t1 values(fn1()); - -connection con1; - -delimiter |; ---error 1419 # only full-global-privs user can create a function -create function fn2() - returns int - no sql -begin - return unix_timestamp(); -end| -delimiter ;| -connection master; -set global log_bin_trust_function_creators=0; -set global log_bin_trust_function_creators=1; -# slave needs it too otherwise will not execute what master allowed: -connection slave; -set global log_bin_trust_function_creators=1; - -connection con1; - -delimiter |; -create function fn2() - returns int - no sql -begin - return unix_timestamp(); -end| -delimiter ;| - -connection master; - -# Now a function which is supposed to not update tables -# as it's "reads sql data", so should not give error even if -# non-deterministic. - -delimiter |; -create function fn3() - returns int - not deterministic - reads sql data -begin - return 0; -end| -delimiter ;| - -select fn3(); ---replace_result localhost.localdomain localhost 127.0.0.1 localhost ---replace_column 13 # 14 # -select * from mysql.proc where db='mysqltest1'; -select * from t1; - -sync_slave_with_master; -use mysqltest1; -select * from t1; ---replace_result localhost.localdomain localhost 127.0.0.1 localhost ---replace_column 13 # 14 # -select * from mysql.proc where db='mysqltest1'; - -# ********************** PART 3 : TRIGGERS *************** - -connection con1; -# now fails due to missing trigger grant (err 1142 i/o 1227) due to new -# check in sql_trigger.cc (v1.44) by anozdrin on 2006/02/01 --azundris ---error ER_TABLEACCESS_DENIED_ERROR -create trigger trg before insert on t1 for each row set new.a= 10; - -connection master; -delete from t1; -# TODO: when triggers can contain an update, test that this update -# does not go into binlog. -# I'm not setting user vars in the trigger, because replication of user vars -# would take care of propagating the user var's value to slave, so even if -# the trigger was not executed on slave it would not be discovered. -create trigger trg before insert on t1 for each row set new.a= 10; -insert into t1 values (1); -select * from t1; -sync_slave_with_master; -select * from t1; - -connection master; -delete from t1; -drop trigger trg; -insert into t1 values (1); -select * from t1; ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -#show binlog events in 'master-bin.000001' from 106; -sync_slave_with_master; -select * from t1; - - -# -# Test for bug #13969 "Routines which are replicated from master can't be -# executed on slave". -# -connection master; -create procedure foo() - not deterministic - reads sql data - select * from t1; -sync_slave_with_master; -# This should not fail -call foo(); -connection master; -drop procedure foo; -sync_slave_with_master; - - -# Clean up -connection master; -drop function fn1; -drop database mysqltest1; -drop user "zedjzlcsjhd"@127.0.0.1; -use test; -sync_slave_with_master; -use test; - -# -# Bug#14077 "Failure to replicate a stored function with a cursor": -# verify that stored routines with cursors work on slave. -# -connection master; ---disable_warnings -drop function if exists f1; ---enable_warnings -delimiter |; -create function f1() returns int reads sql data -begin - declare var integer; - declare c cursor for select a from v1; - open c; - fetch c into var; - close c; - return var; -end| -delimiter ;| -create view v1 as select 1 as a; -create table t1 (a int); -insert into t1 (a) values (f1()); -select * from t1; -drop view v1; -drop function f1; -sync_slave_with_master; -connection slave; -select * from t1; - -# -# Bug#16621 "INSERTs in Stored Procedures causes data corruption in the Binary -# Log for 5.0.18" -# - -# Prepare environment. - -connection master; - ---disable_warnings -DROP PROCEDURE IF EXISTS p1; -DROP TABLE IF EXISTS t1; ---enable_warnings - -# Test case. - -CREATE TABLE t1(col VARCHAR(10)); - -CREATE PROCEDURE p1(arg VARCHAR(10)) - INSERT INTO t1 VALUES(arg); - -CALL p1('test'); - -SELECT * FROM t1; - -sync_slave_with_master; -SELECT * FROM t1; - -# Cleanup -connection master; -DROP PROCEDURE p1; - - -# -# BUG#20438: CREATE statements for views, stored routines and triggers can be -# not replicable. -# - ---echo ---echo ---> Test for BUG#20438 - -# Prepare environment. - ---echo ---echo ---> Preparing environment... ---echo ---> connection: master ---connection master - ---disable_warnings -DROP PROCEDURE IF EXISTS p1; -DROP FUNCTION IF EXISTS f1; ---enable_warnings - ---echo ---echo ---> Synchronizing slave with master... - ---save_master_pos ---connection slave ---sync_with_master - ---echo ---echo ---> connection: master ---connection master - -# Test. - ---echo ---echo ---> Creating procedure... - -/*!50003 CREATE PROCEDURE p1() SET @a = 1 */; - -/*!50003 CREATE FUNCTION f1() RETURNS INT RETURN 0 */; - ---echo ---echo ---> Checking on master... - -SHOW CREATE PROCEDURE p1; -SHOW CREATE FUNCTION f1; - ---echo ---echo ---> Synchronizing slave with master... - ---save_master_pos ---connection slave ---sync_with_master - ---echo ---> connection: master - ---echo ---echo ---> Checking on slave... - -SHOW CREATE PROCEDURE p1; -SHOW CREATE FUNCTION f1; - -# Cleanup. - ---echo ---echo ---> connection: master ---connection master - ---echo ---echo ---> Cleaning up... - -DROP PROCEDURE p1; -DROP FUNCTION f1; - ---save_master_pos ---connection slave ---sync_with_master ---connection master - - -# cleanup -connection master; -drop table t1; -sync_slave_with_master; - -# Restore log_bin_trust_function_creators to original value -set global log_bin_trust_function_creators=0; -connection master; -set global log_bin_trust_function_creators=0; ---echo End of 5.0 tests - -# -# Bug22043: MySQL don't add "USE <DATABASE>" before "DROP PROCEDURE IF EXISTS" -# -connection master; -reset master; ---disable_warnings -drop database if exists mysqltest; -drop database if exists mysqltest2; ---enable_warnings -create database mysqltest; -create database mysqltest2; -use mysqltest2; -create table t ( t integer ); -create procedure mysqltest.test() begin end; -insert into t values ( 1 ); -#show binlog events in 'master-bin.000001' from 106; ---error ER_BAD_DB_ERROR -create procedure `\\`.test() begin end; -# Clean up -drop database mysqltest; -drop database mysqltest2; - ---echo End of 5.1 tests +--source suite/rpl/t/rpl_sp.test diff --git a/mysql-test/suite/engines/funcs/t/rpl_sp004.test b/mysql-test/suite/engines/funcs/t/rpl_sp004.test index 967e7007c15..ca5c802b279 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_sp004.test +++ b/mysql-test/suite/engines/funcs/t/rpl_sp004.test @@ -1,97 +1,2 @@ -############################################################################# -# Original Author: JBM # -# Original Date: Aug/14/2005 # -############################################################################# -# Test: This test contains two sp that create and drop tables, insert and # -# updated data and uses the NOW() function. # -############################################################################# +--source suite/rpl/t/rpl_sp004.test - -# Includes --- source include/master-slave.inc - - -# Begin clean up test section -connection master; ---disable_warnings -DROP PROCEDURE IF EXISTS test.p1; -DROP PROCEDURE IF EXISTS test.p2; -DROP TABLE IF EXISTS test.t2; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t3; ---enable_warnings -# End of cleanup - -# Begin test section 1 - -delimiter |; -CREATE PROCEDURE test.p1() -BEGIN - CREATE TABLE IF NOT EXISTS test.t1(a INT,PRIMARY KEY(a)); - CREATE TABLE IF NOT EXISTS test.t2(a INT,PRIMARY KEY(a)); - INSERT INTO test.t1 VALUES (4),(2),(1),(3); - UPDATE test.t1 SET a=a+4 WHERE a=4; - INSERT INTO test.t2 (a) SELECT t1.a FROM test.t1; - UPDATE test.t1 SET a=a+4 WHERE a=8; - CREATE TABLE IF NOT EXISTS test.t3(n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n)); -END| -CREATE PROCEDURE test.p2() -BEGIN - DROP TABLE IF EXISTS test.t1; - DROP TABLE IF EXISTS test.t2; - INSERT INTO test.t3 VALUES(NULL,11111111.233333,NOW()); -END| -delimiter ;| - -CALL test.p1(); -SELECT * FROM test.t1 ORDER BY a; -SELECT * FROM test.t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM test.t1 ORDER BY a; -SELECT * FROM test.t2 ORDER BY a; - -connection master; -CALL test.p2(); -USE test; -SHOW TABLES; -#SELECT * FROM test.t3; -save_master_pos; -connection slave; -sync_with_master; -USE test; -SHOW TABLES; -#SELECT * FROM test.t3; - -connection master; -CALL test.p1(); -SELECT * FROM test.t1 ORDER BY a; -SELECT * FROM test.t2 ORDER BY a; -#SELECT * FROM test.t3; -save_master_pos; -connection slave; -sync_with_master; -SELECT * FROM test.t1 ORDER BY a; -SELECT * FROM test.t2 ORDER BY a; -#SELECT * FROM test.t3; - ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp004_master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp004_slave.sql - -# Cleanup -connection master; -#show binlog events; -DROP PROCEDURE IF EXISTS test.p1; -DROP PROCEDURE IF EXISTS test.p2; -DROP TABLE IF EXISTS test.t1; -DROP TABLE IF EXISTS test.t2; -DROP TABLE IF EXISTS test.t3; -sync_slave_with_master; - -# If the test fails, you will need to diff the dumps to see why. - -diff_files $MYSQLTEST_VARDIR/tmp/sp004_master.sql $MYSQLTEST_VARDIR/tmp/sp004_slave.sql; - - -# End of 5.0 test case diff --git a/mysql-test/suite/engines/funcs/t/rpl_sp_effects.test b/mysql-test/suite/engines/funcs/t/rpl_sp_effects.test index 94ce539291d..29b27c728e4 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_sp_effects.test +++ b/mysql-test/suite/engines/funcs/t/rpl_sp_effects.test @@ -1,208 +1,2 @@ -########################################## -# Change Author: JBM -# Change Date: 2006-05-02 -########################################## +--source suite/rpl/t/rpl_sp_effects.test -# Test of replication of stored procedures (WL#2146 for MySQL 5.0) --- source include/master-slave.inc - -# **************************************************************** -connection master; - -# cleanup ---disable_warnings -drop procedure if exists p1; -drop procedure if exists p2; -drop function if exists f1; -drop table if exists t1,t2; -drop view if exists v1; ---enable_warnings -create table t1 (a int); - -SET GLOBAL log_bin_trust_function_creators = 1; - -# 1. Test simple variables use. -delimiter //; -create procedure p1() -begin - declare spv int default 0; - while spv < 5 do - insert into t1 values(spv+1); - set spv=spv+1; - end while; -end// -delimiter ;// - -call p1(); - -sync_slave_with_master; -connection slave; -SELECT * FROM t1 ORDER BY a; -connection master; -SELECT * FROM t1 ORDER BY a; - -# 2. Test SP variable name -delimiter //; -create procedure p2() -begin - declare a int default 4; - create table t2 as select a; -end// -delimiter ;// - -call p2(); -SELECT * FROM t2 ORDER BY a; -sync_slave_with_master; -connection slave; -SELECT * FROM t2 ORDER BY a; - -connection master; -drop procedure p1; -drop procedure p2; -drop table t2; - -# 3. Test FUNCTIONs in various places - -delimiter //; -create function f1(x int) returns int -begin - insert into t1 values(x); - return x+1; -end// - -create procedure p1(a int, b int) -begin - declare v int default f1(5); - if (f1(6)) then - select 'yes'; - end if; - set v = f1(7); - while f1(8) < 1 do - select 'this cant be'; - end while; - -end// -delimiter ;// - -call p1(f1(1), f1(2)); -SELECT * FROM t1 ORDER BY a; - -create table t2(a int); -insert into t2 values (10),(11); -SELECT a,f1(a) FROM t2 ORDER BY a; - -# This shouldn't put separate 'call f1(3)' into binlog: -insert into t2 select f1(3); -SELECT 'master:',a FROM t1 ORDER BY a; - -sync_slave_with_master; -connection slave; -SELECT 'slave:',a FROM t1 ORDER BY a; - -connection master; -drop procedure p1; -delete from t1; -delete from t2; - -# 4. VIEWs -delete from t1; -insert into t2 values(1),(2); -create view v1 as select f1(a) as f from t2; -select * from v1 order by f; -SELECT 'master:',a FROM t1 ORDER BY a; - -sync_slave_with_master; -connection slave; -SELECT 'slave:',a FROM t1 ORDER BY a; - -connection master; -drop view v1; -delete from t1; - -# 5. Prepared statements. -prepare s1 from 'select f1(?)'; -set @xx=123; -execute s1 using @xx; -SELECT 'master:',a FROM t1 ORDER BY a; - -sync_slave_with_master; -connection slave; -SELECT 'slave:',a FROM t1 ORDER BY a; - -connection master; -delete from t1; - -# 5. Cursors. -# t2 has (1),(2); -delimiter //; -create procedure p1(spv int) -begin - declare c cursor for select f1(spv) from t2; - while (spv > 2) do - open c; - fetch c into spv; - close c; - set spv= spv - 10; - end while; -end// -delimiter ;// -call p1(15); -SELECT 'master:',a FROM t1 ORDER BY a; -sync_slave_with_master; -connection slave; -SELECT 'slave:',a FROM t1 ORDER BY a; - -connection master; -drop procedure p1; -drop function f1; -drop table t1,t2; - -# BUG#12637: User variables + SPs replication -create table t1 (a int); -delimiter //; -create procedure p1() -begin - insert into t1 values(@x); - set @x=@x+1; - insert into t1 values(@x); - if (f2()) then - insert into t1 values(1243); - end if; -end// - -create function f2() returns int -begin - insert into t1 values(@z); - set @z=@z+1; - insert into t1 values(@z); - return 0; -end// - -create function f1() returns int -begin - insert into t1 values(@y); - call p1(); - return 0; -end// - -delimiter ;// - -set @x=10; -set @y=20; -set @z=100; -select f1(); - -set @x=30; -call p1(); - -SELECT 'master', a FROM t1 ORDER BY a; -sync_slave_with_master; -connection slave; -SELECT 'slave', a FROM t1 ORDER BY a; - -connection master; -drop table t1; -drop function f1; -drop function f2; -drop procedure p1; -sync_slave_with_master; diff --git a/mysql-test/suite/engines/funcs/t/rpl_start_stop_slave.test b/mysql-test/suite/engines/funcs/t/rpl_start_stop_slave.test index 19988cf902a..632a1a0232c 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_start_stop_slave.test +++ b/mysql-test/suite/engines/funcs/t/rpl_start_stop_slave.test @@ -1,10 +1,10 @@ -source include/master-slave.inc; +--source include/master-slave.inc # # Bug#6148 () # connection slave; -stop slave; +--source include/stop_slave.inc # Let the master do lots of insertions connection master; @@ -17,20 +17,19 @@ while ($1) dec $1; } enable_query_log; -save_master_pos; connection slave; -start slave; -sleep 1; -stop slave io_thread; +--source include/start_slave.inc +--source include/stop_slave_io.inc start slave io_thread; -sync_with_master; +--source include/wait_for_slave_io_to_start.inc connection master; -drop table t1; -save_master_pos; +--sync_slave_with_master -connection slave; -sync_with_master; +connection master; +drop table t1; +--sync_slave_with_master -# End of 4.1 tests +# End of test +--source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_stm_mystery22.test b/mysql-test/suite/engines/funcs/t/rpl_stm_mystery22.test index 017593fdfba..ca1b14201d3 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_stm_mystery22.test +++ b/mysql-test/suite/engines/funcs/t/rpl_stm_mystery22.test @@ -20,7 +20,7 @@ # first, cause a duplicate key problem on the slave create table t1(n int auto_increment primary key, s char(10)); -sync_slave_with_master; +--sync_slave_with_master insert into t1 values (2,'old'); connection master; insert into t1 values(NULL,'new'); @@ -31,13 +31,13 @@ connection slave; wait_for_slave_to_stop; select * from t1 order by n; delete from t1 where n = 2; ---disable_warnings -start slave; ---enable_warnings + +--source include/start_slave.inc + sync_with_master; #now the buggy slave would be confused on the offset but it can replicate #in order to make it break, we need to stop/start the slave one more time -stop slave; +--source include/stop_slave.inc connection master; # to be able to really confuse the slave, we need some non-auto-increment # events in the log @@ -51,9 +51,9 @@ set sql_log_bin=1; delete from t1 where n=4; save_master_pos; connection slave; ---disable_warnings -start slave; ---enable_warnings + +--source include/start_slave.inc + #now the truth comes out - if the slave is buggy, it will never sync because #the slave thread is not able to read events sync_with_master; @@ -61,6 +61,6 @@ select * from t1 order by n; #clean up connection master; drop table t1; -sync_slave_with_master; - +--sync_slave_with_master +--source include/rpl_end.inc # End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_stm_no_op.test b/mysql-test/suite/engines/funcs/t/rpl_stm_no_op.test index 66dc89bd712..e1f920b0928 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_stm_no_op.test +++ b/mysql-test/suite/engines/funcs/t/rpl_stm_no_op.test @@ -1,93 +1,2 @@ -# It's true only in statement-based replication that a statement which -# updates no rows (UPDATE/DELETE) is binlogged; in row-based -# replication, as we log modified rows, nothing is binlogged in this -# case. So this test is meaningul only in statement-based (and if it was -# enabled in row-based, it would fail as expected). +--source suite/rpl/t/rpl_stm_no_op.test --- source include/have_binlog_format_mixed_or_statement.inc - -source include/master-slave.inc; - -# see if DROP DATABASE is binlogged even if no effect -connection slave; -create database mysqltest; -connection master; -drop database if exists mysqltest; -sync_slave_with_master; -# can't read dir ---replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" \\ / ---error 1049 -show tables from mysqltest; - -# see if DROP TABLE is binlogged even if no effect -connection slave; -create table t1 (a int); -connection master; -drop table if exists t1; -sync_slave_with_master; -# table does not exist ---error 1146 -select * from t1; - -# see if single-table DELETE is binlogged even if no effect -connection master; -create table t1 (a int, b int); -sync_slave_with_master; -insert into t1 values(1,1); -connection master; -delete from t1; -sync_slave_with_master; -select * from t1; - -# see if single-table UPDATE is binlogged even if no effect -insert into t1 values(1,1); -connection master; -insert into t1 values(2,1); -update t1 set a=2; -sync_slave_with_master; -select * from t1; - -# End of 4.1 tests - -# see if multi-table UPDATE is binlogged even if no effect (BUG#13348) - -connection master; -create table t2 (a int, b int); -delete from t1; -insert into t1 values(1,1); -insert into t2 values(1,1); - -sync_slave_with_master; -# force a difference to see if master's multi-UPDATE will correct it -update t1 set a=2; - -connection master; -UPDATE t1, t2 SET t1.a = t2.a; - -sync_slave_with_master; -select * from t1; -select * from t2; - -# See if multi-table DELETE is binlogged even if no effect - -connection master; -delete from t1; -delete from t2; - -sync_slave_with_master; -# force a difference to see if master's multi-DELETE will correct it -insert into t1 values(1,1); -insert into t2 values(1,1); - -connection master; -DELETE t1.*, t2.* from t1, t2; - -sync_slave_with_master; -select * from t1; -select * from t2; - - -# cleanup -connection master; -drop table t1, t2; -sync_slave_with_master; diff --git a/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test index 396ba4073e4..2a16d90f9ad 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test @@ -1,564 +1 @@ --- source include/master-slave.inc - -connection default; -set @saved_binlog_format = @@global.binlog_format; - -# Since this test generates row-based events in the binary log, the -# slave SQL thread cannot be in STATEMENT mode to execute this test, -# so we only execute it for MIXED and ROW as default value of -# BINLOG_FORMAT. - -connection slave; --- source include/have_binlog_format_mixed_or_row.inc - -connection master; ---disable_warnings -drop database if exists mysqltest1; -create database mysqltest1; ---enable_warnings -use mysqltest1; -set session binlog_format=row; -set global binlog_format=row; - -show global variables like "binlog_format%"; -show session variables like "binlog_format%"; -select @@global.binlog_format, @@session.binlog_format; - -CREATE TABLE t1 (a varchar(100)); - -prepare stmt1 from 'insert into t1 select concat(UUID(),?)'; -set @string="emergency_1_"; -insert into t1 values("work_2_"); -execute stmt1 using @string; -deallocate prepare stmt1; - -prepare stmt1 from 'insert into t1 select ?'; -insert into t1 values(concat(UUID(),"work_3_")); -execute stmt1 using @string; -deallocate prepare stmt1; - -insert into t1 values(concat("for_4_",UUID())); -insert into t1 select "yesterday_5_"; - -# verify that temp tables prevent a switch to SBR -create temporary table tmp(a char(100)); -insert into tmp values("see_6_"); ---error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR -set binlog_format=statement; -insert into t1 select * from tmp; -drop temporary table tmp; - -# Now we go to SBR -set binlog_format=statement; -show global variables like "binlog_format%"; -show session variables like "binlog_format%"; -select @@global.binlog_format, @@session.binlog_format; -set global binlog_format=statement; -show global variables like "binlog_format%"; -show session variables like "binlog_format%"; -select @@global.binlog_format, @@session.binlog_format; - -prepare stmt1 from 'insert into t1 select ?'; -set @string="emergency_7_"; -insert into t1 values("work_8_"); -execute stmt1 using @string; -deallocate prepare stmt1; - -prepare stmt1 from 'insert into t1 select ?'; -insert into t1 values("work_9_"); -execute stmt1 using @string; -deallocate prepare stmt1; - -insert into t1 values("for_10_"); -insert into t1 select "yesterday_11_"; - -# test SET DEFAULT (=statement at this point of test) -set binlog_format=default; -select @@global.binlog_format, @@session.binlog_format; -# due to cluster it's hard to set back to default -#--error ER_NO_DEFAULT -set global binlog_format=default; -select @@global.binlog_format, @@session.binlog_format; - -prepare stmt1 from 'insert into t1 select ?'; -set @string="emergency_12_"; -insert into t1 values("work_13_"); -execute stmt1 using @string; -deallocate prepare stmt1; - -prepare stmt1 from 'insert into t1 select ?'; -insert into t1 values("work_14_"); -execute stmt1 using @string; -deallocate prepare stmt1; - -insert into t1 values("for_15_"); -insert into t1 select "yesterday_16_"; - -# and now the mixed mode - -set binlog_format=mixed; -select @@global.binlog_format, @@session.binlog_format; -set global binlog_format=mixed; -select @@global.binlog_format, @@session.binlog_format; - -prepare stmt1 from 'insert into t1 select concat(UUID(),?)'; -set @string="emergency_17_"; -insert into t1 values("work_18_"); -execute stmt1 using @string; -deallocate prepare stmt1; - -prepare stmt1 from 'insert into t1 select ?'; -insert into t1 values(concat(UUID(),"work_19_")); -execute stmt1 using @string; -deallocate prepare stmt1; - -insert into t1 values(concat("for_20_",UUID())); -insert into t1 select "yesterday_21_"; - -prepare stmt1 from 'insert into t1 select ?'; -insert into t1 values(concat(UUID(),"work_22_")); -execute stmt1 using @string; -deallocate prepare stmt1; - -insert into t1 values(concat("for_23_",UUID())); -insert into t1 select "yesterday_24_"; - -# Test of CREATE TABLE SELECT - -create table t2 select rpad(UUID(),100,' '); -create table t3 select 1 union select UUID(); -create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3); -create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3); -# what if UUID() is first: ---disable_warnings -insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4); ---enable_warnings - -# inside a stored procedure - -delimiter |; -create procedure foo() -begin -insert into t1 values("work_25_"); -insert into t1 values(concat("for_26_",UUID())); -insert into t1 select "yesterday_27_"; -end| -create procedure foo2() -begin -insert into t1 values(concat("emergency_28_",UUID())); -insert into t1 values("work_29_"); -insert into t1 values(concat("for_30_",UUID())); -set session binlog_format=row; # accepted for stored procs -insert into t1 values("more work_31_"); -set session binlog_format=mixed; -end| -create function foo3() returns bigint unsigned -begin - set session binlog_format=row; # rejected for stored funcs - insert into t1 values("alarm"); - return 100; -end| -create procedure foo4(x varchar(100)) -begin -insert into t1 values(concat("work_250_",x)); -insert into t1 select "yesterday_270_"; -end| -delimiter ;| -call foo(); -call foo2(); -call foo4("hello"); -call foo4(UUID()); -call foo4("world"); - -# test that can't SET in a stored function ---error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT -select foo3(); -select * from t1 where a="alarm"; - -# Tests of stored functions/triggers/views for BUG#20930 "Mixed -# binlogging mode does not work with stored functions, triggers, -# views" - -# Function which calls procedure -drop function foo3; -delimiter |; -create function foo3() returns bigint unsigned -begin - insert into t1 values("foo3_32_"); - call foo(); - return 100; -end| -delimiter ;| -insert into t2 select foo3(); - -prepare stmt1 from 'insert into t2 select foo3()'; -execute stmt1; -execute stmt1; -deallocate prepare stmt1; - -# Test if stored function calls stored function which calls procedure -# which requires row-based. - -delimiter |; -create function foo4() returns bigint unsigned -begin - insert into t2 select foo3(); - return 100; -end| -delimiter ;| -select foo4(); - -prepare stmt1 from 'select foo4()'; -execute stmt1; -execute stmt1; -deallocate prepare stmt1; - -# A simple stored function -delimiter |; -create function foo5() returns bigint unsigned -begin - insert into t2 select UUID(); - return 100; -end| -delimiter ;| -select foo5(); - -prepare stmt1 from 'select foo5()'; -execute stmt1; -execute stmt1; -deallocate prepare stmt1; - -# A simple stored function where UUID() is in the argument -delimiter |; -create function foo6(x varchar(100)) returns bigint unsigned -begin - insert into t2 select x; - return 100; -end| -delimiter ;| -select foo6("foo6_1_"); -select foo6(concat("foo6_2_",UUID())); - -prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))'; -execute stmt1; -execute stmt1; -deallocate prepare stmt1; - - -# Test of views using UUID() - -create view v1 as select uuid(); -create table t11 (data varchar(255)); -insert into t11 select * from v1; -# Test of querying INFORMATION_SCHEMA which parses the view's body, -# to verify that it binlogs statement-based (is not polluted by -# the parsing of the view's body). -insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11'); -prepare stmt1 from "insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')"; -execute stmt1; -execute stmt1; -deallocate prepare stmt1; - -# Test of triggers with UUID() -delimiter |; -create trigger t11_bi before insert on t11 for each row -begin - set NEW.data = concat(NEW.data,UUID()); -end| -delimiter ;| -insert into t11 values("try_560_"); - -# DELAYED option not supported by table created -# using innodb. -# Test that INSERT DELAYED works in mixed mode (BUG#20649) -#insert delayed into t2 values("delay_1_"); -#insert delayed into t2 values(concat("delay_2_",UUID())); -#insert delayed into t2 values("delay_6_"); - -# Test for BUG#20633 (INSERT DELAYED RAND()/user_variable does not -# replicate fine in statement-based ; we test that in mixed mode it -# works). -#insert delayed into t2 values(rand()); -#set @a=2.345; -#insert delayed into t2 values(@a); - -sleep 4; # time for the delayed inserts to reach disk - -# If you want to do manual testing of the mixed mode regarding UDFs (not -# testable automatically as quite platform- and compiler-dependent), -# you just need to set the variable below to 1, and to -# "make udf_example.so" in sql/, and to copy sql/udf_example.so to -# MYSQL_TEST_DIR/lib/mysql. -let $you_want_to_test_UDF=0; -if ($you_want_to_test_UDF) -{ - CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so'; - prepare stmt1 from 'insert into t1 select metaphon(?)'; - set @string="emergency_133_"; - insert into t1 values("work_134_"); - execute stmt1 using @string; - deallocate prepare stmt1; - prepare stmt1 from 'insert into t1 select ?'; - insert into t1 values(metaphon("work_135_")); - execute stmt1 using @string; - deallocate prepare stmt1; - insert into t1 values(metaphon("for_136_")); - insert into t1 select "yesterday_137_"; - create table t6 select metaphon("for_138_"); - create table t7 select 1 union select metaphon("for_139_"); - create table t8 select * from t1 where 3 in (select 1 union select 2 union select metaphon("for_140_") union select 3); - create table t9 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3); -} - -create table t20 select * from t1; # save for comparing later -create table t21 select * from t2; -create table t22 select * from t3; -drop table t1,t2,t3; - -# This tests the fix to -# BUG#19630 stored function inserting into two auto_increment breaks statement-based binlog -# We verify that under the mixed binlog mode, a stored function -# modifying at least two tables having an auto_increment column, -# is binlogged row-based. Indeed in statement-based binlogging, -# only the auto_increment value generated for the first table -# is recorded in the binlog, the value generated for the 2nd table -# lacking. - -create table t1 (a int primary key auto_increment, b varchar(100)); -create table t2 (a int primary key auto_increment, b varchar(100)); -create table t3 (b varchar(100)); -delimiter |; -create function f (x varchar(100)) returns int deterministic -begin - insert into t1 values(null,x); - insert into t2 values(null,x); - return 1; -end| -delimiter ;| -select f("try_41_"); -# Two operations which compensate each other except that their net -# effect is that they advance the auto_increment counter of t2 on slave: -sync_slave_with_master; -use mysqltest1; -insert into t2 values(2,null),(3,null),(4,null); -delete from t2 where a>=2; - -connection master; -# this is the call which didn't replicate well -select f("try_42_"); -sync_slave_with_master; - -# now use prepared statement and test again, just to see that the RBB -# mode isn't set at PREPARE but at EXECUTE. - -insert into t2 values(3,null),(4,null); -delete from t2 where a>=3; - -connection master; -prepare stmt1 from 'select f(?)'; -set @string="try_43_"; -insert into t1 values(null,"try_44_"); # should be SBB -execute stmt1 using @string; # should be RBB -deallocate prepare stmt1; -sync_slave_with_master; - -# verify that if only one table has auto_inc, it does not trigger RBB -# (we'll check in binlog further below) - -connection master; -create table t12 select * from t1; # save for comparing later -drop table t1; -create table t1 (a int, b varchar(100), key(a)); -select f("try_45_"); - -# restore table's key -create table t13 select * from t1; -drop table t1; -create table t1 (a int primary key auto_increment, b varchar(100)); - -# now test if it's two functions, each of them inserts in one table - -drop function f; -# we need a unique key to have sorting of rows by mysqldump -create table t14 (unique (a)) select * from t2; -truncate table t2; -delimiter |; -create function f1 (x varchar(100)) returns int deterministic -begin - insert into t1 values(null,x); - return 1; -end| -create function f2 (x varchar(100)) returns int deterministic -begin - insert into t2 values(null,x); - return 1; -end| -delimiter ;| -select f1("try_46_"),f2("try_47_"); - -sync_slave_with_master; -insert into t2 values(2,null),(3,null),(4,null); -delete from t2 where a>=2; - -connection master; -# Test with SELECT and INSERT -select f1("try_48_"),f2("try_49_"); -insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_"))); -sync_slave_with_master; - -# verify that if f2 does only read on an auto_inc table, this does not -# switch to RBB -connection master; -drop function f2; -delimiter |; -create function f2 (x varchar(100)) returns int deterministic -begin - declare y int; - insert into t1 values(null,x); - set y = (select count(*) from t2); - return y; -end| -delimiter ;| -select f1("try_53_"),f2("try_54_"); -sync_slave_with_master; - -# And now, a normal statement with a trigger (no stored functions) - -connection master; -drop function f2; -delimiter |; -create trigger t1_bi before insert on t1 for each row -begin - insert into t2 values(null,"try_55_"); -end| -delimiter ;| -insert into t1 values(null,"try_56_"); -# and now remove one auto_increment and verify SBB -alter table t1 modify a int, drop primary key; -insert into t1 values(null,"try_57_"); -sync_slave_with_master; - -# Test for BUG#20499 "mixed mode with temporary table breaks binlog" -# Slave used to have only 2 rows instead of 3. -connection master; -CREATE TEMPORARY TABLE t15 SELECT UUID(); -create table t16 like t15; -INSERT INTO t16 SELECT * FROM t15; -# we'll verify that this one is done RBB -insert into t16 values("try_65_"); -drop table t15; -# we'll verify that this one is done SBB -insert into t16 values("try_66_"); -sync_slave_with_master; - -# and now compare: - -connection master; - -# first check that data on master is sensible -select count(*) from t1; -select count(*) from t2; -select count(*) from t3; -select count(*) from t4; -select count(*) from t5; -select count(*) from t11; -select count(*) from t20; -select count(*) from t21; -select count(*) from t22; -select count(*) from t12; -select count(*) from t13; -select count(*) from t14; -select count(*) from t16; -if ($you_want_to_test_UDF) -{ - select count(*) from t6; - select count(*) from t7; - select count(*) from t8; - select count(*) from t9; -} - -sync_slave_with_master; - -# -# Bug#20863 If binlog format is changed between update and unlock of -# tables, wrong binlog -# - -connection master; -DROP TABLE IF EXISTS t11; -SET SESSION BINLOG_FORMAT=STATEMENT; -CREATE TABLE t11 (song VARCHAR(255)); -LOCK TABLES t11 WRITE; -SET SESSION BINLOG_FORMAT=ROW; -INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict'); -SET SESSION BINLOG_FORMAT=STATEMENT; -INSERT INTO t11 VALUES('Careful With That Axe, Eugene'); -UNLOCK TABLES; - ---query_vertical SELECT * FROM t11 -sync_slave_with_master; -USE mysqltest1; ---query_vertical SELECT * FROM t11 - -connection master; -DROP TABLE IF EXISTS t12; -SET SESSION BINLOG_FORMAT=MIXED; -CREATE TABLE t12 (data LONG); -LOCK TABLES t12 WRITE; -INSERT INTO t12 VALUES(UUID()); -UNLOCK TABLES; - ---disable_result_log ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events; ---enable_result_log -sync_slave_with_master; - -# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql - -# Let's compare. Note: If they match test will pass, if they do not match -# the test will show that the diff statement failed and not reject file -# will be created. You will need to go to the mysql-test dir and diff -# the files your self to see what is not matching - -diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql; - -connection master; ---disable_result_log ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events; ---enable_result_log - -# Now test that mysqlbinlog works fine on a binlog generated by the -# mixed mode - -# BUG#11312 "DELIMITER is not written to the binary log that causes -# syntax error" makes that mysqlbinlog will fail if we pass it the -# text of queries; this forces us to use --base64-output here. - -# BUG#20929 "BINLOG command causes invalid free plus assertion -# failure" makes mysqld segfault when receiving --base64-output - -# So I can't enable this piece of test -# SIGH - -if ($enable_when_11312_or_20929_fixed) -{ ---exec $MYSQL_BINLOG --base64-output $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql -drop database mysqltest1; ---exec $MYSQL < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql -# the old mysqldump output on slave is the same as what it was on -# master before restoring on master. -diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql; -} - -drop database mysqltest1; -sync_slave_with_master; - -connection default; -set global binlog_format= @saved_binlog_format; +--source suite/rpl/include/rpl_switch_stm_row_mixed.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_temp_table.test b/mysql-test/suite/engines/funcs/t/rpl_temp_table.test index c13470f20b6..43b5ce49129 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_temp_table.test +++ b/mysql-test/suite/engines/funcs/t/rpl_temp_table.test @@ -1,69 +1,2 @@ -# drop table t1 t2 t3 are included int master-slave.inc -# meaningful only in statement-based: +--source suite/rpl/t/rpl_temp_table.test --- source include/have_binlog_format_mixed_or_statement.inc --- source include/master-slave.inc - ---disable_query_log -CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); ---enable_query_log - - -create table t2 (n int, PRIMARY KEY(n)); -create temporary table t1 (n int); -create temporary table t3 (n int not null); - -insert into t1 values(1),(2),(3),(100),(25),(26),(200),(300); ---disable_warnings -insert into t2 select * from t1; ---enable_warnings -alter table t3 add primary key(n); - -flush logs; -insert into t3 values (1010); ---disable_warnings -insert into t2 select * from t3; ---enable_warnings - -drop table if exists t3; -insert into t2 values (1012); - -connection master1; -create temporary table t1 (n int); -insert into t1 values (4),(5); ---disable_warnings -insert into t2 select * from t1; ---enable_warnings - -save_master_pos; -disconnect master; - -connection slave; -#add 1 to the saved position, so we will catch drop table on disconnect -#for sure -sync_with_master 1; - -connection master1; -insert into t2 values(61); - -save_master_pos; -disconnect master1; - -connection slave; -#same trick - make sure we catch drop of temporary table on disconnect -sync_with_master 1; - -select * from t2; -select count(*) from t2; -select sum(n) from t2; -show status like 'Slave_open_temp_tables'; - -# -# Clean up -# -connect (master2,localhost,root,,); -connection master2; -drop table if exists t1,t2; -save_master_pos; -connection slave; -sync_with_master; diff --git a/mysql-test/suite/engines/funcs/t/rpl_temporary.test b/mysql-test/suite/engines/funcs/t/rpl_temporary.test index aa90a5153bf..460ea55a675 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_temporary.test +++ b/mysql-test/suite/engines/funcs/t/rpl_temporary.test @@ -1,235 +1,2 @@ +--source suite/rpl/t/rpl_temporary.test --- source include/master-slave.inc - -# Clean up old slave's binlogs. -# The slave is started with --log-slave-updates -# and this test does SHOW BINLOG EVENTS on the slave's -# binlog. But previous tests can influence the current test's -# binlog (e.g. a temporary table in the previous test has not -# been explicitly deleted, or it has but the slave hasn't had -# enough time to catch it before STOP SLAVE, -# and at the beginning of the current -# test the slave immediately writes DROP TEMPORARY TABLE this_old_table). -# We wait for the slave to have written all he wants to the binlog -# (otherwise RESET MASTER may come too early). -save_master_pos; -connection slave; -sync_with_master; -reset master; -connection master; - ---disable_query_log -CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); ---enable_query_log - -connect (con1,localhost,root,,); - -#added on 2007/5/18 -connection con1; -CREATE USER ''@localhost; - -connect (con2,localhost,root,,); -# We want to connect as an unprivileged user. But if we use user="" then this -# will pick the Unix login, which will cause problems if you're running the test -# as root. -connect (con3,localhost,zedjzlcsjhd,,); - -# We are going to use SET PSEUDO_THREAD_ID in this test; -# check that it requires the SUPER privilege. - -connection con3; -SET @save_select_limit=@@session.sql_select_limit; ---error 1227 -SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100; -SELECT @@session.sql_select_limit = @save_select_limit; #shouldn't have changed -# While we are here we also test that SQL_LOG_BIN can't be set ---error 1227 -SET @@session.sql_select_limit=10, @@session.sql_log_bin=0; -SELECT @@session.sql_select_limit = @save_select_limit; #shouldn't have changed -# Now as root, to be sure it works -connection con2; -SET @@session.pseudo_thread_id=100; -SET @@session.pseudo_thread_id=connection_id(); -SET @@session.sql_log_bin=0; -SET @@session.sql_log_bin=1; - -connection con3; -let $VERSION=`select version()`; - ---disable_warnings -drop table if exists t1,t2; ---enable_warnings - -create table t1(f int); -create table t2(f int); -insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); - -connection con1; -create temporary table t3(f int); ---disable_warnings -insert into t3 select * from t1 where f<6; ---enable_warnings -sleep 1; - -connection con2; -create temporary table t3(f int); -sleep 1; - -connection con1; ---disable_warnings -insert into t2 select count(*) from t3; ---enable_warnings -sleep 1; - -connection con2; ---disable_warnings -insert into t3 select * from t1 where f>=4; ---enable_warnings -sleep 1; - -connection con1; -drop temporary table t3; -sleep 1; - -connection con2; ---disable_warnings -insert into t2 select count(*) from t3; ---enable_warnings -drop temporary table t3; - -select * from t2 ORDER BY f; - -# Commented out 8/30/2005 to make compatable with both sbr and rbr -#--replace_result $VERSION VERSION -#--replace_column 2 # 5 # -#show binlog events; - -drop table t1, t2; - -use test; -SET TIMESTAMP=1040323920; -create table t1(f int); -SET TIMESTAMP=1040323931; -create table t2(f int); -SET TIMESTAMP=1040323938; -insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); - -SET TIMESTAMP=1040323945; -SET @@session.pseudo_thread_id=1; -create temporary table t3(f int); -SET TIMESTAMP=1040323952; -SET @@session.pseudo_thread_id=1; ---disable_warnings -insert into t3 select * from t1 where f<6; ---enable_warnings -SET TIMESTAMP=1040324145; -SET @@session.pseudo_thread_id=2; -create temporary table t3(f int); -SET TIMESTAMP=1040324186; -SET @@session.pseudo_thread_id=1; ---disable_warnings -insert into t2 select count(*) from t3; ---enable_warnings -SET TIMESTAMP=1040324200; -SET @@session.pseudo_thread_id=2; ---disable_warnings -insert into t3 select * from t1 where f>=4; ---enable_warnings -SET TIMESTAMP=1040324211; -SET @@session.pseudo_thread_id=1; -drop temporary table t3; -SET TIMESTAMP=1040324219; -SET @@session.pseudo_thread_id=2; ---disable_warnings -insert into t2 select count(*) from t3; ---enable_warnings -SET TIMESTAMP=1040324224; -SET @@session.pseudo_thread_id=2; -drop temporary table t3; - -select * from t2 ORDER BY f; -drop table t1,t2; - -# Create last a temporary table that is not dropped at end to ensure that we -# don't get any memory leaks for this - -create temporary table t3 (f int); -#sync_with_master; - -# The server will now close done - -# -# Bug#17284 erroneous temp table cleanup on slave -# - -connection master; -create temporary table t4 (f int); -create table t5 (f int); -#sync_with_master; -# find dumper's $id -select id from information_schema.processlist where command='Binlog Dump' into @id; -kill @id; # to stimulate reconnection by slave w/o timeout ---disable_warnings -insert into t5 select * from t4; ---enable_warnings -save_master_pos; - -connection slave; -sync_with_master; -select * from t5 /* must be 1 after reconnection */; - -connection master; -drop temporary table t4; -drop table t5; - -# -# BUG#17263 incorrect generation DROP temp tables -# Temporary tables of connection are dropped in batches -# where a batch correspond to pseudo_thread_id -# value was set up at the moment of temp table creation -# -connection con1; -set @@session.pseudo_thread_id=100; -create temporary table t101 (id int); -create temporary table t102 (id int); -set @@session.pseudo_thread_id=200; -create temporary table t201 (id int); -create temporary table `t``201` (id int); -# emulate internal temp table not to come to binlog -create temporary table `#sql_not_user_table202` (id int); -set @@session.pseudo_thread_id=300; -create temporary table t301 (id int); -create temporary table t302 (id int); -create temporary table `#sql_not_user_table303` (id int); - - -#Added on 2007/5/18 -DROP USER ''@localhost; - -disconnect con1; - -#now do something to show that slave is ok after DROP temp tables -connection master; -create table t1(f int); -insert into t1 values (1); - -sync_slave_with_master; -#connection slave; -select * from t1 /* must be 1 */; - -connection master; -drop table t1; - -# -#14157: utf8 encoding in binlog without set character_set_client -# -exec $MYSQL --character-sets-dir=../sql/share/charsets/ --default-character-set=latin1 test -e "create table t1 (a int); set names latin1; create temporary table äöüÄÖÜ (a int); insert into äöüÄÖÜ values (1); insert into t1 select * from äöüÄÖÜ"; - -sync_slave_with_master; -#connection slave; -select * from t1; - -connection master; -drop table t1; - -# End of 5.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_trigger.test b/mysql-test/suite/engines/funcs/t/rpl_trigger.test index 77cc7a3b2c0..4f61e738200 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_trigger.test +++ b/mysql-test/suite/engines/funcs/t/rpl_trigger.test @@ -5,16 +5,7 @@ --source include/have_binlog_format_mixed_or_statement.inc --source include/master-slave.inc -disable_query_log; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -enable_query_log; - ---disable_warnings -DROP TABLE IF EXISTS t1; -DROP TABLE IF EXISTS t2; -DROP TABLE IF EXISTS t3; - ---enable_warnings # # #12482: Triggers has side effects with auto_increment values @@ -45,19 +36,16 @@ SET @@RAND_SEED1=658490765, @@RAND_SEED2=635893186; --disable_warnings insert into t1 values(1,1,rand()),(NULL,2,rand()); insert into t2 (b) values(last_insert_id()); -insert into t2 values(3,0),(NULL,0); -insert into t2 values(NULL,0),(500,0); +insert into t2 values(3,0); +insert into t2 values(NULL,0); +insert into t2 values(NULL,0); +insert into t2 values(500,0); --enable_warnings select a,b, truncate(rand_value,4) from t1; select * from t2; select a,name, old_a, old_b, truncate(rand_value,4) from t3; -save_master_pos; -connection slave; -sync_with_master; ---disable_query_log -select "--- On slave --" as ""; ---enable_query_log +--sync_slave_with_master select a,b, truncate(rand_value,4) from t1; select * from t2; select a,name, old_a, old_b, truncate(rand_value,4) from t3; @@ -109,17 +97,14 @@ let $time=`select a from t1`; # - dump definers on the slave; SELECT routine_name, definer -FROM information_schema.routines; +FROM information_schema.routines +WHERE routine_name = 'bug12480'; SELECT trigger_name, definer -FROM information_schema.triggers; +FROM information_schema.triggers +WHERE trigger_name = 't1_first'; -save_master_pos; -connection slave; -sync_with_master; ---disable_query_log -select "--- On slave --" as ""; ---enable_query_log +--sync_slave_with_master # XXX: Definers of stored procedures and functions are not replicated. WL#2897 # (Complete definer support in the stored routines) addresses this issue. So, @@ -127,10 +112,12 @@ select "--- On slave --" as ""; # item. SELECT routine_name, definer -FROM information_schema.routines; +FROM information_schema.routines +WHERE routine_name = 'bug12480'; SELECT trigger_name, definer -FROM information_schema.triggers; +FROM information_schema.triggers +WHERE trigger_name = 't1_first'; select a=b && a=c from t1; --disable_query_log @@ -170,9 +157,7 @@ create database other; use other; insert into test.t1 values (1); -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master connection master; use test; @@ -219,7 +204,7 @@ while ($rnd) dec $i; } - sync_slave_with_master; + --sync_slave_with_master #connection slave; eval select * from t1$rnd; delimiter |; @@ -258,7 +243,7 @@ while ($rnd) dec $i; } - sync_slave_with_master; + --sync_slave_with_master #connection slave; eval SELECT * from t1$rnd /* must be f1 $max_rows ... 1 */; eval SELECT * from t3$rnd /* must be f3 $max_rows * 100 ... 100 */; @@ -270,6 +255,8 @@ while ($rnd) connection master; eval drop table t1$rnd; + --sync_slave_with_master + connection master; dec $rnd; } @@ -300,26 +287,42 @@ while ($rnd) # Stop the slave. connection slave; -STOP SLAVE; +--source include/stop_slave.inc # Replace master's binlog. connection master; +let $MYSQLD_DATADIR= `select @@datadir`; FLUSH LOGS; -let $DATADIR = `select @@datadir`; -remove_file $DATADIR/master-bin.000001; -copy_file $MYSQL_TEST_DIR/std_data/bug16266.000001 $DATADIR/master-bin.000001; + +# Stop master server +--let $rpl_server_number= 1 +--source include/rpl_stop_server.inc + +# Replace binlog +remove_file $MYSQLD_DATADIR/master-bin.000001; +copy_file $MYSQL_TEST_DIR/std_data/bug16266.000001 $MYSQLD_DATADIR/master-bin.000001; + +--let $rpl_server_number= 1 +--source include/rpl_start_server.inc + +let $binlog_version= query_get_value(SHOW BINLOG EVENTS, Info, 1); + + +# Make the slave to replay the new binlog. +--echo --> Master binlog: $binlog_version # Make the slave to replay the new binlog. connection slave; RESET SLAVE; -START SLAVE; +--source include/start_slave.inc SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0; # Check that the replication succeeded. SHOW TABLES LIKE 't_'; +--replace_column 6 # SHOW TRIGGERS; SELECT * FROM t1; SELECT * FROM t2; @@ -338,7 +341,7 @@ DROP TRIGGER trg1; DROP TABLE t1; DROP TABLE t2; -STOP SLAVE; +--source include/stop_slave.inc RESET SLAVE; # The master should be clean. @@ -352,7 +355,7 @@ RESET MASTER; # Restart slave. connection slave; -START SLAVE; +--source include/start_slave.inc # @@ -367,7 +370,6 @@ START SLAVE; --echo --echo ---> Preparing environment... ---echo ---> connection: master --connection master --disable_warnings @@ -378,12 +380,9 @@ DROP TABLE IF EXISTS t2; --echo --echo ---> Synchronizing slave with master... ---save_master_pos ---connection slave ---sync_with_master +--sync_slave_with_master --echo ---echo ---> connection: master --connection master # Test. @@ -412,11 +411,7 @@ SELECT * FROM t2; --echo --echo ---> Synchronizing slave with master... ---save_master_pos ---connection slave ---sync_with_master - ---echo ---> connection: master +--sync_slave_with_master --echo --echo ---> Checking on slave... @@ -427,7 +422,6 @@ SELECT * FROM t2; # Cleanup. --echo ---echo ---> connection: master --connection master --echo @@ -436,9 +430,7 @@ SELECT * FROM t2; DROP TABLE t1; DROP TABLE t2; ---save_master_pos ---connection slave ---sync_with_master +--sync_slave_with_master --connection master # @@ -469,9 +461,7 @@ insert into t1 values (3, "c"); select * from t1; -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master select * from t1; @@ -481,6 +471,5 @@ drop table if exists t1,t11; # # End of tests # -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master +--source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_trunc_temp.test b/mysql-test/suite/engines/funcs/t/rpl_trunc_temp.test index 28bcb0c06c3..fa072022824 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_trunc_temp.test +++ b/mysql-test/suite/engines/funcs/t/rpl_trunc_temp.test @@ -1,35 +1,2 @@ -# Requires statement logging --- source include/have_binlog_format_mixed_or_statement.inc +--source suite/rpl/t/rpl_trunc_temp.test -source include/master-slave.inc; - -# -# Bug#17137 Running "truncate table" on temporary table -# leaves the table open on a slave -# - -create temporary table t1 (n int); -insert into t1 values(1); -sync_slave_with_master; -show status like 'Slave_open_temp_tables'; - -# Perform a delete from temp table -connection master; -delete from t1; -sync_slave_with_master; -show status like 'Slave_open_temp_tables'; - -# Perform truncate on temp table -connection master; -truncate t1; -sync_slave_with_master; -show status like 'Slave_open_temp_tables'; - -# Disconnect the master, temp table on slave should dissapear -disconnect master; ---real_sleep 3 # time for DROP to be read by slave -connection slave; -show status like 'Slave_open_temp_tables'; - - -# End of 4.1 tests diff --git a/mysql-test/suite/engines/funcs/t/rpl_user_variables.test b/mysql-test/suite/engines/funcs/t/rpl_user_variables.test index 530cda3d87a..1b78f2b5fb5 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_user_variables.test +++ b/mysql-test/suite/engines/funcs/t/rpl_user_variables.test @@ -1,57 +1,2 @@ -################################### -# -# Test of replicating user variables -# -################################### +--source suite/rpl/t/rpl_user_variables.test --- source include/master-slave.inc -# Disable PS as the log positions differs ---disable_ps_protocol - - -# Clean up old slave's binlogs. -# The slave is started with --log-slave-updates -# and this test does SHOW BINLOG EVENTS on the slave's -# binlog. But previous tests can influence the current test's -# binlog (e.g. a temporary table in the previous test has not -# been explicitly deleted, or it has but the slave hasn't had -# enough time to catch it before STOP SLAVE, -# and at the beginning of the current -# test the slave immediately writes DROP TEMPORARY TABLE this_old_table). -# We wait for the slave to have written all he wants to the binlog -# (otherwise RESET MASTER may come too early). -save_master_pos; -connection slave; -sync_with_master; -reset master; -connection master; - -create table t1(n char(30)); -set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1; -set @s1:='This is a test', @r1:=12.5, @r2:=-12.5; -set @n1:=null; -set @s2:='', @s3:='abc\'def', @s4:= 'abc\\def', @s5:= 'abc''def'; -insert into t1 values (@i1), (@i2), (@i3), (@i4); -insert into t1 values (@r1), (@r2); -insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5); -insert into t1 values (@n1); -insert into t1 values (@n2); # not explicitly set before -insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1); -insert into t1 values (@a+(@b:=@a+1)); -set @q:='abc'; -insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')); -set @a:=5; -insert into t1 values (@a),(@a); -# To flush the pending event, we add the following statement. RBR can -# concatenate the result of several statements, which SBR cannot. -select * from t1 where n = '<nonexistant>'; -connection master1; # see if variable is reset in binlog when thread changes -insert into t1 values (@a),(@a),(@a*5); -SELECT * FROM t1 ORDER BY n; -sync_slave_with_master; -SELECT * FROM t1 ORDER BY n; -connection master; -insert into t1 select * FROM (select @var1 union select @var2) AS t2; -drop table t1; -sync_slave_with_master; -stop slave; diff --git a/mysql-test/suite/engines/funcs/t/rpl_variables.test b/mysql-test/suite/engines/funcs/t/rpl_variables.test index 031131a3f2b..ca612a5593b 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_variables.test +++ b/mysql-test/suite/engines/funcs/t/rpl_variables.test @@ -1,4 +1,4 @@ -source include/master-slave.inc; +--source include/master-slave.inc # Init for restoration of variable values set @my_slave_net_timeout =@@global.slave_net_timeout; @@ -19,3 +19,4 @@ show variables like 'slave_skip_errors'; # Cleanup set global slave_net_timeout=@my_slave_net_timeout; set global sql_slave_skip_counter=@my_sql_slave_skip_counter; +--source include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_view-slave.opt b/mysql-test/suite/engines/funcs/t/rpl_view-slave.opt deleted file mode 100644 index 79b3bf6174b..00000000000 --- a/mysql-test/suite/engines/funcs/t/rpl_view-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---replicate-ignore-table=test.foo diff --git a/mysql-test/suite/engines/funcs/t/rpl_view.test b/mysql-test/suite/engines/funcs/t/rpl_view.test index 3eff8f7550a..b81b22ece4e 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_view.test +++ b/mysql-test/suite/engines/funcs/t/rpl_view.test @@ -1,155 +1,2 @@ -# NYI - row-based cannot use CREATE ... SELECT +--source suite/rpl/t/rpl_view.test -source include/master-slave.inc; ---disable_warnings -drop table if exists t1,v1; -drop view if exists t1,v1; -sync_slave_with_master; -reset master; ---enable_warnings - -# -# Check that creation drop of view is replicated, also check replication of -# updating of view -# -connection master; -create table t1 (a int); -insert into t1 values (1); -create view v1 as select a from t1; -insert into v1 values (2); -select * from v1 order by a; -sync_slave_with_master; -# view already have to be on slave -select * from v1 order by a; -connection master; -update v1 set a=3 where a=1; -select * from v1 order by a; -sync_slave_with_master; -select * from v1 order by a; -connection master; -delete from v1 where a=2; -select * from v1 order by a; -sync_slave_with_master; -select * from v1 order by a; -connection master; -# 'alter view' internally maped to creation, but still check that it works -alter view v1 as select a as b from t1; -sync_slave_with_master; -select * from v1 order by 1; -connection master; -drop view v1; -sync_slave_with_master; -#error, because view have to be removed from slave --- error 1146 -select * from v1 order by a; -connection master; -drop table t1; -sync_slave_with_master; -# Change Author: JBM -# Change Date: 2005-12-22 -# Change: Commented out binlog events to work with SBR and RBR -#--replace_column 2 # 5 # -# show binlog events limit 1,100; - -# -# BUG#20438: CREATE statements for views, stored routines and triggers can be -# not replicable. -# - ---echo ---echo ---> Test for BUG#20438 - -# Prepare environment. - ---echo ---echo ---> Preparing environment... ---echo ---> connection: master ---connection master - ---disable_warnings -DROP TABLE IF EXISTS t1; -DROP VIEW IF EXISTS v1; ---enable_warnings - ---echo ---echo ---> Synchronizing slave with master... - ---save_master_pos ---connection slave ---sync_with_master - ---echo ---echo ---> connection: master ---connection master - -# Test. - ---echo ---echo ---> Creating objects... - -CREATE TABLE t1(c INT); - -/*!50003 CREATE VIEW v1 AS SELECT * FROM t1 */; - ---echo ---echo ---> Inserting value... - -INSERT INTO t1 VALUES(1); - ---echo ---echo ---> Checking on master... - -SELECT * FROM t1; - ---echo ---echo ---> Synchronizing slave with master... - ---save_master_pos ---connection slave ---sync_with_master - ---echo ---> connection: master - ---echo ---echo ---> Checking on slave... - -SELECT * FROM t1; - -# Cleanup. - ---echo ---echo ---> connection: master ---connection master - ---echo ---echo ---> Cleaning up... - -DROP VIEW v1; -DROP TABLE t1; - ---save_master_pos ---connection slave ---sync_with_master ---connection master - -# -# BUG#19419: "VIEW: View that the column name is different -# by master and slave is made". -# -connection master; -create table t1(a int, b int); -insert into t1 values (1, 1), (1, 2), (1, 3); -create view v1(a, b) as select a, sum(b) from t1 group by a; - -sync_slave_with_master; -explain v1; -show create table v1; -select * from v1; - -connection master; -drop table t1; -drop view v1; - -sync_slave_with_master; - ---echo End of 5.0 tests diff --git a/mysql-test/suite/engines/iuds/r/insert_decimal.result b/mysql-test/suite/engines/iuds/r/insert_decimal.result index f167712d048..2f174c5e70b 100644 --- a/mysql-test/suite/engines/iuds/r/insert_decimal.result +++ b/mysql-test/suite/engines/iuds/r/insert_decimal.result @@ -110,15 +110,12 @@ Warnings: Warning 1264 Out of range value for column 'c1' at row 1 Warning 1264 Out of range value for column 'c2' at row 1 Warning 1264 Out of range value for column 'c3' at row 1 -Warning 1366 Incorrect decimal value: '1e+18446744073709551616' for column `test`.`t2`.`c1` at row 2 -Warning 1366 Incorrect decimal value: '1e+18446744073709551616' for column `test`.`t2`.`c2` at row 2 -Warning 1366 Incorrect decimal value: '1e+18446744073709551616' for column `test`.`t2`.`c3` at row 2 +Warning 1264 Out of range value for column 'c1' at row 2 +Warning 1264 Out of range value for column 'c2' at row 2 +Warning 1264 Out of range value for column 'c3' at row 2 Note 1265 Data truncated for column 'c1' at row 3 Note 1265 Data truncated for column 'c2' at row 3 Note 1265 Data truncated for column 'c3' at row 3 -Warning 1366 Incorrect decimal value: '1e-9223372036854775809' for column `test`.`t2`.`c1` at row 4 -Warning 1366 Incorrect decimal value: '1e-9223372036854775809' for column `test`.`t2`.`c2` at row 4 -Warning 1366 Incorrect decimal value: '1e-9223372036854775809' for column `test`.`t2`.`c3` at row 4 SELECT * FROM t1; c1 c2 c3 c4 0.00000 -0.10000 0 13 @@ -142,7 +139,6 @@ c1 c2 c3 c4 0 0 0 15 0 0 0 26 0 0 0 29 -0 0 0 31 0 0 0 32 0 0 0 33 0 0 0 7 @@ -160,6 +156,7 @@ c1 c2 c3 c4 9999999999 9999999999 9999999999 25 9999999999 9999999999 9999999999 28 9999999999 9999999999 9999999999 30 +9999999999 9999999999 9999999999 31 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) as max_value, sum(c1) as sum, avg(c1) as avg FROM t1; total_rows min_value max_value sum avg 7 0.00000 99999.99999 212446.04999 30349.435712857 @@ -171,13 +168,13 @@ total_rows min_value max_value sum avg 7 0 111111111 111211212 18535202.0000 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) as max_value, sum(c1) as sum, avg(c1) as avg FROM t2; total_rows min_value max_value sum avg -30 -9999999999 9999999999 21322222222 710740740.7333 +30 -9999999999 9999999999 31322222221 1044074074.0333 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) as max_value, sum(c2) as sum, avg(c2) as avg FROM t2; total_rows min_value max_value sum avg -30 0 9999999999 33444444445 1114814814.8333 +30 0 9999999999 43444444444 1448148148.1333 SELECT count(*) as total_rows, min(c3) as min_value, max(c3) as max_value, sum(c3) as sum, avg(c3) as avg FROM t2; total_rows min_value max_value sum avg -30 -9999999999 9999999999 43322222220 1444074074.0000 +30 -9999999999 9999999999 53322222219 1777407407.3000 SELECT * FROM t1; c1 c2 c3 c4 0.00000 -0.10000 0 13 diff --git a/mysql-test/suite/federated/assisted_discovery.result b/mysql-test/suite/federated/assisted_discovery.result index 4818ff7bb02..e8d6663e9bc 100644 --- a/mysql-test/suite/federated/assisted_discovery.result +++ b/mysql-test/suite/federated/assisted_discovery.result @@ -13,8 +13,7 @@ CREATE TABLE t1 ( `name` varchar(32) default 'name') DEFAULT CHARSET=latin1; connection master; -CREATE TABLE t1 ENGINE=FEDERATED -CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1'; +CREATE TABLE t1 ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -38,6 +37,9 @@ id group a\\b a\\ name 1 1 2 NULL foo 2 1 2 NULL fee DROP TABLE t1; +# +# MDEV-11311 Create federated table does not work as expected +# create table t1 ( a bigint(20) not null auto_increment, b bigint(20) not null, @@ -57,8 +59,7 @@ t1 CREATE TABLE `t1` ( KEY `b` (`b`,`c`,`d`(255)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 connection master; -create table t1 engine=federated -connection='mysql://root@127.0.0.1:SLAVE_PORT/test/t1'; +create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -72,6 +73,12 @@ t1 CREATE TABLE `t1` ( drop table t1; connection slave; drop table t1; +# +# MDEV-17227 Server crash in TABLE_SHARE::init_from_sql_statement_string upon table discovery with non-existent database +# +connection master; +create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; +ERROR HY000: Unable to connect to foreign data source: Table 'test.t1' doesn't exist connection master; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; diff --git a/mysql-test/suite/federated/assisted_discovery.test b/mysql-test/suite/federated/assisted_discovery.test index fa83a2a8e19..bd32878f811 100644 --- a/mysql-test/suite/federated/assisted_discovery.test +++ b/mysql-test/suite/federated/assisted_discovery.test @@ -13,9 +13,7 @@ CREATE TABLE t1 ( connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE t1 ENGINE=FEDERATED - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; +evalp CREATE TABLE t1 ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; --replace_result $SLAVE_MYPORT SLAVE_PORT SHOW CREATE TABLE t1; @@ -30,9 +28,9 @@ connection slave; SELECT * FROM t1; DROP TABLE t1; -# -# -# +--echo # +--echo # MDEV-11311 Create federated table does not work as expected +--echo # create table t1 ( a bigint(20) not null auto_increment, b bigint(20) not null, @@ -44,9 +42,7 @@ create table t1 ( show create table t1; connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table t1 engine=federated - connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; +evalp create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; --replace_result $SLAVE_MYPORT SLAVE_PORT show create table t1; drop table t1; @@ -54,5 +50,12 @@ drop table t1; connection slave; drop table t1; +--echo # +--echo # MDEV-17227 Server crash in TABLE_SHARE::init_from_sql_statement_string upon table discovery with non-existent database +--echo # +connection master; +--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE +evalp create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; + source include/federated_cleanup.inc; diff --git a/mysql-test/suite/federated/federatedx.result b/mysql-test/suite/federated/federatedx.result index 8345f56dba9..2c21e31afe9 100644 --- a/mysql-test/suite/federated/federatedx.result +++ b/mysql-test/suite/federated/federatedx.result @@ -2284,6 +2284,32 @@ connection master; CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:SLAVE_PORT/federated/t1'; ERROR HY000: Can't create federated table. Foreign data src error: database: 'federated' username: '' hostname: '127.0.0.1' # +# MDEV-17573 Assertion in federatedx on multi-update +# +create table t1 ( +x int, +d datetime); +create table t1f engine=FEDERATED connection='mysql://root@127.0.0.1:MASTER_MYPORT/test/t1'; +create table t2 ( +x int, y int, +d datetime); +create table t2f engine=FEDERATED connection='mysql://root@127.0.0.1:MASTER_MYPORT/test/t2'; +create table t3 ( +x int, y int, z int, +d datetime); +create table t3f engine=FEDERATED connection='mysql://root@127.0.0.1:MASTER_MYPORT/test/t3'; +insert into t1 values (1, "1990-01-01 00:00"); +insert into t1 values (1, "1991-01-01 11:11"); +insert into t2 values (2, 2, "1992-02-02 22:22"); +insert into t3 values (3, 3, 3, "1993-03-03 23:33"); +update t1f, t2f, t3f set t1f.x= 11, t2f.y= 22, t3f.z= 33; +drop table t1f; +drop table t2f; +drop table t3f; +drop table t1; +drop table t2; +drop table t3; +# # MDEV-21049 Segfault in create federatedx table with empty hostname # connection master; diff --git a/mysql-test/suite/federated/federatedx.test b/mysql-test/suite/federated/federatedx.test index fcc0178c024..51d34298626 100644 --- a/mysql-test/suite/federated/federatedx.test +++ b/mysql-test/suite/federated/federatedx.test @@ -2011,6 +2011,35 @@ connection master; eval CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:$SLAVE_MYPORT/federated/t1'; --echo # +--echo # MDEV-17573 Assertion in federatedx on multi-update +--echo # +create table t1 ( + x int, + d datetime); +--replace_result $MASTER_MYPORT MASTER_MYPORT +eval create table t1f engine=FEDERATED connection='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t1'; + +create table t2 ( + x int, y int, + d datetime); +--replace_result $MASTER_MYPORT MASTER_MYPORT +eval create table t2f engine=FEDERATED connection='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t2'; + +create table t3 ( + x int, y int, z int, + d datetime); +--replace_result $MASTER_MYPORT MASTER_MYPORT +eval create table t3f engine=FEDERATED connection='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t3'; + +insert into t1 values (1, "1990-01-01 00:00"); +insert into t1 values (1, "1991-01-01 11:11"); +insert into t2 values (2, 2, "1992-02-02 22:22"); +insert into t3 values (3, 3, 3, "1993-03-03 23:33"); +update t1f, t2f, t3f set t1f.x= 11, t2f.y= 22, t3f.z= 33; + +drop table t1f; drop table t2f; drop table t3f; drop table t1; drop table t2; drop table t3; + +--echo # --echo # MDEV-21049 Segfault in create federatedx table with empty hostname --echo # connection master; diff --git a/mysql-test/suite/funcs_1/r/is_check_constraints.result b/mysql-test/suite/funcs_1/r/is_check_constraints.result index 37fd191d979..2436be8142f 100644 --- a/mysql-test/suite/funcs_1/r/is_check_constraints.result +++ b/mysql-test/suite/funcs_1/r/is_check_constraints.result @@ -90,7 +90,9 @@ CREATE TABLE t3 ( a int, b int check (b>0), # field constraint named 'b' -CONSTRAINT b check (b>10) # table constraint +CONSTRAINT b check (b>10), # table constraint +# `CHECK_CLAUSE` should allow more then `var(64)` constraints +CONSTRAINT b1 check (b<123456789012345678901234567890123456789012345678901234567890123456789) ) ENGINE=InnoDB; SELECT * from information_schema.check_constraints; CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE @@ -104,6 +106,7 @@ def foo t2 CHK_dates `start_date` is null def foo t2 name char_length(`name`) > 2 def foo t3 b `b` > 0 def foo t3 b `b` > 10 +def foo t3 b1 `b` < 123456789012345678901234567890123456789012345678901234567890123456789 disconnect con1; CONNECT con2, localhost, boo2,, test; SELECT * from information_schema.check_constraints; diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result index e4797521889..a6e74cb2f05 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is.result @@ -24,7 +24,7 @@ def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 '' NO varchar 32 96 N def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 '' NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select NEVER NULL def information_schema CHARACTER_SETS DESCRIPTION 3 '' NO varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60) select NEVER NULL def information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL -def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 5 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL +def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 5 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select NEVER NULL def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select NEVER NULL def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL @@ -570,7 +570,7 @@ NULL information_schema CHARACTER_SETS MAXLEN bigint NULL NULL NULL NULL bigint( 3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema CHECK_CONSTRAINTS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema CHECK_CONSTRAINTS CHECK_CLAUSE varchar 64 192 utf8 utf8_general_ci varchar(64) +1.0000 information_schema CHECK_CONSTRAINTS CHECK_CLAUSE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext 3.0000 information_schema CLIENT_STATISTICS CLIENT varchar 64 192 utf8 utf8_general_ci varchar(64) NULL information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS bigint NULL NULL NULL NULL bigint(21) NULL information_schema CLIENT_STATISTICS CONCURRENT_CONNECTIONS bigint NULL NULL NULL NULL bigint(21) diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result index 4fc90b8433d..71765adb3fe 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result @@ -24,7 +24,7 @@ def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 '' NO varchar 32 96 N def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 '' NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) NEVER NULL def information_schema CHARACTER_SETS DESCRIPTION 3 '' NO varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60) NEVER NULL def information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL -def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 5 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL +def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 5 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext NEVER NULL def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) NEVER NULL def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL @@ -570,7 +570,7 @@ NULL information_schema CHARACTER_SETS MAXLEN bigint NULL NULL NULL NULL bigint( 3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema CHECK_CONSTRAINTS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema CHECK_CONSTRAINTS CHECK_CLAUSE varchar 64 192 utf8 utf8_general_ci varchar(64) +1.0000 information_schema CHECK_CONSTRAINTS CHECK_CLAUSE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext 3.0000 information_schema CLIENT_STATISTICS CLIENT varchar 64 192 utf8 utf8_general_ci varchar(64) NULL information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS bigint NULL NULL NULL NULL bigint(21) NULL information_schema CLIENT_STATISTICS CONCURRENT_CONNECTIONS bigint NULL NULL NULL NULL bigint(21) diff --git a/mysql-test/suite/funcs_1/r/is_tables_is.result b/mysql-test/suite/funcs_1/r/is_tables_is.result index 9af3aa860a0..65dae5a0d6b 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_is.result +++ b/mysql-test/suite/funcs_1/r/is_tables_is.result @@ -91,9 +91,9 @@ TABLE_CATALOG def TABLE_SCHEMA information_schema TABLE_NAME CHECK_CONSTRAINTS TABLE_TYPE SYSTEM VIEW -ENGINE MEMORY +ENGINE MYISAM_OR_MARIA VERSION 11 -ROW_FORMAT Fixed +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -1157,9 +1157,9 @@ TABLE_CATALOG def TABLE_SCHEMA information_schema TABLE_NAME CHECK_CONSTRAINTS TABLE_TYPE SYSTEM VIEW -ENGINE MEMORY +ENGINE MYISAM_OR_MARIA VERSION 11 -ROW_FORMAT Fixed +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# diff --git a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result index 9af3aa860a0..65dae5a0d6b 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result @@ -91,9 +91,9 @@ TABLE_CATALOG def TABLE_SCHEMA information_schema TABLE_NAME CHECK_CONSTRAINTS TABLE_TYPE SYSTEM VIEW -ENGINE MEMORY +ENGINE MYISAM_OR_MARIA VERSION 11 -ROW_FORMAT Fixed +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -1157,9 +1157,9 @@ TABLE_CATALOG def TABLE_SCHEMA information_schema TABLE_NAME CHECK_CONSTRAINTS TABLE_TYPE SYSTEM VIEW -ENGINE MEMORY +ENGINE MYISAM_OR_MARIA VERSION 11 -ROW_FORMAT Fixed +ROW_FORMAT DYNAMIC_OR_PAGE TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# diff --git a/mysql-test/suite/funcs_1/t/is_check_constraints.test b/mysql-test/suite/funcs_1/t/is_check_constraints.test index b539de67f73..dbd286e6239 100644 --- a/mysql-test/suite/funcs_1/t/is_check_constraints.test +++ b/mysql-test/suite/funcs_1/t/is_check_constraints.test @@ -69,7 +69,9 @@ CREATE TABLE t3 ( a int, b int check (b>0), # field constraint named 'b' -CONSTRAINT b check (b>10) # table constraint +CONSTRAINT b check (b>10), # table constraint +# `CHECK_CLAUSE` should allow more then `var(64)` constraints +CONSTRAINT b1 check (b<123456789012345678901234567890123456789012345678901234567890123456789) ) ENGINE=InnoDB; --sorted_result SELECT * from information_schema.check_constraints; diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 046feac5566..eb90424cf84 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -13,35 +13,38 @@ GCF-1081 : MDEV-18283 Galera test failure on galera.GCF-1081 GCF-939 : MDEV-21520 galera.GCF-939 MDEV-20225 : MDEV-20886 galera.MDEV-20225 -MW-286 : MDEV-18464 Killing thread can cause mutex deadlock if done concurrently with Galera/replication victim kill MW-328A : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002 MW-328B : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002 MW-329 : MDEV-19962 Galera test failure on MW-329 +galera_FK_duplicate_client_insert : MDEV-24473: galera.galera_FK_duplicate_client_insert MTR failed: SIGABRT. InnoDB: Conflicting lock on table. Assertion failure in lock0lock.cc galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event() +galera_bf_abort_at_after_statement : MDEV-21557: galera_bf_abort_at_after_statement MTR failed: query 'reap' succeeded - should have failed with errno 1213 galera_bf_abort_group_commit : MDEV-18282 Galera test failure on galera.galera_bf_abort_group_commit -galera_binlog_stmt_autoinc : MDEV-19959 Galera test failure on galera_binlog_stmt_autoinc +galera_bf_lock_wait : MDEV-21597 wsrep::transaction::start_transaction(): Assertion `active() == false' failed galera_encrypt_tmp_files : Get error failed to enable encryption of temporary files galera_ftwrl : MDEV-21525 galera.galera_ftwrl galera_gcache_recover_manytrx : MDEV-18834 Galera test failure galera_kill_largechanges : MDEV-18179 Galera test failure on galera.galera_kill_largechanges -galera_kill_nochanges : MDEV-18280 Galera test failure on galera_split_brain and galera_kill_nochanges galera_many_tables_nopk : MDEV-18182 Galera test failure on galera.galera_many_tables_nopk galera_mdl_race : MDEV-21524 galera.galera_mdl_race galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails galera_pc_ignore_sb : MDEV-20888 galera.galera_pc_ignore_sb +galera_pc_recovery : MDEV-25199 cluster fails to start up galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim -galera_split_brain : MDEV-18280 Galera test failure on galera_split_brain and galera_kill_nochanges galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade -galera_sst_mariabackup_encrypt_with_key : MDEV-21484 galera_sst_mariabackup_encrypt_with_key galera_toi_ddl_nonconflicting : MDEV-21518 galera.galera_toi_ddl_nonconflicting galera_toi_truncate : MDEV-22996 Hang on galera_toi_truncate test case +galera_var_ignore_apply_errors : MDEV-20451: Lock wait timeout exceeded in galera_var_ignore_apply_errors galera_var_node_address : MDEV-20485 Galera test failure galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang galera_var_reject_queries : assertion in inline_mysql_socket_send galera_var_replicate_myisam_on : MDEV-24062 Galera test failure on galera_var_replicate_myisam_on galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit galera_wan : MDEV-17259 Test failure on galera.galera_wan +mysql-wsrep#198 : MDEV-24446: galera.mysql-wsrep#198 MTR failed: query 'reap' failed: 2000: Unknown MySQL error partition : MDEV-19958 Galera test failure on galera.partition query_cache: MDEV-15805 Test failure on galera.query_cache sql_log_bin : MDEV-21491 galera.sql_log_bin -versioning_trx_id : MDEV-18590 galera.versioning_trx_id +versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch +galera_wsrep_provider_unset_set: wsrep_provider is read-only for security reasons +pxc-421: wsrep_provider is read-only for security reasons diff --git a/mysql-test/suite/galera/include/galera_st_clean_slave.inc b/mysql-test/suite/galera/include/galera_st_clean_slave.inc index 44cbf67fd12..de1842e7ccf 100644 --- a/mysql-test/suite/galera/include/galera_st_clean_slave.inc +++ b/mysql-test/suite/galera/include/galera_st_clean_slave.inc @@ -2,24 +2,26 @@ --echo This is accomplished by shutting down node #2 and removing its var directory before restarting it --connection node_1 -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1'; +--source include/wait_condition.inc SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; --echo Shutting down server ... @@ -38,28 +40,28 @@ COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); --connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1 SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); --connection node_2 --echo Starting server ... @@ -70,52 +72,56 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; --connection node_1 -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; --connection node_1a_galera_st_clean_slave -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; --let $wait_condition = SELECT COUNT(*)=35 FROM t1 --source include/wait_condition.inc -SELECT COUNT(*) = 35 FROM t1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +SELECT * from t1; SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COMMIT; -SET AUTOCOMMIT=ON; --connection node_1 --let $wait_condition = SELECT COUNT(*)=35 FROM t1 --source include/wait_condition.inc -SELECT COUNT(*) = 35 FROM t1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +SELECT * from t1; SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; diff --git a/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc b/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc index 3ac52deb284..ecbd4bad188 100644 --- a/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc +++ b/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc @@ -1,27 +1,27 @@ --echo Performing State Transfer on a server that has been temporarily disconnected --connection node_1 -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; --connection node_2 SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; ---source suite/galera/include/galera_unload_provider.inc +--source suite/galera/include/galera_stop_replication.inc --connection node_1 --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' @@ -29,31 +29,31 @@ COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); --connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1 SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); --connection node_2 ---source suite/galera/include/galera_load_provider.inc +--source suite/galera/include/galera_start_replication.inc # # client connections were killed by provider load, so have to re-open here @@ -68,52 +68,55 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; --connection node_1 -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; --connection node_1a_galera_st_disconnect_slave -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; --let $wait_condition = SELECT COUNT(*)=35 FROM t1 --source include/wait_condition.inc -SELECT COUNT(*) = 35 FROM t1; -SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -COMMIT; SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +SELECT * FROM t1; +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; --connection node_1 --let $wait_condition = SELECT COUNT(*)=35 FROM t1 --source include/wait_condition.inc -SELECT COUNT(*) = 35 FROM t1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +SELECT * FROM t1; SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; diff --git a/mysql-test/suite/galera/include/galera_st_kill_slave.inc b/mysql-test/suite/galera/include/galera_st_kill_slave.inc index a4d9e91e8be..c69dc1d7542 100644 --- a/mysql-test/suite/galera/include/galera_st_kill_slave.inc +++ b/mysql-test/suite/galera/include/galera_st_kill_slave.inc @@ -1,24 +1,26 @@ --echo Performing State Transfer on a server that has been killed and restarted --connection node_1 -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1'; +--source include/wait_condition.inc SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; --source include/kill_galera.inc @@ -29,28 +31,28 @@ COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); --connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1 SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); --connection node_2 --let $galera_wsrep_recover_server_id=2 @@ -64,52 +66,56 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; --connection node_1 -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; --connection node_1a_galera_st_kill_slave -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); ROLLBACK; --let $wait_condition = SELECT COUNT(*)=35 FROM t1 --source include/wait_condition.inc -SELECT COUNT(*) = 35 FROM t1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +SELECT * FROM t1; SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COMMIT; -SET AUTOCOMMIT=ON; --connection node_1 --let $wait_condition = SELECT COUNT(*)=35 FROM t1 --source include/wait_condition.inc -SELECT COUNT(*) = 35 FROM t1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +SELECT * FROM t1; SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; diff --git a/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc b/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc index bb8c68bd181..22aa4f12f35 100644 --- a/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc +++ b/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc @@ -4,22 +4,24 @@ if ($have_debug) { --echo while a DDL was in progress on it --connection node_1 -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1'; +--source include/wait_condition.inc START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; # Suspend the applier as it applies the ALTER TABLE @@ -42,28 +44,28 @@ SET wsrep_sync_wait = 0; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -INSERT INTO t1 (f1) VALUES ('node1_committed_during'); +INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); +INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); +INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); +INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); +INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); --connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1 SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); --connection node_2 --let $galera_wsrep_recover_server_id=2 @@ -76,58 +78,66 @@ INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' --source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; +--source include/wait_condition.inc + SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -INSERT INTO t1 (f1) VALUES ('node2_committed_after'); +INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); +INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); +INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); +INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); +INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); COMMIT; --connection node_1 -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -INSERT INTO t1 (f1) VALUES ('node1_committed_after'); +INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); +INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); +INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); +INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); +INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); COMMIT; --connection node_1a_galera_st_kill_slave_ddl -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; --let $wait_condition = SELECT COUNT(*)=35 FROM t1 --source include/wait_condition.inc -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -SELECT COUNT(*) = 35 FROM t1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +SELECT * FROM t1; SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COMMIT; -SET AUTOCOMMIT=ON; --connection node_1 --let $wait_condition = SELECT COUNT(*)=35 FROM t1 --source include/wait_condition.inc -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -SELECT COUNT(*) = 35 FROM t1; + +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +SELECT * FROM t1; SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; SET GLOBAL debug_dbug = $debug_orig; } diff --git a/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc b/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc index eeb6a15e0a3..7492e9f3579 100644 --- a/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc +++ b/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc @@ -1,14 +1,14 @@ --echo Performing State Transfer on a server that has been shut down cleanly and restarted --connection node_1 -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; --connection node_2 @@ -17,11 +17,11 @@ COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; --echo Shutting down server ... @@ -33,28 +33,28 @@ COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); --connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1 SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); --connection node_2 --echo Starting server ... @@ -65,52 +65,57 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; --connection node_1 -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; --connection node_1a_galera_st_shutdown_slave -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; --let $wait_condition = SELECT COUNT(*)=35 FROM t1 --source include/wait_condition.inc -SELECT COUNT(*) = 35 FROM t1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +SELECT * from t1; SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COMMIT; -SET AUTOCOMMIT=ON; --connection node_1 --let $wait_condition = SELECT COUNT(*)=35 FROM t1 --source include/wait_condition.inc -SELECT COUNT(*) = 35 FROM t1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +SELECT * from t1; SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; + diff --git a/mysql-test/suite/galera/include/galera_load_provider.inc b/mysql-test/suite/galera/include/galera_start_replication.inc index 0f843597d9c..b9b201106d7 100644 --- a/mysql-test/suite/galera/include/galera_load_provider.inc +++ b/mysql-test/suite/galera/include/galera_start_replication.inc @@ -1,8 +1,6 @@ --echo Loading wsrep provider ... --disable_query_log ---eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig'; - # # count occurences of successful node starts in error log # diff --git a/mysql-test/suite/galera/include/galera_unload_provider.inc b/mysql-test/suite/galera/include/galera_stop_replication.inc index cd841f51fbc..ed7e9bc41f0 100644 --- a/mysql-test/suite/galera/include/galera_unload_provider.inc +++ b/mysql-test/suite/galera/include/galera_stop_replication.inc @@ -1,7 +1,6 @@ --echo Unloading wsrep provider ... --let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address` ---let $wsrep_provider_orig = `SELECT @@wsrep_provider` --let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` --let $wsrep_error_log_orig = `SELECT @@log_error` if(!$wsrep_log_error_orig) @@ -12,4 +11,4 @@ if(!$wsrep_log_error_orig) } --let LOG_FILE= $wsrep_log_error_orig -SET GLOBAL wsrep_provider = 'none'; +SET GLOBAL wsrep_cluster_address = ''; diff --git a/mysql-test/suite/galera/r/MENT-1047.result b/mysql-test/suite/galera/r/MENT-1047.result new file mode 100644 index 00000000000..76d58f6d52f --- /dev/null +++ b/mysql-test/suite/galera/r/MENT-1047.result @@ -0,0 +1,4 @@ +connection node_2; +connection node_1; +XA START 'trx'; +ERROR 42000: This version of MariaDB doesn't yet support 'XA transactions with Galera replication' diff --git a/mysql-test/suite/galera/r/galera_UK_conflict.result b/mysql-test/suite/galera/r/galera_UK_conflict.result new file mode 100644 index 00000000000..44bb64c9d63 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_UK_conflict.result @@ -0,0 +1,131 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 int, f3 int, unique key keyj (f2)); +INSERT INTO t1 VALUES (1, 1, 0); +INSERT INTO t1 VALUES (3, 3, 0); +INSERT INTO t1 VALUES (10, 10, 0); +SET GLOBAL wsrep_slave_threads = 3; +SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb"; +connection node_1; +SET SESSION wsrep_sync_wait=0; +START TRANSACTION; +DELETE FROM t1 WHERE f2 = 3; +INSERT INTO t1 VALUES (3, 3, 1); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +SET SESSION wsrep_sync_wait=0; +connection node_2; +INSERT INTO t1 VALUES (5, 5, 2); +connection node_1a; +SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_2; +INSERT INTO t1 VALUES (4, 4, 2); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync'; +connection node_1; +COMMIT; +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync'; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL DEBUG_DBUG = ""; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; +SET GLOBAL debug_dbug = NULL; +SET debug_sync='RESET'; +SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb"; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; +SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_slave_enter_sync'; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL DEBUG_DBUG = ""; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; +SET GLOBAL debug_dbug = NULL; +SET debug_sync='RESET'; +SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_slave_enter_sync'; +SET GLOBAL wsrep_provider_options = 'dbug='; +connection node_1; +SELECT * FROM t1; +f1 f2 f3 +1 1 0 +3 3 1 +4 4 2 +5 5 2 +10 10 0 +SET GLOBAL wsrep_slave_threads = DEFAULT; +connection node_2; +SELECT * FROM t1; +f1 f2 f3 +1 1 0 +3 3 1 +4 4 2 +5 5 2 +10 10 0 +INSERT INTO t1 VALUES (7,7,7); +INSERT INTO t1 VALUES (8,8,8); +DROP TABLE t1; +test scenario 2 +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 int, f3 int, unique key keyj (f2)); +INSERT INTO t1 VALUES (1, 1, 0); +INSERT INTO t1 VALUES (3, 3, 0); +INSERT INTO t1 VALUES (10, 10, 0); +SET GLOBAL wsrep_slave_threads = 3; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_1; +SET SESSION wsrep_sync_wait=0; +START TRANSACTION; +DELETE FROM t1 WHERE f2 = 3; +INSERT INTO t1 VALUES (3, 3, 1); +connection node_1a; +SET SESSION wsrep_sync_wait=0; +connection node_2; +INSERT INTO t1 VALUES (5, 5, 2); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync'; +connection node_1; +COMMIT; +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_replay_cb"; +SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync'; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_replay_cb_reached"; +SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_slave_enter_sync'; +connection node_2; +INSERT INTO t1 VALUES (4, 4, 2); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_slave_enter_sync'; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL DEBUG_DBUG = ""; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_replay_cb"; +SET GLOBAL debug_dbug = NULL; +SET debug_sync='RESET'; +connection node_1; +SET GLOBAL wsrep_slave_threads = DEFAULT; +connection node_2; +SELECT * FROM t1; +f1 f2 f3 +1 1 0 +3 3 1 +4 4 2 +5 5 2 +10 10 0 +INSERT INTO t1 VALUES (7,7,7); +INSERT INTO t1 VALUES (8,8,8); +DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_as_slave_replay.result b/mysql-test/suite/galera/r/galera_as_slave_replay.result index 760617be5f7..3c2cea19179 100644 --- a/mysql-test/suite/galera/r/galera_as_slave_replay.result +++ b/mysql-test/suite/galera/r/galera_as_slave_replay.result @@ -1,10 +1,13 @@ connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; connection node_2a; +connection node_2; connection node_1; +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +connection node_3; RESET MASTER; connection node_2a; START SLAVE; -connection node_1; +connection node_3; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb; INSERT INTO t1 VALUES (1, 'a'); INSERT INTO t1 VALUES (3, 'a'); @@ -18,15 +21,14 @@ f1 f2 UPDATE t1 SET f2 = 'c' WHERE f1 > 1; connection node_2a; SET SESSION wsrep_sync_wait = 0; -connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; -connection node_3; +connection node_1; SET SESSION wsrep_sync_wait = 0; connection node_2a; -SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync'; +SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync'; SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; -connection node_3; -INSERT INTO test.t1 VALUES (2, 'b'); connection node_1; +INSERT INTO test.t1 VALUES (2, 'b'); +connection node_3; COMMIT; connection node_2a; SET SESSION wsrep_on = 0; @@ -35,8 +37,8 @@ SET GLOBAL debug_dbug = ""; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; connection node_2a; SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync'; -connection node_1; +SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync'; +connection node_3; SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a'; COUNT(*) = 1 1 @@ -61,7 +63,7 @@ SET DEBUG_SYNC = "RESET"; # # test phase with real abort # -connection node_1; +connection node_3; set binlog_format=ROW; insert into t1 values (4, 'd'); SET AUTOCOMMIT=ON; @@ -70,9 +72,9 @@ UPDATE t1 SET f2 = 'd' WHERE f1 = 3; connection node_2a; SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync'; SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; -connection node_3; -UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3; connection node_1; +UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3; +connection node_3; COMMIT; connection node_2a; SET GLOBAL debug_dbug = ""; @@ -90,6 +92,6 @@ set session wsrep_sync_wait=0; STOP SLAVE; RESET SLAVE; DROP TABLE t1; -connection node_1; +connection node_3; DROP TABLE t1; RESET MASTER; diff --git a/mysql-test/suite/galera/r/galera_bf_abort_ps.result b/mysql-test/suite/galera/r/galera_bf_abort_ps.result new file mode 100644 index 00000000000..42292cb20a0 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_bf_abort_ps.result @@ -0,0 +1,16 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node_2'); +connection node_1; +INSERT INTO t1 VALUES (1,'node_1'); +connection node_2a; +connection node_2; +INSERT INTO t1 VALUES (2, 'node_2'); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +wsrep_local_aborts_increment +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_bf_abort_ps_threadpool.result b/mysql-test/suite/galera/r/galera_bf_abort_ps_threadpool.result new file mode 100644 index 00000000000..7482e76778e --- /dev/null +++ b/mysql-test/suite/galera/r/galera_bf_abort_ps_threadpool.result @@ -0,0 +1,22 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node_2'); +connection node_2a; +SET GLOBAL debug_dbug = "+d,sync.wsrep_apply_cb"; +connection node_1; +INSERT INTO t1 VALUES (1,'node_1'); +connection node_2a; +SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; +connection node_2; +SET DEBUG_SYNC = "wsrep_before_before_command SIGNAL signal.wsrep_apply_cb WAIT_FOR bf_abort"; +INSERT INTO t1 VALUES (2, 'node_2'); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +wsrep_local_aborts_increment +1 +SET DEBUG_SYNC = 'RESET'; +SET GLOBAL debug_dbug = DEFAULT; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_ctas.result b/mysql-test/suite/galera/r/galera_ctas.result new file mode 100644 index 00000000000..f044f807410 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_ctas.result @@ -0,0 +1,88 @@ +connection node_2; +connection node_1; +connection node_1; +create table t1_Aria(a int, count int, b int, key(b)) engine=Aria; +INSERT INTO t1_Aria values (1,1,1); +create table t1_MyISAM(a int, count int, b int, key(b)) engine=MyISAM; +INSERT INTO t1_MyISAM values (1,1,1); +create table t1_InnoDB(a int, count int, b int, key(b)) engine=InnoDB; +INSERT INTO t1_InnoDB values (1,1,1); +SET SESSION default_storage_engine=MyISAM; +CREATE TABLE t2 AS SELECT * FROM t1_Aria; +CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; +CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2, t3,t4; +SET SESSION default_storage_engine=Aria; +CREATE TABLE t2 AS SELECT * FROM t1_Aria; +CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; +CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 +SHOW CREATE TABLE t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 +DROP TABLE t2, t3,t4; +SET SESSION default_storage_engine=InnoDB; +CREATE TABLE t2 AS SELECT * FROM t1_Aria; +CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; +CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `a` int(11) DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t2, t3,t4; +DROP TABLE t1_MyISAM, t1_Aria,t1_InnoDB; diff --git a/mysql-test/suite/galera/r/galera_fk_cascade_delete.result b/mysql-test/suite/galera/r/galera_fk_cascade_delete.result index 16db26c3c6b..808e32b8cb2 100644 --- a/mysql-test/suite/galera/r/galera_fk_cascade_delete.result +++ b/mysql-test/suite/galera/r/galera_fk_cascade_delete.result @@ -4,7 +4,6 @@ connection node_1; # test phase with cascading foreign key through 3 tables # connection node_1; -set wsrep_sync_wait=0; CREATE TABLE grandparent ( id INT NOT NULL PRIMARY KEY ) ENGINE=InnoDB; @@ -26,15 +25,26 @@ INSERT INTO grandparent VALUES (1),(2); INSERT INTO parent VALUES (1,1), (2,2); INSERT INTO child VALUES (1,1), (2,2); connection node_2; -set wsrep_sync_wait=0; DELETE FROM grandparent WHERE id = 1; +SELECT * FROM grandparent; +id +2 +SELECT * FROM parent; +id grandparent_id +2 2 +SELECT * FROM child; +id parent_id +2 2 connection node_1; -SELECT COUNT(*), COUNT(*) = 0 FROM parent WHERE grandparent_id = 1; -COUNT(*) COUNT(*) = 0 -0 1 -SELECT COUNT(*), COUNT(*) = 0 FROM child WHERE parent_id = 1; -COUNT(*) COUNT(*) = 0 -0 1 +SELECT * FROM grandparent; +id +2 +SELECT * FROM parent; +id grandparent_id +2 2 +SELECT * FROM child; +id parent_id +2 2 DROP TABLE child; DROP TABLE parent; DROP TABLE grandparent; diff --git a/mysql-test/suite/galera/r/galera_fk_cascade_delete_debug.result b/mysql-test/suite/galera/r/galera_fk_cascade_delete_debug.result index bd76692b27c..e545da53855 100644 --- a/mysql-test/suite/galera/r/galera_fk_cascade_delete_debug.result +++ b/mysql-test/suite/galera/r/galera_fk_cascade_delete_debug.result @@ -20,12 +20,10 @@ INSERT INTO child VALUES (1,'row one'), (2,'row two'); connection node_2; DELETE FROM parent; connection node_1; -SELECT COUNT(*), COUNT(*) = 0 FROM parent; -COUNT(*) COUNT(*) = 0 -0 1 -SELECT COUNT(*), COUNT(*) = 0 FROM child; -COUNT(*) COUNT(*) = 0 -0 1 +SELECT * FROM parent; +id +SELECT * FROM child; +id parent_id DROP TABLE child; DROP TABLE parent; # @@ -60,11 +58,9 @@ SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; SET GLOBAL debug_dbug = ""; SET DEBUG_SYNC = "RESET"; connection node_1; -SELECT COUNT(*), COUNT(*) = 0 FROM parent; -COUNT(*) COUNT(*) = 0 -0 1 -SELECT COUNT(*), COUNT(*) = 0 FROM child; -COUNT(*) COUNT(*) = 0 -0 1 +SELECT * FROM parent; +id +SELECT * FROM child; +id j parent_id DROP TABLE child; DROP TABLE parent; diff --git a/mysql-test/suite/galera/r/galera_fulltext.result b/mysql-test/suite/galera/r/galera_fulltext.result index a22296278fa..6c642757aa4 100644 --- a/mysql-test/suite/galera/r/galera_fulltext.result +++ b/mysql-test/suite/galera/r/galera_fulltext.result @@ -36,3 +36,31 @@ COUNT(f1) = 1000 1 DROP TABLE t1; DROP TABLE ten; +connection node_1; +SET @value=REPEAT (1,5001); +CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb; +INSERT IGNORE INTO t VALUES(@value); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT COUNT(*) FROM t; +COUNT(*) +1 +connection node_2; +SELECT COUNT(*) FROM t; +COUNT(*) +1 +connection node_1; +DROP TABLE t; +CREATE TABLE t (a VARCHAR(5000)) engine=innodb; +INSERT IGNORE INTO t VALUES(@value); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT COUNT(*) FROM t; +COUNT(*) +1 +connection node_2; +SELECT COUNT(*) FROM t; +COUNT(*) +1 +connection node_1; +DROP TABLE t; diff --git a/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff index fe54c515395..adf12c23e4a 100644 --- a/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff @@ -1,27 +1,27 @@ ---- galera_ist_mariabackup.result 2018-12-11 13:33:56.728535840 +0100 -+++ galera_ist_mariabackup.reject 2018-12-11 13:37:40.572535840 +0100 -@@ -290,3 +290,111 @@ +--- r/galera_ist_mariabackup.result 2021-04-10 14:21:16.141724901 +0300 ++++ r/galera_ist_mariabackup,debug.reject 2021-04-10 14:49:04.455785652 +0300 +@@ -517,3 +517,187 @@ + 1 DROP TABLE t1; COMMIT; - SET AUTOCOMMIT=ON; +Performing State Transfer on a server that has been killed and restarted +while a DDL was in progress on it +connection node_1; -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); +connection node_2; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; @@ -32,26 +32,26 @@ +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +connection node_2; @@ -59,56 +59,132 @@ +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave_ddl; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; -+SET AUTOCOMMIT=ON; +connection node_1; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; -+SET AUTOCOMMIT=ON; +SET GLOBAL debug_dbug = $debug_orig; diff --git a/mysql-test/suite/galera/r/galera_ist_mariabackup.result b/mysql-test/suite/galera/r/galera_ist_mariabackup.result index 13f7d898a59..5a71b490a80 100644 --- a/mysql-test/suite/galera/r/galera_ist_mariabackup.result +++ b/mysql-test/suite/galera/r/galera_ist_mariabackup.result @@ -4,49 +4,49 @@ connection node_1; connection node_2; Performing State Transfer on a server that has been temporarily disconnected connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Unloading wsrep provider ... -SET GLOBAL wsrep_provider = 'none'; +SET GLOBAL wsrep_cluster_address = ''; connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Loading wsrep provider ... disconnect node_2; @@ -54,239 +54,466 @@ connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_disconnect_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 -COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been shut down cleanly and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_shutdown_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Killing server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_kill_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; diff --git a/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff index 792f98b4427..c9457d70812 100644 --- a/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff @@ -1,27 +1,27 @@ ---- r/galera_ist_mariabackup_innodb_flush_logs.result 2018-11-21 21:34:20.157054441 +0200 -+++ r/galera_ist_mariabackup_innodb_flush_logs.reject 2018-11-22 09:16:16.824604445 +0200 -@@ -94,3 +94,111 @@ +--- r/galera_ist_mariabackup_innodb_flush_logs.result 2021-04-10 14:21:52.661886653 +0300 ++++ r/galera_ist_mariabackup_innodb_flush_logs,debug.reject 2021-04-10 14:49:56.740062774 +0300 +@@ -172,3 +172,187 @@ + 1 DROP TABLE t1; COMMIT; - SET AUTOCOMMIT=ON; +Performing State Transfer on a server that has been killed and restarted +while a DDL was in progress on it +connection node_1; -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); +connection node_2; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; @@ -32,26 +32,26 @@ +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +connection node_2; @@ -59,56 +59,132 @@ +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave_ddl; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; -+SET AUTOCOMMIT=ON; +connection node_1; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; -+SET AUTOCOMMIT=ON; +SET GLOBAL debug_dbug = $debug_orig; diff --git a/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs.result b/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs.result index 99b9c8d6c1b..2060698bee0 100644 --- a/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs.result +++ b/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs.result @@ -2,97 +2,173 @@ connection node_2; connection node_1; Performing State Transfer on a server that has been killed and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Killing server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_kill_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; diff --git a/mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff index 141b1ebd25f..e4e255deea2 100644 --- a/mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff @@ -1,27 +1,27 @@ ---- r/galera_ist_mysqldump.result 2018-11-22 14:25:28.551554055 +0200 -+++ r/galera_ist_mysqldump.reject 2018-11-22 15:46:33.119441931 +0200 -@@ -200,6 +200,114 @@ +--- r/galera_ist_mysqldump.result 2021-04-10 14:23:23.158282307 +0300 ++++ r/galera_ist_mysqldump,debug.reject 2021-04-10 15:27:13.316299695 +0300 +@@ -354,6 +354,190 @@ + 1 DROP TABLE t1; COMMIT; - SET AUTOCOMMIT=ON; +Performing State Transfer on a server that has been killed and restarted +while a DDL was in progress on it +connection node_1; -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); +connection node_2; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; @@ -32,26 +32,26 @@ +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +connection node_2; @@ -59,58 +59,134 @@ +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave_ddl; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; -+SET AUTOCOMMIT=ON; +connection node_1; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; -+SET AUTOCOMMIT=ON; +SET GLOBAL debug_dbug = $debug_orig; connection node_1; CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); diff --git a/mysql-test/suite/galera/r/galera_ist_mysqldump.result b/mysql-test/suite/galera/r/galera_ist_mysqldump.result index 222eb7704e8..6c57a571b85 100644 --- a/mysql-test/suite/galera/r/galera_ist_mysqldump.result +++ b/mysql-test/suite/galera/r/galera_ist_mysqldump.result @@ -14,194 +14,346 @@ connection node_1; connection node_2; Performing State Transfer on a server that has been shut down cleanly and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_shutdown_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Killing server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_kill_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; connection node_1; CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); DROP USER sst; diff --git a/mysql-test/suite/galera/r/galera_ist_restart_joiner.result b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result index 80d2c90642b..7cb6d90840e 100644 --- a/mysql-test/suite/galera/r/galera_ist_restart_joiner.result +++ b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result @@ -5,8 +5,9 @@ connection node_2; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a'), (4, 'a'), (5, 'a'),(6, 'a'); connection node_2; +SET SESSION wsrep_sync_wait=0; Unloading wsrep provider ... -SET GLOBAL wsrep_provider = 'none'; +SET GLOBAL wsrep_cluster_address = ''; connection node_1; UPDATE t1 SET f2 = 'b' WHERE f1 > 1; UPDATE t1 SET f2 = 'c' WHERE f1 > 2; diff --git a/mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff index 260f8a8cab8..e76b37838fb 100644 --- a/mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff @@ -1,27 +1,27 @@ ---- r/galera_ist_rsync.result 2018-09-11 12:38:42.027479411 +0300 -+++ r/galera_ist_rsync.reject 2018-09-17 10:50:16.527307668 +0300 -@@ -259,3 +259,111 @@ +--- r/galera_ist_rsync.result 2021-04-10 14:24:05.942467091 +0300 ++++ r/galera_ist_rsync,debug.reject 2021-04-10 14:52:14.236776538 +0300 +@@ -517,3 +517,187 @@ + 1 DROP TABLE t1; COMMIT; - SET AUTOCOMMIT=ON; +Performing State Transfer on a server that has been killed and restarted +while a DDL was in progress on it +connection node_1; -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); +connection node_2; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; @@ -32,26 +32,26 @@ +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +connection node_2; @@ -59,56 +59,132 @@ +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave_ddl; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; -+SET AUTOCOMMIT=ON; +connection node_1; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; -+SET AUTOCOMMIT=ON; +SET GLOBAL debug_dbug = $debug_orig; diff --git a/mysql-test/suite/galera/r/galera_ist_rsync.result b/mysql-test/suite/galera/r/galera_ist_rsync.result index 13f7d898a59..5a71b490a80 100644 --- a/mysql-test/suite/galera/r/galera_ist_rsync.result +++ b/mysql-test/suite/galera/r/galera_ist_rsync.result @@ -4,49 +4,49 @@ connection node_1; connection node_2; Performing State Transfer on a server that has been temporarily disconnected connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Unloading wsrep provider ... -SET GLOBAL wsrep_provider = 'none'; +SET GLOBAL wsrep_cluster_address = ''; connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Loading wsrep provider ... disconnect node_2; @@ -54,239 +54,466 @@ connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_disconnect_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 -COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been shut down cleanly and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_shutdown_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Killing server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_kill_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; diff --git a/mysql-test/suite/galera/r/galera_kill_nochanges.result b/mysql-test/suite/galera/r/galera_kill_nochanges.result index 8795608a303..f7478e29fd8 100644 --- a/mysql-test/suite/galera/r/galera_kill_nochanges.result +++ b/mysql-test/suite/galera/r/galera_kill_nochanges.result @@ -1,3 +1,5 @@ +connection node_2; +connection node_1; connection node_1; connection node_2; connection node_1; diff --git a/mysql-test/suite/galera/r/galera_log_bin_opt.result b/mysql-test/suite/galera/r/galera_log_bin_opt.result new file mode 100644 index 00000000000..160575df412 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_log_bin_opt.result @@ -0,0 +1,80 @@ +connection node_2; +connection node_1; +connection node_1; +set global wsrep_on=OFF; +reset master; +set global wsrep_on=ON; +connection node_2; +set global wsrep_on=OFF; +reset master; +set global wsrep_on=ON; +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (id INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1); +INSERT INTO t2 VALUES (1); +connection node_2; +SELECT COUNT(*) = 1 FROM t1; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 2 FROM t2; +COUNT(*) = 2 +1 +connection node_1; +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t1) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER +connection node_2; +SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; +COUNT(*) = 2 +1 +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t1) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER +DROP TABLE t1; +DROP TABLE t2; +#cleanup +connection node_1; +SET GLOBAL wsrep_on=OFF; +RESET MASTER; diff --git a/mysql-test/suite/galera/r/galera_split_brain.result b/mysql-test/suite/galera/r/galera_split_brain.result index 7c669e5516a..bd8c3a5bc44 100644 --- a/mysql-test/suite/galera/r/galera_split_brain.result +++ b/mysql-test/suite/galera/r/galera_split_brain.result @@ -1,3 +1,5 @@ +connection node_2; +connection node_1; connection node_1; connection node_2; call mtr.add_suppression("WSREP: TO isolation failed for: "); @@ -6,7 +8,7 @@ connection node_2; Killing server ... connection node_1; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -ERROR 40001: WSREP replication failed. Check your wsrep connection state and retry the query. +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction connection node_2; connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; disconnect node_2; diff --git a/mysql-test/suite/galera/r/galera_ssl_upgrade.result b/mysql-test/suite/galera/r/galera_ssl_upgrade.result index b24671d120d..8aab135c6a2 100644 --- a/mysql-test/suite/galera/r/galera_ssl_upgrade.result +++ b/mysql-test/suite/galera/r/galera_ssl_upgrade.result @@ -1,15 +1,25 @@ +call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown"); SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; VARIABLE_VALUE = 'Synced' 1 SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 1 +connection node_1; +call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown.*"); +connection node_2; +call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown.*"); +connection node_1; +connection node_2; +connection node_1; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 1 +connection node_2; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 1 +connection node_1; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 1 diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff index 819bcba7cac..bad8355b514 100644 --- a/mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff @@ -1,27 +1,27 @@ ---- r/galera_sst_mariabackup.result 2018-11-21 16:50:35.766982279 +0200 -+++ r/galera_sst_mariabackup.reject 2018-11-22 09:20:10.344408266 +0200 -@@ -286,5 +286,113 @@ +--- r/galera_sst_mariabackup.result 2021-04-10 14:25:04.142716409 +0300 ++++ r/galera_sst_mariabackup,debug.reject 2021-04-10 14:53:30.033162191 +0300 +@@ -516,5 +516,189 @@ + 1 DROP TABLE t1; COMMIT; - SET AUTOCOMMIT=ON; +Performing State Transfer on a server that has been killed and restarted +while a DDL was in progress on it +connection node_1; -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); +connection node_2; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; @@ -32,26 +32,26 @@ +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +connection node_2; @@ -59,58 +59,134 @@ +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave_ddl; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; -+SET AUTOCOMMIT=ON; +connection node_1; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; -+SET AUTOCOMMIT=ON; +SET GLOBAL debug_dbug = $debug_orig; disconnect node_2; disconnect node_1; diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup.result b/mysql-test/suite/galera/r/galera_sst_mariabackup.result index 4fdc283b286..caf602c017c 100644 --- a/mysql-test/suite/galera/r/galera_sst_mariabackup.result +++ b/mysql-test/suite/galera/r/galera_sst_mariabackup.result @@ -4,289 +4,517 @@ connection node_1; connection node_2; Performing State Transfer on a server that has been shut down cleanly and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_shutdown_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that starts from a clean var directory This is accomplished by shutting down node #2 and removing its var directory before restarting it connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; Cleaning var directory ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_clean_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Killing server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_kill_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; disconnect node_2; disconnect node_1; diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff index f06da63561a..870b12de3c9 100644 --- a/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff @@ -1,27 +1,27 @@ ---- r/galera_sst_mariabackup_data_dir.result 2018-12-12 13:59:56.525554689 +0100 -+++ r/galera_sst_mariabackup_data_dir.reject 2018-12-12 14:33:50.868181956 +0100 -@@ -286,5 +286,113 @@ +--- r/galera_sst_mariabackup_data_dir.result 2021-04-10 14:26:02.798965488 +0300 ++++ r/galera_sst_mariabackup_data_dir,debug.reject 2021-04-10 14:54:44.825538224 +0300 +@@ -516,5 +516,189 @@ + 1 DROP TABLE t1; COMMIT; - SET AUTOCOMMIT=ON; +Performing State Transfer on a server that has been killed and restarted +while a DDL was in progress on it +connection node_1; -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); +connection node_2; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; @@ -32,26 +32,26 @@ +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +connection node_2; @@ -59,58 +59,134 @@ +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave_ddl; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; -+SET AUTOCOMMIT=ON; +connection node_1; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; -+SET AUTOCOMMIT=ON; +SET GLOBAL debug_dbug = $debug_orig; disconnect node_2; disconnect node_1; diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir.result b/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir.result index 4fdc283b286..caf602c017c 100644 --- a/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir.result +++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir.result @@ -4,289 +4,517 @@ connection node_1; connection node_2; Performing State Transfer on a server that has been shut down cleanly and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_shutdown_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that starts from a clean var directory This is accomplished by shutting down node #2 and removing its var directory before restarting it connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; Cleaning var directory ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_clean_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Killing server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_kill_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; disconnect node_2; disconnect node_1; diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mysqldump,debug.rdiff index 2978411c8f7..e73a27ad0ac 100644 --- a/mysql-test/suite/galera/r/galera_sst_mysqldump,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_mysqldump,debug.rdiff @@ -1,43 +1,27 @@ ---- galera_sst_mysqldump.result 2018-11-29 23:54:03.663607613 +0100 -+++ galera_sst_mysqldump,debug.reject 2018-11-29 23:55:42.377562815 +0100 -@@ -1,3 +1,5 @@ -+connection node_2; -+connection node_1; - Setting SST method to mysqldump ... - call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to '127.0.0.1'"); - call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos"); -@@ -56,6 +58,9 @@ - INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); - connection node_2; - Loading wsrep provider ... -+disconnect node_2; -+connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2; -+connection node_2; - SET AUTOCOMMIT=OFF; - START TRANSACTION; - INSERT INTO t1 VALUES ('node2_committed_after'); -@@ -390,6 +395,114 @@ +--- r/galera_sst_mysqldump.result 2021-04-18 13:15:29.909314729 +0300 ++++ r/galera_sst_mysqldump.reject 2021-04-18 13:50:47.096965646 +0300 +@@ -698,6 +698,190 @@ + 1 DROP TABLE t1; COMMIT; - SET AUTOCOMMIT=ON; +Performing State Transfer on a server that has been killed and restarted +while a DDL was in progress on it +connection node_1; -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); +connection node_2; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; @@ -48,26 +32,26 @@ +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +connection node_2; @@ -75,58 +59,134 @@ +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave_ddl; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; -+SET AUTOCOMMIT=ON; +connection node_1; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; -+SET AUTOCOMMIT=ON; +SET GLOBAL debug_dbug = $debug_orig; connection node_1; CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump,release.rdiff b/mysql-test/suite/galera/r/galera_sst_mysqldump,release.rdiff deleted file mode 100644 index 3e8fee1b098..00000000000 --- a/mysql-test/suite/galera/r/galera_sst_mysqldump,release.rdiff +++ /dev/null @@ -1,18 +0,0 @@ ---- suite/galera/r/galera_sst_mysqldump.result 2018-12-20 14:22:41.730134062 +0100 -+++ suite/galera/r/galera_sst_mysqldump.reject 2019-01-16 22:18:44.139781857 +0100 -@@ -1,3 +1,5 @@ -+connection node_2; -+connection node_1; - Setting SST method to mysqldump ... - call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to '127.0.0.1'"); - call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos"); -@@ -56,6 +58,9 @@ - INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); - connection node_2; - Loading wsrep provider ... -+disconnect node_2; -+connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2; -+connection node_2; - SET AUTOCOMMIT=OFF; - START TRANSACTION; - INSERT INTO t1 VALUES ('node2_committed_after'); diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump.result b/mysql-test/suite/galera/r/galera_sst_mysqldump.result index 4ed679ba477..e63b6f6f98d 100644 --- a/mysql-test/suite/galera/r/galera_sst_mysqldump.result +++ b/mysql-test/suite/galera/r/galera_sst_mysqldump.result @@ -1,3 +1,5 @@ +connection node_2; +connection node_1; Setting SST method to mysqldump ... call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to '127.0.0.1'"); call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos"); @@ -11,385 +13,691 @@ connection node_1; connection node_2; Performing State Transfer on a server that has been temporarily disconnected connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Unloading wsrep provider ... -SET GLOBAL wsrep_provider = 'none'; +SET GLOBAL wsrep_cluster_address = ''; connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Loading wsrep provider ... +disconnect node_2; +connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_disconnect_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 -COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been shut down cleanly and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_shutdown_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that starts from a clean var directory This is accomplished by shutting down node #2 and removing its var directory before restarting it connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; Cleaning var directory ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_clean_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Killing server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_kill_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; connection node_1; CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); DROP USER sst; diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key,debug.rdiff index aee525936d1..7d73f7a6ae6 100644 --- a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key,debug.rdiff @@ -1,27 +1,27 @@ ---- r/galera_sst_mysqldump_with_key.result 2019-07-04 09:39:54.993971174 +0300 -+++ r/galera_sst_mysqldump_with_key.reject 2019-07-04 09:55:34.171175305 +0300 -@@ -204,6 +204,114 @@ +--- r/galera_sst_mysqldump_with_key.result 2021-04-10 14:33:29.441606621 +0300 ++++ r/galera_sst_mysqldump_with_key,debug.reject 2021-04-10 15:02:45.367881573 +0300 +@@ -358,6 +358,190 @@ + 1 DROP TABLE t1; COMMIT; - SET AUTOCOMMIT=ON; +Performing State Transfer on a server that has been killed and restarted +while a DDL was in progress on it +connection node_1; -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); +connection node_2; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; @@ -32,26 +32,26 @@ +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +connection node_2; @@ -59,58 +59,134 @@ +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave_ddl; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; -+SET AUTOCOMMIT=ON; +connection node_1; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; -+SET AUTOCOMMIT=ON; +SET GLOBAL debug_dbug = $debug_orig; connection node_1; CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result index 21b912ac222..fcb250f02ce 100644 --- a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result +++ b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result @@ -18,194 +18,346 @@ GRANT USAGE ON *.* TO sslsst REQUIRE SSL; SET GLOBAL wsrep_sst_auth = 'sslsst:'; Performing State Transfer on a server that has been shut down cleanly and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_shutdown_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Killing server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_kill_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; connection node_1; CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); DROP USER sst; diff --git a/mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff index 94dd8c2e502..c4937bfb4ca 100644 --- a/mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff @@ -1,27 +1,27 @@ ---- galera_sst_rsync.result -+++ galera_sst_rsync,debug.reject -@@ -284,3 +284,111 @@ +--- r/galera_sst_rsync_data_dir.result 2021-04-10 14:35:28.090610315 +0300 ++++ r/galera_sst_rsync_data_dir,debug.reject 2021-04-10 15:41:44.876068411 +0300 +@@ -516,3 +516,187 @@ + 1 DROP TABLE t1; COMMIT; - SET AUTOCOMMIT=ON; +Performing State Transfer on a server that has been killed and restarted +while a DDL was in progress on it +connection node_1; -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); +connection node_2; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; @@ -32,26 +32,26 @@ +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +connection node_2; @@ -59,56 +59,132 @@ +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave_ddl; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; -+SET AUTOCOMMIT=ON; +connection node_1; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; -+SET AUTOCOMMIT=ON; +SET GLOBAL debug_dbug = $debug_orig; diff --git a/mysql-test/suite/galera/r/galera_sst_rsync.result b/mysql-test/suite/galera/r/galera_sst_rsync.result index d41d0d34e75..8b531bc6a3f 100644 --- a/mysql-test/suite/galera/r/galera_sst_rsync.result +++ b/mysql-test/suite/galera/r/galera_sst_rsync.result @@ -4,287 +4,515 @@ connection node_1; connection node_2; Performing State Transfer on a server that has been shut down cleanly and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_shutdown_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that starts from a clean var directory This is accomplished by shutting down node #2 and removing its var directory before restarting it connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; Cleaning var directory ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_clean_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Killing server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_kill_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; diff --git a/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff index 8ffe51c0cc3..14f67770572 100644 --- a/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff @@ -1,33 +1,27 @@ ---- galera_sst_rsync2.result 2018-11-29 17:57:53.288606346 +0100 -+++ galera_sst_rsync2,debug.reject 2018-11-29 18:00:01.172512000 +0100 -@@ -1,3 +1,5 @@ -+connection node_2; -+connection node_1; - connection node_1; - connection node_2; - Performing State Transfer on a server that has been shut down cleanly and restarted -@@ -286,3 +288,111 @@ +--- r/galera_sst_rsync2.result 2021-04-10 14:34:48.646288119 +0300 ++++ r/galera_sst_rsync2,debug.reject 2021-04-10 15:04:10.276286996 +0300 +@@ -516,3 +516,187 @@ + 1 DROP TABLE t1; COMMIT; - SET AUTOCOMMIT=ON; +Performing State Transfer on a server that has been killed and restarted +while a DDL was in progress on it +connection node_1; -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); +connection node_2; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; @@ -38,26 +32,26 @@ +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +connection node_2; @@ -65,56 +59,132 @@ +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave_ddl; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; -+SET AUTOCOMMIT=ON; +connection node_1; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; -+SET AUTOCOMMIT=ON; +SET GLOBAL debug_dbug = $debug_orig; diff --git a/mysql-test/suite/galera/r/galera_sst_rsync2.result b/mysql-test/suite/galera/r/galera_sst_rsync2.result index d41d0d34e75..8b531bc6a3f 100644 --- a/mysql-test/suite/galera/r/galera_sst_rsync2.result +++ b/mysql-test/suite/galera/r/galera_sst_rsync2.result @@ -4,287 +4,515 @@ connection node_1; connection node_2; Performing State Transfer on a server that has been shut down cleanly and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_shutdown_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that starts from a clean var directory This is accomplished by shutting down node #2 and removing its var directory before restarting it connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; Cleaning var directory ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_clean_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Killing server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_kill_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff index e307a2ff0f9..00b42d53b51 100644 --- a/mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff @@ -1,27 +1,27 @@ ---- suite/galera/r/galera_sst_rsync_data_dir.result 2018-09-13 14:52:50.848220719 +0200 -+++ suite/galera/r/galera_sst_rsync_data_dir.reject 2018-09-13 15:03:32.339135247 +0200 -@@ -286,3 +286,111 @@ +--- r/galera_sst_rsync_data_dir.result 2021-04-10 14:35:28.090610315 +0300 ++++ r/galera_sst_rsync_data_dir,debug.reject 2021-04-10 15:50:26.945234998 +0300 +@@ -516,3 +516,187 @@ + 1 DROP TABLE t1; COMMIT; - SET AUTOCOMMIT=ON; +Performing State Transfer on a server that has been killed and restarted +while a DDL was in progress on it +connection node_1; -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); +connection node_2; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; @@ -32,26 +32,26 @@ +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +connection node_2; @@ -59,56 +59,132 @@ +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave_ddl; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; -+SET AUTOCOMMIT=ON; +connection node_1; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; -+SET AUTOCOMMIT=ON; +SET GLOBAL debug_dbug = $debug_orig; diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_data_dir.result b/mysql-test/suite/galera/r/galera_sst_rsync_data_dir.result index d41d0d34e75..8b531bc6a3f 100644 --- a/mysql-test/suite/galera/r/galera_sst_rsync_data_dir.result +++ b/mysql-test/suite/galera/r/galera_sst_rsync_data_dir.result @@ -4,287 +4,515 @@ connection node_1; connection node_2; Performing State Transfer on a server that has been shut down cleanly and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_shutdown_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that starts from a clean var directory This is accomplished by shutting down node #2 and removing its var directory before restarting it connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; Cleaning var directory ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_clean_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Killing server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_kill_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; diff --git a/mysql-test/suite/galera/r/galera_toi_lock_shared.result b/mysql-test/suite/galera/r/galera_toi_lock_shared.result index fe1c88075d5..ec54d1019e9 100644 --- a/mysql-test/suite/galera/r/galera_toi_lock_shared.result +++ b/mysql-test/suite/galera/r/galera_toi_lock_shared.result @@ -6,12 +6,21 @@ connection node_2; ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=SHARED; connection node_1; INSERT INTO t1 VALUES (2, 2); -SELECT COUNT(*) = 2 FROM t1; -COUNT(*) = 2 -1 +SELECT COUNT(*) AS EXPECT_2 FROM t1; +EXPECT_2 +2 +SELECT * FROM t1; +id f2 +1 NULL +2 2 connection node_2; INSERT INTO t1 VALUES (3, 3); -SELECT COUNT(*) = 3 FROM t1; -COUNT(*) = 3 -1 +SELECT COUNT(*) AS EXPECT_3 FROM t1; +EXPECT_3 +3 +SELECT * FROM t1; +id f2 +1 NULL +2 2 +3 3 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_truncate.result b/mysql-test/suite/galera/r/galera_truncate.result index c649d9bbaf9..c9a4bc854f8 100644 --- a/mysql-test/suite/galera/r/galera_truncate.result +++ b/mysql-test/suite/galera/r/galera_truncate.result @@ -32,6 +32,17 @@ SELECT AUTO_INCREMENT = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME IN ('t AUTO_INCREMENT = 1 1 1 +connection node_1; +TRUNCATE TABLE mysql.user; +ERROR 42S02: Table 'mysql.user' doesn't exist +TRUNCATE TABLE performance_schema.threads; +ERROR HY000: Invalid performance_schema usage +TRUNCATE TABLE information_schema.tables; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +TRUNCATE TABLE mysql.innodb_index_stats; +TRUNCATE TABLE foo.bar; +ERROR 42S02: Table 'foo.bar' doesn't exist +TRUNCATE TABLE t1; DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; diff --git a/mysql-test/suite/galera/r/galera_var_sst_auth.result b/mysql-test/suite/galera/r/galera_var_sst_auth.result index 6a5683e2633..98d683c3b2d 100644 --- a/mysql-test/suite/galera/r/galera_var_sst_auth.result +++ b/mysql-test/suite/galera/r/galera_var_sst_auth.result @@ -1,8 +1,7 @@ connection node_2; connection node_1; -# -# MDEV-10492: Assertion failure on shutdown when wsrep_sst_auth set in config -# +connection node_1; +connection node_2; SELECT @@global.wsrep_sst_auth; @@global.wsrep_sst_auth ******** @@ -10,5 +9,14 @@ SET @@global.wsrep_sst_auth='foo:bar'; SELECT @@global.wsrep_sst_auth; @@global.wsrep_sst_auth ******** -disconnect node_2; -disconnect node_1; +connection node_2; +SET @@global.wsrep_sst_auth= 'abcdefghijklmnopqrstuvwxyz'; +SELECT @@global.wsrep_sst_auth; +@@global.wsrep_sst_auth +******** +Shutdown node_2 +connection node_1; +connection node_2; +SELECT @@global.wsrep_sst_auth; +@@global.wsrep_sst_auth +******** diff --git a/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result b/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result index 5323bc9bf60..88cc444106b 100644 --- a/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result +++ b/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result @@ -22,3 +22,106 @@ SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3; COUNT(*) = 1 1 DROP TABLE t1; +connection node_1; +START TRANSACTION; +SET SESSION wsrep_on=OFF; +ERROR 25000: You are not allowed to execute this command in a transaction +SET GLOBAL wsrep_on=OFF; +ERROR 25000: You are not allowed to execute this command in a transaction +COMMIT; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +START TRANSACTION; +INSERT INTO t1 VALUES (1); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;; +connection node_1a; +SET GLOBAL wsrep_on = OFF; +connection node_1; +SHOW SESSION VARIABLES LIKE 'wsrep_on'; +Variable_name Value +wsrep_on ON +SHOW GLOBAL VARIABLES LIKE 'wsrep_on'; +Variable_name Value +wsrep_on OFF +INSERT INTO t1 VALUES (2); +COMMIT; +connection node_2; +SET SESSION wsrep_sync_wait = 15; +SELECT * FROM t1; +f1 +1 +2 +connection node_1a; +SET GLOBAL wsrep_on = ON; +DROP TABLE t1; +connection node_1; +SET GLOBAL wsrep_on = OFF; +connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;; +connection node_1b; +SHOW SESSION VARIABLES LIKE 'wsrep_on'; +Variable_name Value +wsrep_on OFF +SHOW GLOBAL VARIABLES LIKE 'wsrep_on'; +Variable_name Value +wsrep_on OFF +CREATE TABLE t2 (f1 INTEGER); +DROP TABLE t2; +SET GLOBAL wsrep_on = ON; +SHOW SESSION VARIABLES LIKE 'wsrep_on'; +Variable_name Value +wsrep_on ON +disconnect node_1b; +connection node_1; +SET GLOBAL wsrep_on = OFF; +SET SESSION wsrep_on = ON; +ERROR HY000: Can't enable @@session.wsrep_on, while @@global.wsrep_on is disabled +SET GLOBAL wsrep_on = ON; +SET SESSION wsrep_on = ON; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +SET GLOBAL wsrep_on = OFF; +connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;; +connection node_1b; +SHOW SESSION VARIABLES LIKE 'wsrep_on'; +Variable_name Value +wsrep_on OFF +SHOW GLOBAL VARIABLES LIKE 'wsrep_on'; +Variable_name Value +wsrep_on OFF +SET GLOBAL wsrep_on = ON; +START TRANSACTION; +INSERT INTO t1 VALUES(1); +COMMIT; +SELECT * FROM t1; +f1 +1 +connection node_2; +SELECT * FROM t1; +f1 +1 +DROP TABLE t1; +connection node_1; +SET SESSION wsrep_on = OFF; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +INSERT INTO t1 VALUES (1); +START TRANSACTION; +INSERT INTO t1 VALUES (2); +COMMIT; +DROP TABLE t1; +connection node_2; +SHOW TABLES; +Tables_in_test +connection node_1; +SET SESSION wsrep_on = ON; +SET GLOBAL wsrep_on = OFF; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +INSERT INTO t1 VALUES (1); +START TRANSACTION; +INSERT INTO t1 VALUES (2); +COMMIT; +connection node_2; +SHOW TABLES; +Tables_in_test +connection node_1; +DROP TABLE t1; +SET GLOBAL wsrep_on = ON; diff --git a/mysql-test/suite/galera/r/galera_var_wsrep_provider_options.result b/mysql-test/suite/galera/r/galera_var_wsrep_provider_options.result new file mode 100644 index 00000000000..5ef4a23fd90 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_var_wsrep_provider_options.result @@ -0,0 +1,10 @@ +connection node_2; +connection node_1; +call mtr.add_suppression("WSREP: Unknown parameter 'a'"); +call mtr.add_suppression("WSREP: Set options returned 7"); +SET GLOBAL wsrep_provider_options=NULL; +ERROR HY000: Incorrect arguments to SET +SET GLOBAL wsrep_provider_options=''; +SET GLOBAL wsrep_provider_options=' '; +SET GLOBAL wsrep_provider_options='a=1'; +ERROR HY000: Incorrect arguments to SET diff --git a/mysql-test/suite/sys_vars/r/wsrep_start_position_basic.result b/mysql-test/suite/galera/r/galera_var_wsrep_start_position.result index a49e6135d47..3d409f90eac 100644 --- a/mysql-test/suite/sys_vars/r/wsrep_start_position_basic.result +++ b/mysql-test/suite/galera/r/galera_var_wsrep_start_position.result @@ -1,7 +1,9 @@ +connection node_2; +connection node_1; # # wsrep_start_position # -# save the initial value +CALL mtr.add_suppression("WSREP: SST failed for position .*"); SET @wsrep_start_position_global_saved = @@global.wsrep_start_position; # default SELECT @@global.wsrep_start_position; @@ -11,46 +13,92 @@ SELECT @@global.wsrep_start_position; # scope SELECT @@session.wsrep_start_position; ERROR HY000: Variable 'wsrep_start_position' is a GLOBAL variable -SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-1'; SELECT @@global.wsrep_start_position; @@global.wsrep_start_position 00000000-0000-0000-0000-000000000000:-1 # valid values -SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-2'; +SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-1'; +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 + +SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:0'; +ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '00000000-0000-0000-0000-000000000000:0' SELECT @@global.wsrep_start_position; @@global.wsrep_start_position -00000000-0000-0000-0000-000000000000:-2 +00000000-0000-0000-0000-000000000000:-1 +# invalid values SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:100'; +ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:100' SELECT @@global.wsrep_start_position; @@global.wsrep_start_position -12345678-1234-1234-1234-123456789012:100 -SET @@global.wsrep_start_position=default; +00000000-0000-0000-0000-000000000000:-1 +SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-2'; +ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '00000000-0000-0000-0000-000000000000:-2' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 +SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-2A'; +ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '00000000-0000-0000-0000-000000000000:-2A' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 +SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:0A'; +ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '00000000-0000-0000-0000-000000000000:0A' SELECT @@global.wsrep_start_position; @@global.wsrep_start_position 00000000-0000-0000-0000-000000000000:-1 - -# invalid values SET @@global.wsrep_start_position='000000000000000-0000-0000-0000-000000000000:-1'; ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '000000000000000-0000-0000-0000-000000000000:-1' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 SET @@global.wsrep_start_position='12345678-1234-1234-12345-123456789012:100'; ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-12345-123456789012:100' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 SET @@global.wsrep_start_position='12345678-1234-123-12345-123456789012:0'; ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-123-12345-123456789012:0' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:_99999'; ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:_99999' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:a'; ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:a' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 SET @@global.wsrep_start_position='OFF'; ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of 'OFF' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 SET @@global.wsrep_start_position=ON; ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of 'ON' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 SET @@global.wsrep_start_position=''; ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 SET @@global.wsrep_start_position=NULL; ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of 'NULL' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 SET @@global.wsrep_start_position='junk'; ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of 'junk' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 # restore the initial value SET @@global.wsrep_start_position = @wsrep_start_position_global_saved; diff --git a/mysql-test/suite/galera/r/galera_virtual_blob.result b/mysql-test/suite/galera/r/galera_virtual_blob.result new file mode 100644 index 00000000000..fd1c84f7083 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_virtual_blob.result @@ -0,0 +1,21 @@ +connection node_2; +connection node_1; +CREATE TABLE t (f INT GENERATED ALWAYS AS (a+b)VIRTUAL,a INT,b INT,h BLOB); +INSERT INTO t (a,b)VALUES(0,0), (0,0), (0,0), (0,0), (0,0); +SELECT * from t; +f a b h +0 0 0 NULL +0 0 0 NULL +0 0 0 NULL +0 0 0 NULL +0 0 0 NULL +connection node_2; +SELECT * from t; +f a b h +0 0 0 NULL +0 0 0 NULL +0 0 0 NULL +0 0 0 NULL +0 0 0 NULL +connection node_1; +DROP TABLE t; diff --git a/mysql-test/suite/galera/r/galera_virtual_column.result b/mysql-test/suite/galera/r/galera_virtual_column.result new file mode 100644 index 00000000000..71820ed8225 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_virtual_column.result @@ -0,0 +1,19 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE p (id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT) ENGINE = InnoDB; +CREATE TABLE c (id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, pid INT UNSIGNED, bitmap TINYINT UNSIGNED NOT NULL DEFAULT 0, bitmap5 TINYINT UNSIGNED GENERATED ALWAYS AS (bitmap&(1<<5)) VIRTUAL, FOREIGN KEY (pid) REFERENCES p (id) ON DELETE CASCADE ON UPDATE CASCADE); +CREATE INDEX bitmap5 ON c(bitmap5) USING BTREE; +INSERT INTO p VALUES(1); +INSERT INTO c(pid) VALUES(1); +connection node_2; +connection node_1; +DELETE FROM p WHERE id=1; +SELECT * FROM p; +id +SELECT * FROM c; +id pid bitmap bitmap5 +connection node_2; +connection node_1; +DROP TABLE c; +DROP TABLE p; diff --git a/mysql-test/suite/galera/r/lp1376747-4.result b/mysql-test/suite/galera/r/lp1376747-4.result index 6bbc24309ad..888961b592d 100644 --- a/mysql-test/suite/galera/r/lp1376747-4.result +++ b/mysql-test/suite/galera/r/lp1376747-4.result @@ -5,32 +5,34 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); connection node_2; SET session wsrep_sync_wait=0; -FLUSH TABLE WITH READ LOCK; +FLUSH TABLES WITH READ LOCK; connection node_1; ALTER TABLE t1 ADD COLUMN f2 INTEGER; INSERT INTO t1 VALUES (2,3); connection node_2a; SET session wsrep_sync_wait=0; -# node_1 DDL should not yet be applied SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SET debug_sync='flush_tables_with_read_lock_after_acquire_locks SIGNAL parked2 WAIT_FOR go2'; FLUSH TABLES t1 WITH READ LOCK;; connection node_2; +SET debug_sync='now WAIT_FOR parked2'; +SET debug_sync='now SIGNAL go2'; UNLOCK TABLES; -# node_1 DDL should not yet be applied 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 +set debug_sync= 'RESET'; connection node_2a; UNLOCK TABLES; -# node_1 DDL should be applied 2 +SET SESSION wsrep_sync_wait = DEFAULT; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/suite/galera/r/mysql-wsrep#33,debug.rdiff b/mysql-test/suite/galera/r/mysql-wsrep#33,debug.rdiff index d8fed3897fd..971f11bb8ec 100644 --- a/mysql-test/suite/galera/r/mysql-wsrep#33,debug.rdiff +++ b/mysql-test/suite/galera/r/mysql-wsrep#33,debug.rdiff @@ -1,27 +1,27 @@ ---- r/mysql-wsrep#33.result 2020-02-13 15:14:31.871914684 +0200 -+++ r/mysql-wsrep#33.reject 2020-02-13 17:01:22.559450367 +0200 -@@ -395,6 +395,114 @@ +--- r/mysql-wsrep#33.result 2021-04-10 14:36:42.663191908 +0300 ++++ r/mysql-wsrep#33,debug.reject 2021-04-10 15:43:02.420168969 +0300 +@@ -698,6 +698,190 @@ + 1 DROP TABLE t1; COMMIT; - SET AUTOCOMMIT=ON; +Performing State Transfer on a server that has been killed and restarted +while a DDL was in progress on it +connection node_1; -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); +connection node_2; +START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; @@ -32,26 +32,26 @@ +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +connection node_2; @@ -59,58 +59,134 @@ +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave_ddl; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; -+SET AUTOCOMMIT=ON; +connection node_1; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; -+SET AUTOCOMMIT=ON; +SET GLOBAL debug_dbug = $debug_orig; connection node_2; connection node_1; diff --git a/mysql-test/suite/galera/r/mysql-wsrep#33.result b/mysql-test/suite/galera/r/mysql-wsrep#33.result index fb0b593cc96..2c116347fca 100644 --- a/mysql-test/suite/galera/r/mysql-wsrep#33.result +++ b/mysql-test/suite/galera/r/mysql-wsrep#33.result @@ -13,49 +13,49 @@ connection node_2; SET GLOBAL wsrep_sst_method = 'mysqldump'; Performing State Transfer on a server that has been temporarily disconnected connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Unloading wsrep provider ... -SET GLOBAL wsrep_provider = 'none'; +SET GLOBAL wsrep_cluster_address = ''; connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Loading wsrep provider ... disconnect node_2; @@ -63,338 +63,641 @@ connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_disconnect_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 -COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been shut down cleanly and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_shutdown_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that starts from a clean var directory This is accomplished by shutting down node #2 and removing its var directory before restarting it connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Shutting down server ... connection node_1; Cleaning var directory ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_clean_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted connection node_1; -CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); -INSERT INTO t1 VALUES ('node1_committed_before'); +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); COMMIT; connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); -INSERT INTO t1 VALUES ('node2_committed_before'); +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); COMMIT; Killing server ... connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); -INSERT INTO t1 VALUES ('node1_committed_during'); +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); COMMIT; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); -INSERT INTO t1 VALUES ('node2_committed_after'); +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); COMMIT; connection node_1; -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); COMMIT; SET AUTOCOMMIT=OFF; START TRANSACTION; -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); -INSERT INTO t1 VALUES ('node1_committed_after'); +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); COMMIT; connection node_1a_galera_st_kill_slave; -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); ROLLBACK; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 COMMIT; -SET AUTOCOMMIT=ON; connection node_1; -SELECT COUNT(*) = 35 FROM t1; -COUNT(*) = 35 -1 +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; COUNT(*) = 0 1 DROP TABLE t1; COMMIT; -SET AUTOCOMMIT=ON; connection node_2; connection node_1; CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); diff --git a/mysql-test/suite/galera/t/MDEV-16509.test b/mysql-test/suite/galera/t/MDEV-16509.test index a17d7899939..ea4430d5e3f 100644 --- a/mysql-test/suite/galera/t/MDEV-16509.test +++ b/mysql-test/suite/galera/t/MDEV-16509.test @@ -5,7 +5,7 @@ --source include/galera_cluster.inc --source include/have_debug.inc --source include/have_debug_sync.inc - +--source include/galera_have_debug_sync.inc CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; diff --git a/mysql-test/suite/galera/t/MENT-1047.test b/mysql-test/suite/galera/t/MENT-1047.test new file mode 100644 index 00000000000..1431818f806 --- /dev/null +++ b/mysql-test/suite/galera/t/MENT-1047.test @@ -0,0 +1,7 @@ +# +# MENT-1047 - Reject XA with Galera replication +# +--source include/galera_cluster.inc + +--error ER_NOT_SUPPORTED_YET +XA START 'trx'; diff --git a/mysql-test/suite/galera/t/galera#500.test b/mysql-test/suite/galera/t/galera#500.test index 60f303b7103..471620b32c1 100644 --- a/mysql-test/suite/galera/t/galera#500.test +++ b/mysql-test/suite/galera/t/galera#500.test @@ -8,9 +8,10 @@ --source include/galera_cluster.inc --source include/galera_have_debug_sync.inc +# Save original auto_increment_offset values. --let $node_1=node_1 --let $node_2=node_2 ---source suite/galera/include/auto_increment_offset_save.inc +--source include/auto_increment_offset_save.inc # Force node_2 gcomm background thread to terminate via exception. --connection node_2 @@ -41,4 +42,4 @@ SET SESSION wsrep_on=0; --connection node_2 CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2."); ---source suite/galera/include/auto_increment_offset_restore.inc +--source include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera/t/galera_UK_conflict.test b/mysql-test/suite/galera/t/galera_UK_conflict.test new file mode 100644 index 00000000000..9978ba9b8bf --- /dev/null +++ b/mysql-test/suite/galera/t/galera_UK_conflict.test @@ -0,0 +1,276 @@ +# +# This test tests the operation of transaction replay with a scenario +# where two subsequent write sets being applied conflict with local transaction +# in commit phase. The conflict is "false positive" confict on GAP lock in +# secondary unique index. +# The first applier will cause BF abort for the local committer, which +# starts replaying because of positive certification. +# In buggy version, the test scenario continues so that while the local transaction +# is replaying, the latter applier experiences similar UK GAP lock conflict +# and forces the replayer to abort second time. +# In fixed version, this latter replayer BF abort should not happen. +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_debug_sync.inc +--source include/galera_have_debug_sync.inc + + +--let $expected_wsrep_local_replays = `SELECT VARIABLE_VALUE+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'` + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 int, f3 int, unique key keyj (f2)); +INSERT INTO t1 VALUES (1, 1, 0); +INSERT INTO t1 VALUES (3, 3, 0); +INSERT INTO t1 VALUES (10, 10, 0); + +# we will need 2 appliers threads for applyin two writes ets in parallel in node1 +# and 1 applier thread for handling replaying +SET GLOBAL wsrep_slave_threads = 3; +SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb"; + +--connection node_1 +# starting a transaction, which deletes and inserts the middle row in test table +# this will be victim of false positive conflict with appliers +SET SESSION wsrep_sync_wait=0; +START TRANSACTION; + +DELETE FROM t1 WHERE f2 = 3; +INSERT INTO t1 VALUES (3, 3, 1); + +# Control connection to manage sync points for appliers +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connection node_1a +SET SESSION wsrep_sync_wait=0; + +# send from node 2 first an INSERT transaction, which will conflict on GAP lock in node 1 +--connection node_2 +INSERT INTO t1 VALUES (5, 5, 2); + +--connection node_1a +# wait to see the INSERT in apply_cb sync point +SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; + +# first applier seen in wait point, set sync point for the second INSERT +--let $galera_sync_point = apply_monitor_slave_enter_sync +--source include/galera_set_sync_point.inc + +--connection node_2 +# send second insert into same GAP in test table +INSERT INTO t1 VALUES (4, 4, 2); + +--connection node_1a +# wait for the second insert to arrive in his sync point +--let $galera_sync_point = apply_monitor_slave_enter_sync +--source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc + +# both appliers are now waiting in separate sync points + +# Block the local commit, send the COMMIT and wait until it gets blocked +--let $galera_sync_point = commit_monitor_master_enter_sync +--source include/galera_set_sync_point.inc + +--connection node_1 +--send COMMIT + +--connection node_1a +# wait for the local commit to enter in commit monitor wait state +--let $galera_sync_point = apply_monitor_slave_enter_sync commit_monitor_master_enter_sync +--source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc + +# release the local transaction to continue with commit +--let $galera_sync_point = commit_monitor_master_enter_sync +--source include/galera_signal_sync_point.inc +--source include/galera_clear_sync_point.inc + +# and now release the first applier, it should force local trx to abort +SET GLOBAL DEBUG_DBUG = ""; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; +SET GLOBAL debug_dbug = NULL; +SET debug_sync='RESET'; + +# wait for BF abort to happen and replaying begin +--let $wait_condition = SELECT VARIABLE_VALUE= $expected_wsrep_local_replays FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'; +--let $wait_condition_on_error_output= SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'; +--source include/wait_condition_with_debug.inc + +# set another sync point for second applier +SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb"; + +# letting the second appier to move forward +--let $galera_sync_point = apply_monitor_slave_enter_sync +--source include/galera_signal_sync_point.inc + +# waiting until second applier is in wait state +SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; + +# stopping second applier before commit +--let $galera_sync_point = commit_monitor_slave_enter_sync +--source include/galera_set_sync_point.inc +--source include/galera_clear_sync_point.inc + +# releasing the second insert, with buggy version it will conflict with +# replayer +SET GLOBAL DEBUG_DBUG = ""; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; +SET GLOBAL debug_dbug = NULL; +SET debug_sync='RESET'; + +# with fixed version, second applier has reached comit monitor, and we can +# release it to complete +--let $galera_sync_point = commit_monitor_slave_enter_sync +--source include/galera_signal_sync_point.inc +--source include/galera_clear_sync_point.inc + +# local commit should succeed +--connection node_1 +--reap + +SELECT * FROM t1; + +# returning original slave thread count +SET GLOBAL wsrep_slave_threads = DEFAULT; + +--connection node_2 +SELECT * FROM t1; + +# replicate some transactions, so that wsrep slave thread count can reach +# original state in node 1 +INSERT INTO t1 VALUES (7,7,7); +INSERT INTO t1 VALUES (8,8,8); + +DROP TABLE t1; + +################################################################################## +# test scenario 2 +# +# commit order is now: INSERT-1, local COMMIT, INSERT-2 +# while local trx is replaying, the latter applier has applied and is waiting +# for commit. +# The point in this scenario is to verify that replayer does not try to abort +# the latter applier +################################################################################# + +--echo test scenario 2 + +--connection node_1 +--let $expected_wsrep_local_replays = `SELECT VARIABLE_VALUE+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'` + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 int, f3 int, unique key keyj (f2)); +INSERT INTO t1 VALUES (1, 1, 0); +INSERT INTO t1 VALUES (3, 3, 0); +INSERT INTO t1 VALUES (10, 10, 0); + +# we will need 2 appliers threads for applyin two writes sets in parallel in node1 +# and 1 applier thread for handling replaying +SET GLOBAL wsrep_slave_threads = 3; + +# set sync point for the first INSERT applier +--let $galera_sync_point = apply_monitor_slave_enter_sync +--source include/galera_set_sync_point.inc + +--connection node_1 +# starting a transaction, which deletes and inserts the middle row in test table +# this will be victim of false positive conflict with appliers +SET SESSION wsrep_sync_wait=0; +START TRANSACTION; + +DELETE FROM t1 WHERE f2 = 3; +INSERT INTO t1 VALUES (3, 3, 1); + +# Control connection to manage sync points for appliers +--connection node_1a +SET SESSION wsrep_sync_wait=0; + +# send from node 2 first an INSERT transaction, which will conflict on GAP lock in node 1 +--connection node_2 +INSERT INTO t1 VALUES (5, 5, 2); + +--connection node_1a +# wait to see the INSERT in apply_cb sync point +--let $galera_sync_point = apply_monitor_slave_enter_sync +--source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc + +# Block the local commit, send the COMMIT and wait until it gets blocked +--let $galera_sync_point = commit_monitor_master_enter_sync +--source include/galera_set_sync_point.inc + +--connection node_1 +--send COMMIT + +--connection node_1a +# wait for the local commit to enter in commit monitor wait state +--let $galera_sync_point = apply_monitor_slave_enter_sync commit_monitor_master_enter_sync +--source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc + +# set sync point before replaying +SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_replay_cb"; + +# release the local transaction to continue with commit +# it should advance and end up waiting in commit monitor for his turn +--let $galera_sync_point = commit_monitor_master_enter_sync +--source include/galera_signal_sync_point.inc +--source include/galera_clear_sync_point.inc + +# and now release the first applier, it should force local trx to abort +--let $galera_sync_point = apply_monitor_slave_enter_sync +--source include/galera_signal_sync_point.inc +--source include/galera_clear_sync_point.inc + +# wait for BF abort to happen and replaying begin +--let $wait_condition = SELECT VARIABLE_VALUE= $expected_wsrep_local_replays FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'; +--let $wait_condition_on_error_output= SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'; +--source include/wait_condition_with_debug.inc + +# replayer should now be in stopped in sync point +SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_replay_cb_reached"; + +# set sync point for the second INSERT +--let $galera_sync_point = commit_monitor_slave_enter_sync +--source include/galera_set_sync_point.inc + +--connection node_2 +# send second insert into same GAP in test table +INSERT INTO t1 VALUES (4, 4, 2); + +--connection node_1a +# wait for the second applier to enter in commit monitor wait state +--let $galera_sync_point = commit_monitor_slave_enter_sync +--source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc + +# and, letting the second appier to move forward, it will stop naturally +# to wait for commit order after replayer's commit +--let $galera_sync_point = commit_monitor_slave_enter_sync +--source include/galera_signal_sync_point.inc +--source include/galera_clear_sync_point.inc + +# and now release the replayer, if all is good,it will commit before the second applier +SET GLOBAL DEBUG_DBUG = ""; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_replay_cb"; +SET GLOBAL debug_dbug = NULL; +SET debug_sync='RESET'; + +# local commit should succeed +--connection node_1 +--reap + +--let $wait_condition = SELECT COUNT(*)=5 FROM t1; +--source include/wait_condition.inc + +# returning original slave thread count +SET GLOBAL wsrep_slave_threads = DEFAULT; + +--connection node_2 +SELECT * FROM t1; + +# replicate some transactions, so that wsrep slave thread count can reach +# original state in node 1 +INSERT INTO t1 VALUES (7,7,7); +INSERT INTO t1 VALUES (8,8,8); + +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_as_slave_replay.test b/mysql-test/suite/galera/t/galera_as_slave_replay.test index 93f95349e6d..47f70bda721 100644 --- a/mysql-test/suite/galera/t/galera_as_slave_replay.test +++ b/mysql-test/suite/galera/t/galera_as_slave_replay.test @@ -18,9 +18,10 @@ #--source suite/galera/include/galera_have_debug_sync.inc # -# node 1 is native MariaDB server operating as async replication master +# node 3 is native MariaDB server operating as async replication master # ---connection node_1 +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 +--connection node_3 RESET MASTER; --connection node_2a @@ -31,14 +32,14 @@ RESET MASTER; # -# nodes 2 and 3 form a galera cluster, node 2 operates as slave for native MariaDB naster in node 1 +# nodes 1 and 2 form a galera cluster, node 2 operates as slave for native MariaDB naster in node 3 # --disable_query_log ---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1; +--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3; --enable_query_log START SLAVE; ---connection node_1 +--connection node_3 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb; INSERT INTO t1 VALUES (1, 'a'); INSERT INTO t1 VALUES (3, 'a'); @@ -63,15 +64,14 @@ SET SESSION wsrep_sync_wait = 0; --source include/wait_condition.inc # wait for create table and inserts to be replicated in cluster ---connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 ---connection node_3 +--connection node_1 SET SESSION wsrep_sync_wait = 0; --let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1; --source include/wait_condition.inc --connection node_2a # Block the future commit of async replication ---let $galera_sync_point = commit_monitor_enter_sync +--let $galera_sync_point = commit_monitor_master_enter_sync --source include/galera_set_sync_point.inc # block also the applier before applying begins @@ -81,13 +81,13 @@ SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; # now inject a conflicting insert from node 3, it will replicate with # earlier seqno (than async transaction) and pause before applying in node 2 # ---connection node_3 +--connection node_1 INSERT INTO test.t1 VALUES (2, 'b'); # # send the update from master, this will succeed here, beceuase of async replication. # async replication will apply this in node 2 and pause before commit phase, ---connection node_1 +--connection node_3 --error 0 COMMIT; @@ -108,7 +108,7 @@ SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; --source include/galera_clear_sync_point.inc --source include/galera_signal_sync_point.inc ---connection node_1 +--connection node_3 SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a'; SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; @@ -139,7 +139,7 @@ SET DEBUG_SYNC = "RESET"; --echo # test phase with real abort --echo # ---connection node_1 +--connection node_3 set binlog_format=ROW; @@ -163,11 +163,11 @@ UPDATE t1 SET f2 = 'd' WHERE f1 = 3; SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; # Inject a conflicting update from node 3 ---connection node_3 +--connection node_1 UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3; # send the update from master ---connection node_1 +--connection node_3 --error 0 COMMIT; @@ -195,6 +195,6 @@ RESET SLAVE; DROP TABLE t1; ---connection node_1 +--connection node_3 DROP TABLE t1; RESET MASTER; diff --git a/mysql-test/suite/galera/t/galera_bf_abort_ps.cnf b/mysql-test/suite/galera/t/galera_bf_abort_ps.cnf new file mode 100644 index 00000000000..34c1a8cc3cf --- /dev/null +++ b/mysql-test/suite/galera/t/galera_bf_abort_ps.cnf @@ -0,0 +1,3 @@ +!include ../galera_2nodes.cnf +[mysqltest] +ps-protocol
\ No newline at end of file diff --git a/mysql-test/suite/galera/t/galera_bf_abort_ps.test b/mysql-test/suite/galera/t/galera_bf_abort_ps.test new file mode 100644 index 00000000000..d2dfb92651e --- /dev/null +++ b/mysql-test/suite/galera/t/galera_bf_abort_ps.test @@ -0,0 +1,34 @@ +# +# MDEV-24255 +# Test BF abort of a transaction that has ps-protocol enabled +# + +--source include/galera_cluster.inc + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB; +--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 + +--connection node_2 +--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` + +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node_2'); + +--connection node_1 +INSERT INTO t1 VALUES (1,'node_1'); + +--connection node_2a +--let $wait_condition = SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'node_1' +--source include/wait_condition.inc + +--connection node_2 +--error ER_LOCK_DEADLOCK +INSERT INTO t1 VALUES (2, 'node_2'); + +--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` + +--disable_query_log +--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment; +--enable_query_log + +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_bf_abort_ps_threadpool.cnf b/mysql-test/suite/galera/t/galera_bf_abort_ps_threadpool.cnf new file mode 100644 index 00000000000..83baa995c17 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_bf_abort_ps_threadpool.cnf @@ -0,0 +1,7 @@ +!include ../galera_2nodes.cnf + +[mysqld] +thread-handling=pool-of-threads + +[mysqltest] +ps-protocol diff --git a/mysql-test/suite/galera/t/galera_bf_abort_ps_threadpool.test b/mysql-test/suite/galera/t/galera_bf_abort_ps_threadpool.test new file mode 100644 index 00000000000..56348a6f527 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_bf_abort_ps_threadpool.test @@ -0,0 +1,54 @@ +# +# MDEV-24255 +# Test BF abort of a transaction that has ps-protocol enabled +# This test stresses the case where wsrep_before_command() +# finds the transaction in state s_must_abort. This only +# possible when the server is using the thread pool. +# + +--source include/galera_cluster.inc +--source include/have_debug_sync.inc + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB; + +--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 + +--connection node_2 +--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` + +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node_2'); + +--connection node_2a +SET GLOBAL debug_dbug = "+d,sync.wsrep_apply_cb"; + +--connection node_1 +INSERT INTO t1 VALUES (1,'node_1'); + +--connection node_2a +SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; + +--connection node_2 +SET DEBUG_SYNC = "wsrep_before_before_command SIGNAL signal.wsrep_apply_cb WAIT_FOR bf_abort"; + +# +# The following INSERT is expected to enter +# wsrep_before_command() and find its transaction +# in state s_must_abort. +# Notice that the test appears more complicated +# than it needs to... however we cannot use +# --send for this INSERT, otherwise mysqltest +# will not use ps-protocol +# +--error ER_LOCK_DEADLOCK +INSERT INTO t1 VALUES (2, 'node_2'); + +--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` + +--disable_query_log +--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment; +--enable_query_log + +SET DEBUG_SYNC = 'RESET'; +SET GLOBAL debug_dbug = DEFAULT; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_bf_kill_debug.test b/mysql-test/suite/galera/t/galera_bf_kill_debug.test index b687a5a6a67..c322f283757 100644 --- a/mysql-test/suite/galera/t/galera_bf_kill_debug.test +++ b/mysql-test/suite/galera/t/galera_bf_kill_debug.test @@ -84,7 +84,7 @@ SET DEBUG_SYNC = "now SIGNAL continue_kill"; --reap --connection node_2a ---error 0,1213 +--error 0,1213,2013 select * from t1; --connection node_2 diff --git a/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf b/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf new file mode 100644 index 00000000000..889c81b4a0a --- /dev/null +++ b/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf @@ -0,0 +1,7 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +auto_increment_offset=1 + +[mysqld.2] +auto_increment_offset=2 diff --git a/mysql-test/suite/galera/t/galera_ctas.test b/mysql-test/suite/galera/t/galera_ctas.test new file mode 100644 index 00000000000..8b9ad9c4a20 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_ctas.test @@ -0,0 +1,39 @@ +--source include/galera_cluster.inc + +--connection node_1 +create table t1_Aria(a int, count int, b int, key(b)) engine=Aria; +INSERT INTO t1_Aria values (1,1,1); +create table t1_MyISAM(a int, count int, b int, key(b)) engine=MyISAM; +INSERT INTO t1_MyISAM values (1,1,1); +create table t1_InnoDB(a int, count int, b int, key(b)) engine=InnoDB; +INSERT INTO t1_InnoDB values (1,1,1); + +SET SESSION default_storage_engine=MyISAM; +CREATE TABLE t2 AS SELECT * FROM t1_Aria; +CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; +CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; +SHOW CREATE TABLE t2; +SHOW CREATE TABLE t3; +SHOW CREATE TABLE t4; +DROP TABLE t2, t3,t4; + +SET SESSION default_storage_engine=Aria; +CREATE TABLE t2 AS SELECT * FROM t1_Aria; +CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; +CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; +SHOW CREATE TABLE t2; +SHOW CREATE TABLE t3; +SHOW CREATE TABLE t4; +DROP TABLE t2, t3,t4; + +SET SESSION default_storage_engine=InnoDB; +CREATE TABLE t2 AS SELECT * FROM t1_Aria; +CREATE TABLE t3 AS SELECT * FROM t1_MyISAM; +CREATE TABLE t4 AS SELECT * FROM t1_InnoDB; +SHOW CREATE TABLE t2; +SHOW CREATE TABLE t3; +SHOW CREATE TABLE t4; + +DROP TABLE t2, t3,t4; +DROP TABLE t1_MyISAM, t1_Aria,t1_InnoDB; + diff --git a/mysql-test/suite/galera/t/galera_fk_cascade_delete.test b/mysql-test/suite/galera/t/galera_fk_cascade_delete.test index a3e0dbcf36f..49b54f0f7f0 100644 --- a/mysql-test/suite/galera/t/galera_fk_cascade_delete.test +++ b/mysql-test/suite/galera/t/galera_fk_cascade_delete.test @@ -9,7 +9,6 @@ --echo # --connection node_1 -set wsrep_sync_wait=0; CREATE TABLE grandparent ( id INT NOT NULL PRIMARY KEY @@ -36,8 +35,12 @@ INSERT INTO parent VALUES (1,1), (2,2); INSERT INTO child VALUES (1,1), (2,2); --connection node_2 -set wsrep_sync_wait=0; - +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'grandparent' +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'parent' +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'child' +--source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*) = 2 FROM child; --source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*) = 2 FROM parent; @@ -46,6 +49,10 @@ set wsrep_sync_wait=0; --source include/wait_condition.inc DELETE FROM grandparent WHERE id = 1; +SELECT * FROM grandparent; +SELECT * FROM parent; +SELECT * FROM child; + --connection node_1 --let $wait_condition = SELECT COUNT(*) = 1 FROM child; --source include/wait_condition.inc @@ -53,8 +60,10 @@ DELETE FROM grandparent WHERE id = 1; --source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*) = 1 FROM grandparent; --source include/wait_condition.inc -SELECT COUNT(*), COUNT(*) = 0 FROM parent WHERE grandparent_id = 1; -SELECT COUNT(*), COUNT(*) = 0 FROM child WHERE parent_id = 1; + +SELECT * FROM grandparent; +SELECT * FROM parent; +SELECT * FROM child; DROP TABLE child; DROP TABLE parent; diff --git a/mysql-test/suite/galera/t/galera_fk_cascade_delete_debug.test b/mysql-test/suite/galera/t/galera_fk_cascade_delete_debug.test index 96e633f83d7..d902783ed64 100644 --- a/mysql-test/suite/galera/t/galera_fk_cascade_delete_debug.test +++ b/mysql-test/suite/galera/t/galera_fk_cascade_delete_debug.test @@ -25,16 +25,25 @@ INSERT INTO parent VALUES ('row one'), ('row two'); INSERT INTO child VALUES (1,'row one'), (2,'row two'); --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'parent' +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'child' +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 2 FROM parent; +--source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*) = 2 FROM child; --source include/wait_condition.inc + DELETE FROM parent; --connection node_1 +--let $wait_condition = SELECT COUNT(*) = 0 FROM parent; +--source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*) = 0 FROM child; --source include/wait_condition.inc -SELECT COUNT(*), COUNT(*) = 0 FROM parent; -SELECT COUNT(*), COUNT(*) = 0 FROM child; +SELECT * FROM parent; +SELECT * FROM child; DROP TABLE child; DROP TABLE parent; @@ -62,6 +71,12 @@ INSERT INTO parent VALUES (1); INSERT INTO child VALUES (1,0,1); --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'parent' +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'child' +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 1 FROM parent; +--source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*) = 1 FROM child; --source include/wait_condition.inc @@ -89,11 +104,13 @@ SET DEBUG_SYNC = "RESET"; --connection node_1 --reap - +--let $wait_condition = SELECT COUNT(*) = 0 FROM parent; +--source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*) = 0 FROM child; --source include/wait_condition.inc -SELECT COUNT(*), COUNT(*) = 0 FROM parent; -SELECT COUNT(*), COUNT(*) = 0 FROM child; + +SELECT * FROM parent; +SELECT * FROM child; DROP TABLE child; DROP TABLE parent; diff --git a/mysql-test/suite/galera/t/galera_fulltext.test b/mysql-test/suite/galera/t/galera_fulltext.test index a90cab1aa1a..19aa4f7a0a0 100644 --- a/mysql-test/suite/galera/t/galera_fulltext.test +++ b/mysql-test/suite/galera/t/galera_fulltext.test @@ -60,3 +60,26 @@ SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk'); DROP TABLE t1; DROP TABLE ten; +# +# MDEV-24978 : SIGABRT in __libc_message +# +--connection node_1 +SET @value=REPEAT (1,5001); +CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb; +INSERT IGNORE INTO t VALUES(@value); +SELECT COUNT(*) FROM t; + +--connection node_2 +SELECT COUNT(*) FROM t; + +--connection node_1 +DROP TABLE t; +CREATE TABLE t (a VARCHAR(5000)) engine=innodb; +INSERT IGNORE INTO t VALUES(@value); +SELECT COUNT(*) FROM t; + +--connection node_2 +SELECT COUNT(*) FROM t; + +--connection node_1 +DROP TABLE t; diff --git a/mysql-test/suite/galera/t/galera_gcache_recover.cnf b/mysql-test/suite/galera/t/galera_gcache_recover.cnf index c7b59b6a27e..34c757de77e 100644 --- a/mysql-test/suite/galera/t/galera_gcache_recover.cnf +++ b/mysql-test/suite/galera/t/galera_gcache_recover.cnf @@ -4,4 +4,4 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true' +wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes' diff --git a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test index 42f210170bc..f56d0e657bd 100644 --- a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test +++ b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test @@ -21,7 +21,8 @@ INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a'), (4, 'a'), (5, 'a'),(6, 'a'); # Disconnect node #2 --connection node_2 ---source suite/galera/include/galera_unload_provider.inc +SET SESSION wsrep_sync_wait=0; +--source suite/galera/include/galera_stop_replication.inc --connection node_1 UPDATE t1 SET f2 = 'b' WHERE f1 > 1; @@ -43,7 +44,6 @@ UPDATE t1 SET f2 = 'c' WHERE f1 > 2; # ... and restart provider to force IST --echo Loading wsrep_provider ... --disable_query_log ---eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig'; # Make sure IST will block ... --let $galera_sync_point = recv_IST_after_apply_trx --source include/galera_set_sync_point.inc diff --git a/mysql-test/suite/galera/t/galera_log_bin.inc b/mysql-test/suite/galera/t/galera_log_bin.inc new file mode 100644 index 00000000000..cc78367b510 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_log_bin.inc @@ -0,0 +1,46 @@ +--source include/galera_cluster.inc +--source include/force_restart.inc + +--connection node_1 +set global wsrep_on=OFF; +reset master; +set global wsrep_on=ON; +--connection node_2 +set global wsrep_on=OFF; +reset master; +set global wsrep_on=ON; + +# +# Test Galera with --log-bin --log-slave-updates . +# This way the actual MySQL binary log is used, +# rather than Galera's own implementation +# + +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); + +CREATE TABLE t2 (id INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1); +INSERT INTO t2 VALUES (1); + +--connection node_2 +SELECT COUNT(*) = 1 FROM t1; +SELECT COUNT(*) = 2 FROM t2; + +--connection node_1 +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +--let $MASTER_MYPORT=$NODE_MYPORT_1 +--source include/show_binlog_events.inc + +--connection node_2 +SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; +--let $MASTER_MYPORT=$NODE_MYPORT_2 +--source include/show_binlog_events.inc + +DROP TABLE t1; +DROP TABLE t2; + +--echo #cleanup +--connection node_1 +SET GLOBAL wsrep_on=OFF; +RESET MASTER; diff --git a/mysql-test/suite/galera/t/galera_log_bin.test b/mysql-test/suite/galera/t/galera_log_bin.test index cc78367b510..923bd623a8a 100644 --- a/mysql-test/suite/galera/t/galera_log_bin.test +++ b/mysql-test/suite/galera/t/galera_log_bin.test @@ -1,46 +1 @@ ---source include/galera_cluster.inc ---source include/force_restart.inc - ---connection node_1 -set global wsrep_on=OFF; -reset master; -set global wsrep_on=ON; ---connection node_2 -set global wsrep_on=OFF; -reset master; -set global wsrep_on=ON; - -# -# Test Galera with --log-bin --log-slave-updates . -# This way the actual MySQL binary log is used, -# rather than Galera's own implementation -# - -CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -INSERT INTO t1 VALUES (1); - -CREATE TABLE t2 (id INT) ENGINE=InnoDB; -INSERT INTO t2 VALUES (1); -INSERT INTO t2 VALUES (1); - ---connection node_2 -SELECT COUNT(*) = 1 FROM t1; -SELECT COUNT(*) = 2 FROM t2; - ---connection node_1 -ALTER TABLE t1 ADD COLUMN f2 INTEGER; ---let $MASTER_MYPORT=$NODE_MYPORT_1 ---source include/show_binlog_events.inc - ---connection node_2 -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ---let $MASTER_MYPORT=$NODE_MYPORT_2 ---source include/show_binlog_events.inc - -DROP TABLE t1; -DROP TABLE t2; - ---echo #cleanup ---connection node_1 -SET GLOBAL wsrep_on=OFF; -RESET MASTER; +--source galera_log_bin.inc diff --git a/mysql-test/suite/galera/t/galera_log_bin_opt-master.opt b/mysql-test/suite/galera/t/galera_log_bin_opt-master.opt new file mode 100644 index 00000000000..03fcb5d040d --- /dev/null +++ b/mysql-test/suite/galera/t/galera_log_bin_opt-master.opt @@ -0,0 +1 @@ +--log-slave-updates --log-bin diff --git a/mysql-test/suite/galera/t/galera_log_bin_opt.cnf b/mysql-test/suite/galera/t/galera_log_bin_opt.cnf new file mode 100644 index 00000000000..a09efd2e011 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_log_bin_opt.cnf @@ -0,0 +1,15 @@ +!include ../galera_2nodes.cnf + +[mysqld] +wsrep_sst_method=mariabackup +wsrep_sst_auth="root:" + +[mysqld.1] +wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' + +[mysqld.2] +wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' + +[sst] +transferfmt=@ENV.MTR_GALERA_TFMT +streamfmt=xbstream diff --git a/mysql-test/suite/galera/t/galera_log_bin_opt.test b/mysql-test/suite/galera/t/galera_log_bin_opt.test new file mode 100644 index 00000000000..f3d0afbc8bc --- /dev/null +++ b/mysql-test/suite/galera/t/galera_log_bin_opt.test @@ -0,0 +1,2 @@ +--source include/have_mariabackup.inc +--source galera_log_bin.inc diff --git a/mysql-test/suite/galera/t/galera_rsu_error.test b/mysql-test/suite/galera/t/galera_rsu_error.test index cad8154ac76..6de7607b6ec 100644 --- a/mysql-test/suite/galera/t/galera_rsu_error.test +++ b/mysql-test/suite/galera/t/galera_rsu_error.test @@ -9,6 +9,9 @@ CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; INSERT INTO t1 VALUES (1), (1); --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1'; +--source include/wait_condition.inc + SET SESSION wsrep_OSU_method = "RSU"; --error ER_DUP_ENTRY ALTER TABLE t1 ADD PRIMARY KEY (f1); diff --git a/mysql-test/suite/galera/t/galera_split_brain.test b/mysql-test/suite/galera/t/galera_split_brain.test index 91a2cc326a2..6a822b8f127 100644 --- a/mysql-test/suite/galera/t/galera_split_brain.test +++ b/mysql-test/suite/galera/t/galera_split_brain.test @@ -26,18 +26,13 @@ call mtr.add_suppression("WSREP: TO isolation failed for: "); CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; # Reset the master and restart the slave so that post-test checks can run - - --connection node_2 --source include/start_mysqld.inc ---sleep 5 --source include/wait_until_connected_again.inc --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' --source include/wait_condition.inc ---sleep 10 - --connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 --source include/wait_until_connected_again.inc @@ -46,4 +41,3 @@ CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; --source include/auto_increment_offset_restore.inc --source include/galera_end.inc - diff --git a/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf b/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf index 3fd1c650c05..2954ae0f4cb 100644 --- a/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf +++ b/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf @@ -1,7 +1,7 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem' +wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem' +wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem' diff --git a/mysql-test/suite/galera/t/galera_ssl_upgrade.test b/mysql-test/suite/galera/t/galera_ssl_upgrade.test index 2ce932b5398..146a0126f1f 100644 --- a/mysql-test/suite/galera/t/galera_ssl_upgrade.test +++ b/mysql-test/suite/galera/t/galera_ssl_upgrade.test @@ -6,15 +6,33 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/have_ssl_communication.inc + +call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown"); SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--connection node_1 +call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown.*"); +--connection node_2 +call mtr.add_suppression("WSREP: write_handler(): protocol is shutdown.*"); + +# Setup galera ports +--connection node_1 +--source suite/galera/include/galera_base_port.inc +--let $NODE_GALERAPORT_1 = $_NODE_GALERAPORT + +--connection node_2 +--source suite/galera/include/galera_base_port.inc +--let $NODE_GALERAPORT_2 = $_NODE_GALERAPORT + # 2. Restart node #1 with a socket.ssl_ca that includes both the new and the old certificate --connection node_1 --source include/shutdown_mysqld.inc ---let $start_mysqld_params = --wsrep-cluster-address=gcomm://127.0.0.1:$NODE_GALERAPORT_2 --wsrep_provider_options=base_port=$NODE_GALERAPORT_1;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera-upgrade-ca-cert.pem;socket.ssl_cert=$MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=$MYSQL_TEST_DIR/std_data/cakey.pem +--let $restart_noprint = 1 +--let $start_mysqld_params = --wsrep-cluster-address=gcomm://127.0.0.1:$NODE_GALERAPORT_2 --wsrep_provider_options=base_port=$NODE_GALERAPORT_1;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera-upgrade-ca-cert.pem;socket.ssl_cert=$MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=$MYSQL_TEST_DIR/std_data/galera-key.pem --source include/start_mysqld.inc --source include/wait_until_connected_again.inc diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_lost_found.test b/mysql-test/suite/galera/t/galera_sst_mariabackup_lost_found.test index d1c30656139..e8dcbd849d8 100644 --- a/mysql-test/suite/galera/t/galera_sst_mariabackup_lost_found.test +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_lost_found.test @@ -10,7 +10,7 @@ --connection node_2 #--connection node_2 -#--source suite/galera/include/galera_unload_provider.inc +#--source suite/galera/include/galera_stop_replication.inc --echo Shutting down server ... --source include/shutdown_mysqld.inc diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_sequential.test b/mysql-test/suite/galera/t/galera_toi_ddl_sequential.test index 51eae7005df..89a1af845c9 100644 --- a/mysql-test/suite/galera/t/galera_toi_ddl_sequential.test +++ b/mysql-test/suite/galera/t/galera_toi_ddl_sequential.test @@ -9,6 +9,9 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1'; +--source include/wait_condition.inc + ALTER TABLE t1 ADD COLUMN f2 INTEGER; INSERT INTO t1 VALUES (2, 3); diff --git a/mysql-test/suite/galera/t/galera_toi_lock_shared.test b/mysql-test/suite/galera/t/galera_toi_lock_shared.test index 6857a0e08ca..566bc721926 100644 --- a/mysql-test/suite/galera/t/galera_toi_lock_shared.test +++ b/mysql-test/suite/galera/t/galera_toi_lock_shared.test @@ -10,14 +10,25 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 1 FROM t1 +--source include/wait_condition.inc + ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=SHARED; --connection node_1 +--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; +--source include/wait_condition.inc INSERT INTO t1 VALUES (2, 2); -SELECT COUNT(*) = 2 FROM t1; +SELECT COUNT(*) AS EXPECT_2 FROM t1; +SELECT * FROM t1; --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 2 FROM t1 +--source include/wait_condition.inc INSERT INTO t1 VALUES (3, 3); -SELECT COUNT(*) = 3 FROM t1; +SELECT COUNT(*) AS EXPECT_3 FROM t1; +SELECT * FROM t1; DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_truncate.test b/mysql-test/suite/galera/t/galera_truncate.test index 79f9bad1f1b..0000b430e45 100644 --- a/mysql-test/suite/galera/t/galera_truncate.test +++ b/mysql-test/suite/galera/t/galera_truncate.test @@ -3,8 +3,7 @@ # --source include/galera_cluster.inc ---source include/have_innodb.inc - +--source include/have_perfschema.inc # # Simple case # @@ -14,6 +13,9 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; INSERT INTO t1 VALUES (1); --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1'; +--source include/wait_condition.inc + TRUNCATE TABLE t1; SELECT COUNT(*) = 0 FROM t1; @@ -29,6 +31,9 @@ CREATE TABLE t2 (f1 VARCHAR(255)) Engine=InnoDB; INSERT INTO t2 VALUES ('abc'); --connection node_1 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t2'; +--source include/wait_condition.inc + TRUNCATE TABLE t2; --connection node_2 @@ -51,6 +56,23 @@ TRUNCATE TABLE t4; --connection node_2 SELECT AUTO_INCREMENT = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME IN ('t3', 't4'); + +# +# MDEV-24865 : Server crashes when truncate mysql user table +# +--connection node_1 + +--error ER_NO_SUCH_TABLE +TRUNCATE TABLE mysql.user; +--error ER_WRONG_PERFSCHEMA_USAGE +TRUNCATE TABLE performance_schema.threads; +--error ER_DBACCESS_DENIED_ERROR +TRUNCATE TABLE information_schema.tables; +TRUNCATE TABLE mysql.innodb_index_stats; +--error ER_NO_SUCH_TABLE +TRUNCATE TABLE foo.bar; +TRUNCATE TABLE t1; + DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; diff --git a/mysql-test/suite/galera/t/galera_truncate_temporary.test b/mysql-test/suite/galera/t/galera_truncate_temporary.test index 3ad94eb9930..ea20911bd5d 100644 --- a/mysql-test/suite/galera/t/galera_truncate_temporary.test +++ b/mysql-test/suite/galera/t/galera_truncate_temporary.test @@ -67,6 +67,9 @@ CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t1 VALUES (2); --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1'; +--source include/wait_condition.inc + TRUNCATE TABLE t1; SELECT COUNT(*) = 0 FROM t1; diff --git a/mysql-test/suite/galera/t/galera_var_sst_auth.cnf b/mysql-test/suite/galera/t/galera_var_sst_auth.cnf index ff29db2306b..114815d446a 100644 --- a/mysql-test/suite/galera/t/galera_var_sst_auth.cnf +++ b/mysql-test/suite/galera/t/galera_var_sst_auth.cnf @@ -5,8 +5,3 @@ wsrep_sst_auth=root: [mysqld.2] wsrep_sst_auth=root: - - - - - diff --git a/mysql-test/suite/galera/t/galera_var_sst_auth.test b/mysql-test/suite/galera/t/galera_var_sst_auth.test index 5c9b3f5a61e..ebeaddc0e63 100644 --- a/mysql-test/suite/galera/t/galera_var_sst_auth.test +++ b/mysql-test/suite/galera/t/galera_var_sst_auth.test @@ -1,12 +1,39 @@ --source include/galera_cluster.inc --source include/have_innodb.inc ---echo # ---echo # MDEV-10492: Assertion failure on shutdown when wsrep_sst_auth set in config ---echo # +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc + +# +# MDEV-10492: Assertion failure on shutdown when wsrep_sst_auth set in config +# SELECT @@global.wsrep_sst_auth; SET @@global.wsrep_sst_auth='foo:bar'; SELECT @@global.wsrep_sst_auth; ---source include/galera_end.inc +# +# MDEV-24509 Warning: Memory not freed: 56 on SET @@global.wsrep_sst_auth +# +--connection node_2 +SET @@global.wsrep_sst_auth= 'abcdefghijklmnopqrstuvwxyz'; +SELECT @@global.wsrep_sst_auth; +--echo Shutdown node_2 +--source include/shutdown_mysqld.inc + +# On node_1, verify that the node has left the cluster. +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +# Restart node_2 +--connection node_2 +--source include/start_mysqld.inc +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +SELECT @@global.wsrep_sst_auth; + +# Restore original auto_increment_offset values. +--source include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test b/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test index 783b78792e6..10517f877ae 100644 --- a/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test +++ b/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test @@ -30,3 +30,138 @@ SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3; DROP TABLE t1; + +# +# Test that variable wsrep_on cannot be changed while in +# active transaction. +# + +--connection node_1 +START TRANSACTION; +--error ER_CANT_DO_THIS_DURING_AN_TRANSACTION +SET SESSION wsrep_on=OFF; +--error ER_CANT_DO_THIS_DURING_AN_TRANSACTION +SET GLOBAL wsrep_on=OFF; +COMMIT; + + +# +# Test that @@global.wsrep_on does not affect the value of +# @@session.wsrep_on of current sessions +# + +--connection node_1 +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +START TRANSACTION; +INSERT INTO t1 VALUES (1); + +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +--connection node_1a +SET GLOBAL wsrep_on = OFF; + +--connection node_1 +SHOW SESSION VARIABLES LIKE 'wsrep_on'; +SHOW GLOBAL VARIABLES LIKE 'wsrep_on'; +INSERT INTO t1 VALUES (2); +COMMIT; + +--connection node_2 +SET SESSION wsrep_sync_wait = 15; +SELECT * FROM t1; + +--connection node_1a +SET GLOBAL wsrep_on = ON; +DROP TABLE t1; + + +# +# New connections inherit @@session.wsrep_on from @@global.wsrep_on +# + +--connection node_1 +SET GLOBAL wsrep_on = OFF; + +--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; +--connection node_1b +SHOW SESSION VARIABLES LIKE 'wsrep_on'; +SHOW GLOBAL VARIABLES LIKE 'wsrep_on'; +CREATE TABLE t2 (f1 INTEGER); +DROP TABLE t2; + +SET GLOBAL wsrep_on = ON; +SHOW SESSION VARIABLES LIKE 'wsrep_on'; + +--disconnect node_1b + + +# +# Can't set @@session.wsrep_on = ON, while @@global.wsrep_on = OFF +# + +--connection node_1 +SET GLOBAL wsrep_on = OFF; +--error ER_WRONG_ARGUMENTS +SET SESSION wsrep_on = ON; + +SET GLOBAL wsrep_on = ON; +SET SESSION wsrep_on = ON; + + +# +# @@global.wsrep_on = OFF followed by @@global.wsrep_on = ON +# in a new connection +# + +--connection node_1 +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +SET GLOBAL wsrep_on = OFF; +--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; +--connection node_1b +SHOW SESSION VARIABLES LIKE 'wsrep_on'; +SHOW GLOBAL VARIABLES LIKE 'wsrep_on'; +SET GLOBAL wsrep_on = ON; +START TRANSACTION; +INSERT INTO t1 VALUES(1); +COMMIT; + +SELECT * FROM t1; + +--connection node_2 +SELECT * FROM t1; + +DROP TABLE t1; + + +# +# Test single statement, multi statement, and +# TOI tansactions while @@session.wsrep_on = OFF +# and then same @@global.wsrep_on = OFF. +# Notice, the combination @@global.wsrep_on = OFF +# and @@session.wsrep_on = ON is not not possible, +# (as tested above in this test case) +# + +--connection node_1 +SET SESSION wsrep_on = OFF; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +INSERT INTO t1 VALUES (1); +START TRANSACTION; +INSERT INTO t1 VALUES (2); +COMMIT; +DROP TABLE t1; +--connection node_2 +SHOW TABLES; +--connection node_1 +SET SESSION wsrep_on = ON; + +SET GLOBAL wsrep_on = OFF; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +INSERT INTO t1 VALUES (1); +START TRANSACTION; +INSERT INTO t1 VALUES (2); +COMMIT; +--connection node_2 +SHOW TABLES; +--connection node_1 +DROP TABLE t1; +SET GLOBAL wsrep_on = ON; diff --git a/mysql-test/suite/galera/t/galera_var_wsrep_provider_options.test b/mysql-test/suite/galera/t/galera_var_wsrep_provider_options.test new file mode 100644 index 00000000000..3dc2cbaa7d6 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_var_wsrep_provider_options.test @@ -0,0 +1,11 @@ +--source include/galera_cluster.inc + +call mtr.add_suppression("WSREP: Unknown parameter 'a'"); +call mtr.add_suppression("WSREP: Set options returned 7"); + +--error ER_WRONG_ARGUMENTS +SET GLOBAL wsrep_provider_options=NULL; +SET GLOBAL wsrep_provider_options=''; +SET GLOBAL wsrep_provider_options=' '; +--error ER_WRONG_ARGUMENTS +SET GLOBAL wsrep_provider_options='a=1'; diff --git a/mysql-test/suite/sys_vars/t/wsrep_start_position_basic.test b/mysql-test/suite/galera/t/galera_var_wsrep_start_position.test index 3e57cfa6da2..43fd09b902c 100644 --- a/mysql-test/suite/sys_vars/t/wsrep_start_position_basic.test +++ b/mysql-test/suite/galera/t/galera_var_wsrep_start_position.test @@ -1,12 +1,12 @@ ---source include/have_wsrep.inc +--source include/galera_cluster.inc --echo # --echo # wsrep_start_position --echo # ---echo # save the initial value -SET @wsrep_start_position_global_saved = @@global.wsrep_start_position; +CALL mtr.add_suppression("WSREP: SST failed for position .*"); +SET @wsrep_start_position_global_saved = @@global.wsrep_start_position; --echo # default SELECT @@global.wsrep_start_position; @@ -14,40 +14,60 @@ SELECT @@global.wsrep_start_position; --echo # scope --error ER_INCORRECT_GLOBAL_LOCAL_VAR SELECT @@session.wsrep_start_position; -SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-1'; SELECT @@global.wsrep_start_position; --echo --echo # valid values -SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-2'; -SELECT @@global.wsrep_start_position; -SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:100'; -SELECT @@global.wsrep_start_position; -SET @@global.wsrep_start_position=default; +SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-1'; SELECT @@global.wsrep_start_position; --echo +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:0'; +SELECT @@global.wsrep_start_position; --echo # invalid values --error ER_WRONG_VALUE_FOR_VAR +SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:100'; +SELECT @@global.wsrep_start_position; +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-2'; +SELECT @@global.wsrep_start_position; +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-2A'; +SELECT @@global.wsrep_start_position; +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:0A'; +SELECT @@global.wsrep_start_position; +--error ER_WRONG_VALUE_FOR_VAR SET @@global.wsrep_start_position='000000000000000-0000-0000-0000-000000000000:-1'; +SELECT @@global.wsrep_start_position; --error ER_WRONG_VALUE_FOR_VAR SET @@global.wsrep_start_position='12345678-1234-1234-12345-123456789012:100'; +SELECT @@global.wsrep_start_position; --error ER_WRONG_VALUE_FOR_VAR SET @@global.wsrep_start_position='12345678-1234-123-12345-123456789012:0'; +SELECT @@global.wsrep_start_position; --error ER_WRONG_VALUE_FOR_VAR SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:_99999'; +SELECT @@global.wsrep_start_position; --error ER_WRONG_VALUE_FOR_VAR SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:a'; +SELECT @@global.wsrep_start_position; --error ER_WRONG_VALUE_FOR_VAR SET @@global.wsrep_start_position='OFF'; +SELECT @@global.wsrep_start_position; --error ER_WRONG_VALUE_FOR_VAR SET @@global.wsrep_start_position=ON; +SELECT @@global.wsrep_start_position; --error ER_WRONG_VALUE_FOR_VAR SET @@global.wsrep_start_position=''; +SELECT @@global.wsrep_start_position; --error ER_WRONG_VALUE_FOR_VAR SET @@global.wsrep_start_position=NULL; +SELECT @@global.wsrep_start_position; --error ER_WRONG_VALUE_FOR_VAR SET @@global.wsrep_start_position='junk'; +SELECT @@global.wsrep_start_position; --echo --echo # restore the initial value diff --git a/mysql-test/suite/galera/t/galera_virtual_blob.test b/mysql-test/suite/galera/t/galera_virtual_blob.test new file mode 100644 index 00000000000..a10e3025668 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_virtual_blob.test @@ -0,0 +1,10 @@ +--source include/galera_cluster.inc + +CREATE TABLE t (f INT GENERATED ALWAYS AS (a+b)VIRTUAL,a INT,b INT,h BLOB); +INSERT INTO t (a,b)VALUES(0,0), (0,0), (0,0), (0,0), (0,0); +SELECT * from t; + +--connection node_2 +SELECT * from t; +--connection node_1 +DROP TABLE t; diff --git a/mysql-test/suite/galera/t/galera_virtual_column.test b/mysql-test/suite/galera/t/galera_virtual_column.test new file mode 100644 index 00000000000..84e1da024f1 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_virtual_column.test @@ -0,0 +1,42 @@ +# +# This test is for testing virtual columnm support in galera cluster +# +--source include/galera_cluster.inc +--source include/have_innodb.inc + +# +# test case for verifying that cascaded delete in a table with virtual column does not crash slave node +# + +--connection node_1 + +CREATE TABLE p (id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT) ENGINE = InnoDB; +CREATE TABLE c (id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, pid INT UNSIGNED, bitmap TINYINT UNSIGNED NOT NULL DEFAULT 0, bitmap5 TINYINT UNSIGNED GENERATED ALWAYS AS (bitmap&(1<<5)) VIRTUAL, FOREIGN KEY (pid) REFERENCES p (id) ON DELETE CASCADE ON UPDATE CASCADE); + +# not sure of this index is needed for the test +CREATE INDEX bitmap5 ON c(bitmap5) USING BTREE; + +INSERT INTO p VALUES(1); +INSERT INTO c(pid) VALUES(1); + + +--connection node_2 +# wait until both INSERTS have arrived in node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM c +--source include/wait_condition.inc + +--connection node_1 +# delete from parent table, it will cascade into child table +# node_2 might have problem in applying this cascaded delete +DELETE FROM p WHERE id=1; + +SELECT * FROM p; +SELECT * FROM c; + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 0 FROM c; +--source include/wait_condition.inc + +--connection node_1 +DROP TABLE c; +DROP TABLE p; diff --git a/mysql-test/suite/galera/t/lp1376747-4.test b/mysql-test/suite/galera/t/lp1376747-4.test index 7cf922b97e5..d19ff422ab0 100644 --- a/mysql-test/suite/galera/t/lp1376747-4.test +++ b/mysql-test/suite/galera/t/lp1376747-4.test @@ -5,7 +5,8 @@ # after provider is unpaused # --source include/galera_cluster.inc ---source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc --let $galera_connection_name = node_2a --let $galera_server_number = 2 @@ -17,7 +18,7 @@ INSERT INTO t1 VALUES (1); --connection node_2 SET session wsrep_sync_wait=0; -FLUSH TABLE WITH READ LOCK; +FLUSH TABLES WITH READ LOCK; --connection node_1 ALTER TABLE t1 ADD COLUMN f2 INTEGER; @@ -25,32 +26,33 @@ INSERT INTO t1 VALUES (2,3); --connection node_2a SET session wsrep_sync_wait=0; - ---echo # node_1 DDL should not yet be applied SHOW CREATE TABLE t1; - +SET debug_sync='flush_tables_with_read_lock_after_acquire_locks SIGNAL parked2 WAIT_FOR go2'; --send FLUSH TABLES t1 WITH READ LOCK; --connection node_2 ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%committed%'; ---source include/wait_condition.inc - +SET debug_sync='now WAIT_FOR parked2'; + +# let the flush table wait in pause state before we unlock +# table otherwise there is window where-in flush table is +# yet to wait in pause and unlock allows alter table to proceed. +# this is because send is asynchronous. +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE Info LIKE 'FLUSH TABLES t1 WITH READ LOCK'; +--let $wait_condition_on_error_output = SHOW PROCESSLIST +--source include/wait_condition_with_debug.inc + +SET debug_sync='now SIGNAL go2'; +# this will release existing lock but will not resume +# the cluster as there is new FTRL that is still pausing it. UNLOCK TABLES; - ---echo # node_1 DDL should not yet be applied 2 SHOW CREATE TABLE t1; +set debug_sync= 'RESET'; --connection node_2a --reap UNLOCK TABLES; ---let $wait_condition = SELECT COUNT(*) = 2 FROM t1; ---source include/wait_condition.inc - ---let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 't1'; ---source include/wait_condition.inc - ---echo # node_1 DDL should be applied 2 +SET SESSION wsrep_sync_wait = DEFAULT; SHOW CREATE TABLE t1; SELECT * from t1; diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def index 0e2706f2dc3..87eca207d5a 100644 --- a/mysql-test/suite/galera_3nodes/disabled.def +++ b/mysql-test/suite/galera_3nodes/disabled.def @@ -10,7 +10,16 @@ # ############################################################################## +GAL-501 : MDEV-24645 galera_3nodes.GAL-501 MTR failed: failed to open gcomm backend connection: 110 galera_gtid_2_cluster : MDEV-23775 Galera test failure on galera_3nodes.galera_gtid_2_cluster +galera_ipv6_mariabackup : MDEV-24440: galera_3nodes.galera_ipv6_mariabackup MTR fails sporadically: Failed to read from: wsrep_sst_mariabackup --role 'donor' --address '[::1]:16028/xtrabackup_sst//1' +galera_ipv6_mariabackup_section : MDEV-22195: galera_3nodes.galera_ipv6_mariabackup_section MTR failed: assert_grep.inc failed +galera_ipv6_mysqldump : MDEV-24036: galera_3nodes.galera_ipv6_mysqldump: rare random crashes during shutdown +galera_ipv6_rsync_section : MDEV-23580: galera_3nodes.galera_ipv6_rsync_section MTR failed: WSREP_SST: [ERROR] rsync daemon port '16008' has been taken galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0,t=1,ut=255,o=4,s=0,sr=0,as=1,f=6,src=50524cfe,srcvid=view_id(REG,50524cfe,4),insvid=view_id(UNKNOWN,00000000,0),ru=00000000,r=[-1,-1],fs=75,nl=(} -galera_slave_options_do :MDEV-8798 +galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query +galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query +galera_pc_bootstrap : MDEV-24650 galera_pc_bootstrap MTR failed: Could not execute 'check-testcase' before testcase +galera_safe_to_bootstrap : MDEV-24097 galera_3nodes.galera_safe_to_bootstrap MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed +galera_slave_options_do : MDEV-8798 galera_slave_options_ignore : MDEV-8798 diff --git a/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result b/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result new file mode 100644 index 00000000000..87898891f9b --- /dev/null +++ b/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result @@ -0,0 +1,89 @@ +connection node_2; +connection node_1; +connect node_5, 127.0.0.1, root, , test, $NODE_MYPORT_5; +connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4; +connection node_4; +CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_use_gtid=current_pos;; +START SLAVE; +include/wait_for_slave_to_start.inc +connection node_1; +CREATE TABLE t1(c1 INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INTEGER); +INSERT INTO t1(c2) VALUES(1); +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +connection node_3; +SELECT COUNT(*) = 1 FROM t1; +COUNT(*) = 1 +1 +connection node_1; +include/save_master_gtid.inc +connection node_4; +include/sync_with_master_gtid.inc +SELECT COUNT(*) = 1 FROM t1; +COUNT(*) = 1 +1 +connect node_6, 127.0.0.1, root, , test, $NODE_MYPORT_6; +connection node_6; +SELECT COUNT(*) = 1 FROM t1; +COUNT(*) = 1 +1 +connection node_2; +ALTER TABLE t1 ADD COLUMN t3 INTEGER; +Node 2 column number AFTER ALTER +SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1'; +COUNT(*) = 3 +1 +connection node_3; +Node 3 column number AFTER ALTER +SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1'; +COUNT(*) = 3 +1 +connection node_1; +include/save_master_gtid.inc +connection node_4; +include/sync_with_master_gtid.inc +Node 4 column number AFTER ALTER +SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1'; +COUNT(*) = 3 +1 +connection node_6; +Node 6 column number AFTER ALTER +SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1'; +COUNT(*) = 3 +1 +connection node_2; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +connection node_1; +connection node_4; +connection node_6; +connection node_1; +DROP TABLE t1; +connection node_4; +STOP SLAVE; +RESET SLAVE; +SET GLOBAL wsrep_on = OFF; +RESET MASTER; +SET GLOBAL wsrep_on = ON; +SET GLOBAL GTID_SLAVE_POS=""; +connection node_1; +SET GLOBAL wsrep_on = OFF; +RESET MASTER; +SET GLOBAL wsrep_on = ON; +connection node_2; +SET GLOBAL wsrep_on = OFF; +RESET MASTER; +SET GLOBAL wsrep_on = ON; +connection node_3; +SET GLOBAL wsrep_on = OFF; +RESET MASTER; +SET GLOBAL wsrep_on = ON; +connection node_5; +SET GLOBAL wsrep_on = OFF; +RESET MASTER; +SET GLOBAL wsrep_on = ON; +connection node_6; +SET GLOBAL wsrep_on = OFF; +RESET MASTER; +SET GLOBAL wsrep_on = ON; diff --git a/mysql-test/suite/galera_3nodes/r/galera_ssl_reload.result b/mysql-test/suite/galera_3nodes/r/galera_ssl_reload.result new file mode 100644 index 00000000000..541822797b7 --- /dev/null +++ b/mysql-test/suite/galera_3nodes/r/galera_ssl_reload.result @@ -0,0 +1,15 @@ +connection node_2; +connection node_1; +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +connection node_1; +connection node_2; +connection node_3; +connection node_1; +connection node_2; +connection node_2; +# restart: with restart_parameters +SET GLOBAL wsrep_provider_options = 'socket.ssl_reload=1'; +connection node_3; +# restart: with restart_parameters +connection node_2; +FLUSH SSL; diff --git a/mysql-test/suite/galera_3nodes/r/galera_wsrep_schema_init.result b/mysql-test/suite/galera_3nodes/r/galera_wsrep_schema_init.result new file mode 100644 index 00000000000..2a29afd62be --- /dev/null +++ b/mysql-test/suite/galera_3nodes/r/galera_wsrep_schema_init.result @@ -0,0 +1,94 @@ +connection node_2; +connection node_1; +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +connection node_1; +connection node_1; +connection node_2; +connection node_3; +SHOW CREATE TABLE mysql.wsrep_cluster; +Table Create Table +wsrep_cluster CREATE TABLE `wsrep_cluster` ( + `cluster_uuid` char(36) NOT NULL, + `view_id` bigint(20) NOT NULL, + `view_seqno` bigint(20) NOT NULL, + `protocol_version` int(11) NOT NULL, + `capabilities` int(11) NOT NULL, + PRIMARY KEY (`cluster_uuid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SHOW CREATE TABLE mysql.wsrep_cluster_members; +Table Create Table +wsrep_cluster_members CREATE TABLE `wsrep_cluster_members` ( + `node_uuid` char(36) NOT NULL, + `cluster_uuid` char(36) NOT NULL, + `node_name` char(32) NOT NULL, + `node_incoming_address` varchar(256) NOT NULL, + PRIMARY KEY (`node_uuid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT @@sql_safe_updates; +@@sql_safe_updates +1 +SELECT COUNT(*) = 1 FROM mysql.wsrep_cluster; +COUNT(*) = 1 +1 +SELECT cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_state_uuid') FROM mysql.wsrep_cluster; +cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_state_uuid') +1 +SELECT COUNT(*) = 3 FROM mysql.wsrep_cluster_members; +COUNT(*) = 3 +1 +SELECT COUNT(*) = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size') FROM mysql.wsrep_cluster_members; +COUNT(*) = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size') +1 +SELECT COUNT(*) = 1 FROM mysql.wsrep_cluster_members WHERE node_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_gcomm_uuid'); +COUNT(*) = 1 +1 +SELECT node_incoming_address LIKE '127.0.0.1:%' from mysql.wsrep_cluster_members; +node_incoming_address LIKE '127.0.0.1:%' +1 +1 +1 +SELECT cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_state_uuid') FROM mysql.wsrep_cluster_members; +cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_state_uuid') +1 +1 +1 +connection node_2; +SELECT COUNT(*) = 3 FROM mysql.wsrep_cluster_members; +COUNT(*) = 3 +1 +SELECT COUNT(*) = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size') FROM mysql.wsrep_cluster_members; +COUNT(*) = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size') +1 +SELECT COUNT(*) = 1 FROM mysql.wsrep_cluster_members WHERE node_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_gcomm_uuid'); +COUNT(*) = 1 +1 +SELECT node_incoming_address LIKE '127.0.0.1:%' from mysql.wsrep_cluster_members; +node_incoming_address LIKE '127.0.0.1:%' +1 +1 +1 +SELECT cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_state_uuid') FROM mysql.wsrep_cluster_members; +cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_state_uuid') +1 +1 +1 +connection node_3; +SELECT COUNT(*) = 3 FROM mysql.wsrep_cluster_members; +COUNT(*) = 3 +1 +SELECT COUNT(*) = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size') FROM mysql.wsrep_cluster_members; +COUNT(*) = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size') +1 +SELECT COUNT(*) = 1 FROM mysql.wsrep_cluster_members WHERE node_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_gcomm_uuid'); +COUNT(*) = 1 +1 +SELECT node_incoming_address LIKE '127.0.0.1:%' from mysql.wsrep_cluster_members; +node_incoming_address LIKE '127.0.0.1:%' +1 +1 +1 +SELECT cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_state_uuid') FROM mysql.wsrep_cluster_members; +cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_state_uuid') +1 +1 +1 diff --git a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.cnf b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.cnf new file mode 100644 index 00000000000..3889a4f4fdd --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.cnf @@ -0,0 +1,25 @@ +!include ../galera_2x3nodes.cnf + +[mysqld.1] +wsrep_gtid_domain_id=1 +server-id=11 + +[mysqld.2] +wsrep_gtid_domain_id=1 +server-id=12 + +[mysqld.3] +wsrep_gtid_domain_id=1 +server-id=13 + +[mysqld.4] +wsrep_gtid_domain_id=2 +server-id=21 + +[mysqld.5] +wsrep_gtid_domain_id=2 +server-id=22 + +[mysqld.6] +wsrep_gtid_domain_id=2 +server-id=23
\ No newline at end of file diff --git a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test new file mode 100644 index 00000000000..8a9a74a7252 --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test @@ -0,0 +1,148 @@ +# +# This test creates 2x3 nodes galera cluster. +# +# A(1) <-> B(2) <-> C(3) {Galera cluster 1} +# | {Circular Async replication} +# D(4) <-> E(5) <-> F(6) {Galera cluster 2} +# + +--source include/big_test.inc +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--connect node_5, 127.0.0.1, root, , test, $NODE_MYPORT_5 + +--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4 +--connection node_4 + +--replace_result $NODE_MYPORT_1 NODE_MYPORT_1 +--eval CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_1, master_use_gtid=current_pos; +START SLAVE; +--source include/wait_for_slave_to_start.inc + +# +# CREATE TABLE & INSERT +# + +--connection node_1 + +CREATE TABLE t1(c1 INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INTEGER); +INSERT INTO t1(c2) VALUES(1); + +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 +--connection node_3 + +SELECT COUNT(*) = 1 FROM t1; + +--connection node_1 +--source include/save_master_gtid.inc + +--connection node_4 +--source include/sync_with_master_gtid.inc + +SELECT COUNT(*) = 1 FROM t1; + +--connect node_6, 127.0.0.1, root, , test, $NODE_MYPORT_6 +--connection node_6 + +SELECT COUNT(*) = 1 FROM t1; + +# +# ALTER TABLE +# + +--connection node_2 + +ALTER TABLE t1 ADD COLUMN t3 INTEGER; +--echo Node 2 column number AFTER ALTER +SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1'; + +--connection node_3 + +--echo Node 3 column number AFTER ALTER +SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1'; + +--connection node_1 +--source include/save_master_gtid.inc + +--connection node_4 +--source include/sync_with_master_gtid.inc + +--echo Node 4 column number AFTER ALTER +SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1'; + +--connection node_6 + +--echo Node 6 column number AFTER ALTER +SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1'; + +# +# OPTIMIZE TABLE +# + +--connection node_2 + +--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` +OPTIMIZE TABLE t1; + +--connection node_1 + +--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--source include/wait_condition.inc + +--connection node_4 + +--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--source include/wait_condition.inc + +--connection node_6 + +--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--source include/wait_condition.inc + +# +# Cleanup +# + +--connection node_1 + +DROP TABLE t1; + +--connection node_4 + +STOP SLAVE; +RESET SLAVE; +SET GLOBAL wsrep_on = OFF; +RESET MASTER; +SET GLOBAL wsrep_on = ON; +SET GLOBAL GTID_SLAVE_POS=""; + +--connection node_1 + +SET GLOBAL wsrep_on = OFF; +RESET MASTER; +SET GLOBAL wsrep_on = ON; + +--connection node_2 + +SET GLOBAL wsrep_on = OFF; +RESET MASTER; +SET GLOBAL wsrep_on = ON; + +--connection node_3 + +SET GLOBAL wsrep_on = OFF; +RESET MASTER; +SET GLOBAL wsrep_on = ON; + +--connection node_5 + +SET GLOBAL wsrep_on = OFF; +RESET MASTER; +SET GLOBAL wsrep_on = ON; + +--connection node_6 + +SET GLOBAL wsrep_on = OFF; +RESET MASTER; +SET GLOBAL wsrep_on = ON; diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test index f5dd1aeb06d..2f8bf07b5b5 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test @@ -37,7 +37,7 @@ SET GLOBAL wsrep_sst_method = 'mysqldump'; # #--connection node_2 -#--source suite/galera/include/galera_unload_provider.inc +#--source suite/galera/include/galera_stop_replication.inc --echo Shutting down server ... --source include/shutdown_mysqld.inc @@ -63,7 +63,7 @@ INSERT INTO t1 VALUES (1); let $restart_noprint=2; --source include/start_mysqld.inc -#--source suite/galera/include/galera_load_provider.inc +#--source suite/galera/include/galera_start_replication.inc --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' --source include/wait_condition.inc diff --git a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test index 69e80ee6c3d..b77a810f37d 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test +++ b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test @@ -29,10 +29,10 @@ INSERT INTO t1 VALUES (01), (02), (03), (04), (05); # Disconnect nodes #2 and #3 --connection node_2 ---source suite/galera/include/galera_unload_provider.inc +--source suite/galera/include/galera_stop_replication.inc --connection node_3 ---source suite/galera/include/galera_unload_provider.inc +--source suite/galera/include/galera_stop_replication.inc --connection node_1 --source include/wait_until_connected_again.inc diff --git a/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.cnf b/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.cnf new file mode 100644 index 00000000000..65d1599268d --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.cnf @@ -0,0 +1,10 @@ +!include ../galera_3nodes.cnf + +[mysqld.1] +wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_ca=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.root.crt;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.1.crt;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.1.key' + +[mysqld.2] +wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_ca=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.root.crt;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.1.crt;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.1.key' + +[mysqld.3] +wsrep_provider_options='base_port=@mysqld.3.#galera_port;socket.ssl=yes;socket.ssl_ca=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.root.crt;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.1.crt;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera_certs/galera.1.key' diff --git a/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.test b/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.test new file mode 100644 index 00000000000..0c22a58b3e9 --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.test @@ -0,0 +1,67 @@ +# +# Test reloading of Galera SSL certificate without shutting down node +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 + +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--let $node_3=node_3 +--source ../galera/include/auto_increment_offset_save.inc + +# Setup galera ports +--connection node_1 +--source suite/galera/include/galera_base_port.inc +--let $NODE_GALERAPORT_1 = $_NODE_GALERAPORT + +--connection node_2 +--source suite/galera/include/galera_base_port.inc +--let $NODE_GALERAPORT_2 = $_NODE_GALERAPORT + +# Setup temporary file for SSL reloading +let $ssl_cert = $MYSQLTEST_VARDIR/tmp/ssl_cert.pem; +let $ssl_key = $MYSQLTEST_VARDIR/tmp/ssl_key.pem; +let $ssl_ca = $MYSQLTEST_VARDIR/tmp/ssl_ca.pem; + +copy_file std_data/galera_certs/galera.root.crt $ssl_ca; +copy_file std_data/galera_certs/galera.1.crt $ssl_cert; +copy_file std_data/galera_certs/galera.1.key $ssl_key; + +--connection node_2 +--source include/shutdown_mysqld.inc +--let $restart_noprint=1 +--let $restart_parameters = --wsrep_cluster_address=gcomm://127.0.0.1:$NODE_GALERAPORT_1 --wsrep_provider_options=base_port=$NODE_GALERAPORT_2;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera_certs/galera.root.crt;socket.ssl_cert=$MYSQLTEST_VARDIR/tmp/ssl_cert.pem;socket.ssl_key=$MYSQLTEST_VARDIR/tmp/ssl_key.pem +--source include/start_mysqld.inc +--source include/galera_wait_ready.inc + +# Set certificate and key and reload by setting directly `wsrep_provider_options` +remove_file $ssl_cert; +remove_file $ssl_key; +copy_file std_data/galera_certs/galera.2.crt $ssl_cert; +copy_file std_data/galera_certs/galera.2.key $ssl_key; +SET GLOBAL wsrep_provider_options = 'socket.ssl_reload=1'; + +--connection node_3 +--source include/shutdown_mysqld.inc +--let $restart_parameters = --wsrep_cluster_address=gcomm://127.0.0.1:$NODE_GALERAPORT_2 +--source include/start_mysqld.inc + +# Set certificate and key and reload by executing `FLUSH SSL` +--connection node_2 +remove_file $ssl_cert; +remove_file $ssl_key; +copy_file std_data/galera_certs/galera.1.crt $ssl_cert; +copy_file std_data/galera_certs/galera.1.key $ssl_key; +FLUSH SSL; + +# Cleanup +remove_file $ssl_ca; +remove_file $ssl_cert; +remove_file $ssl_key; + +# Restore original auto_increment_offset values. +--source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema_init.cnf b/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema_init.cnf new file mode 100644 index 00000000000..317094cea72 --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema_init.cnf @@ -0,0 +1,5 @@ +!include ../galera_3nodes.cnf + +[mysqld] +sql-safe-updates=1 +wsrep-debug=1 diff --git a/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema_init.test b/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema_init.test new file mode 100644 index 00000000000..7d8089a8ceb --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema_init.test @@ -0,0 +1,58 @@ +# +# This test performs basic checks on the contents of the wsrep_schema +# +# wsrep_members_history checks are temporarily disabled until it +# can be made configurable. +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 +--connection node_1 +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--let $node_3=node_3 +--source ../galera/include/auto_increment_offset_save.inc + +# Make the test fail if table structure has changed + +SHOW CREATE TABLE mysql.wsrep_cluster; +SHOW CREATE TABLE mysql.wsrep_cluster_members; +#disabled SHOW CREATE TABLE mysql.wsrep_member_history; +SELECT @@sql_safe_updates; + +# Checks for the wsrep_cluster table + +SELECT COUNT(*) = 1 FROM mysql.wsrep_cluster; +SELECT cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_state_uuid') FROM mysql.wsrep_cluster; + +# Checks for the wsrep_cluster_members table + +SELECT COUNT(*) = 3 FROM mysql.wsrep_cluster_members; +SELECT COUNT(*) = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size') FROM mysql.wsrep_cluster_members; +SELECT COUNT(*) = 1 FROM mysql.wsrep_cluster_members WHERE node_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_gcomm_uuid'); + +SELECT node_incoming_address LIKE '127.0.0.1:%' from mysql.wsrep_cluster_members; +SELECT cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_state_uuid') FROM mysql.wsrep_cluster_members; + +--connection node_2 + +SELECT COUNT(*) = 3 FROM mysql.wsrep_cluster_members; +SELECT COUNT(*) = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size') FROM mysql.wsrep_cluster_members; +SELECT COUNT(*) = 1 FROM mysql.wsrep_cluster_members WHERE node_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_gcomm_uuid'); + +SELECT node_incoming_address LIKE '127.0.0.1:%' from mysql.wsrep_cluster_members; +SELECT cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_state_uuid') FROM mysql.wsrep_cluster_members; + +--connection node_3 +SELECT COUNT(*) = 3 FROM mysql.wsrep_cluster_members; +SELECT COUNT(*) = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size') FROM mysql.wsrep_cluster_members; +SELECT COUNT(*) = 1 FROM mysql.wsrep_cluster_members WHERE node_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_gcomm_uuid'); + +SELECT node_incoming_address LIKE '127.0.0.1:%' from mysql.wsrep_cluster_members; +SELECT cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_state_uuid') FROM mysql.wsrep_cluster_members; + +--source ../galera/include/auto_increment_offset_restore.inc + diff --git a/mysql-test/suite/galera_sr/disabled.def b/mysql-test/suite/galera_sr/disabled.def index c0e5857d6bc..d52ee32f610 100644 --- a/mysql-test/suite/galera_sr/disabled.def +++ b/mysql-test/suite/galera_sr/disabled.def @@ -11,5 +11,4 @@ ############################################################################## GCF-1060 : MDEV-20848 galera_sr.GCF_1060 -galera-features#56 : MDEV-18542 galera_sr.galera-features#56 - +galera-features#56 : MDEV-24896 diff --git a/mysql-test/suite/galera_sr/r/MDEV-25226.result b/mysql-test/suite/galera_sr/r/MDEV-25226.result new file mode 100644 index 00000000000..4699023562d --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-25226.result @@ -0,0 +1,24 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES(1); +SET SESSION wsrep_on=OFF; +ERROR 25000: You are not allowed to execute this command in a transaction +SET GLOBAL wsrep_on=OFF; +ERROR 25000: You are not allowed to execute this command in a transaction +INSERT INTO t1 VALUES(2); +COMMIT; +connection node_1; +SELECT * FROM t1; +f1 +1 +2 +connection node_2; +SELECT * FROM t1; +f1 +1 +2 +connection node_1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera-features#56.result b/mysql-test/suite/galera_sr/r/galera-features#56.result index a4264739cbf..15fcb475acb 100644 --- a/mysql-test/suite/galera_sr/r/galera-features#56.result +++ b/mysql-test/suite/galera_sr/r/galera-features#56.result @@ -18,21 +18,21 @@ set session wsrep_sync_wait=0; SET GLOBAL wsrep_slave_threads = 4; SET SESSION wsrep_trx_fragment_size = 1; connection node_1; -INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;; +INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;; connection node_1a; -INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;; +INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;; connection node_2; -INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;; +INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;; connection node_1; connection node_1a; connection node_2; set session wsrep_sync_wait=15; SELECT COUNT(*) FROM t1; COUNT(*) -30000 +300 SELECT COUNT(DISTINCT f1) FROM t1; COUNT(DISTINCT f1) -30000 +300 connection default; DROP TABLE t1; DROP TABLE ten; diff --git a/mysql-test/suite/galera_sr/t/GCF-900.test b/mysql-test/suite/galera_sr/t/GCF-900.test index 3f1b53630b6..b44423c5013 100644 --- a/mysql-test/suite/galera_sr/t/GCF-900.test +++ b/mysql-test/suite/galera_sr/t/GCF-900.test @@ -15,6 +15,9 @@ START TRANSACTION; INSERT INTO t1 VALUES (2, 0); --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1'; +--source include/wait_condition.inc + ALTER TABLE t1 DROP COLUMN f2; --connection node_1 diff --git a/mysql-test/suite/galera_sr/t/MDEV-25226.test b/mysql-test/suite/galera_sr/t/MDEV-25226.test new file mode 100644 index 00000000000..3d19a0b9675 --- /dev/null +++ b/mysql-test/suite/galera_sr/t/MDEV-25226.test @@ -0,0 +1,33 @@ +# +# MDEV-25226 - Test the case the where wsrep_on is set OFF +# on a transaction that has already replicated a fragment. +# +# This would cause: Assertion `transaction_.active() == false || +# (transaction_.state() == wsrep::transaction::s_executing || +# transaction_.state() == wsrep::transaction::s_prepared || +# transaction_.state() == wsrep::transaction::s_aborted || +# transaction_.state() == wsrep::transaction::s_must_abort)' +# + +--source include/galera_cluster.inc + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); + +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES(1); +--error ER_CANT_DO_THIS_DURING_AN_TRANSACTION +SET SESSION wsrep_on=OFF; +--error ER_CANT_DO_THIS_DURING_AN_TRANSACTION +SET GLOBAL wsrep_on=OFF; +INSERT INTO t1 VALUES(2); +COMMIT; + +--connection node_1 +SELECT * FROM t1; + +--connection node_2 +SELECT * FROM t1; + +--connection node_1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/t/galera-features#56.test b/mysql-test/suite/galera_sr/t/galera-features#56.test index 4d46a3bf853..ac73c2efe3d 100644 --- a/mysql-test/suite/galera_sr/t/galera-features#56.test +++ b/mysql-test/suite/galera_sr/t/galera-features#56.test @@ -3,8 +3,6 @@ ## --source include/galera_cluster.inc ---source include/have_innodb.inc ---source include/big_test.inc # Create a second connection to node1 so that we can run transactions concurrently --let $galera_connection_name = node_1a @@ -19,7 +17,6 @@ INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB; SET SESSION wsrep_trx_fragment_size = 1; - --connection node_2 set session wsrep_sync_wait=15; SELECT COUNT(*) from ten; @@ -35,13 +32,13 @@ SET GLOBAL wsrep_slave_threads = 4; SET SESSION wsrep_trx_fragment_size = 1; --connection node_1 ---send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; +--send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2; --connection node_1a ---send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; +--send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2; --connection node_2 ---send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; +--send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2; --connection node_1 --reap diff --git a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc index 28c854c44f4..f4350d25ae9 100644 --- a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc +++ b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc @@ -343,11 +343,12 @@ DELETE FROM t1 WHERE c=1; DROP TABLE t1; } ---error ER_PARSE_ERROR CREATE TABLE t1 (c CHAR(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ("foo bar")); +SHOW CREATE TABLE t1; +DROP TABLE t1; CREATE TABLE t1 (i INT); ---error ER_PARSE_ERROR ALTER TABLE t1 ADD COLUMN c CHAR(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ("foo bar"); +SHOW CREATE TABLE t1; DROP TABLE t1; --error ER_PARSE_ERROR CREATE TABLE t1 (i INT COLLATE utf8_bin, c INT COLLATE utf8_bin GENERATED ALWAYS AS (10)); diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result index a98652248f8..6da3f3c14d3 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result @@ -426,10 +426,20 @@ INSERT INTO t1(a) VALUES(0); DELETE FROM t1 WHERE c=1; DROP TABLE t1; CREATE TABLE t1 (c CHAR(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ("foo bar")); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GENERATED ALWAYS AS ("foo bar"))' at line 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ('foo bar') VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; CREATE TABLE t1 (i INT); ALTER TABLE t1 ADD COLUMN c CHAR(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ("foo bar"); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GENERATED ALWAYS AS ("foo bar")' at line 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) DEFAULT NULL, + `c` char(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ('foo bar') VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (i INT COLLATE utf8_bin, c INT COLLATE utf8_bin GENERATED ALWAYS AS (10)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GENERATED ALWAYS AS (10))' at line 1 diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result index 82a879be3f7..0d7aaeab1fa 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result @@ -426,10 +426,20 @@ INSERT INTO t1(a) VALUES(0); DELETE FROM t1 WHERE c=1; DROP TABLE t1; CREATE TABLE t1 (c CHAR(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ("foo bar")); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GENERATED ALWAYS AS ("foo bar"))' at line 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ('foo bar') VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; CREATE TABLE t1 (i INT); ALTER TABLE t1 ADD COLUMN c CHAR(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ("foo bar"); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GENERATED ALWAYS AS ("foo bar")' at line 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) DEFAULT NULL, + `c` char(10) CHARACTER SET utf8 COLLATE utf8_bin GENERATED ALWAYS AS ('foo bar') VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; CREATE TABLE t1 (i INT COLLATE utf8_bin, c INT COLLATE utf8_bin GENERATED ALWAYS AS (10)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GENERATED ALWAYS AS (10))' at line 1 diff --git a/mysql-test/suite/gcol/r/innodb_virtual_fk.result b/mysql-test/suite/gcol/r/innodb_virtual_fk.result index 50685e04a69..252274f3e0a 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_fk.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_fk.result @@ -790,3 +790,36 @@ t1 CREATE TABLE `t1` ( ALTER TABLE t1 DROP INDEX f1; ALTER TABLE t1 DROP f3; DROP TABLE t1; +# +# MDEV-24041 Generated column DELETE with FOREIGN KEY crash InnoDB +# +SET FOREIGN_KEY_CHECKS=1; +CREATE DATABASE `a-b`; +USE `a-b`; +CREATE TABLE emails ( +id int, +PRIMARY KEY (id) +) ENGINE=InnoDB; +CREATE TABLE email_stats ( +id int, +email_id int, +date_sent char(4), +generated_email_id int as (email_id), +#generated_sent_date DATE GENERATED ALWAYS AS (date_sent), +PRIMARY KEY (id), +KEY mautic_generated_sent_date_email_id (generated_email_id), +FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE SET NULL +) ENGINE=InnoDB; +CREATE TABLE emails_metadata ( +email_id int, +PRIMARY KEY (email_id), +CONSTRAINT FK FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE CASCADE +) ENGINE=InnoDB; +INSERT INTO emails VALUES (1); +INSERT INTO email_stats (id, email_id, date_sent) VALUES (1,1,'Jan'); +INSERT INTO emails_metadata VALUES (1); +DELETE FROM emails; +DROP TABLE email_stats; +DROP TABLE emails_metadata; +DROP TABLE emails; +DROP DATABASE `a-b`; diff --git a/mysql-test/suite/gcol/r/virtual_index_drop.result b/mysql-test/suite/gcol/r/virtual_index_drop.result new file mode 100644 index 00000000000..012e61be459 --- /dev/null +++ b/mysql-test/suite/gcol/r/virtual_index_drop.result @@ -0,0 +1,69 @@ +# +# MDEV-24971 InnoDB access freed virtual column +# after rollback of secondary index +# +CREATE TABLE t1(f1 INT, f2 INT AS (f1 + 2) VIRTUAL)ENGINE=InnoDB; +INSERT INTO t1(f1) VALUES(1), (1); +ALTER TABLE t1 ADD UNIQUE INDEX(f2), ALGORITHM=INPLACE, LOCK=EXCLUSIVE; +ERROR 23000: Duplicate entry '3' for key 'f2' +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) DEFAULT NULL, + `f2` int(11) GENERATED ALWAYS AS (`f1` + 2) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(f1 INT, f2 INT AS (f1 + 2) VIRTUAL)ENGINE=InnoDB; +INSERT INTO t1(f1) VALUES(1), (1); +ALTER TABLE t1 ADD UNIQUE INDEX(f2), ALGORITHM=INPLACE, LOCK=SHARED; +ERROR 23000: Duplicate entry '3' for key 'f2' +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) DEFAULT NULL, + `f2` int(11) GENERATED ALWAYS AS (`f1` + 2) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(f1 INT, f2 INT AS (f1) VIRTUAL)ENGINE=InnoDB; +SET DEBUG_DBUG="+d,create_index_fail"; +SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal"; +ALTER TABLE t1 ADD COLUMN f3 INT AS (f1) VIRTUAL, ADD INDEX(f2, f3); +connect con1,localhost,root,,,; +SET DEBUG_SYNC="now WAIT_FOR con1_go"; +BEGIN; +SELECT * FROM t1; +f1 f2 +SET DEBUG_SYNC="now SIGNAL alter_signal"; +connection default; +ERROR 23000: Duplicate entry '' for key '*UNKNOWN*' +connection con1; +rollback; +connection default; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) DEFAULT NULL, + `f2` int(11) GENERATED ALWAYS AS (`f1`) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(f1 INT, f2 INT AS (f1) VIRTUAL)ENGINE=InnoDB; +SET DEBUG_DBUG="+d,create_index_fail"; +SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal"; +ALTER TABLE t1 ADD INDEX(f2); +connection con1; +SET DEBUG_SYNC="now WAIT_FOR con1_go"; +BEGIN; +INSERT INTO t1(f1) VALUES(1); +SET DEBUG_SYNC="now SIGNAL alter_signal"; +connection default; +ERROR 23000: Duplicate entry '' for key '*UNKNOWN*' +connection con1; +rollback; +connection default; +disconnect con1; +DROP TABLE t1; +CREATE TABLE t1(f1 CHAR(100), f2 CHAR(100) as (f1) VIRTUAL)ENGINE=InnoDB; +ALTER TABLE t1 ADD COLUMN f3 CHAR(100) AS (f2) VIRTUAL, ADD INDEX(f3(10), f1, f3(12)); +ERROR 42S21: Duplicate column name 'f3' +DROP TABLE t1; +SET DEBUG_SYNC=RESET; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_fk.test b/mysql-test/suite/gcol/t/innodb_virtual_fk.test index 23d3ee97290..24b6a4631e6 100644 --- a/mysql-test/suite/gcol/t/innodb_virtual_fk.test +++ b/mysql-test/suite/gcol/t/innodb_virtual_fk.test @@ -649,3 +649,44 @@ SHOW CREATE TABLE t1; ALTER TABLE t1 DROP INDEX f1; ALTER TABLE t1 DROP f3; DROP TABLE t1; + +--echo # +--echo # MDEV-24041 Generated column DELETE with FOREIGN KEY crash InnoDB +--echo # +SET FOREIGN_KEY_CHECKS=1; +CREATE DATABASE `a-b`; +USE `a-b`; +CREATE TABLE emails ( + id int, + PRIMARY KEY (id) +) ENGINE=InnoDB; + +CREATE TABLE email_stats ( + id int, + email_id int, + date_sent char(4), + generated_email_id int as (email_id), + #generated_sent_date DATE GENERATED ALWAYS AS (date_sent), + PRIMARY KEY (id), + KEY mautic_generated_sent_date_email_id (generated_email_id), + FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE SET NULL +) ENGINE=InnoDB; + + +CREATE TABLE emails_metadata ( + email_id int, + PRIMARY KEY (email_id), + CONSTRAINT FK FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE CASCADE +) ENGINE=InnoDB; + + +INSERT INTO emails VALUES (1); +INSERT INTO email_stats (id, email_id, date_sent) VALUES (1,1,'Jan'); +INSERT INTO emails_metadata VALUES (1); + +DELETE FROM emails; + +DROP TABLE email_stats; +DROP TABLE emails_metadata; +DROP TABLE emails; +DROP DATABASE `a-b`; diff --git a/mysql-test/suite/gcol/t/virtual_index_drop.test b/mysql-test/suite/gcol/t/virtual_index_drop.test new file mode 100644 index 00000000000..016832b9e6d --- /dev/null +++ b/mysql-test/suite/gcol/t/virtual_index_drop.test @@ -0,0 +1,71 @@ +--source include/have_innodb.inc +--source include/have_debug.inc + +--echo # +--echo # MDEV-24971 InnoDB access freed virtual column +--echo # after rollback of secondary index +--echo # + +# Exclusive lock must not defer the index removal + +CREATE TABLE t1(f1 INT, f2 INT AS (f1 + 2) VIRTUAL)ENGINE=InnoDB; +INSERT INTO t1(f1) VALUES(1), (1); +--error ER_DUP_ENTRY +ALTER TABLE t1 ADD UNIQUE INDEX(f2), ALGORITHM=INPLACE, LOCK=EXCLUSIVE; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# If Shared lock and table doesn't have any other open handle +# then InnoDB must not defer the index removal + +CREATE TABLE t1(f1 INT, f2 INT AS (f1 + 2) VIRTUAL)ENGINE=InnoDB; +INSERT INTO t1(f1) VALUES(1), (1); +--error ER_DUP_ENTRY +ALTER TABLE t1 ADD UNIQUE INDEX(f2), ALGORITHM=INPLACE, LOCK=SHARED; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +# InnoDB should store the newly dropped virtual column into +# new_vcol_info in index when rollback of alter happens + +CREATE TABLE t1(f1 INT, f2 INT AS (f1) VIRTUAL)ENGINE=InnoDB; +SET DEBUG_DBUG="+d,create_index_fail"; +SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal"; +SEND ALTER TABLE t1 ADD COLUMN f3 INT AS (f1) VIRTUAL, ADD INDEX(f2, f3); +connect(con1,localhost,root,,,); +SET DEBUG_SYNC="now WAIT_FOR con1_go"; +BEGIN; +SELECT * FROM t1; +SET DEBUG_SYNC="now SIGNAL alter_signal"; +connection default; +--error ER_DUP_ENTRY +reap; +connection con1; +rollback; +connection default; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1(f1 INT, f2 INT AS (f1) VIRTUAL)ENGINE=InnoDB; +SET DEBUG_DBUG="+d,create_index_fail"; +SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal"; +send ALTER TABLE t1 ADD INDEX(f2); +connection con1; +SET DEBUG_SYNC="now WAIT_FOR con1_go"; +BEGIN; +INSERT INTO t1(f1) VALUES(1); +SET DEBUG_SYNC="now SIGNAL alter_signal"; +connection default; +--error ER_DUP_ENTRY +reap; +connection con1; +rollback; +connection default; +disconnect con1; +DROP TABLE t1; + +CREATE TABLE t1(f1 CHAR(100), f2 CHAR(100) as (f1) VIRTUAL)ENGINE=InnoDB; +--error ER_DUP_FIELDNAME +ALTER TABLE t1 ADD COLUMN f3 CHAR(100) AS (f2) VIRTUAL, ADD INDEX(f3(10), f1, f3(12)); +DROP TABLE t1; +SET DEBUG_SYNC=RESET; diff --git a/mysql-test/suite/innodb/include/innodb_simulate_comp_failures.inc b/mysql-test/suite/innodb/include/innodb_simulate_comp_failures.inc deleted file mode 100644 index d9c0294faf5..00000000000 --- a/mysql-test/suite/innodb/include/innodb_simulate_comp_failures.inc +++ /dev/null @@ -1,152 +0,0 @@ ---echo # ---echo # Testing robustness against random compression failures ---echo # - ---source include/not_embedded.inc ---source include/have_innodb.inc - ---let $simulate_comp_failures_save = `SELECT @@innodb_simulate_comp_failures` - ---disable_query_log -call mtr.add_suppression("InnoDB: Simulating a compression failure for table `test`\\.`t1`"); ---enable_query_log - -# create the table with compressed pages of size 8K. -CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(msg)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; - -SHOW CREATE TABLE t1; - -# percentage of compressions that will be forced to fail -SET GLOBAL innodb_simulate_comp_failures = 25; - ---disable_query_log ---disable_result_log - -let $num_inserts_ind = $num_inserts; -let $commit_iterations=50; - -while ($num_inserts_ind) -{ - let $repeat = `select floor(rand() * 10)`; - eval INSERT INTO t1(id, msg) - VALUES ($num_inserts_ind, REPEAT('abcdefghijklmnopqrstuvwxyz', $repeat)); - dec $num_inserts_ind; -} - ---enable_query_log ---enable_result_log - -COMMIT; -SELECT COUNT(id) FROM t1; - ---disable_query_log ---disable_result_log - -# do random ops, making sure that some pages will get fragmented and reorganized. -let $num_ops_ind = $num_ops; -let $commit_count= $commit_iterations; - -BEGIN; - -while($num_ops_ind) -{ - let $idx = `select floor(rand()*$num_inserts)`; - let $insert_or_update = `select floor(rand()*3)`; - - let $repeat = `select floor(rand() * 9) + 1`; - - let $msg = query_get_value(`select repeat('abcdefghijklmnopqrstuvwxyz', $repeat) as x`, x, 1); - - let $single_or_multi = `select floor(rand()*10)`; - - if ($insert_or_update) - { - let $cnt = query_get_value(SELECT COUNT(*) cnt FROM t1 WHERE id=$idx, cnt, 1); - - if ($cnt) - { - let $update = `select floor(rand()*2)`; - - if ($update) - { - if ($single_or_multi) - { - eval UPDATE t1 SET msg=\"$msg\" WHERE id=$idx; - } - - if (!$single_or_multi) - { - eval UPDATE t1 SET msg=\"$msg\" WHERE id >= $idx - 100 AND id <= $idx + 100; - } - - } - - if (!$update) - { - if ($single_or_multi) - { - eval INSERT INTO t1(msg, id) VALUES (\"$msg\", $idx) ON DUPLICATE KEY UPDATE msg=VALUES(msg), id = VALUES(id); - } - - if (!$single_or_multi) - { - let $diff = 200; - - while ($diff) - { - eval INSERT INTO t1(msg, id) VALUES (\"$msg\", $idx + 100 - $diff) ON DUPLICATE KEY UPDATE msg=VALUES(msg), id=VALUES(id); - - dec $diff; - } - } - } - } - - if (!$cnt) - { - let $null_msg = `select floor(rand()*2)`; - - if ($null_msg) - { - eval INSERT INTO t1(id,msg) VALUES ($idx, NULL); - } - - if (!$null_msg) - { - eval INSERT INTO t1(id, msg) VALUES ($idx, \"$msg\"); - } - } - } - - if (!$insert_or_update) - { - if ($single_or_multi) - { - eval DELETE from t1 WHERE id=$idx; - } - - if (!$single_or_multi) - { - eval DELETE from t1 WHERE id >= $idx - 100 AND id <= $idx + 100; - } - } - - dec $commit_count; - if (!$commit_count) - { - let $commit_count= $commit_iterations; - COMMIT; - BEGIN; - } - - dec $num_ops_ind; -} - -COMMIT; - -# final cleanup -DROP TABLE t1; - -eval SET GLOBAL innodb_simulate_comp_failures = $simulate_comp_failures_save; - ---enable_query_log diff --git a/mysql-test/suite/innodb/r/alter_large_dml.result b/mysql-test/suite/innodb/r/alter_large_dml.result index 056e8fdd768..41f497a5591 100644 --- a/mysql-test/suite/innodb/r/alter_large_dml.result +++ b/mysql-test/suite/innodb/r/alter_large_dml.result @@ -14,16 +14,10 @@ SET DEBUG_SYNC = 'now SIGNAL dml_pause'; SET DEBUG_SYNC = 'now WAIT_FOR dml_restart'; ROLLBACK; BEGIN; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; +INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_81920; ROLLBACK; BEGIN; -INSERT INTO t1 SELECT * FROM t1; -INSERT INTO t1 SELECT * FROM t1; -INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_114688; ROLLBACK; SET DEBUG_SYNC = 'now SIGNAL dml_done'; connect con2, localhost,root,,test; diff --git a/mysql-test/suite/innodb/r/alter_mdl_timeout.result b/mysql-test/suite/innodb/r/alter_mdl_timeout.result new file mode 100644 index 00000000000..7af1362c69e --- /dev/null +++ b/mysql-test/suite/innodb/r/alter_mdl_timeout.result @@ -0,0 +1,23 @@ +create table t1(f1 char(10), f2 char(10) not null, f3 int not null, +f4 int not null, primary key(f3))engine=innodb; +insert into t1 values('a','a', 1, 1), ('b','b', 2, 2), ('c', 'c', 3, 3), ('d', 'd', 4, 4); +SET DEBUG_SYNC="row_merge_after_scan SIGNAL con1_start WAIT_FOR con1_insert"; +SET DEBUG_SYNC="innodb_commit_inplace_alter_table_wait SIGNAL con1_wait WAIT_FOR con1_update"; +ALTER TABLE t1 ADD UNIQUE INDEX(f1(3), f4), ADD UNIQUE INDEX(f2), ALGORITHM=INPLACE; +connect con1,localhost,root,,,; +SET DEBUG_SYNC="now WAIT_FOR con1_start"; +begin; +INSERT INTO t1 VALUES('e','e',5, 5); +SET DEBUG_SYNC="now SIGNAL con1_insert"; +SET DEBUG_SYNC="now WAIT_FOR con1_wait"; +SET DEBUG_SYNC="before_row_upd_sec_new_index_entry SIGNAL con1_update WAIT_FOR alter_rollback"; +UPDATE t1 set f4 = 10 order by f1 desc limit 2; +connection default; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SET DEBUG_SYNC="now SIGNAL alter_rollback"; +connection con1; +commit; +connection default; +disconnect con1; +DROP TABLE t1; +SET DEBUG_SYNC="RESET"; diff --git a/mysql-test/suite/innodb/r/alter_table.result b/mysql-test/suite/innodb/r/alter_table.result index 8330e25c70d..873baa905c6 100644 --- a/mysql-test/suite/innodb/r/alter_table.result +++ b/mysql-test/suite/innodb/r/alter_table.result @@ -70,6 +70,27 @@ ERROR HY000: Tablespace has been discarded for table `t` ALTER TABLE t FORCE; ERROR HY000: Tablespace has been discarded for table `t` DROP TABLE t; +# +# MDEV-24763 ALTER TABLE fails to rename a column in SYS_FIELDS +# +CREATE TABLE t1 (a INT, b TEXT, c INT, PRIMARY KEY(b(9)), INDEX(c,a)) +ENGINE=InnoDB; +ALTER TABLE t1 CHANGE COLUMN a u INT; +SELECT sf.* FROM information_schema.innodb_sys_fields sf +INNER JOIN information_schema.innodb_sys_indexes si ON sf.index_id=si.index_id +INNER JOIN information_schema.innodb_sys_tables st ON si.table_id=st.table_id +WHERE st.name='test/t1' ORDER BY sf.index_id,sf.pos; +INDEX_ID NAME POS +ID b 0 +ID c 0 +ID u 1 +DROP TABLE t1; +# +# End of 10.2 tests +# +# +# Check that innodb supports transactional=1 +# create table t1 (a int) transactional=1 engine=aria; create table t2 (a int) transactional=1 engine=innodb; show create table t1; @@ -85,3 +106,6 @@ t2 CREATE TABLE `t2` ( alter table t1 engine=innodb; alter table t1 add column b int; drop table t1,t2; +# +# End of 10.4 tests +# diff --git a/mysql-test/suite/innodb/r/alter_varchar_change.result b/mysql-test/suite/innodb/r/alter_varchar_change.result index ddf0449a040..9bf0d126588 100644 --- a/mysql-test/suite/innodb/r/alter_varchar_change.result +++ b/mysql-test/suite/innodb/r/alter_varchar_change.result @@ -492,11 +492,18 @@ DROP TABLE t1; DROP PROCEDURE get_index_id; DROP PROCEDURE get_table_id; create table t (a varchar(100)) engine=innodb; -select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a'; +select sc.name, sc.pos, sc.mtype, sc.prtype, sc.len +from information_schema.innodb_sys_columns sc +inner join information_schema.innodb_sys_tables st +on sc.table_id=st.table_id where st.name='test/t' and sc.name='a'; name pos mtype prtype len a 0 1 524303 100 alter table t modify a varchar(110), algorithm=inplace; -select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a'; +select sc.name, sc.pos, sc.mtype, sc.prtype, sc.len +from information_schema.innodb_sys_columns sc +inner join information_schema.innodb_sys_tables st +on sc.table_id=st.table_id where st.name='test/t' and sc.name='a'; name pos mtype prtype len a 0 1 524303 110 drop table t; +# End of 10.2 tests diff --git a/mysql-test/suite/innodb/r/default_row_format_alter.result b/mysql-test/suite/innodb/r/default_row_format_alter.result index 363954c1a6c..fa5adb32fb0 100644 --- a/mysql-test/suite/innodb/r/default_row_format_alter.result +++ b/mysql-test/suite/innodb/r/default_row_format_alter.result @@ -83,6 +83,16 @@ Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length I t1 InnoDB # Compact # # # # # # NULL # # NULL latin1_swedish_ci NULL 0 N DROP TABLE t1; # +# MDEV-24758 heap-use-after-poison in innobase_add_instant_try/rec_copy +# +CREATE TABLE t1 (pk INT PRIMARY KEY) CHARACTER SET utf8 ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +SET GLOBAL innodb_default_row_format = REDUNDANT; +ALTER TABLE t1 ADD a CHAR(8) DEFAULT ''; +DROP TABLE t1; +SET GLOBAL innodb_default_row_format = @row_format; +# End of 10.3 tests +# # MDEV-23295 Assertion fields[i].same(instant.fields[i]) failed # SET GLOBAL innodb_default_row_format = @row_format; @@ -104,4 +114,5 @@ SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1'; ROW_FORMAT Dynamic DROP TABLE t1; +# End of 10.4 tests SET GLOBAL innodb_default_row_format = @row_format; diff --git a/mysql-test/suite/innodb/r/file_format_defaults.result b/mysql-test/suite/innodb/r/file_format_defaults.result index 4fd280450aa..ab4d72258a5 100644 --- a/mysql-test/suite/innodb/r/file_format_defaults.result +++ b/mysql-test/suite/innodb/r/file_format_defaults.result @@ -8,7 +8,7 @@ SELECT @@innodb_file_per_table; SET SQL_MODE=strict_all_tables; CREATE TABLE tab0 (c1 VARCHAR(65530), KEY(c1(3073))) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; Warnings: -Warning 1071 Specified key was too long; max key length is 3072 bytes +Note 1071 Specified key was too long; max key length is 3072 bytes SHOW CREATE TABLE tab0; Table Create Table tab0 CREATE TABLE `tab0` ( diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result index 34d0c3dad64..c7332f3dfc6 100644 --- a/mysql-test/suite/innodb/r/foreign_key.result +++ b/mysql-test/suite/innodb/r/foreign_key.result @@ -801,6 +801,17 @@ ERROR 23000: Duplicate entry '10' for key 'ind9' SET FOREIGN_KEY_CHECKS= 0; ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (pk); DROP TABLE t1; +SET FOREIGN_KEY_CHECKS= 1; +# +# MDEV-23455 Hangs + Sig11 in unknown location(s) due to single complex FK query +# +Parsing foreign keys 1... +ERROR HY000: Can't create table `test`.`t0` (errno: 150 "Foreign key constraint is incorrectly formed") +Parsing foreign keys 2... +ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") +Parsing foreign keys 3... +ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") +Parsing foreign keys 4... # End of 10.2 tests CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)), FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB; diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result index 273da66073e..1efd5c61af7 100644 --- a/mysql-test/suite/innodb/r/innodb-autoinc.result +++ b/mysql-test/suite/innodb/r/innodb-autoinc.result @@ -789,7 +789,7 @@ t2 CREATE TABLE `t2` ( `n` int(10) unsigned NOT NULL, `o` enum('FALSE','TRUE') DEFAULT NULL, PRIMARY KEY (`m`) -) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1 +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 INSERT INTO t1 (b,c) SELECT n,o FROM t2 ; SHOW CREATE TABLE t1; Table Create Table diff --git a/mysql-test/suite/innodb/r/innodb-virtual-columns2.result b/mysql-test/suite/innodb/r/innodb-virtual-columns2.result index 3574ba72849..99a1c610bd3 100644 --- a/mysql-test/suite/innodb/r/innodb-virtual-columns2.result +++ b/mysql-test/suite/innodb/r/innodb-virtual-columns2.result @@ -62,3 +62,28 @@ INSERT INTO t1 (i) VALUES (1),(2); SELECT * FROM t1 WHERE y BETWEEN 2012 AND 2016 FOR UPDATE; y i b vi DROP TABLE t1; +# +# MDEV-23632 ALTER TABLE...ADD KEY creates corrupted index on virtual column +# +CREATE TABLE t1(a INT PRIMARY KEY, b INT, g INT GENERATED ALWAYS AS(b)VIRTUAL) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,1,default); +ALTER TABLE t1 ADD COLUMN c INT; +ALTER TABLE t1 ADD KEY(g); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT g FROM t1 FORCE INDEX (g); +g +1 +DROP TABLE t1; +CREATE TABLE t1(a INT, b INT, g INT GENERATED ALWAYS AS(b)VIRTUAL) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,1,default); +ALTER TABLE t1 ADD COLUMN c INT PRIMARY KEY; +ALTER TABLE t1 ADD KEY(g); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT g FROM t1 FORCE INDEX (g); +g +1 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result index b48a85a2443..bcdd799f9ff 100644 --- a/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-test/suite/innodb/r/innodb.result @@ -2300,7 +2300,7 @@ drop table t1; SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; create table t1 (v varchar(65530), key(v)); Warnings: -Warning 1071 Specified key was too long; max key length is 3072 bytes +Note 1071 Specified key was too long; max key length is 3072 bytes drop table t1; create table t1 (v varchar(65536)); Warnings: @@ -3319,3 +3319,20 @@ c1 c2 9 3 DROP TABLE t1; DROP TABLE t2; +# +# MDEV-24748 Extern field check missing +# in btr_index_rec_validate() +# +CREATE TABLE t1 (pk INT, c1 char(255), +c2 char(255), c3 char(255), c4 char(255), +c5 char(255), c6 char(255), c7 char(255), +c8 char(255), primary key (pk) +) CHARACTER SET utf32 ENGINE=InnoDB; +INSERT INTO t1 VALUES +(1, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'), +(2, 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p'); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +ALTER TABLE t1 FORCE; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb_buffer_pool_fail.result b/mysql-test/suite/innodb/r/innodb_buffer_pool_fail.result new file mode 100644 index 00000000000..9879ef206f2 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_buffer_pool_fail.result @@ -0,0 +1,8 @@ +call mtr.add_suppression("InnoDB: Cannot allocate memory for the buffer pool"); +call mtr.add_suppression("InnoDB: Plugin initialization aborted at srv0start.cc.*"); +call mtr.add_suppression("Plugin 'InnoDB' init function returned error."); +call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed."); +# +# MDEV-25019 memory allocation failures during startup cause server failure in different, confusing ways +# +# restart: --debug_dbug=+d,ib_buf_chunk_init_fails diff --git a/mysql-test/suite/innodb/r/innodb_multi_update.result b/mysql-test/suite/innodb/r/innodb_multi_update.result index 64f9ebc2fc2..93bd4e6716c 100644 --- a/mysql-test/suite/innodb/r/innodb_multi_update.result +++ b/mysql-test/suite/innodb/r/innodb_multi_update.result @@ -81,4 +81,5 @@ 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) +UPDATE (SELECT ((SELECT 1 FROM t1),1) = (1,1) FROM t1 WHERE (SELECT 1 FROM t1)) x, t1 AS d SET d.f1 = 1; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result b/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result deleted file mode 100644 index f35e4159603..00000000000 --- a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result +++ /dev/null @@ -1,17 +0,0 @@ -# -# Testing robustness against random compression failures -# -CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(msg)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `msg` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `msg_i` (`msg`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 -SET GLOBAL innodb_simulate_comp_failures = 25; -COMMIT; -SELECT COUNT(id) FROM t1; -COUNT(id) -1500 diff --git a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures_small.result b/mysql-test/suite/innodb/r/innodb_simulate_comp_failures_small.result deleted file mode 100644 index 099c673bca7..00000000000 --- a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures_small.result +++ /dev/null @@ -1,17 +0,0 @@ -# -# Testing robustness against random compression failures -# -CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(msg)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `msg` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `msg_i` (`msg`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 -SET GLOBAL innodb_simulate_comp_failures = 25; -COMMIT; -SELECT COUNT(id) FROM t1; -COUNT(id) -1000 diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result index e0661557159..110939b5fdb 100644 --- a/mysql-test/suite/innodb/r/instant_alter.result +++ b/mysql-test/suite/innodb/r/instant_alter.result @@ -2841,3 +2841,43 @@ t1 CREATE TABLE `t1` ( KEY `i1` (`a`) COMMENT 'comment2' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; +# +# MDEV-25057 Assertion `n_fields < dtuple_get_n_fields(entry)' +# failed in dtuple_convert_big_rec +# +CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, +a CHAR(255) NOT NULL, +b CHAR(255) NOT NULL, c INT) ENGINE=InnoDB CHARSET utf32; +ALTER TABLE t1 DROP c; +INSERT INTO t1(a, b) SELECT '', '' FROM seq_1_to_16; +SELECT COUNT(*) FROM t1; +COUNT(*) +16 +DROP TABLE t1; +# +# MDEV-25630 Rollback of instant operation adds wrong +# column to secondary index +# +CREATE TABLE t1 (f1 INT, f2 INT, f3 INT, f4 INT, +PRIMARY KEY(f1, f4), +KEY(f2))ENGINE=InnoDB; +CREATE TABLE t2 (f1 INT, f2 INT, PRIMARY KEY(f1), +FOREIGN KEY fk (f2) REFERENCES t2(f1) +)ENGINE=InnoDB; +ALTER TABLE t1 ADD f5 INT; +SET FOREIGN_KEY_CHECKS=0; +ALTER TABLE t1 DROP COLUMN f3, ADD FOREIGN KEY fk (f1) +REFERENCES x(x); +ERROR HY000: Failed to add the foreign key constraint 'test/fk' to system tables +ALTER TABLE t1 DROP COLUMN f5; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + `f2` int(11) DEFAULT NULL, + `f3` int(11) DEFAULT NULL, + `f4` int(11) NOT NULL, + PRIMARY KEY (`f1`,`f4`), + KEY `f2` (`f2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/innodb/r/instant_alter_charset.result b/mysql-test/suite/innodb/r/instant_alter_charset.result index 6b60c79b558..8b1171191fa 100644 --- a/mysql-test/suite/innodb/r/instant_alter_charset.result +++ b/mysql-test/suite/innodb/r/instant_alter_charset.result @@ -2032,3 +2032,14 @@ ALTER TABLE t1 MODIFY a VARCHAR(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; INSERT INTO t1 VALUES ('a'); DROP TABLE t1; +# +# MDEV-22775 [HY000][1553] Changing name of primary key column with foreign key constraint fails. +# +create table t1 (id int primary key) engine=innodb default charset=utf8; +create table t2 (input_id int primary key, id int not null, +key a (id), +constraint a foreign key (id) references t1 (id) +)engine=innodb default charset=utf8; +alter table t1 change id id2 int; +drop table t2; +drop table t1; diff --git a/mysql-test/suite/innodb/r/instant_alter_debug.result b/mysql-test/suite/innodb/r/instant_alter_debug.result index 9fcb8b05a34..9a681b77c76 100644 --- a/mysql-test/suite/innodb/r/instant_alter_debug.result +++ b/mysql-test/suite/innodb/r/instant_alter_debug.result @@ -193,6 +193,12 @@ SET DEBUG_SYNC='RESET'; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 SET a=0; ALTER TABLE t1 ADD COLUMN b INT NOT NULL DEFAULT 2, ADD COLUMN c INT; +BEGIN NOT ATOMIC +DECLARE c TEXT DEFAULT(SELECT CONCAT('ALTER TABLE t1 ADD (c', +GROUP_CONCAT(seq SEPARATOR ' INT, c'), ' INT), ALGORITHM=INSTANT;') FROM seq_1_to_130); +EXECUTE IMMEDIATE c; +END; +$$ connection stop_purge; START TRANSACTION WITH CONSISTENT SNAPSHOT; connection default; @@ -211,7 +217,7 @@ SET DEBUG_SYNC = 'now SIGNAL logged'; connection ddl; connection default; SET DEBUG_SYNC = RESET; -SELECT * FROM t1; +SELECT a, b, c FROM t1; a b c 1 2 NULL 2 3 4 @@ -234,7 +240,7 @@ connection ddl; UPDATE t1 SET b = b + 1 WHERE a = 2; connection default; SET DEBUG_SYNC = RESET; -SELECT * FROM t1; +SELECT a, b, c FROM t1; a b c 1 2 NULL 2 3 4 @@ -258,7 +264,7 @@ ERROR 22004: Invalid use of NULL value disconnect ddl; connection default; SET DEBUG_SYNC = RESET; -SELECT * FROM t1; +SELECT a, b, c, d FROM t1; a b c d 1 2 NULL 1 2 3 4 1 @@ -291,44 +297,6 @@ a b vb 5 NULL NULL DROP TABLE t1; # -# MDEV-17899 Assertion failures on rollback of instant ADD/DROP -# MDEV-18098 Crash after rollback of instant DROP COLUMN -# -SET @save_dbug = @@SESSION.debug_dbug; -SET debug_dbug='+d,ib_commit_inplace_fail_1'; -CREATE TABLE t1 (a int, b int) ENGINE=InnoDB; -INSERT INTO t1 VALUES (1,2); -ALTER TABLE t1 DROP COLUMN b; -ERROR HY000: Internal error: Injected error! -ALTER TABLE t1 DROP COLUMN b; -ERROR HY000: Internal error: Injected error! -ALTER TABLE t1 ADD COLUMN c INT; -ERROR HY000: Internal error: Injected error! -SELECT * FROM t1; -a b -1 2 -DROP TABLE t1; -CREATE TABLE t1 (a int, b int) ENGINE=InnoDB; -ALTER TABLE t1 ADD COLUMN c INT; -ERROR HY000: Internal error: Injected error! -BEGIN; -INSERT INTO t1 VALUES(1, 1); -ROLLBACK; -ALTER TABLE t1 DROP COLUMN b; -ERROR HY000: Internal error: Injected error! -INSERT INTO t1 values (1,1); -SELECT * FROM t1; -a b -1 1 -DROP TABLE t1; -SET debug_dbug = @save_dbug; -SELECT variable_value-@old_instant instants -FROM information_schema.global_status -WHERE variable_name = 'innodb_instant_alter_column'; -instants -22 -SET GLOBAL innodb_purge_rseg_truncate_frequency = @save_frequency; -# # MDEV-21045 AddressSanitizer: use-after-poison in mem_heap_dup / row_log_table_get_pk_col # CREATE TABLE t1 (a TEXT) ENGINE = InnoDB ROW_FORMAT=REDUNDANT; @@ -370,3 +338,115 @@ b SET DEBUG_SYNC='RESET'; disconnect con2; DROP TABLE t1; +# +# MDEV-24653 Assertion block->page.id.page_no() == index->page failed +# in innobase_add_instant_try() +# +SET @saved_limit = @@GLOBAL.innodb_limit_optimistic_insert_debug; +SET GLOBAL innodb_limit_optimistic_insert_debug = 2; +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1),(2),(3),(4); +ALTER TABLE t1 ADD COLUMN b INT; +DELETE FROM t1; +InnoDB 0 transactions not purged +ALTER TABLE t1 ADD COLUMN c INT; +SELECT * FROM t1; +a b c +DROP TABLE t1; +SET GLOBAL innodb_limit_optimistic_insert_debug = @saved_limit; +# +# MDEV-24796 Assertion page_has_next... failed +# in btr_pcur_store_position() +# +CREATE TABLE t1 (c INT KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1),(2); +SET GLOBAL innodb_limit_optimistic_insert_debug=2; +ALTER TABLE t1 ADD COLUMN d INT; +DELETE FROM t1; +InnoDB 0 transactions not purged +SELECT * FROM t1 WHERE c<>1 ORDER BY c DESC; +c d +DROP TABLE t1; +SET GLOBAL innodb_limit_optimistic_insert_debug = @saved_limit; +# +# MDEV-24620 ASAN heap-buffer-overflow in btr_pcur_restore_position() +# +CREATE TABLE t1 (a VARCHAR(1) PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +connect stop_purge,localhost,root,,; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection default; +ALTER TABLE t1 ADD c INT; +BEGIN; +DELETE FROM t1; +connect dml,localhost,root,,test; +SET DEBUG_SYNC='row_mysql_handle_errors SIGNAL s1 WAIT_FOR s2'; +UPDATE t1 SET c=1; +connection default; +SET DEBUG_SYNC='now WAIT_FOR s1'; +COMMIT; +connection stop_purge; +COMMIT; +disconnect stop_purge; +connection default; +InnoDB 0 transactions not purged +SET DEBUG_SYNC='now SIGNAL s2'; +connection dml; +disconnect dml; +connection default; +SET DEBUG_SYNC=RESET; +DROP TABLE t1; +# End of 10.3 tests +# +# MDEV-17899 Assertion failures on rollback of instant ADD/DROP +# MDEV-18098 Crash after rollback of instant DROP COLUMN +# +SET @save_dbug = @@SESSION.debug_dbug; +SET debug_dbug='+d,ib_commit_inplace_fail_1'; +CREATE TABLE t1 (a int, b int) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,2); +ALTER TABLE t1 DROP COLUMN b; +ERROR HY000: Internal error: Injected error! +ALTER TABLE t1 DROP COLUMN b; +ERROR HY000: Internal error: Injected error! +ALTER TABLE t1 ADD COLUMN c INT; +ERROR HY000: Internal error: Injected error! +SELECT * FROM t1; +a b +1 2 +DROP TABLE t1; +CREATE TABLE t1 (a int, b int) ENGINE=InnoDB; +ALTER TABLE t1 ADD COLUMN c INT; +ERROR HY000: Internal error: Injected error! +BEGIN; +INSERT INTO t1 VALUES(1, 1); +ROLLBACK; +ALTER TABLE t1 DROP COLUMN b; +ERROR HY000: Internal error: Injected error! +INSERT INTO t1 values (1,1); +SELECT * FROM t1; +a b +1 1 +DROP TABLE t1; +SET debug_dbug = @save_dbug; +# +# MDEV-24512 Assertion failed in rec_is_metadata() +# in btr_discard_only_page_on_level() +# +SET @save_limit= @@GLOBAL.innodb_limit_optimistic_insert_debug; +SET GLOBAL innodb_limit_optimistic_insert_debug=2; +CREATE TABLE t1 (c CHAR(1) UNIQUE) ENGINE=InnoDB; +ALTER TABLE t1 ADD c2 INT NOT NULL DEFAULT 0 FIRST; +INSERT INTO t1 (c) VALUES ('x'),('d'),('r'),('f'),('y'),('u'),('m'),('d'); +ERROR 23000: Duplicate entry 'd' for key 'c' +SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit; +SELECT * FROM t1; +c2 c +DROP TABLE t1; +# End of 10.4 tests +SET GLOBAL innodb_purge_rseg_truncate_frequency = @save_frequency; +SELECT variable_value-@old_instant instants +FROM information_schema.global_status +WHERE variable_name = 'innodb_instant_alter_column'; +instants +32 diff --git a/mysql-test/suite/innodb/r/mvcc_secondary.result b/mysql-test/suite/innodb/r/mvcc_secondary.result new file mode 100644 index 00000000000..2289742e830 --- /dev/null +++ b/mysql-test/suite/innodb/r/mvcc_secondary.result @@ -0,0 +1,24 @@ +# +# MDEV-25459 MVCC read from index on CHAR or VARCHAR wrongly omits rows +# +CREATE TABLE t1 ( +pk int PRIMARY KEY, c varchar(255) UNIQUE, +d char(255), e varchar(255), f char(255), g char(255) +) ENGINE=InnoDB ROW_FORMAT=DYNAMIC DEFAULT CHARACTER SET ucs2; +INSERT INTO t1 VALUES +(1,REPEAT('c',248),REPEAT('a',106),REPEAT('b',220),REPEAT('x',14),''); +BEGIN; +UPDATE t1 SET c=REPEAT('d',170); +connect con1,localhost,root,,; +SELECT pk FROM t1 FORCE INDEX (c); +pk +1 +connection default; +COMMIT; +connection con1; +SELECT pk FROM t1 FORCE INDEX (c); +pk +1 +disconnect con1; +connection default; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/temporary_table.result b/mysql-test/suite/innodb/r/temporary_table.result index d7ea25fa117..0df99aecc46 100644 --- a/mysql-test/suite/innodb/r/temporary_table.result +++ b/mysql-test/suite/innodb/r/temporary_table.result @@ -678,3 +678,99 @@ SET FOREIGN_KEY_CHECKS = 0; CREATE TEMPORARY TABLE t1(f1 INT NOT NULL, FOREIGN KEY(f1) REFERENCES t0(f1))ENGINE=InnoDB; ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") +CREATE TABLE t (c INT) ENGINE=InnoDB; +INSERT INTO t VALUES(0); +CREATE TEMPORARY TABLE t2 (c INT) ENGINE=InnoDB; +START TRANSACTION READ ONLY; +INSERT INTO t2 SELECT * FROM t; +COMMIT; +DROP TABLE t, t2; +CREATE TEMPORARY TABLE t (c INT,c2 INT) ENGINE=InnoDB; +START TRANSACTION READ ONLY; +INSERT INTO t VALUES(0); +ERROR 21S01: Column count doesn't match value count at row 1 +SAVEPOINT s; +INSERT INTO t VALUES(0,0); +COMMIT; +DROP TABLE t; +CREATE TEMPORARY TABLE t (c INT,c2 INT) ENGINE=InnoDB; +START TRANSACTION READ ONLY; +INSERT INTO t VALUES(0); +ERROR 21S01: Column count doesn't match value count at row 1 +SAVEPOINT s; +INSERT INTO t VALUES(0,0); +ROLLBACK; +DROP TABLE t; +CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +START TRANSACTION READ ONLY; +UPDATE t1 SET a= 2; +COMMIT; +DROP TABLE t1; +CREATE TEMPORARY TABLE t(c INT) ENGINE=InnoDB; +SET SESSION tx_read_only=TRUE; +LOCK TABLE test.t READ; +SELECT * FROM t; +c +INSERT INTO t VALUES(0xADC3); +SET SESSION tx_read_only=FALSE; +DROP TABLE t; +CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +START TRANSACTION READ ONLY; +UPDATE t1 SET a= 2; +COMMIT; +DROP TABLE t1; +CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY, b int) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 1); +START TRANSACTION READ ONLY; +UPDATE t1 SET b= 2; +COMMIT; +DROP TABLE t1; +CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY, b int, c varchar(255)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 1, repeat('a', 200)); +START TRANSACTION READ ONLY; +UPDATE t1 SET b= 2, c=repeat('a', 250); +COMMIT; +DROP TABLE t1; +CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +START TRANSACTION READ ONLY; +UPDATE t1 SET a= 2; +ROLLBACK; +DROP TABLE t1; +CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +START TRANSACTION READ ONLY; +DELETE FROM t1 WHERE a= 2; +COMMIT; +DROP TABLE t1; +CREATE TEMPORARY TABLE tmp (a INT) ENGINE=InnoDB; +INSERT INTO tmp () VALUES (),(); +SET TX_READ_ONLY= 1; +INSERT INTO tmp SELECT * FROM tmp; +SET TX_READ_ONLY= 0; +DROP TABLE tmp; +SET sql_mode=''; +SET GLOBAL tx_read_only=TRUE; +CREATE TEMPORARY TABLE t (c INT); +SET SESSION tx_read_only=DEFAULT; +INSERT INTO t VALUES(1); +INSERT INTO t SELECT * FROM t; +SET SESSION tx_read_only=FALSE; +SET GLOBAL tx_read_only=OFF; +DROP TABLE t; +CREATE TEMPORARY TABLE t(a INT); +SET SESSION tx_read_only=ON; +LOCK TABLE t READ; +SELECT COUNT(*)FROM t; +COUNT(*) +0 +INSERT INTO t VALUES (0); +SET SESSION tx_read_only=OFF; +DROP TABLE t; +CREATE TEMPORARY TABLE t (a INT) ENGINE=InnoDB; +INSERT INTO t VALUES (1); +START TRANSACTION READ ONLY; +UPDATE t SET a = NULL; +ROLLBACK; diff --git a/mysql-test/suite/innodb/r/truncate_foreign.result b/mysql-test/suite/innodb/r/truncate_foreign.result index fc09b74d62f..12a41860708 100644 --- a/mysql-test/suite/innodb/r/truncate_foreign.result +++ b/mysql-test/suite/innodb/r/truncate_foreign.result @@ -57,3 +57,14 @@ disconnect dml; connection default; SET DEBUG_SYNC = RESET; DROP TABLE child, parent; +# +# MDEV-24532 Table corruption ER_NO_SUCH_TABLE_IN_ENGINE or +# ER_CRASHED_ON_USAGE after ALTER on table with foreign key +# +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a)) ENGINE=InnoDB; +ALTER TABLE t1 ADD FOREIGN KEY (b) REFERENCES t1 (a) ON UPDATE CASCADE; +LOCK TABLE t1 WRITE; +TRUNCATE TABLE t1; +ALTER TABLE t1 ADD c INT; +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/alter_large_dml.test b/mysql-test/suite/innodb/t/alter_large_dml.test index 5ab3f394115..54f5f171f05 100644 --- a/mysql-test/suite/innodb/t/alter_large_dml.test +++ b/mysql-test/suite/innodb/t/alter_large_dml.test @@ -25,17 +25,11 @@ SET DEBUG_SYNC = 'now WAIT_FOR dml_restart'; ROLLBACK; BEGIN; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; -INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_16384; +INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_81920; ROLLBACK; BEGIN; -INSERT INTO t1 SELECT * FROM t1; -INSERT INTO t1 SELECT * FROM t1; -INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT '','','','','','','','' FROM seq_1_to_114688; ROLLBACK; SET DEBUG_SYNC = 'now SIGNAL dml_done'; diff --git a/mysql-test/suite/innodb/t/alter_mdl_timeout.opt b/mysql-test/suite/innodb/t/alter_mdl_timeout.opt new file mode 100644 index 00000000000..9e0e38bd64a --- /dev/null +++ b/mysql-test/suite/innodb/t/alter_mdl_timeout.opt @@ -0,0 +1 @@ +--lock_wait_timeout=2 diff --git a/mysql-test/suite/innodb/t/alter_mdl_timeout.test b/mysql-test/suite/innodb/t/alter_mdl_timeout.test new file mode 100644 index 00000000000..15e7f524fd0 --- /dev/null +++ b/mysql-test/suite/innodb/t/alter_mdl_timeout.test @@ -0,0 +1,32 @@ +--source include/have_innodb.inc +--source include/have_debug.inc + +create table t1(f1 char(10), f2 char(10) not null, f3 int not null, + f4 int not null, primary key(f3))engine=innodb; +insert into t1 values('a','a', 1, 1), ('b','b', 2, 2), ('c', 'c', 3, 3), ('d', 'd', 4, 4); +SET DEBUG_SYNC="row_merge_after_scan SIGNAL con1_start WAIT_FOR con1_insert"; +SET DEBUG_SYNC="innodb_commit_inplace_alter_table_wait SIGNAL con1_wait WAIT_FOR con1_update"; +send ALTER TABLE t1 ADD UNIQUE INDEX(f1(3), f4), ADD UNIQUE INDEX(f2), ALGORITHM=INPLACE; + +connect(con1,localhost,root,,,); +SET DEBUG_SYNC="now WAIT_FOR con1_start"; +begin; +INSERT INTO t1 VALUES('e','e',5, 5); +SET DEBUG_SYNC="now SIGNAL con1_insert"; +SET DEBUG_SYNC="now WAIT_FOR con1_wait"; +SET DEBUG_SYNC="before_row_upd_sec_new_index_entry SIGNAL con1_update WAIT_FOR alter_rollback"; +SEND UPDATE t1 set f4 = 10 order by f1 desc limit 2; + +connection default; +--error ER_LOCK_WAIT_TIMEOUT +reap; +SET DEBUG_SYNC="now SIGNAL alter_rollback"; + +connection con1; +reap; +commit; + +connection default; +disconnect con1; +DROP TABLE t1; +SET DEBUG_SYNC="RESET"; diff --git a/mysql-test/suite/innodb/t/alter_table.test b/mysql-test/suite/innodb/t/alter_table.test index aca70e61bc6..2b84a37cdce 100644 --- a/mysql-test/suite/innodb/t/alter_table.test +++ b/mysql-test/suite/innodb/t/alter_table.test @@ -80,9 +80,26 @@ ALTER TABLE t ENGINE INNODB; ALTER TABLE t FORCE; DROP TABLE t; -# -# Check that innodb supports transactional=1 -# +--echo # +--echo # MDEV-24763 ALTER TABLE fails to rename a column in SYS_FIELDS +--echo # +CREATE TABLE t1 (a INT, b TEXT, c INT, PRIMARY KEY(b(9)), INDEX(c,a)) +ENGINE=InnoDB; +ALTER TABLE t1 CHANGE COLUMN a u INT; +--replace_column 1 ID +SELECT sf.* FROM information_schema.innodb_sys_fields sf +INNER JOIN information_schema.innodb_sys_indexes si ON sf.index_id=si.index_id +INNER JOIN information_schema.innodb_sys_tables st ON si.table_id=st.table_id +WHERE st.name='test/t1' ORDER BY sf.index_id,sf.pos; +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo # + +--echo # +--echo # Check that innodb supports transactional=1 +--echo # create table t1 (a int) transactional=1 engine=aria; create table t2 (a int) transactional=1 engine=innodb; @@ -91,3 +108,8 @@ show create table t2; alter table t1 engine=innodb; alter table t1 add column b int; drop table t1,t2; + +--echo # +--echo # End of 10.4 tests +--echo # + diff --git a/mysql-test/suite/innodb/t/alter_varchar_change.test b/mysql-test/suite/innodb/t/alter_varchar_change.test index 65dc38a3411..d1ce5d7403e 100644 --- a/mysql-test/suite/innodb/t/alter_varchar_change.test +++ b/mysql-test/suite/innodb/t/alter_varchar_change.test @@ -361,7 +361,15 @@ DROP PROCEDURE get_table_id; # LEN must increase here create table t (a varchar(100)) engine=innodb; -select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a'; +select sc.name, sc.pos, sc.mtype, sc.prtype, sc.len +from information_schema.innodb_sys_columns sc +inner join information_schema.innodb_sys_tables st +on sc.table_id=st.table_id where st.name='test/t' and sc.name='a'; alter table t modify a varchar(110), algorithm=inplace; -select name, pos, mtype, prtype, len from information_schema.innodb_sys_columns where name='a'; +select sc.name, sc.pos, sc.mtype, sc.prtype, sc.len +from information_schema.innodb_sys_columns sc +inner join information_schema.innodb_sys_tables st +on sc.table_id=st.table_id where st.name='test/t' and sc.name='a'; drop table t; + +--echo # End of 10.2 tests diff --git a/mysql-test/suite/innodb/t/default_row_format_alter.test b/mysql-test/suite/innodb/t/default_row_format_alter.test index 1f0b0d56bc4..7cd4d672858 100644 --- a/mysql-test/suite/innodb/t/default_row_format_alter.test +++ b/mysql-test/suite/innodb/t/default_row_format_alter.test @@ -97,6 +97,19 @@ SHOW TABLE STATUS LIKE 't1'; DROP TABLE t1; --echo # +--echo # MDEV-24758 heap-use-after-poison in innobase_add_instant_try/rec_copy +--echo # + +CREATE TABLE t1 (pk INT PRIMARY KEY) CHARACTER SET utf8 ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +SET GLOBAL innodb_default_row_format = REDUNDANT; +ALTER TABLE t1 ADD a CHAR(8) DEFAULT ''; +DROP TABLE t1; +SET GLOBAL innodb_default_row_format = @row_format; + +--echo # End of 10.3 tests + +--echo # --echo # MDEV-23295 Assertion fields[i].same(instant.fields[i]) failed --echo # SET GLOBAL innodb_default_row_format = @row_format; @@ -116,4 +129,6 @@ ALTER TABLE t1 DROP b; SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1'; DROP TABLE t1; +--echo # End of 10.4 tests + SET GLOBAL innodb_default_row_format = @row_format; diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test index 41299e4bc35..a413ea43646 100644 --- a/mysql-test/suite/innodb/t/foreign_key.test +++ b/mysql-test/suite/innodb/t/foreign_key.test @@ -782,6 +782,45 @@ ALTER TABLE t1 ADD UNIQUE INDEX ind9 (b), LOCK=SHARED; SET FOREIGN_KEY_CHECKS= 0; ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (pk); DROP TABLE t1; +SET FOREIGN_KEY_CHECKS= 1; + +--echo # +--echo # MDEV-23455 Hangs + Sig11 in unknown location(s) due to single complex FK query +--echo # +let $constr_prefix= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; +let $fk_ref= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; +let $fk_field= yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy; +let $constr_count= 200; # each 100 constrs is 1 sec of test execution +let $i= 0; + +while ($i < $constr_count) +{ + let $p= $constr_prefix$i; + let $constr= CONSTRAINT $p FOREIGN KEY ($fk_field) REFERENCES t1($fk_ref) ON UPDATE SET NULL; + if ($i) + { + let $constrs= $constrs, $constr; + } + if (!$i) + { + let $constrs= $constr; + } + inc $i; +} +--disable_query_log +--echo Parsing foreign keys 1... +--error ER_CANT_CREATE_TABLE +eval create table t0($fk_field int, $constrs) engine innodb; +--echo Parsing foreign keys 2... +--error ER_CANT_CREATE_TABLE +eval create table t1($fk_field int, $constrs) engine innodb; +--echo Parsing foreign keys 3... +--error ER_CANT_CREATE_TABLE +eval create table t1($fk_ref int, $fk_field int, $constrs) engine innodb; +--echo Parsing foreign keys 4... +eval create table t1($fk_ref int primary key, $fk_field int, $constrs) engine innodb; +drop table t1; +--enable_query_log --echo # End of 10.2 tests diff --git a/mysql-test/suite/innodb/t/innodb-virtual-columns2.test b/mysql-test/suite/innodb/t/innodb-virtual-columns2.test index 474a6354576..13ecffcc896 100644 --- a/mysql-test/suite/innodb/t/innodb-virtual-columns2.test +++ b/mysql-test/suite/innodb/t/innodb-virtual-columns2.test @@ -52,3 +52,23 @@ SELECT * FROM t1 WHERE y BETWEEN 2012 AND 2016 FOR UPDATE; INSERT INTO t1 (i) VALUES (1),(2); SELECT * FROM t1 WHERE y BETWEEN 2012 AND 2016 FOR UPDATE; DROP TABLE t1; + +--echo # +--echo # MDEV-23632 ALTER TABLE...ADD KEY creates corrupted index on virtual column +--echo # + +CREATE TABLE t1(a INT PRIMARY KEY, b INT, g INT GENERATED ALWAYS AS(b)VIRTUAL) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,1,default); +ALTER TABLE t1 ADD COLUMN c INT; +ALTER TABLE t1 ADD KEY(g); +CHECK TABLE t1; +SELECT g FROM t1 FORCE INDEX (g); +DROP TABLE t1; + +CREATE TABLE t1(a INT, b INT, g INT GENERATED ALWAYS AS(b)VIRTUAL) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,1,default); +ALTER TABLE t1 ADD COLUMN c INT PRIMARY KEY; # Triggers `new_clustered` +ALTER TABLE t1 ADD KEY(g); +CHECK TABLE t1; +SELECT g FROM t1 FORCE INDEX (g); +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test index a81e6c3f900..ba5126e4757 100644 --- a/mysql-test/suite/innodb/t/innodb.test +++ b/mysql-test/suite/innodb/t/innodb.test @@ -2592,3 +2592,21 @@ SELECT * FROM t2; DROP TABLE t1; DROP TABLE t2; + +--echo # +--echo # MDEV-24748 Extern field check missing +--echo # in btr_index_rec_validate() +--echo # +CREATE TABLE t1 (pk INT, c1 char(255), +c2 char(255), c3 char(255), c4 char(255), +c5 char(255), c6 char(255), c7 char(255), +c8 char(255), primary key (pk) +) CHARACTER SET utf32 ENGINE=InnoDB; + +INSERT INTO t1 VALUES + (1, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'), + (2, 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p'); +CHECK TABLE t1; +ALTER TABLE t1 FORCE; +# Cleanup +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_fail.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_fail.test new file mode 100644 index 00000000000..1d938e12e78 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_fail.test @@ -0,0 +1,11 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +call mtr.add_suppression("InnoDB: Cannot allocate memory for the buffer pool"); +call mtr.add_suppression("InnoDB: Plugin initialization aborted at srv0start.cc.*"); +call mtr.add_suppression("Plugin 'InnoDB' init function returned error."); +call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed."); +--echo # +--echo # MDEV-25019 memory allocation failures during startup cause server failure in different, confusing ways +--echo # +let restart_parameters=--debug_dbug="+d,ib_buf_chunk_init_fails"; +--source include/restart_mysqld.inc diff --git a/mysql-test/suite/innodb/t/innodb_bug60049-master.opt b/mysql-test/suite/innodb/t/innodb_bug60049-master.opt deleted file mode 100644 index 22a5d4ed221..00000000000 --- a/mysql-test/suite/innodb/t/innodb_bug60049-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb_fast_shutdown=0 diff --git a/mysql-test/suite/innodb/t/innodb_bug60049.test b/mysql-test/suite/innodb/t/innodb_bug60049.test deleted file mode 100644 index cb05ca297ea..00000000000 --- a/mysql-test/suite/innodb/t/innodb_bug60049.test +++ /dev/null @@ -1,49 +0,0 @@ -# Bug #60049 Verify that purge leaves no garbage in unique secondary indexes -# This test requires a fresh server start-up and a slow shutdown. -# This was a suspected bug (not a bug). - --- source include/not_embedded.inc --- source include/have_innodb.inc --- source include/have_innodb_16k.inc - --- disable_query_log -call mtr.add_suppression('\\[ERROR\\] InnoDB: Table `mysql`.`innodb_(table|index)_stats` not found'); -call mtr.add_suppression('\\[ERROR\\] InnoDB: Fetch of persistent statistics requested for table `mysql`.`gtid_executed`'); - -let $create1 = query_get_value(SHOW CREATE TABLE mysql.innodb_table_stats, Create Table, 1); -let $create2 = query_get_value(SHOW CREATE TABLE mysql.innodb_index_stats, Create Table, 1); -DROP TABLE mysql.innodb_index_stats; -DROP TABLE mysql.innodb_table_stats; --- enable_query_log - -CREATE TABLE t(a INT)ENGINE=InnoDB STATS_PERSISTENT=0; -RENAME TABLE t TO u; -DROP TABLE u; -SELECT @@innodb_fast_shutdown; -let $MYSQLD_DATADIR=`select @@datadir`; - ---source include/shutdown_mysqld.inc - -# Check the tail of ID_IND (SYS_TABLES.ID) -let IBDATA1=$MYSQLD_DATADIR/ibdata1; -perl; -my $file = $ENV{'IBDATA1'}; -open(FILE, "<$file") || die "Unable to open $file"; -# Read DICT_HDR_TABLE_IDS, the root page number of ID_IND (SYS_TABLES.ID). -seek(FILE, 7*16384+38+36, 0) || die "Unable to seek $file"; -die unless read(FILE, $_, 4) == 4; -my $sys_tables_id_root = unpack("N", $_); -print "Last record of ID_IND root page ($sys_tables_id_root):\n"; -# This should be the last record in ID_IND. Dump it in hexadecimal. -seek(FILE, $sys_tables_id_root*16384 + 152, 0) || die "Unable to seek $file"; -read(FILE, $_, 32) || die "Unable to read $file"; -close(FILE); -print unpack("H*", $_), "\n"; -EOF - ---source include/start_mysqld.inc - --- disable_query_log -USE mysql; -eval $create1; -eval $create2; diff --git a/mysql-test/suite/innodb/t/innodb_multi_update.test b/mysql-test/suite/innodb/t/innodb_multi_update.test index 8d5283a9ed5..74a7aea7d13 100644 --- a/mysql-test/suite/innodb/t/innodb_multi_update.test +++ b/mysql-test/suite/innodb/t/innodb_multi_update.test @@ -35,4 +35,5 @@ 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; +UPDATE (SELECT ((SELECT 1 FROM t1),1) = (1,1) FROM t1 WHERE (SELECT 1 FROM t1)) x, t1 AS d SET d.f1 = 1; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt deleted file mode 100644 index 39b205c9b68..00000000000 --- a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---innodb-file-per-table ---skip-innodb-doublewrite diff --git a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test deleted file mode 100644 index 5a4978c9b37..00000000000 --- a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures.test +++ /dev/null @@ -1,9 +0,0 @@ ---source include/big_test.inc -# test takes too long with valgrind ---source include/not_valgrind.inc ---source include/have_debug.inc ---let $num_inserts = 1500 ---let $num_ops = 3500 ---source suite/innodb/include/innodb_simulate_comp_failures.inc -# clean exit ---exit diff --git a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures_small-master.opt b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures_small-master.opt deleted file mode 100644 index fae32059249..00000000000 --- a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures_small-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---innodb-file-per-table - diff --git a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures_small.test b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures_small.test deleted file mode 100644 index 79a16d36917..00000000000 --- a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures_small.test +++ /dev/null @@ -1,8 +0,0 @@ ---source include/have_debug.inc ---source include/not_valgrind.inc - ---let $num_inserts = 1000 ---let $num_ops = 30 ---source suite/innodb/include/innodb_simulate_comp_failures.inc -# clean exit ---exit diff --git a/mysql-test/suite/innodb/t/instant_alter.test b/mysql-test/suite/innodb/t/instant_alter.test index 83dca4cb5a6..3872f080d6b 100644 --- a/mysql-test/suite/innodb/t/instant_alter.test +++ b/mysql-test/suite/innodb/t/instant_alter.test @@ -1,4 +1,5 @@ --source include/innodb_page_size.inc +--source include/have_sequence.inc --echo # --echo # MDEV-11369: Instant ADD COLUMN for InnoDB @@ -903,3 +904,36 @@ CREATE INDEX i1 ON t1(a) COMMENT 'comment1'; ALTER TABLE t1 DROP INDEX i1, ADD INDEX i1(a) COMMENT 'comment2', ALGORITHM=INSTANT; SHOW CREATE TABLE t1; DROP TABLE t1; + +--echo # +--echo # MDEV-25057 Assertion `n_fields < dtuple_get_n_fields(entry)' +--echo # failed in dtuple_convert_big_rec +--echo # +CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, + a CHAR(255) NOT NULL, + b CHAR(255) NOT NULL, c INT) ENGINE=InnoDB CHARSET utf32; +ALTER TABLE t1 DROP c; +INSERT INTO t1(a, b) SELECT '', '' FROM seq_1_to_16; +SELECT COUNT(*) FROM t1; +# Cleanup +DROP TABLE t1; + +--echo # +--echo # MDEV-25630 Rollback of instant operation adds wrong +--echo # column to secondary index +--echo # +CREATE TABLE t1 (f1 INT, f2 INT, f3 INT, f4 INT, + PRIMARY KEY(f1, f4), + KEY(f2))ENGINE=InnoDB; +CREATE TABLE t2 (f1 INT, f2 INT, PRIMARY KEY(f1), + FOREIGN KEY fk (f2) REFERENCES t2(f1) + )ENGINE=InnoDB; + +ALTER TABLE t1 ADD f5 INT; +SET FOREIGN_KEY_CHECKS=0; +--error ER_FK_FAIL_ADD_SYSTEM +ALTER TABLE t1 DROP COLUMN f3, ADD FOREIGN KEY fk (f1) + REFERENCES x(x); +ALTER TABLE t1 DROP COLUMN f5; +SHOW CREATE TABLE t1; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/innodb/t/instant_alter_charset.test b/mysql-test/suite/innodb/t/instant_alter_charset.test index a5ddd49830c..1d444b88a7f 100644 --- a/mysql-test/suite/innodb/t/instant_alter_charset.test +++ b/mysql-test/suite/innodb/t/instant_alter_charset.test @@ -843,3 +843,17 @@ ALTER TABLE t1 MODIFY a VARCHAR(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; INSERT INTO t1 VALUES ('a'); DROP TABLE t1; + + +--echo # +--echo # MDEV-22775 [HY000][1553] Changing name of primary key column with foreign key constraint fails. +--echo # + +create table t1 (id int primary key) engine=innodb default charset=utf8; +create table t2 (input_id int primary key, id int not null, + key a (id), + constraint a foreign key (id) references t1 (id) +)engine=innodb default charset=utf8; +alter table t1 change id id2 int; +drop table t2; +drop table t1; diff --git a/mysql-test/suite/innodb/t/instant_alter_debug.combinations b/mysql-test/suite/innodb/t/instant_alter_debug.combinations new file mode 100644 index 00000000000..f3bc2cc0c25 --- /dev/null +++ b/mysql-test/suite/innodb/t/instant_alter_debug.combinations @@ -0,0 +1,4 @@ +[redundant] +innodb_default_row_format=redundant +[dynamic] +innodb_default_row_format=dynamic diff --git a/mysql-test/suite/innodb/t/instant_alter_debug.test b/mysql-test/suite/innodb/t/instant_alter_debug.test index fe80de2ca51..b93b9dd8f1b 100644 --- a/mysql-test/suite/innodb/t/instant_alter_debug.test +++ b/mysql-test/suite/innodb/t/instant_alter_debug.test @@ -1,6 +1,7 @@ --source include/have_innodb.inc --source include/have_debug.inc --source include/have_debug_sync.inc +--source include/have_sequence.inc SET @save_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency; SET GLOBAL innodb_purge_rseg_truncate_frequency=1; @@ -216,6 +217,15 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 SET a=0; ALTER TABLE t1 ADD COLUMN b INT NOT NULL DEFAULT 2, ADD COLUMN c INT; +DELIMITER $$; +BEGIN NOT ATOMIC + DECLARE c TEXT DEFAULT(SELECT CONCAT('ALTER TABLE t1 ADD (c', + GROUP_CONCAT(seq SEPARATOR ' INT, c'), ' INT), ALGORITHM=INSTANT;') FROM seq_1_to_130); + EXECUTE IMMEDIATE c; +END; +$$ +DELIMITER ;$$ + connection stop_purge; START TRANSACTION WITH CONSISTENT SNAPSHOT; @@ -233,6 +243,7 @@ connection default; SET DEBUG_SYNC = 'now WAIT_FOR copied'; let $wait_all_purged = 1; --source include/wait_all_purged.inc +let $wait_all_purged = 0; INSERT INTO t1 SET a=1; INSERT INTO t1 SET a=2,b=3,c=4; SET DEBUG_SYNC = 'now SIGNAL logged'; @@ -242,7 +253,7 @@ reap; connection default; SET DEBUG_SYNC = RESET; -SELECT * FROM t1; +SELECT a, b, c FROM t1; ALTER TABLE t1 DROP b, ALGORITHM=INSTANT; connection stop_purge; START TRANSACTION WITH CONSISTENT SNAPSHOT; @@ -260,6 +271,7 @@ connection default; SET DEBUG_SYNC = 'now WAIT_FOR copied'; let $wait_all_purged = 1; --source include/wait_all_purged.inc +let $wait_all_purged = 0; INSERT INTO t1 SET a=1; INSERT INTO t1 SET a=2,c=4; SET DEBUG_SYNC = 'now SIGNAL logged'; @@ -270,7 +282,7 @@ UPDATE t1 SET b = b + 1 WHERE a = 2; connection default; SET DEBUG_SYNC = RESET; -SELECT * FROM t1; +SELECT a, b, c FROM t1; --echo # --echo # MDEV-15872 Crash in online ALTER TABLE...ADD PRIMARY KEY @@ -297,7 +309,7 @@ disconnect ddl; connection default; SET DEBUG_SYNC = RESET; -SELECT * FROM t1; +SELECT a, b, c, d FROM t1; DROP TABLE t1; --echo # @@ -326,44 +338,6 @@ SELECT * FROM t1; DROP TABLE t1; --echo # ---echo # MDEV-17899 Assertion failures on rollback of instant ADD/DROP ---echo # MDEV-18098 Crash after rollback of instant DROP COLUMN ---echo # - -SET @save_dbug = @@SESSION.debug_dbug; -SET debug_dbug='+d,ib_commit_inplace_fail_1'; -CREATE TABLE t1 (a int, b int) ENGINE=InnoDB; -INSERT INTO t1 VALUES (1,2); ---error ER_INTERNAL_ERROR -ALTER TABLE t1 DROP COLUMN b; ---error ER_INTERNAL_ERROR -ALTER TABLE t1 DROP COLUMN b; ---error ER_INTERNAL_ERROR -ALTER TABLE t1 ADD COLUMN c INT; -SELECT * FROM t1; -DROP TABLE t1; - -CREATE TABLE t1 (a int, b int) ENGINE=InnoDB; ---error ER_INTERNAL_ERROR -ALTER TABLE t1 ADD COLUMN c INT; -BEGIN; -INSERT INTO t1 VALUES(1, 1); -ROLLBACK; ---error ER_INTERNAL_ERROR -ALTER TABLE t1 DROP COLUMN b; -INSERT INTO t1 values (1,1); -SELECT * FROM t1; -DROP TABLE t1; - -SET debug_dbug = @save_dbug; - -SELECT variable_value-@old_instant instants -FROM information_schema.global_status -WHERE variable_name = 'innodb_instant_alter_column'; - -SET GLOBAL innodb_purge_rseg_truncate_frequency = @save_frequency; - ---echo # --echo # MDEV-21045 AddressSanitizer: use-after-poison in mem_heap_dup / row_log_table_get_pk_col --echo # CREATE TABLE t1 (a TEXT) ENGINE = InnoDB ROW_FORMAT=REDUNDANT; @@ -414,3 +388,134 @@ SELECT * FROM t1; SET DEBUG_SYNC='RESET'; --disconnect con2 DROP TABLE t1; + +--echo # +--echo # MDEV-24653 Assertion block->page.id.page_no() == index->page failed +--echo # in innobase_add_instant_try() +--echo # + +SET @saved_limit = @@GLOBAL.innodb_limit_optimistic_insert_debug; +SET GLOBAL innodb_limit_optimistic_insert_debug = 2; + +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1),(2),(3),(4); +ALTER TABLE t1 ADD COLUMN b INT; +DELETE FROM t1; +--source include/wait_all_purged.inc +ALTER TABLE t1 ADD COLUMN c INT; + +SELECT * FROM t1; +DROP TABLE t1; +SET GLOBAL innodb_limit_optimistic_insert_debug = @saved_limit; + +--echo # +--echo # MDEV-24796 Assertion page_has_next... failed +--echo # in btr_pcur_store_position() +--echo # + +CREATE TABLE t1 (c INT KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1),(2); +SET GLOBAL innodb_limit_optimistic_insert_debug=2; +ALTER TABLE t1 ADD COLUMN d INT; +DELETE FROM t1; +--source include/wait_all_purged.inc +SELECT * FROM t1 WHERE c<>1 ORDER BY c DESC; +DROP TABLE t1; + +SET GLOBAL innodb_limit_optimistic_insert_debug = @saved_limit; + +--echo # +--echo # MDEV-24620 ASAN heap-buffer-overflow in btr_pcur_restore_position() +--echo # + +CREATE TABLE t1 (a VARCHAR(1) PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +connect (stop_purge,localhost,root,,); +START TRANSACTION WITH CONSISTENT SNAPSHOT; + +connection default; +ALTER TABLE t1 ADD c INT; +BEGIN; +DELETE FROM t1; + +connect (dml,localhost,root,,test); +SET DEBUG_SYNC='row_mysql_handle_errors SIGNAL s1 WAIT_FOR s2'; +send UPDATE t1 SET c=1; + +connection default; +SET DEBUG_SYNC='now WAIT_FOR s1'; +COMMIT; + +connection stop_purge; +COMMIT; +disconnect stop_purge; + +connection default; +--source include/wait_all_purged.inc +SET DEBUG_SYNC='now SIGNAL s2'; + +connection dml; +reap; +disconnect dml; + +connection default; +SET DEBUG_SYNC=RESET; +DROP TABLE t1; + +--echo # End of 10.3 tests + +--echo # +--echo # MDEV-17899 Assertion failures on rollback of instant ADD/DROP +--echo # MDEV-18098 Crash after rollback of instant DROP COLUMN +--echo # + +SET @save_dbug = @@SESSION.debug_dbug; +SET debug_dbug='+d,ib_commit_inplace_fail_1'; +CREATE TABLE t1 (a int, b int) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,2); +--error ER_INTERNAL_ERROR +ALTER TABLE t1 DROP COLUMN b; +--error ER_INTERNAL_ERROR +ALTER TABLE t1 DROP COLUMN b; +--error ER_INTERNAL_ERROR +ALTER TABLE t1 ADD COLUMN c INT; +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (a int, b int) ENGINE=InnoDB; +--error ER_INTERNAL_ERROR +ALTER TABLE t1 ADD COLUMN c INT; +BEGIN; +INSERT INTO t1 VALUES(1, 1); +ROLLBACK; +--error ER_INTERNAL_ERROR +ALTER TABLE t1 DROP COLUMN b; +INSERT INTO t1 values (1,1); +SELECT * FROM t1; +DROP TABLE t1; + +SET debug_dbug = @save_dbug; + +--echo # +--echo # MDEV-24512 Assertion failed in rec_is_metadata() +--echo # in btr_discard_only_page_on_level() +--echo # + +SET @save_limit= @@GLOBAL.innodb_limit_optimistic_insert_debug; +SET GLOBAL innodb_limit_optimistic_insert_debug=2; +CREATE TABLE t1 (c CHAR(1) UNIQUE) ENGINE=InnoDB; + +ALTER TABLE t1 ADD c2 INT NOT NULL DEFAULT 0 FIRST; +--error ER_DUP_ENTRY +INSERT INTO t1 (c) VALUES ('x'),('d'),('r'),('f'),('y'),('u'),('m'),('d'); +SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # End of 10.4 tests + +SET GLOBAL innodb_purge_rseg_truncate_frequency = @save_frequency; + +SELECT variable_value-@old_instant instants +FROM information_schema.global_status +WHERE variable_name = 'innodb_instant_alter_column'; diff --git a/mysql-test/suite/innodb/t/mvcc_secondary.test b/mysql-test/suite/innodb/t/mvcc_secondary.test new file mode 100644 index 00000000000..93c91c40076 --- /dev/null +++ b/mysql-test/suite/innodb/t/mvcc_secondary.test @@ -0,0 +1,26 @@ +--source include/innodb_page_size_small.inc + +--echo # +--echo # MDEV-25459 MVCC read from index on CHAR or VARCHAR wrongly omits rows +--echo # + +CREATE TABLE t1 ( + pk int PRIMARY KEY, c varchar(255) UNIQUE, + d char(255), e varchar(255), f char(255), g char(255) +) ENGINE=InnoDB ROW_FORMAT=DYNAMIC DEFAULT CHARACTER SET ucs2; + +INSERT INTO t1 VALUES +(1,REPEAT('c',248),REPEAT('a',106),REPEAT('b',220),REPEAT('x',14),''); + +BEGIN; +UPDATE t1 SET c=REPEAT('d',170); + +connect (con1,localhost,root,,); +SELECT pk FROM t1 FORCE INDEX (c); +connection default; +COMMIT; +connection con1; +SELECT pk FROM t1 FORCE INDEX (c); +disconnect con1; +connection default; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test index 8e3ddf95634..13c203b587b 100644 --- a/mysql-test/suite/innodb/t/temporary_table.test +++ b/mysql-test/suite/innodb/t/temporary_table.test @@ -502,3 +502,110 @@ SET FOREIGN_KEY_CHECKS = 0; --error ER_CANT_CREATE_TABLE CREATE TEMPORARY TABLE t1(f1 INT NOT NULL, FOREIGN KEY(f1) REFERENCES t0(f1))ENGINE=InnoDB; + +CREATE TABLE t (c INT) ENGINE=InnoDB; +INSERT INTO t VALUES(0); +CREATE TEMPORARY TABLE t2 (c INT) ENGINE=InnoDB; +START TRANSACTION READ ONLY; +INSERT INTO t2 SELECT * FROM t; +COMMIT; +DROP TABLE t, t2; + +CREATE TEMPORARY TABLE t (c INT,c2 INT) ENGINE=InnoDB; +START TRANSACTION READ ONLY; +--error ER_WRONG_VALUE_COUNT_ON_ROW +INSERT INTO t VALUES(0); +SAVEPOINT s; +INSERT INTO t VALUES(0,0); +COMMIT; +DROP TABLE t; + +CREATE TEMPORARY TABLE t (c INT,c2 INT) ENGINE=InnoDB; +START TRANSACTION READ ONLY; +--error ER_WRONG_VALUE_COUNT_ON_ROW +INSERT INTO t VALUES(0); +SAVEPOINT s; +INSERT INTO t VALUES(0,0); +ROLLBACK; +DROP TABLE t; + +CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +START TRANSACTION READ ONLY; +UPDATE t1 SET a= 2; +COMMIT; +DROP TABLE t1; + +CREATE TEMPORARY TABLE t(c INT) ENGINE=InnoDB; +SET SESSION tx_read_only=TRUE; +LOCK TABLE test.t READ; +SELECT * FROM t; +INSERT INTO t VALUES(0xADC3); +SET SESSION tx_read_only=FALSE; +DROP TABLE t; + +CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +START TRANSACTION READ ONLY; +UPDATE t1 SET a= 2; +COMMIT; +DROP TABLE t1; + +CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY, b int) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 1); +START TRANSACTION READ ONLY; +UPDATE t1 SET b= 2; +COMMIT; +DROP TABLE t1; + +CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY, b int, c varchar(255)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 1, repeat('a', 200)); +START TRANSACTION READ ONLY; +UPDATE t1 SET b= 2, c=repeat('a', 250); +COMMIT; +DROP TABLE t1; + +CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +START TRANSACTION READ ONLY; +UPDATE t1 SET a= 2; +ROLLBACK; +DROP TABLE t1; + +CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +START TRANSACTION READ ONLY; +DELETE FROM t1 WHERE a= 2; +COMMIT; +DROP TABLE t1; + +CREATE TEMPORARY TABLE tmp (a INT) ENGINE=InnoDB; +INSERT INTO tmp () VALUES (),(); +SET TX_READ_ONLY= 1; +INSERT INTO tmp SELECT * FROM tmp; +SET TX_READ_ONLY= 0; +DROP TABLE tmp; + +SET sql_mode=''; +SET GLOBAL tx_read_only=TRUE; +CREATE TEMPORARY TABLE t (c INT); +SET SESSION tx_read_only=DEFAULT; +INSERT INTO t VALUES(1); +INSERT INTO t SELECT * FROM t; +SET SESSION tx_read_only=FALSE; +SET GLOBAL tx_read_only=OFF; +DROP TABLE t; + +CREATE TEMPORARY TABLE t(a INT); +SET SESSION tx_read_only=ON; +LOCK TABLE t READ; +SELECT COUNT(*)FROM t; +INSERT INTO t VALUES (0); +SET SESSION tx_read_only=OFF; +DROP TABLE t; + +CREATE TEMPORARY TABLE t (a INT) ENGINE=InnoDB; +INSERT INTO t VALUES (1); +START TRANSACTION READ ONLY; +UPDATE t SET a = NULL; +ROLLBACK; diff --git a/mysql-test/suite/innodb/t/truncate_foreign.test b/mysql-test/suite/innodb/t/truncate_foreign.test index d9d647e69f0..1c150e5db40 100644 --- a/mysql-test/suite/innodb/t/truncate_foreign.test +++ b/mysql-test/suite/innodb/t/truncate_foreign.test @@ -67,3 +67,16 @@ connection default; SET DEBUG_SYNC = RESET; DROP TABLE child, parent; + +--echo # +--echo # MDEV-24532 Table corruption ER_NO_SUCH_TABLE_IN_ENGINE or +--echo # ER_CRASHED_ON_USAGE after ALTER on table with foreign key +--echo # + +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a)) ENGINE=InnoDB; +ALTER TABLE t1 ADD FOREIGN KEY (b) REFERENCES t1 (a) ON UPDATE CASCADE; +LOCK TABLE t1 WRITE; +TRUNCATE TABLE t1; +ALTER TABLE t1 ADD c INT; +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_fts/r/create.result b/mysql-test/suite/innodb_fts/r/create.result index 55c5c45f643..3ca24f5253d 100644 --- a/mysql-test/suite/innodb_fts/r/create.result +++ b/mysql-test/suite/innodb_fts/r/create.result @@ -178,3 +178,13 @@ Table Op Msg_type Msg_text test.t1 optimize status OK DROP TABLE t1; SET GLOBAL innodb_optimize_fulltext_only= @optimize_fulltext.save; +# +# MDEV-24403 Segfault on CREATE TABLE with explicit FTS_DOC_ID_INDEX by multiple fields +# +create table t1 ( +f1 int, f2 text, +FTS_DOC_ID bigint unsigned not null, +unique key FTS_DOC_ID_INDEX(FTS_DOC_ID, f1), +fulltext (f2)) +engine=innodb; +ERROR 42000: Incorrect index name 'FTS_DOC_ID_INDEX' diff --git a/mysql-test/suite/innodb_fts/r/fulltext.result b/mysql-test/suite/innodb_fts/r/fulltext.result index 0e30dd0be05..abcdebca01d 100644 --- a/mysql-test/suite/innodb_fts/r/fulltext.result +++ b/mysql-test/suite/innodb_fts/r/fulltext.result @@ -689,3 +689,33 @@ FTS_DOC_ID t 2 foo bar 3 foo DROP TABLE t; +# +# MDEV-25295 Aborted FTS_DOC_ID_INDEX considered as +# existing FTS_DOC_ID_INDEX during DDL +# +SET sql_mode=''; +CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED NOT NULL,title CHAR(1),body TEXT)engine=innodb; +INSERT INTO t1 (FTS_DOC_ID,title,body)VALUES(1,0,0), (1,0,0); +CREATE FULLTEXT INDEX idx1 ON t1 (title,body); +ERROR 23000: Duplicate entry '' for key '*UNKNOWN*' +CREATE FULLTEXT INDEX idx1 ON t1 (title,body); +ERROR 23000: Duplicate entry '' for key '*UNKNOWN*' +DROP TABLE t1; +SET sql_mode = DEFAULT; +# +# MDEV-25070 SIGSEGV in fts_create_in_mem_aux_table +# +CREATE TABLE t1 (a CHAR, FULLTEXT KEY(a)) ENGINE=InnoDB; +ALTER TABLE t1 DISCARD TABLESPACE; +ALTER TABLE t1 ADD FULLTEXT INDEX (a); +Warnings: +Warning 1814 Tablespace has been discarded for table `t1` +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(1) DEFAULT NULL, + FULLTEXT KEY `a` (`a`), + FULLTEXT KEY `a_2` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; +# End of 10.3 tests diff --git a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result index 7d98aba7fc3..b50bf047265 100644 --- a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result +++ b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result @@ -232,6 +232,38 @@ CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY, f1 VARCHAR(200),FULLTEXT fidx(f1))engine=innodb; ALTER TABLE t1 DROP index fidx, ADD FULLTEXT INDEX(f1); DROP TABLE t1; +# +# MDEV-21478 Inplace alter fails to report error when +# FTS_DOC_ID is added +SET NAMES utf8; +CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB; +ALTER TABLE t1 ADD FTS_DOC_ıD BIGINT UNSIGNED NOT NULL, ALGORITHM=COPY; +ALTER TABLE t1 DROP COLUMN FTS_DOC_ıD; +ALTER TABLE t1 ADD FTS_DOC_ıD BIGINT UNSIGNED NOT NULL, ALGORITHM=INPLACE; +DROP TABLE t1; +CREATE TABLE t1 (f1 INT NOT NULL)ENGINE=InnoDB; +ALTER TABLE t1 ADD FTS_DOC_İD BIGINT UNSIGNED NOT NULL, ALGORITHM=INPLACE; +ERROR 42000: Incorrect column name 'FTS_DOC_İD' +ALTER TABLE t1 ADD FTS_DOC_İD BIGINT UNSIGNED NOT NULL, ALGORITHM=COPY; +ERROR 42000: Incorrect column name 'FTS_DOC_İD' +ALTER TABLE t1 ADD fts_doc_id INT, ALGORITHM=COPY; +ERROR 42000: Incorrect column name 'fts_doc_id' +ALTER TABLE t1 ADD fts_doc_id INT, ALGORITHM=INPLACE; +ERROR 42000: Incorrect column name 'fts_doc_id' +ALTER TABLE t1 ADD fts_doc_id BIGINT UNSIGNED NOT NULL, ALGORITHM=COPY; +ERROR 42000: Incorrect column name 'fts_doc_id' +ALTER TABLE t1 ADD fts_doc_id BIGINT UNSIGNED NOT NULL, ALGORITHM=INPLACE; +ERROR 42000: Incorrect column name 'fts_doc_id' +ALTER TABLE t1 ADD FTS_DOC_ID INT UNSIGNED NOT NULL, ALGORITHM=COPY; +ERROR 42000: Incorrect column name 'FTS_DOC_ID' +ALTER TABLE t1 ADD FTS_DOC_ID INT UNSIGNED NOT NULL, ALGORITHM=INPLACE; +ERROR 42000: Incorrect column name 'FTS_DOC_ID' +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB; ALTER TABLE t1 ADD FULLTEXT KEY(a), ADD COLUMN b VARCHAR(3), ADD FULLTEXT KEY(b); DROP TABLE t1; @@ -244,3 +276,4 @@ CREATE TABLE t1 ENGINE=InnoDB; ALTER TABLE t1 ADD c SERIAL; DROP TABLE t1; +# End of 10.3 tests diff --git a/mysql-test/suite/innodb_fts/r/misc_debug.result b/mysql-test/suite/innodb_fts/r/misc_debug.result index f1110797f33..10e3cf8874d 100644 --- a/mysql-test/suite/innodb_fts/r/misc_debug.result +++ b/mysql-test/suite/innodb_fts/r/misc_debug.result @@ -26,3 +26,29 @@ SET DEBUG_DBUG="+d,fts_instrument_sync"; INSERT INTO t1 VALUES(1, "mariadb"); ALTER TABLE t1 FORCE; DROP TABLE t2, t1; +# +# MDEV-25200 Index count mismatch due to aborted FULLTEXT INDEX +# +CREATE TABLE t1(a INT, b TEXT, c TEXT, FULLTEXT INDEX(b)) ENGINE=InnoDB; +connect con1,localhost,root,,test; +SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL s1 WAIT_FOR g1'; +SET DEBUG_SYNC='innodb_commit_inplace_alter_table_enter SIGNAL s2 WAIT_FOR g2'; +ALTER TABLE t1 ADD FULLTEXT(c); +connection default; +SET DEBUG_SYNC='now WAIT_FOR s1'; +KILL QUERY @id; +SET DEBUG_SYNC='now SIGNAL g1 WAIT_FOR s2'; +START TRANSACTION; +SELECT * FROM t1; +a b c +SET DEBUG_SYNC='now SIGNAL s2'; +connection con1; +ERROR 70100: Query execution was interrupted +disconnect con1; +connection default; +SET DEBUG_SYNC=RESET; +ALTER TABLE t1 ADD bl INT AS (LENGTH(b)) VIRTUAL; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_fts/t/create.test b/mysql-test/suite/innodb_fts/t/create.test index 4e522994fcc..38c93de4982 100644 --- a/mysql-test/suite/innodb_fts/t/create.test +++ b/mysql-test/suite/innodb_fts/t/create.test @@ -106,3 +106,14 @@ SET GLOBAL innodb_optimize_fulltext_only= 1; OPTIMIZE TABLE t1; DROP TABLE t1; SET GLOBAL innodb_optimize_fulltext_only= @optimize_fulltext.save; + +--echo # +--echo # MDEV-24403 Segfault on CREATE TABLE with explicit FTS_DOC_ID_INDEX by multiple fields +--echo # +--error ER_WRONG_NAME_FOR_INDEX +create table t1 ( + f1 int, f2 text, + FTS_DOC_ID bigint unsigned not null, + unique key FTS_DOC_ID_INDEX(FTS_DOC_ID, f1), + fulltext (f2)) +engine=innodb; diff --git a/mysql-test/suite/innodb_fts/t/fulltext.test b/mysql-test/suite/innodb_fts/t/fulltext.test index 663b202265b..f3bcaaec5cc 100644 --- a/mysql-test/suite/innodb_fts/t/fulltext.test +++ b/mysql-test/suite/innodb_fts/t/fulltext.test @@ -717,3 +717,28 @@ while ($N) } DROP TABLE t; + +--echo # +--echo # MDEV-25295 Aborted FTS_DOC_ID_INDEX considered as +--echo # existing FTS_DOC_ID_INDEX during DDL +--echo # +SET sql_mode=''; +CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED NOT NULL,title CHAR(1),body TEXT)engine=innodb; +INSERT INTO t1 (FTS_DOC_ID,title,body)VALUES(1,0,0), (1,0,0); +--error ER_DUP_ENTRY +CREATE FULLTEXT INDEX idx1 ON t1 (title,body); +--error ER_DUP_ENTRY +CREATE FULLTEXT INDEX idx1 ON t1 (title,body); +DROP TABLE t1; +SET sql_mode = DEFAULT; + +--echo # +--echo # MDEV-25070 SIGSEGV in fts_create_in_mem_aux_table +--echo # +CREATE TABLE t1 (a CHAR, FULLTEXT KEY(a)) ENGINE=InnoDB; +ALTER TABLE t1 DISCARD TABLESPACE; +ALTER TABLE t1 ADD FULLTEXT INDEX (a); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +--echo # End of 10.3 tests diff --git a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test index cca110f3550..7c56811a2d9 100644 --- a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test +++ b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test @@ -278,6 +278,47 @@ CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY, ALTER TABLE t1 DROP index fidx, ADD FULLTEXT INDEX(f1); DROP TABLE t1; +--echo # +--echo # MDEV-21478 Inplace alter fails to report error when +--echo # FTS_DOC_ID is added + +SET NAMES utf8; + +CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB; +ALTER TABLE t1 ADD FTS_DOC_ıD BIGINT UNSIGNED NOT NULL, ALGORITHM=COPY; +ALTER TABLE t1 DROP COLUMN FTS_DOC_ıD; +ALTER TABLE t1 ADD FTS_DOC_ıD BIGINT UNSIGNED NOT NULL, ALGORITHM=INPLACE; +DROP TABLE t1; + +CREATE TABLE t1 (f1 INT NOT NULL)ENGINE=InnoDB; + +--error ER_WRONG_COLUMN_NAME +ALTER TABLE t1 ADD FTS_DOC_İD BIGINT UNSIGNED NOT NULL, ALGORITHM=INPLACE; + +--error ER_WRONG_COLUMN_NAME +ALTER TABLE t1 ADD FTS_DOC_İD BIGINT UNSIGNED NOT NULL, ALGORITHM=COPY; + +--error ER_WRONG_COLUMN_NAME +ALTER TABLE t1 ADD fts_doc_id INT, ALGORITHM=COPY; + +--error ER_WRONG_COLUMN_NAME +ALTER TABLE t1 ADD fts_doc_id INT, ALGORITHM=INPLACE; + +--error ER_WRONG_COLUMN_NAME +ALTER TABLE t1 ADD fts_doc_id BIGINT UNSIGNED NOT NULL, ALGORITHM=COPY; + +--error ER_WRONG_COLUMN_NAME +ALTER TABLE t1 ADD fts_doc_id BIGINT UNSIGNED NOT NULL, ALGORITHM=INPLACE; + +--error ER_WRONG_COLUMN_NAME +ALTER TABLE t1 ADD FTS_DOC_ID INT UNSIGNED NOT NULL, ALGORITHM=COPY; + +--error ER_WRONG_COLUMN_NAME +ALTER TABLE t1 ADD FTS_DOC_ID INT UNSIGNED NOT NULL, ALGORITHM=INPLACE; + +SHOW CREATE TABLE t1; +DROP TABLE t1; + # Add more than one FTS index CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB; ALTER TABLE t1 ADD FULLTEXT KEY(a), ADD COLUMN b VARCHAR(3), ADD FULLTEXT KEY(b); @@ -294,3 +335,5 @@ CREATE TABLE t1 ENGINE=InnoDB; ALTER TABLE t1 ADD c SERIAL; DROP TABLE t1; + +--echo # End of 10.3 tests diff --git a/mysql-test/suite/innodb_fts/t/misc_debug.test b/mysql-test/suite/innodb_fts/t/misc_debug.test index aaf628abe6d..461e3f1d9d4 100644 --- a/mysql-test/suite/innodb_fts/t/misc_debug.test +++ b/mysql-test/suite/innodb_fts/t/misc_debug.test @@ -5,6 +5,8 @@ --source include/have_innodb.inc --source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/count_sessions.inc # Following test is for Bug 14668777 - ASSERT ON IB_VECTOR_SIZE( # TABLE->FTS->INDEXES, ALTER TABLE @@ -52,3 +54,32 @@ INSERT INTO t1 VALUES(1, "mariadb"); ALTER TABLE t1 FORCE; # Cleanup DROP TABLE t2, t1; + +--echo # +--echo # MDEV-25200 Index count mismatch due to aborted FULLTEXT INDEX +--echo # +CREATE TABLE t1(a INT, b TEXT, c TEXT, FULLTEXT INDEX(b)) ENGINE=InnoDB; +connect(con1,localhost,root,,test); +let $ID= `SELECT @id := CONNECTION_ID()`; +SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL s1 WAIT_FOR g1'; +SET DEBUG_SYNC='innodb_commit_inplace_alter_table_enter SIGNAL s2 WAIT_FOR g2'; +send ALTER TABLE t1 ADD FULLTEXT(c); +connection default; +SET DEBUG_SYNC='now WAIT_FOR s1'; +let $ignore= `SELECT @id := $ID`; +KILL QUERY @id; +SET DEBUG_SYNC='now SIGNAL g1 WAIT_FOR s2'; +START TRANSACTION; +SELECT * FROM t1; +SET DEBUG_SYNC='now SIGNAL s2'; +connection con1; +--error ER_QUERY_INTERRUPTED +reap; +disconnect con1; +connection default; +SET DEBUG_SYNC=RESET; +# Exploit MDEV-17468 to force the table definition to be reloaded +ALTER TABLE t1 ADD bl INT AS (LENGTH(b)) VIRTUAL; +CHECK TABLE t1; +DROP TABLE t1; +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/suite/innodb_gis/t/1.test b/mysql-test/suite/innodb_gis/t/1.test index 7c9199c59ae..f08fdaddbda 100644 --- a/mysql-test/suite/innodb_gis/t/1.test +++ b/mysql-test/suite/innodb_gis/t/1.test @@ -393,7 +393,6 @@ insert into t1 values (1); insert into t1 values (1.11); --error 1416 insert into t1 values ("qwerty"); -# --error ER_GIS_INVALID_DATA --error ER_BAD_NULL_ERROR insert into t1 values (ST_pointfromtext('point(1,1)')); @@ -437,7 +436,6 @@ select ST_y(b) IS NULL from t1; -# --error ER_GIS_INVALID_DATA select MBRwithin(b, b) IS NULL, MBRcontains(b, b) IS NULL, MBRoverlaps(b, b) IS NULL, MBRequals(b, b) IS NULL, MBRdisjoint(b, b) IS NULL, ST_touches(b, b) IS NULL, @@ -466,7 +464,6 @@ DROP TABLE t1; # CREATE TABLE `t1` ( `col9` set('a'), `col89` date); INSERT IGNORE INTO `t1` VALUES ('','0000-00-00'); -# --error ER_GIS_INVALID_DATA select ST_geomfromtext(col9,col89) as a from t1; DROP TABLE t1; @@ -623,17 +620,11 @@ SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRwithin FROM t1 a1 JOIN # MBROverlaps needs a few more tests, with point and line dimensions -# --error ER_GIS_INVALID_DATA SET @vert1 = ST_GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); -# --error ER_GIS_INVALID_DATA SET @horiz1 = ST_GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); -# --error ER_GIS_INVALID_DATA SET @horiz2 = ST_GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); -# --error ER_GIS_INVALID_DATA SET @horiz3 = ST_GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); -# --error ER_GIS_INVALID_DATA SET @point1 = ST_GeomFromText('POLYGON ((0 0))'); -# --error ER_GIS_INVALID_DATA SET @point2 = ST_GeomFromText('POLYGON ((-2 0))'); SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS MBRoverlaps FROM t1 a1 WHERE MBROverlaps(a1.square, @vert1) GROUP BY a1.name; @@ -773,10 +764,8 @@ SELECT 1 FROM (SELECT GREATEST(1,GEOMETRYCOLLECTION('00000','00000')) b FROM DUA --echo # BUG#51875: crash when loading data into geometry function ST_polyfromwkb --echo # SET @a=0x00000000030000000100000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440; -# --error ER_GIS_INVALID_DATA SET @a=ST_POLYFROMWKB(@a); SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440; -# --error ER_GIS_INVALID_DATA SET @a=ST_POLYFROMWKB(@a); @@ -901,7 +890,6 @@ DROP TABLE g1; CREATE TABLE g1(a TEXT NOT NULL, KEY(a(255))); INSERT INTO g1 VALUES ('a'),('a'); -# --error ER_GIS_INVALID_DATA SELECT 1 FROM g1 WHERE a >= ANY (SELECT 1 FROM g1 WHERE a = ST_geomfromtext('') OR a) ; diff --git a/mysql-test/suite/innodb_gis/t/bug16236208.test b/mysql-test/suite/innodb_gis/t/bug16236208.test index b55ab1d0fd3..3a1fbefc52c 100644 --- a/mysql-test/suite/innodb_gis/t/bug16236208.test +++ b/mysql-test/suite/innodb_gis/t/bug16236208.test @@ -47,7 +47,6 @@ ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')); CREATE INDEX linestring_index ON linestring(linestring_nokey(5)); ALTER TABLE linestring ADD KEY (linestring_key(5)); -# --error ER_GIS_INVALID_DATA SELECT ST_AsText(linestring_nokey) FROM linestring FORCE KEY ( linestring_key ) WHERE ST_CONTAINS( ST_GeomFromText('POLYGON( ( 3923 2815 , 4246 2122 , 4028 2971 , 4017 3019 , 3923 2815 ) )') , linestring_key ) AND diff --git a/mysql-test/suite/innodb_gis/t/create_spatial_index.test b/mysql-test/suite/innodb_gis/t/create_spatial_index.test index 7ddece9ad86..ef87a51d372 100644 --- a/mysql-test/suite/innodb_gis/t/create_spatial_index.test +++ b/mysql-test/suite/innodb_gis/t/create_spatial_index.test @@ -1143,7 +1143,6 @@ insert into `t1` values( linestring(point(1,1),point(1,1)) ); -# --error ER_GIS_INVALID_DATA --error ER_BAD_NULL_ERROR insert into `t1` values ( diff --git a/mysql-test/suite/innodb_gis/t/gis.test b/mysql-test/suite/innodb_gis/t/gis.test index 44aec76770a..629bb94b8c5 100644 --- a/mysql-test/suite/innodb_gis/t/gis.test +++ b/mysql-test/suite/innodb_gis/t/gis.test @@ -1,4 +1,4 @@ -# This is a testcase copied from mysql-test/t/gis.test +# This is a testcase copied from mysql-test/main/gis.test --source include/have_innodb.inc -- source include/have_geometry.inc @@ -388,7 +388,6 @@ insert into t1 values (1.11); --error 1416 insert into t1 values ("qwerty"); --error 1048 -# --error ER_GIS_INVALID_DATA insert into t1 values (ST_pointfromtext('point(1,1)')); drop table t1; @@ -431,7 +430,6 @@ select ST_y(b) IS NULL from t1; -# --error ER_GIS_INVALID_DATA select MBRwithin(b, b) IS NULL, MBRcontains(b, b) IS NULL, MBRoverlaps(b, b) IS NULL, MBRequals(b, b) IS NULL, MBRdisjoint(b, b) IS NULL, ST_touches(b, b) IS NULL, @@ -460,7 +458,6 @@ DROP TABLE t1; # CREATE TABLE `t1` ( `col9` set('a'), `col89` date); INSERT IGNORE INTO `t1` VALUES ('','0000-00-00'); -# --error ER_GIS_INVALID_DATA select ST_geomfromtext(col9,col89) as a from t1; DROP TABLE t1; @@ -617,17 +614,11 @@ SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS MBRwithin FROM t1 a1 JOIN # MBROverlaps needs a few more tests, with point and line dimensions -# --error ER_GIS_INVALID_DATA SET @vert1 = ST_GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); -# --error ER_GIS_INVALID_DATA SET @horiz1 = ST_GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); -# --error ER_GIS_INVALID_DATA SET @horiz2 = ST_GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); -# --error ER_GIS_INVALID_DATA SET @horiz3 = ST_GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); -# --error ER_GIS_INVALID_DATA SET @point1 = ST_GeomFromText('POLYGON ((0 0))'); -# --error ER_GIS_INVALID_DATA SET @point2 = ST_GeomFromText('POLYGON ((-2 0))'); SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS MBRoverlaps FROM t1 a1 WHERE MBROverlaps(a1.square, @vert1) GROUP BY a1.name; @@ -767,10 +758,8 @@ SELECT 1 FROM (SELECT GREATEST(1,GEOMETRYCOLLECTION('00000','00000')) b FROM DUA --echo # BUG#51875: crash when loading data into geometry function ST_polyfromwkb --echo # SET @a=0x00000000030000000100000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440; -# --error ER_GIS_INVALID_DATA SET @a=ST_POLYFROMWKB(@a); SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440; -# --error ER_GIS_INVALID_DATA SET @a=ST_POLYFROMWKB(@a); @@ -903,7 +892,6 @@ DROP TABLE g1; CREATE TABLE g1(a TEXT NOT NULL, KEY(a(255))); INSERT INTO g1 VALUES ('a'),('a'); -# --error ER_GIS_INVALID_DATA SELECT 1 FROM g1 WHERE a >= ANY (SELECT 1 FROM g1 WHERE a = ST_geomfromtext('') OR a) ; @@ -1442,6 +1430,5 @@ DROP DATABASE gis_ogs; --echo # Bug#13362660 ASSERTION `FIELD_POS < FIELD_COUNT' FAILED. IN PROTOCOL_TEXT::STORE --echo # -# --error ER_GIS_INVALID_DATA --error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION SELECT ST_Union('', ''), md5(1); diff --git a/mysql-test/suite/innodb_gis/t/precise.test b/mysql-test/suite/innodb_gis/t/precise.test index 08b7e348362..3ddfc9369a4 100644 --- a/mysql-test/suite/innodb_gis/t/precise.test +++ b/mysql-test/suite/innodb_gis/t/precise.test @@ -122,7 +122,6 @@ SELECT ST_Equals(ST_PointFromText('POINT (12 13)'),ST_PointFromText('POINT (12 1 --echo # BUG#11759650/51979: UNION/INTERSECTION OF POLYGONS CRASHES MYSQL --echo # -# --error ER_GIS_INVALID_DATA SELECT ST_ASTEXT(ST_UNION(ST_GEOMFROMTEXT('POLYGON((525000 183300,525400 183300,525400 18370, 525000 183700,525000 183300))'), ST_geomfromtext('POLYGON((525298.67 183511.53,525296.57 diff --git a/mysql-test/suite/innodb_gis/t/rtree.test b/mysql-test/suite/innodb_gis/t/rtree.test index 58d81576b3e..98931e70e62 100644 --- a/mysql-test/suite/innodb_gis/t/rtree.test +++ b/mysql-test/suite/innodb_gis/t/rtree.test @@ -78,17 +78,11 @@ SELECT name, ST_AsText(square) from t1 where MBRWithin(@p, square); # MBROverlaps needs a few more tests, with point and line dimensions -# --error ER_GIS_INVALID_DATA SET @vert1 = ST_GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); -# --error ER_GIS_INVALID_DATA SET @horiz1 = ST_GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); -# --error ER_GIS_INVALID_DATA SET @horiz2 = ST_GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); -# --error ER_GIS_INVALID_DATA SET @horiz3 = ST_GeomFromText('POLYGON ((2 0, 3 0, 2 0))'); -# --error ER_GIS_INVALID_DATA SET @point1 = ST_GeomFromText('POLYGON ((0 0))'); -# --error ER_GIS_INVALID_DATA SET @point2 = ST_GeomFromText('POLYGON ((-2 0))'); SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS MBRoverlaps FROM t1 a1 WHERE MBROverlaps(a1.square, @vert1) GROUP BY a1.name; diff --git a/mysql-test/suite/innodb_gis/t/rtree_purge.test b/mysql-test/suite/innodb_gis/t/rtree_purge.test index 42f00428b88..60ecbe2e53a 100644 --- a/mysql-test/suite/innodb_gis/t/rtree_purge.test +++ b/mysql-test/suite/innodb_gis/t/rtree_purge.test @@ -1,7 +1,7 @@ # This test case will test R-tree purge. --source include/innodb_page_size.inc -# Valgrind takes too much time on PB2 even in the --big-test runs. +--source include/have_sequence.inc --source include/not_valgrind.inc SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency; @@ -16,9 +16,7 @@ set @p=point(1,1); let $n=200; while ($n) { begin; -insert into t values(@p,@p),(@p,@p); -insert into t select @p,@p -from t a,t b,t c,t d,t e,t f,t g; +insert into t select @p,@p from seq_1_to_130; delete from t; commit; dec $n; diff --git a/mysql-test/suite/innodb_zip/r/index_large_prefix.result b/mysql-test/suite/innodb_zip/r/index_large_prefix.result index 4866c152640..986453851eb 100644 --- a/mysql-test/suite/innodb_zip/r/index_large_prefix.result +++ b/mysql-test/suite/innodb_zip/r/index_large_prefix.result @@ -325,10 +325,10 @@ ROW_FORMAT=DYNAMIC; SET sql_mode=''; create index idx1 on worklog5743(a2); Warnings: -Warning 1071 Specified key was too long; max key length is 3072 bytes +Note 1071 Specified key was too long; max key length is 3072 bytes create index idx2 on worklog5743(a3); Warnings: -Warning 1071 Specified key was too long; max key length is 3072 bytes +Note 1071 Specified key was too long; max key length is 3072 bytes create index idx3 on worklog5743(a4); show warnings; Level Code Message @@ -337,7 +337,7 @@ create index idx4 on worklog5743(a1, a2); ERROR 42000: Specified key was too long; max key length is 3072 bytes show warnings; Level Code Message -Warning 1071 Specified key was too long; max key length is 3072 bytes +Note 1071 Specified key was too long; max key length is 3072 bytes Error 1071 Specified key was too long; max key length is 3072 bytes create index idx5 on worklog5743(a1, a5); ERROR 42000: Specified key was too long; max key length is 3072 bytes diff --git a/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result b/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result index 2c66133404c..e88b72ef1d4 100644 --- a/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result +++ b/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result @@ -1224,7 +1224,7 @@ DROP INDEX prefix_idx ON worklog5743; SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (4000)); Warnings: -Warning 1071 Specified key was too long; max key length is 3072 bytes +Note 1071 Specified key was too long; max key length is 3072 bytes SET sql_mode = default; INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); SELECT col_1_varbinary = REPEAT("a", 4000) FROM worklog5743; diff --git a/mysql-test/suite/maria/icp.result b/mysql-test/suite/maria/icp.result index 96793beae8a..975c280d467 100644 --- a/mysql-test/suite/maria/icp.result +++ b/mysql-test/suite/maria/icp.result @@ -450,11 +450,11 @@ c1 INT NOT NULL, PRIMARY KEY (pk) ); INSERT INTO t1 VALUES (1,9),(2,7),(3,6),(4,3),(5,1); -EXPLAIN SELECT pk, c1 FROM t1 WHERE pk <> 3; +EXPLAIN SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 5 Using where SET SESSION optimizer_switch='index_condition_pushdown=off'; -SELECT pk, c1 FROM t1 WHERE pk <> 3; +SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3); pk c1 1 9 2 7 @@ -682,23 +682,23 @@ INSERT INTO t2 VALUES ('Ill'), ('eckqzsflbzaffti'), ('w'), ('she'), ('gxbwypqtjzwywwer'), ('w'); SET SESSION optimizer_switch='index_condition_pushdown=off'; EXPLAIN -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 1 SIMPLE t2 ref a a 515 const 1 Using where -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; b c 1 4 SET SESSION optimizer_switch='index_condition_pushdown=on'; EXPLAIN -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 1 SIMPLE t2 ref a a 515 const 1 Using where -SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND t1.b != 0 +SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; b c 1 4 diff --git a/mysql-test/suite/maria/maria-ucs2.result b/mysql-test/suite/maria/maria-ucs2.result index 1a54ab78081..321a374f4c2 100644 --- a/mysql-test/suite/maria/maria-ucs2.result +++ b/mysql-test/suite/maria/maria-ucs2.result @@ -17,7 +17,7 @@ test.t1 check status OK SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR ALTER TABLE t1 MODIFY a VARCHAR(800) CHARSET `ucs2`; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK @@ -30,7 +30,7 @@ t1 CREATE TABLE `t1` ( DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(800),KEY(a)) ENGINE=Aria CHARACTER SET ucs2; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes INSERT INTO t1 VALUES (REPEAT('abc ',200)); CHECK TABLE t1; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result index 913bf4efbdf..03d37270eed 100644 --- a/mysql-test/suite/maria/maria.result +++ b/mysql-test/suite/maria/maria.result @@ -1594,7 +1594,7 @@ a b drop table t1; create table t1 (v varchar(65530), key(v)); Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes drop table if exists t1; set statement sql_mode = 'NO_ENGINE_SUBSTITUTION' for create table t1 (v varchar(65536)); @@ -1866,7 +1866,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a varchar(2048), key `a` (a)); Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1876,7 +1876,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a varchar(2048), key `a` (a) key_block_size=1024); Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1886,7 +1886,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=1024; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1953,7 +1953,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=8192; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1965,7 +1965,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) key_block_size=8192; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1995,7 +1995,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000); Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result index 64ae268997a..09fc696c272 100644 --- a/mysql-test/suite/maria/maria3.result +++ b/mysql-test/suite/maria/maria3.result @@ -17,7 +17,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000); Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/suite/maria/mrr.result b/mysql-test/suite/maria/mrr.result index 5c709fb34e5..17b7b751dfb 100644 --- a/mysql-test/suite/maria/mrr.result +++ b/mysql-test/suite/maria/mrr.result @@ -393,7 +393,7 @@ PRIMARY KEY (pk), KEY col_varchar_1024_latin1_key (col_varchar_1024_latin1_key) ) ENGINE=Aria; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes INSERT INTO t1 VALUES (1,'z'), (2,'abcdefjhjkl'), (3,'in'), (4,'abcdefjhjkl'), (6,'abcdefjhjkl'), (11,'zx'), (12,'abcdefjhjm'), (13,'jn'), (14,'abcdefjhjp'), (16,'abcdefjhjr'); @@ -430,7 +430,7 @@ f5 varchar(1024) COLLATE latin1_bin, KEY (f5) ) ENGINE=Aria TRANSACTIONAL=0 ; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes # Fill the table with some data SELECT alias2.* , alias1.f2 FROM diff --git a/mysql-test/suite/mariabackup/error_during_copyback.result b/mysql-test/suite/mariabackup/error_during_copyback.result new file mode 100644 index 00000000000..ba27f0f83e6 --- /dev/null +++ b/mysql-test/suite/mariabackup/error_during_copyback.result @@ -0,0 +1,10 @@ +CREATE TABLE t(i INT) ENGINE INNODB; +INSERT INTO t VALUES(1); +# xtrabackup backup +# xtrabackup prepare +# restart server +# restart +SELECT * FROM t; +i +1 +DROP TABLE t; diff --git a/mysql-test/suite/mariabackup/error_during_copyback.test b/mysql-test/suite/mariabackup/error_during_copyback.test new file mode 100644 index 00000000000..3ec9fbfc3c3 --- /dev/null +++ b/mysql-test/suite/mariabackup/error_during_copyback.test @@ -0,0 +1,25 @@ +--source include/have_debug.inc +CREATE TABLE t(i INT) ENGINE INNODB; +INSERT INTO t VALUES(1); +echo # xtrabackup backup; +let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; +--disable_result_log +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir; +--enable_result_log +echo # xtrabackup prepare; +--disable_result_log +exec $XTRABACKUP --prepare --target-dir=$targetdir; +let $_datadir= `SELECT @@datadir`; +--source include/shutdown_mysqld.inc +rmdir $_datadir; +error 1; +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir --target-dir=$targetdir --dbug=+d,copy_file_error; +list_files $_datadir; +rmdir $_datadir; +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir --target-dir=$targetdir; +echo # restart server; +--source include/start_mysqld.inc +SELECT * FROM t; +DROP TABLE t; +rmdir $targetdir; + diff --git a/mysql-test/suite/mariabackup/innodb_force_recovery.result b/mysql-test/suite/mariabackup/innodb_force_recovery.result new file mode 100644 index 00000000000..6626bb0bc55 --- /dev/null +++ b/mysql-test/suite/mariabackup/innodb_force_recovery.result @@ -0,0 +1,26 @@ +CREATE TABLE t(i INT) ENGINE INNODB; +INSERT INTO t VALUES(1); +# "innodb_force_recovery=1" should be allowed with "--prepare" only (mariabackup) +FOUND 1 /should only be used with "--prepare"/ in backup.log +# "innodb_force_recovery=1" should be allowed with "--apply-log" only (innobackupex) +FOUND 1 /should only be used with "--apply-log"/ in backup.log +# "innodb_force_recovery" should be limited to "SRV_FORCE_IGNORE_CORRUPT" (mariabackup) +FOUND 1 /innodb_force_recovery = 1/ in backup.log +# "innodb_force_recovery" should be limited to "SRV_FORCE_IGNORE_CORRUPT" (innobackupex) +FOUND 1 /innodb_force_recovery = 1/ in backup.log +# "innodb_force_recovery" should be read from "backup-my.cnf" (mariabackup) +FOUND 1 /innodb_force_recovery = 1/ in backup.log +# "innodb_force_recovery=1" should be read from "backup-my.cnf" (innobackupex) +FOUND 1 /innodb_force_recovery = 1/ in backup.log +# "innodb_force_recovery" from the command line should override "backup-my.cnf" (mariabackup) +NOT FOUND /innodb_force_recovery = 1/ in backup.log +# "innodb_force_recovery" from the command line should override "backup-my.cnf" (innobackupex) +NOT FOUND /innodb_force_recovery = 1/ in backup.log +# shutdown server +# remove datadir +# xtrabackup move back +# restart +SELECT * FROM t; +i +1 +DROP TABLE t; diff --git a/mysql-test/suite/mariabackup/innodb_force_recovery.test b/mysql-test/suite/mariabackup/innodb_force_recovery.test new file mode 100644 index 00000000000..3a7b3c6106c --- /dev/null +++ b/mysql-test/suite/mariabackup/innodb_force_recovery.test @@ -0,0 +1,138 @@ +# This test checks if "innodb_force_recovery" is only allowed with "--prepare" +# (for mariabackup) and "--apply-log" (for innobackupex), and is limited to +# "SRV_FORCE_IGNORE_CORRUPT" only. + +# Setup. +--source include/have_innodb.inc + +--let targetdir=$MYSQLTEST_VARDIR/tmp/backup +--let backuplog=$MYSQLTEST_VARDIR/tmp/backup.log + +CREATE TABLE t(i INT) ENGINE INNODB; +INSERT INTO t VALUES(1); + +# Check for command line arguments. +--echo # "innodb_force_recovery=1" should be allowed with "--prepare" only (mariabackup) +--disable_result_log +--error 1 +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --innodb-force-recovery=1 --target-dir=$targetdir >$backuplog; +--enable_result_log +--let SEARCH_PATTERN=should only be used with "--prepare" +--let SEARCH_FILE=$backuplog +--source include/search_pattern_in_file.inc + +--echo # "innodb_force_recovery=1" should be allowed with "--apply-log" only (innobackupex) +--disable_result_log +--error 1 +exec $XTRABACKUP --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --no-timestamp --innodb-force-recovery=1 $targetdir >$backuplog; +--enable_result_log +--let SEARCH_PATTERN=should only be used with "--apply-log" +--let SEARCH_FILE=$backuplog +--source include/search_pattern_in_file.inc + +--disable_result_log +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir; +--enable_result_log +--echo # "innodb_force_recovery" should be limited to "SRV_FORCE_IGNORE_CORRUPT" (mariabackup) +--disable_result_log +exec $XTRABACKUP --prepare --innodb-force-recovery=2 --target-dir=$targetdir >$backuplog; +--enable_result_log +--let SEARCH_PATTERN=innodb_force_recovery = 1 +--let SEARCH_FILE=$backuplog +--source include/search_pattern_in_file.inc +rmdir $targetdir; + +--disable_result_log +exec $XTRABACKUP --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --no-timestamp $targetdir; +--enable_result_log +--echo # "innodb_force_recovery" should be limited to "SRV_FORCE_IGNORE_CORRUPT" (innobackupex) +--disable_result_log +exec $XTRABACKUP --innobackupex --apply-log --innodb-force-recovery=2 $targetdir >$backuplog; +--enable_result_log +--let SEARCH_PATTERN=innodb_force_recovery = 1 +--let SEARCH_FILE=$backuplog +--source include/search_pattern_in_file.inc +rmdir $targetdir; + +# Check for default file ("backup-my.cnf"). +--disable_result_log +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir; +--enable_result_log +perl; +my $cfg_path="$ENV{'targetdir'}/backup-my.cnf"; +open(my $fd, '>>', "$cfg_path"); +print $fd "innodb_force_recovery=1\n"; +close $fd; +EOF +--echo # "innodb_force_recovery" should be read from "backup-my.cnf" (mariabackup) +--disable_result_log +exec $XTRABACKUP --defaults-file=$targetdir/backup-my.cnf --prepare --export --target-dir=$targetdir >$backuplog; +--enable_result_log +--let SEARCH_PATTERN=innodb_force_recovery = 1 +--let SEARCH_FILE=$backuplog +--source include/search_pattern_in_file.inc +rmdir $targetdir; + +--disable_result_log +exec $XTRABACKUP --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --no-timestamp $targetdir; +--enable_result_log +perl; +my $cfg_path="$ENV{'targetdir'}/backup-my.cnf"; +open(my $fd, '>>', "$cfg_path"); +print $fd "innodb_force_recovery=2\n"; +close $fd; +EOF +--echo # "innodb_force_recovery=1" should be read from "backup-my.cnf" (innobackupex) +--disable_result_log +exec $XTRABACKUP --innobackupex --defaults-file=$targetdir/backup-my.cnf --apply-log --export $targetdir >$backuplog; +--enable_result_log +--let SEARCH_PATTERN=innodb_force_recovery = 1 +--let SEARCH_FILE=$backuplog +--source include/search_pattern_in_file.inc +rmdir $targetdir; + +# Check for command line argument precedence. +--disable_result_log +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir; +--enable_result_log +perl; +my $cfg_path="$ENV{'targetdir'}/backup-my.cnf"; +open(my $fd, '>>', "$cfg_path"); +print $fd "innodb_force_recovery=1\n"; +close $fd; +EOF +--echo # "innodb_force_recovery" from the command line should override "backup-my.cnf" (mariabackup) +--disable_result_log +exec $XTRABACKUP --defaults-file=$targetdir/backup-my.cnf --prepare --innodb-force-recovery=0 --target-dir=$targetdir >$backuplog; +--enable_result_log +--let SEARCH_PATTERN=innodb_force_recovery = 1 +--let SEARCH_FILE=$backuplog +--source include/search_pattern_in_file.inc +rmdir $targetdir; + +--disable_result_log +exec $XTRABACKUP --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --no-timestamp $targetdir; +--enable_result_log +perl; +my $cfg_path="$ENV{'targetdir'}/backup-my.cnf"; +open(my $fd, '>>', "$cfg_path"); +print $fd "innodb_force_recovery=2\n"; +close $fd; +EOF +--echo # "innodb_force_recovery" from the command line should override "backup-my.cnf" (innobackupex) +--disable_result_log +exec $XTRABACKUP --innobackupex --defaults-file=$targetdir/backup-my.cnf --apply-log --innodb-force-recovery=0 --export $targetdir >$backuplog; +--enable_result_log +--let SEARCH_PATTERN=innodb_force_recovery = 1 +--let SEARCH_FILE=$backuplog +--source include/search_pattern_in_file.inc + +--source include/restart_and_restore.inc + +# Check for restore. +SELECT * FROM t; + +# Clean-up. +DROP TABLE t; +--rmdir $targetdir +--remove_file $backuplog diff --git a/mysql-test/suite/mariabackup/log_page_corruption.result b/mysql-test/suite/mariabackup/log_page_corruption.result index be29ea435b6..91db833622a 100644 --- a/mysql-test/suite/mariabackup/log_page_corruption.result +++ b/mysql-test/suite/mariabackup/log_page_corruption.result @@ -23,11 +23,12 @@ INSERT INTO t6_corrupted_to_drop VALUES (3), (4), (5), (6), (7), (8), (9); INSERT INTO t7_corrupted_to_alter VALUES (3), (4), (5), (6), (7), (8), (9); # Corrupt tables # restart -# Backup must fail due to page corruption +# Backup must fail due to page corruption FOUND 1 /Database page corruption detected.*/ in backup.log # "innodb_corrupted_pages" file must not exist -# Backup must fail, but "innodb_corrupted_pages" file must be created due to --log-innodb-page-corruption option +# Backup must not fail, but "innodb_corrupted_pages" file must be created due to --log-innodb-page-corruption option FOUND 1 /Database page corruption detected.*/ in backup.log +FOUND 1 /completed OK!/ in backup.log --- "innodb_corrupted_pages" file content: --- test/t1_corrupted 6 8 9 @@ -44,7 +45,7 @@ INSERT INTO t1_inc_corrupted VALUES (3), (4), (5), (6), (7), (8), (9); INSERT INTO t2_inc_corrupted VALUES (3), (4), (5), (6), (7), (8), (9); INSERT INTO t3_inc VALUES (3), (4), (5), (6), (7), (8), (9); # restart -# Backup must fail, but "innodb_corrupted_pages" file must be created due to --log-innodb-page-corruption option +# Backup must not fail, but "innodb_corrupted_pages" file must be created due to --log-innodb-page-corruption option --- "innodb_corrupted_pages" file content: --- test/t1_corrupted 6 8 9 diff --git a/mysql-test/suite/mariabackup/log_page_corruption.test b/mysql-test/suite/mariabackup/log_page_corruption.test index e9419687288..0151afb96b4 100644 --- a/mysql-test/suite/mariabackup/log_page_corruption.test +++ b/mysql-test/suite/mariabackup/log_page_corruption.test @@ -59,7 +59,7 @@ EOF --let corrupted_pages_file_filt = $MYSQLTEST_VARDIR/tmp/innodb_corrupted_pages_filt --let perl_result_file=$MYSQLTEST_VARDIR/tmp/perl_result ---echo # Backup must fail due to page corruption +--echo # Backup must fail due to page corruption --disable_result_log --error 1 exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir > $backuplog; @@ -80,15 +80,19 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir= --let after_copy_test_t7_corrupted_to_alter=ALTER TABLE test.t7_corrupted_to_alter ADD COLUMN (d INT) --let add_corrupted_page_for_test_t7_corrupted_to_alter=3 ---echo # Backup must fail, but "innodb_corrupted_pages" file must be created due to --log-innodb-page-corruption option +--echo # Backup must not fail, but "innodb_corrupted_pages" file must be created due to --log-innodb-page-corruption option --disable_result_log ---error 1 --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --log-innodb-page-corruption --target-dir=$targetdir --dbug=+d,mariabackup_events,mariabackup_inject_code > $backuplog --enable_result_log --let SEARCH_PATTERN=Database page corruption detected.* --let SEARCH_FILE=$backuplog --source include/search_pattern_in_file.inc + +--let SEARCH_PATTERN=completed OK! +--let SEARCH_FILE=$backuplog +--source include/search_pattern_in_file.inc + --echo --- "innodb_corrupted_pages" file content: --- perl; do "$ENV{MTR_SUITE_DIR}/include/corrupt-page.pl"; @@ -145,9 +149,8 @@ EOF --let after_copy_test_t7_inc_corrupted_to_alter=ALTER TABLE test.t7_inc_corrupted_to_alter ADD COLUMN (d INT) --let add_corrupted_page_for_test_t7_inc_corrupted_to_alter=3 ---echo # Backup must fail, but "innodb_corrupted_pages" file must be created due to --log-innodb-page-corruption option +--echo # Backup must not fail, but "innodb_corrupted_pages" file must be created due to --log-innodb-page-corruption option --disable_result_log ---error 1 --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --log-innodb-page-corruption --target-dir=$incdir --incremental-basedir=$targetdir --dbug=+d,mariabackup_events,mariabackup_inject_code > $backuplog --disable_result_log @@ -161,6 +164,9 @@ EOF --let SEARCH_PATTERN=Database page corruption detected.* --let SEARCH_FILE=$backuplog --source include/search_pattern_in_file.inc +--let SEARCH_PATTERN=completed OK! +--source include/search_pattern_in_file.inc + --let corrupted_pages_file = $incdir/innodb_corrupted_pages --echo --- "innodb_corrupted_pages" file content: --- perl; @@ -260,7 +266,6 @@ EOF --echo # Full backup with --log-innodb-page-corruption --disable_result_log ---error 1 --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --log-innodb-page-corruption --target-dir=$targetdir --enable_result_log --let corrupted_pages_file = $targetdir/innodb_corrupted_pages @@ -288,7 +293,6 @@ EOF --echo # Incremental backup --log-innodb-page-corruption --disable_result_log ---error 1 --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --log-innodb-page-corruption --target-dir=$incdir --incremental-basedir=$targetdir --dbug=+d,mariabackup_events,mariabackup_inject_code > $backuplog --disable_result_log --let corrupted_pages_file = $incdir/innodb_corrupted_pages diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result index f5554563a18..40f505d8260 100644 --- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result +++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result @@ -245,7 +245,7 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -select * from `table5` where (col2 <= '6566-06-15' AND col24 <> 'd') group by `col83` order by `col83` desc ; +select * from `table5` where (col2 <= '6566-06-15' AND (col24 < 'd' or col24 > 'd')) group by `col83` order by `col83` desc ; col0 col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 col66 col67 col68 col69 col70 col71 col72 col73 col74 col75 col76 col77 col78 col79 col80 col81 col82 col83 col84 col85 col86 col87 col88 col89 col90 col91 col92 col93 col94 col95 col96 col97 col98 col99 col100 col101 col102 col103 col104 col105 col106 col107 col108 col109 col110 col111 col112 col113 col114 col115 col116 col117 col118 col119 col120 col121 col122 col123 col124 col125 col126 col127 col128 col129 col130 col131 col132 col133 col134 col135 col136 col137 col138 col139 col140 col141 col142 col143 col144 col145 col146 col147 col148 col149 col150 col151 col152 col153 col154 col155 col156 col157 col158 col159 col160 col161 col162 col163 col164 col165 col166 col167 col168 col169 col170 col171 col172 col173 col174 col175 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'd' diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test index d59e9e1fbeb..9e8e5c4b3cd 100644 --- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test +++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test @@ -242,9 +242,9 @@ UNLOCK TABLES; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -#explain select * from `table5` where (col2 <= '6566-06-15' AND col24 <> 'd') group by `col83` order by `col83` desc ; +#explain select * from `table5` where (col2 <= '6566-06-15' AND (col24 < 'd' or col24 > 'd') group by `col83` order by `col83` desc ; -select * from `table5` where (col2 <= '6566-06-15' AND col24 <> 'd') group by `col83` order by `col83` desc ; +select * from `table5` where (col2 <= '6566-06-15' AND (col24 < 'd' or col24 > 'd')) group by `col83` order by `col83` desc ; drop table `table5`; SET debug_dbug= @saved_dbug; diff --git a/mysql-test/suite/perfschema/r/schema.result b/mysql-test/suite/perfschema/r/schema.result index 1f331394df6..8ce4cad4f4b 100644 --- a/mysql-test/suite/perfschema/r/schema.result +++ b/mysql-test/suite/perfschema/r/schema.result @@ -62,7 +62,7 @@ users show create table accounts; Table Create Table accounts CREATE TABLE `accounts` ( - `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `CURRENT_CONNECTIONS` bigint(20) NOT NULL, `TOTAL_CONNECTIONS` bigint(20) NOT NULL @@ -140,7 +140,7 @@ events_stages_summary_by_thread_by_event_name CREATE TABLE `events_stages_summar show create table events_stages_summary_by_user_by_event_name; Table Create Table events_stages_summary_by_user_by_event_name CREATE TABLE `events_stages_summary_by_user_by_event_name` ( - `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `EVENT_NAME` varchar(128) NOT NULL, `COUNT_STAR` bigint(20) unsigned NOT NULL, `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL, @@ -151,7 +151,7 @@ events_stages_summary_by_user_by_event_name CREATE TABLE `events_stages_summary_ show create table events_stages_summary_by_account_by_event_name; Table Create Table events_stages_summary_by_account_by_event_name CREATE TABLE `events_stages_summary_by_account_by_event_name` ( - `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `EVENT_NAME` varchar(128) NOT NULL, `COUNT_STAR` bigint(20) unsigned NOT NULL, @@ -398,7 +398,7 @@ events_statements_summary_by_thread_by_event_name CREATE TABLE `events_statement show create table events_statements_summary_by_user_by_event_name; Table Create Table events_statements_summary_by_user_by_event_name CREATE TABLE `events_statements_summary_by_user_by_event_name` ( - `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `EVENT_NAME` varchar(128) NOT NULL, `COUNT_STAR` bigint(20) unsigned NOT NULL, `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL, @@ -428,7 +428,7 @@ events_statements_summary_by_user_by_event_name CREATE TABLE `events_statements_ show create table events_statements_summary_by_account_by_event_name; Table Create Table events_statements_summary_by_account_by_event_name CREATE TABLE `events_statements_summary_by_account_by_event_name` ( - `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `EVENT_NAME` varchar(128) NOT NULL, `COUNT_STAR` bigint(20) unsigned NOT NULL, @@ -590,7 +590,7 @@ events_waits_summary_by_thread_by_event_name CREATE TABLE `events_waits_summary_ show create table events_waits_summary_by_user_by_event_name; Table Create Table events_waits_summary_by_user_by_event_name CREATE TABLE `events_waits_summary_by_user_by_event_name` ( - `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `EVENT_NAME` varchar(128) NOT NULL, `COUNT_STAR` bigint(20) unsigned NOT NULL, `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL, @@ -601,7 +601,7 @@ events_waits_summary_by_user_by_event_name CREATE TABLE `events_waits_summary_by show create table events_waits_summary_by_account_by_event_name; Table Create Table events_waits_summary_by_account_by_event_name CREATE TABLE `events_waits_summary_by_account_by_event_name` ( - `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `EVENT_NAME` varchar(128) NOT NULL, `COUNT_STAR` bigint(20) unsigned NOT NULL, @@ -762,8 +762,8 @@ show create table setup_actors; Table Create Table setup_actors CREATE TABLE `setup_actors` ( `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%', - `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%', - `ROLE` char(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%' + `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%', + `ROLE` char(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%' ) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 show create table setup_consumers; Table Create Table @@ -1028,7 +1028,7 @@ threads CREATE TABLE `threads` ( `NAME` varchar(128) NOT NULL, `TYPE` varchar(10) NOT NULL, `PROCESSLIST_ID` bigint(20) unsigned DEFAULT NULL, - `PROCESSLIST_USER` varchar(16) DEFAULT NULL, + `PROCESSLIST_USER` varchar(128) DEFAULT NULL, `PROCESSLIST_HOST` varchar(60) DEFAULT NULL, `PROCESSLIST_DB` varchar(64) DEFAULT NULL, `PROCESSLIST_COMMAND` varchar(16) DEFAULT NULL, @@ -1042,7 +1042,7 @@ threads CREATE TABLE `threads` ( show create table users; Table Create Table users CREATE TABLE `users` ( - `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `USER` char(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `CURRENT_CONNECTIONS` bigint(20) NOT NULL, `TOTAL_CONNECTIONS` bigint(20) NOT NULL ) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 diff --git a/mysql-test/suite/perfschema/r/table_schema.result b/mysql-test/suite/perfschema/r/table_schema.result index 8caf2017fd2..b7c138c54c7 100644 --- a/mysql-test/suite/perfschema/r/table_schema.result +++ b/mysql-test/suite/perfschema/r/table_schema.result @@ -1,7 +1,7 @@ select * from information_schema.columns where table_schema="performance_schema" order by table_name, ordinal_position; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION -def performance_schema accounts USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references NEVER NULL +def performance_schema accounts USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL def performance_schema accounts HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL def performance_schema accounts CURRENT_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL def performance_schema accounts TOTAL_CONNECTIONS 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL @@ -37,7 +37,7 @@ def performance_schema events_stages_history_long TIMER_END 7 NULL YES bigint NU def performance_schema events_stages_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema events_stages_history_long NESTING_EVENT_ID 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema events_stages_history_long NESTING_EVENT_TYPE 10 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references NEVER NULL -def performance_schema events_stages_summary_by_account_by_event_name USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references NEVER NULL +def performance_schema events_stages_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL def performance_schema events_stages_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL def performance_schema events_stages_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL def performance_schema events_stages_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL @@ -59,7 +59,7 @@ def performance_schema events_stages_summary_by_thread_by_event_name SUM_TIMER_W def performance_schema events_stages_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema events_stages_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema events_stages_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL -def performance_schema events_stages_summary_by_user_by_event_name USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references NEVER NULL +def performance_schema events_stages_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL def performance_schema events_stages_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL def performance_schema events_stages_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema events_stages_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL @@ -192,7 +192,7 @@ def performance_schema events_statements_history_long NO_INDEX_USED 37 NULL NO b def performance_schema events_statements_history_long NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema events_statements_history_long NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema events_statements_history_long NESTING_EVENT_TYPE 40 NULL YES enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('STATEMENT','STAGE','WAIT') select,insert,update,references NEVER NULL -def performance_schema events_statements_summary_by_account_by_event_name USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references NEVER NULL +def performance_schema events_statements_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL def performance_schema events_statements_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL def performance_schema events_statements_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL def performance_schema events_statements_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL @@ -300,7 +300,7 @@ def performance_schema events_statements_summary_by_thread_by_event_name SUM_SOR def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema events_statements_summary_by_thread_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema events_statements_summary_by_thread_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL -def performance_schema events_statements_summary_by_user_by_event_name USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references NEVER NULL +def performance_schema events_statements_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL def performance_schema events_statements_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL def performance_schema events_statements_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema events_statements_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL @@ -408,7 +408,7 @@ def performance_schema events_waits_history_long NESTING_EVENT_TYPE 16 NULL YES def performance_schema events_waits_history_long OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select,insert,update,references NEVER NULL def performance_schema events_waits_history_long NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL def performance_schema events_waits_history_long FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL -def performance_schema events_waits_summary_by_account_by_event_name USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references NEVER NULL +def performance_schema events_waits_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL def performance_schema events_waits_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL def performance_schema events_waits_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL def performance_schema events_waits_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL @@ -437,7 +437,7 @@ def performance_schema events_waits_summary_by_thread_by_event_name SUM_TIMER_WA def performance_schema events_waits_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema events_waits_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema events_waits_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL -def performance_schema events_waits_summary_by_user_by_event_name USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references NEVER NULL +def performance_schema events_waits_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL def performance_schema events_waits_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL def performance_schema events_waits_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema events_waits_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL @@ -561,8 +561,8 @@ def performance_schema session_connect_attrs ATTR_NAME 2 NULL NO varchar 32 96 N def performance_schema session_connect_attrs ATTR_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_bin varchar(1024) select,insert,update,references NEVER NULL def performance_schema session_connect_attrs ORDINAL_POSITION 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL def performance_schema setup_actors HOST 1 '%' NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL -def performance_schema setup_actors USER 2 '%' NO char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references NEVER NULL -def performance_schema setup_actors ROLE 3 '%' NO char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references NEVER NULL +def performance_schema setup_actors USER 2 '%' NO char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL +def performance_schema setup_actors ROLE 3 '%' NO char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL def performance_schema setup_consumers NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL def performance_schema setup_consumers ENABLED 2 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references NEVER NULL def performance_schema setup_instruments NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL @@ -783,7 +783,7 @@ def performance_schema threads THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NU def performance_schema threads NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL def performance_schema threads TYPE 3 NULL NO varchar 10 30 NULL NULL NULL utf8 utf8_general_ci varchar(10) select,insert,update,references NEVER NULL def performance_schema threads PROCESSLIST_ID 4 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL -def performance_schema threads PROCESSLIST_USER 5 NULL YES varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) select,insert,update,references NEVER NULL +def performance_schema threads PROCESSLIST_USER 5 NULL YES varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL def performance_schema threads PROCESSLIST_HOST 6 NULL YES varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60) select,insert,update,references NEVER NULL def performance_schema threads PROCESSLIST_DB 7 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL def performance_schema threads PROCESSLIST_COMMAND 8 NULL YES varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) select,insert,update,references NEVER NULL @@ -793,7 +793,7 @@ def performance_schema threads PROCESSLIST_INFO 11 NULL YES longtext 4294967295 def performance_schema threads PARENT_THREAD_ID 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL def performance_schema threads ROLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references NEVER NULL def performance_schema threads INSTRUMENTED 14 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references NEVER NULL -def performance_schema users USER 1 NULL YES char 16 48 NULL NULL NULL utf8 utf8_bin char(16) select,insert,update,references NEVER NULL +def performance_schema users USER 1 NULL YES char 128 384 NULL NULL NULL utf8 utf8_bin char(128) select,insert,update,references NEVER NULL def performance_schema users CURRENT_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL def performance_schema users TOTAL_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL select count(*) from information_schema.columns diff --git a/mysql-test/suite/perfschema/r/threads_mysql.result b/mysql-test/suite/perfschema/r/threads_mysql.result index 31f91fc6464..40e6360fec7 100644 --- a/mysql-test/suite/perfschema/r/threads_mysql.result +++ b/mysql-test/suite/perfschema/r/threads_mysql.result @@ -17,6 +17,16 @@ processlist_info NULL unified_parent_thread_id NULL role NULL instrumented YES +name thread/sql/manager +type BACKGROUND +processlist_user NULL +processlist_host NULL +processlist_db NULL +processlist_command NULL +processlist_info NULL +unified_parent_thread_id unified parent_thread_id +role NULL +instrumented YES name thread/sql/one_connection type FOREGROUND processlist_user root @@ -44,16 +54,6 @@ processlist_info NULL unified_parent_thread_id unified parent_thread_id role NULL instrumented YES -name thread/sql/slave_background -type BACKGROUND -processlist_user NULL -processlist_host NULL -processlist_db NULL -processlist_command NULL -processlist_info NULL -unified_parent_thread_id unified parent_thread_id -role NULL -instrumented YES CREATE TEMPORARY TABLE t1 AS SELECT thread_id FROM performance_schema.threads WHERE name LIKE 'thread/sql%'; @@ -113,7 +113,7 @@ WHERE t1.name LIKE 'thread/sql%' ORDER BY parent_thread_name, child_thread_name; parent_thread_name child_thread_name thread/sql/event_scheduler thread/sql/event_worker +thread/sql/main thread/sql/manager thread/sql/main thread/sql/one_connection thread/sql/main thread/sql/signal_handler -thread/sql/main thread/sql/slave_background thread/sql/one_connection thread/sql/event_scheduler diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result index ab726a0e22f..40c07805315 100644 --- a/mysql-test/suite/plugins/r/server_audit.result +++ b/mysql-test/suite/plugins/r/server_audit.result @@ -118,6 +118,7 @@ CREATE USER u1 IDENTIFIED BY 'pwd-123'; GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; SET PASSWORD FOR u1 = PASSWORD('pwd 098'); CREATE USER u3 IDENTIFIED BY ''; +ALTER USER u3 IDENTIFIED BY 'pwd-456'; drop user u1, u2, u3; set global server_audit_events='query_ddl'; create table t1(id int); @@ -139,6 +140,10 @@ select 2; 2 2 drop table t1; +create procedure pr1() insert into test.t1 values ("foo", 42); +create function fn1(i int) returns int deterministic return i+1; +drop procedure pr1; +drop function fn1; set global server_audit_events='query_ddl,query_dml'; create table t1(id int); insert into t1 values (1), (2); @@ -210,6 +215,14 @@ select 2; 2 2 drop table t1; +create procedure pr1() insert into test.t1 values ("foo", 42); +create function fn1(i int) returns int deterministic return i+1; +drop procedure pr1; +drop function fn1; +create procedure pr1() insert into test.t1 values ("foo", 42); +create function fn1(i int) returns int deterministic return i+1; +drop procedure pr1; +drop function fn1; set global server_audit_events='table'; set global server_audit_incl_users='user1'; create user user1@localhost; @@ -227,6 +240,7 @@ set global server_audit_logging= on; disconnect cn1; drop user user1@localhost; set global server_audit_events=''; +set global server_audit_incl_users='root, plug_dest'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; connect(localhost,plug,plug_dest,test,MYSQL_PORT,MYSQL_SOCK); @@ -277,7 +291,7 @@ server_audit_file_path server_audit_file_rotate_now OFF server_audit_file_rotate_size 1000000 server_audit_file_rotations 9 -server_audit_incl_users root +server_audit_incl_users root, plug_dest server_audit_logging ON server_audit_mode 1 server_audit_output_type file @@ -392,6 +406,8 @@ TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv, TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'ALTER USER u3 IDENTIFIED BY *****',0 TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, @@ -402,6 +418,10 @@ TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv, TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create procedure pr1() insert into test.t1 values ("foo", 42)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create function fn1(i int) returns int deterministic return i+1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop procedure pr1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop function fn1',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0 @@ -431,6 +451,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv, TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_incl_users=\'root, plug_dest\'',0 TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, @@ -452,8 +473,9 @@ TIME,HOSTNAME,plug,localhost,ID,0,DISCONNECT,,,0 TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv, TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT PROXY ON plug_dest TO plug',0 -TIME,HOSTNAME,plug,localhost,ID,0,PROXY_CONNECT,test,`plug_dest`@`%`,0 TIME,HOSTNAME,plug,localhost,ID,0,CONNECT,test,,0 +TIME,HOSTNAME,plug,localhost,ID,0,PROXY_CONNECT,test,`plug_dest`@`%`,0 +TIME,HOSTNAME,plug,localhost,ID,ID,QUERY,test,'select USER(),CURRENT_USER()',0 TIME,HOSTNAME,plug,localhost,ID,0,DISCONNECT,test,,0 TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, diff --git a/mysql-test/suite/plugins/t/multiauth.test b/mysql-test/suite/plugins/t/multiauth.test index cc6fc0c8644..4cf44fc7c65 100644 --- a/mysql-test/suite/plugins/t/multiauth.test +++ b/mysql-test/suite/plugins/t/multiauth.test @@ -1,3 +1,4 @@ +--source include/not_ubsan.inc # # MDEV-11340 Allow multiple alternative authentication methods for the same user # diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test index 787541f7ca0..01da49756d0 100644 --- a/mysql-test/suite/plugins/t/server_audit.test +++ b/mysql-test/suite/plugins/t/server_audit.test @@ -95,6 +95,7 @@ CREATE USER u1 IDENTIFIED BY 'pwd-123'; GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; SET PASSWORD FOR u1 = PASSWORD('pwd 098'); CREATE USER u3 IDENTIFIED BY ''; +ALTER USER u3 IDENTIFIED BY 'pwd-456'; drop user u1, u2, u3; set global server_audit_events='query_ddl'; @@ -106,6 +107,12 @@ select 2; /*! select 2*/; /*comment*/ select 2; drop table t1; + +create procedure pr1() insert into test.t1 values ("foo", 42); +create function fn1(i int) returns int deterministic return i+1; +drop procedure pr1; +drop function fn1; + set global server_audit_events='query_ddl,query_dml'; create table t1(id int); insert into t1 values (1), (2); @@ -145,6 +152,15 @@ insert into t1 values (1), (2); select * from t1; select 2; drop table t1; +create procedure pr1() insert into test.t1 values ("foo", 42); +create function fn1(i int) returns int deterministic return i+1; +drop procedure pr1; +drop function fn1; + +create procedure pr1() insert into test.t1 values ("foo", 42); +create function fn1(i int) returns int deterministic return i+1; +drop procedure pr1; +drop function fn1; set global server_audit_events='table'; set global server_audit_incl_users='user1'; @@ -173,6 +189,7 @@ source include/wait_until_count_sessions.inc; drop user user1@localhost; set global server_audit_events=''; +set global server_audit_incl_users='root, plug_dest'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; diff --git a/mysql-test/suite/rpl/disabled.def b/mysql-test/suite/rpl/disabled.def index 89140a19ac8..1ed8651da17 100644 --- a/mysql-test/suite/rpl/disabled.def +++ b/mysql-test/suite/rpl/disabled.def @@ -10,8 +10,7 @@ # ############################################################################## -rpl_spec_variables : BUG#11755836 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux -#rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock +#rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings rpl_partition_archive : MDEV-5077 2013-09-27 svoj Cannot exchange partition with archive table rpl_row_binlog_max_cache_size : MDEV-11092 rpl_row_index_choice : MDEV-11666 diff --git a/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test b/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test index 0f46b00f683..4c93ad86209 100644 --- a/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test +++ b/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test @@ -49,14 +49,14 @@ connection master; --echo *** Single statement on transactional table *** --disable_query_log ---error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE, 1534 eval INSERT INTO t1 (a, data) VALUES (1, CONCAT($data, $data, $data, $data, $data)); --enable_query_log --echo *** Single statement on non-transactional table *** --disable_query_log ---error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE, 1534 eval INSERT INTO t2 (a, data) VALUES (2, CONCAT($data, $data, $data, $data, $data, $data)); --enable_query_log diff --git a/mysql-test/suite/rpl/include/rpl_semi_sync.inc b/mysql-test/suite/rpl/include/rpl_semi_sync.inc index 393b49372e1..c3cd918b5fc 100644 --- a/mysql-test/suite/rpl/include/rpl_semi_sync.inc +++ b/mysql-test/suite/rpl/include/rpl_semi_sync.inc @@ -9,7 +9,6 @@ source include/have_innodb.inc; source include/master-slave.inc; let $engine_type= InnoDB; -#let $engine_type= MyISAM; # Suppress warnings that might be generated during the test connection master; @@ -94,7 +93,6 @@ enable_query_log; echo [ status of semi-sync on master should be OFF ]; show status like 'Rpl_semi_sync_master_clients'; show status like 'Rpl_semi_sync_master_status'; ---replace_result 305 304 show status like 'Rpl_semi_sync_master_yes_tx'; # reset master to make sure the following test will start with a clean environment @@ -201,16 +199,23 @@ connection slave; source include/stop_slave.inc; connection master; +--source include/kill_binlog_dump_threads.inc set global rpl_semi_sync_master_timeout= 5000; # The first semi-sync check should be on because after slave stop, # there are no transactions on the master. echo [ master status should be ON ]; -show status like 'Rpl_semi_sync_master_status'; + +let $status_var= Rpl_semi_sync_master_status; +let $status_var_value= ON; +source include/wait_for_status_var.inc; + +let $status_var= Rpl_semi_sync_master_clients; +let $status_var_value= 0; +source include/wait_for_status_var.inc; + show status like 'Rpl_semi_sync_master_no_tx'; ---replace_result 305 304 show status like 'Rpl_semi_sync_master_yes_tx'; -show status like 'Rpl_semi_sync_master_clients'; echo [ semi-sync replication of these transactions will fail ]; insert into t1 values (500); @@ -225,7 +230,6 @@ source include/wait_for_status_var.inc; echo [ master status should be OFF ]; show status like 'Rpl_semi_sync_master_status'; show status like 'Rpl_semi_sync_master_no_tx'; ---replace_result 305 304 show status like 'Rpl_semi_sync_master_yes_tx'; # Semi-sync status on master is now OFF, so all these transactions @@ -246,7 +250,6 @@ insert into t1 values (100); echo [ master status should be OFF ]; show status like 'Rpl_semi_sync_master_status'; show status like 'Rpl_semi_sync_master_no_tx'; ---replace_result 305 304 show status like 'Rpl_semi_sync_master_yes_tx'; --echo # @@ -274,9 +277,11 @@ connection master; # The master semi-sync status should be on again after slave catches up. echo [ master status should be ON again after slave catches up ]; -show status like 'Rpl_semi_sync_master_status'; + +let $status_var= Rpl_semi_sync_master_status; +let $status_var_value= ON; +source include/wait_for_status_var.inc; show status like 'Rpl_semi_sync_master_no_tx'; ---replace_result 305 304 show status like 'Rpl_semi_sync_master_yes_tx'; show status like 'Rpl_semi_sync_master_clients'; @@ -332,11 +337,7 @@ replace_result $engine_type ENGINE_TYPE; eval create table t1 (a int) engine = $engine_type; drop table t1; -##show status like 'Rpl_semi_sync_master_status'; - sync_slave_with_master; ---replace_column 2 # -show status like 'Rpl_relay%'; echo [ test reset master ]; connection master; @@ -353,19 +354,7 @@ source include/stop_slave.inc; reset slave; # Kill the dump thread on master for previous slave connection and -# wait for it to exit -connection master; -let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`; -if ($_tid) -{ - --replace_result $_tid _tid - eval kill query $_tid; - - # After dump thread exit, Rpl_semi_sync_master_clients will be 0 - let $status_var= Rpl_semi_sync_master_clients; - let $status_var_value= 0; - source include/wait_for_status_var.inc; -} +--source include/kill_binlog_dump_threads.inc connection slave; source include/start_slave.inc; @@ -404,17 +393,7 @@ connection master; reset master; # Kill the dump thread on master for previous slave connection and wait for it to exit -let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`; -if ($_tid) -{ - --replace_result $_tid _tid - eval kill query $_tid; - - # After dump thread exit, Rpl_semi_sync_master_clients will be 0 - let $status_var= Rpl_semi_sync_master_clients; - let $status_var_value= 0; - source include/wait_for_status_var.inc; -} +--source include/kill_binlog_dump_threads.inc # Do not binlog the following statement because it will generate # different events for ROW and STATEMENT format @@ -459,21 +438,16 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; connection master; # Kill the dump thread on master for previous slave connection and wait for it to exit -let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`; -if ($_tid) -{ - --replace_result $_tid _tid - eval kill query $_tid; - - # After dump thread exit, Rpl_semi_sync_master_clients will be 0 - let $status_var= Rpl_semi_sync_master_clients; - let $status_var_value= 0; - source include/wait_for_status_var.inc; -} +--source include/kill_binlog_dump_threads.inc echo [ Semi-sync status on master should be ON ]; -show status like 'Rpl_semi_sync_master_clients'; +let $status_var= Rpl_semi_sync_master_clients; +let $status_var_value= 0; +source include/wait_for_status_var.inc; show status like 'Rpl_semi_sync_master_status'; +let $status_var= Rpl_semi_sync_master_status; +let $status_var_value= ON; +source include/wait_for_status_var.inc; set global rpl_semi_sync_master_enabled= 0; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_change_master.result b/mysql-test/suite/rpl/r/rpl_change_master.result index 5439bdef72c..48cec72d917 100644 --- a/mysql-test/suite/rpl/r/rpl_change_master.result +++ b/mysql-test/suite/rpl/r/rpl_change_master.result @@ -22,4 +22,8 @@ n connection master; drop table t1; connection slave; +connection master; +CHANGE MASTER TO MASTER_USER='root', MASTER_SSL=0, MASTER_SSL_CA='', MASTER_SSL_CERT='', +MASTER_SSL_KEY='', MASTER_SSL_CRL='', MASTER_SSL_CRLPATH=''; +CHANGE MASTER TO MASTER_USER='root', MASTER_PASSWORD='', MASTER_SSL=0; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_ignore_grant.result b/mysql-test/suite/rpl/r/rpl_ignore_grant.result index 64da944a5dc..0a5564ac6c0 100644 --- a/mysql-test/suite/rpl/r/rpl_ignore_grant.result +++ b/mysql-test/suite/rpl/r/rpl_ignore_grant.result @@ -1,14 +1,12 @@ include/master-slave.inc [connection master] connection master; -set global sql_mode=""; -set local sql_mode=""; +set sql_mode=""; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; connection slave; -set global sql_mode=""; -set local sql_mode=""; +set sql_mode=""; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; @@ -43,7 +41,5 @@ connection slave; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; -set global sql_mode=default; connection master; -set global sql_mode=default; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result index 04f55fc1263..aae3418b546 100644 --- a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result +++ b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result @@ -12,6 +12,7 @@ Note 1003 select master_pos_wait('master-bin.999999',0,2) AS `master_pos_wait('m select master_pos_wait('master-bin.999999',0); connection slave1; stop slave sql_thread; +include/wait_for_slave_sql_to_stop.inc connection slave; master_pos_wait('master-bin.999999',0) NULL diff --git a/mysql-test/suite/rpl/r/rpl_relay_max_extension.result b/mysql-test/suite/rpl/r/rpl_relay_max_extension.result new file mode 100644 index 00000000000..4444398203e --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_relay_max_extension.result @@ -0,0 +1,37 @@ +include/rpl_init.inc [topology=1->2] +connection server_2; +include/stop_slave.inc +RESET SLAVE; +include/start_slave.inc +include/stop_slave.inc +# +# Stop slave server +# +# +# Simulate file number get close to 999997 +# by renaming relay logs and modifying index/info files +# +# Restart slave server +# +SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads; +SET @save_max_relay_log_size= @@GLOBAL.max_relay_log_size; +SET GLOBAL slave_parallel_threads=1; +SET GLOBAL max_relay_log_size=100 * 1024; +include/start_slave.inc +connection server_1; +create table t1 (i int, c varchar(1024)); +# +# Insert some data to generate enough amount of binary logs +# +connection server_2; +# +# Assert that 'slave-relay-bin.999999' is purged. +# +NOT FOUND /slave-relay-bin.999999/ in slave-relay-bin.index +include/stop_slave.inc +SET GLOBAL slave_parallel_threads= @save_slave_parallel_threads; +SET GLOBAL max_relay_log_size= @save_max_relay_log_size; +include/start_slave.inc +connection server_1; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_USER.result b/mysql-test/suite/rpl/r/rpl_row_USER.result index 5a59bb57795..2771c674f44 100644 --- a/mysql-test/suite/rpl/r/rpl_row_USER.result +++ b/mysql-test/suite/rpl/r/rpl_row_USER.result @@ -1,6 +1,5 @@ include/master-slave.inc [connection master] -set global sql_mode=""; set local sql_mode=""; connection master; DROP DATABASE IF EXISTS mysqltest1; @@ -40,7 +39,6 @@ REVOKE ALL ON mysqltest1.* FROM 'tester'@'%'; REVOKE ALL ON mysqltest1.* FROM ''@'localhost%'; DROP USER tester@'%'; DROP USER ''@'localhost%'; +FLUSH PRIVILEGES; connection slave; include/rpl_end.inc -set global sql_mode=default; -set local sql_mode=default; diff --git a/mysql-test/suite/rpl/r/rpl_row_utf32.result b/mysql-test/suite/rpl/r/rpl_row_utf32.result index af6e709860e..6d177b7cda0 100644 --- a/mysql-test/suite/rpl/r/rpl_row_utf32.result +++ b/mysql-test/suite/rpl/r/rpl_row_utf32.result @@ -3,7 +3,7 @@ include/master-slave.inc SET SQL_LOG_BIN=0; CREATE TABLE t1 (c1 char(255) DEFAULT NULL, KEY c1 (c1)) DEFAULT CHARSET=utf32; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes SET SQL_LOG_BIN=1; connection slave; SET @saved_slave_type_conversions= @@global.slave_type_conversions; @@ -13,7 +13,7 @@ include/start_slave.inc SET SQL_LOG_BIN=0; CREATE TABLE t1 ( c1 varchar(255) DEFAULT NULL, KEY c1 (c1)) DEFAULT CHARSET=utf32; Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 1000 bytes SET SQL_LOG_BIN=1; connection master; INSERT INTO t1(c1) VALUES ('insert into t1'); diff --git a/mysql-test/suite/rpl/r/rpl_row_vcol_crash.result b/mysql-test/suite/rpl/r/rpl_row_vcol_crash.result new file mode 100644 index 00000000000..f76d8935fa8 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_vcol_crash.result @@ -0,0 +1,380 @@ +include/master-slave.inc +[connection master] +# +# Test case 1: KEY on a virtual column with ON DELETE CASCADE +# +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1),(2),(3); +CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY, +t1_id INT NOT NULL, +v_col INT AS (t1_id+1) VIRTUAL, KEY (v_col), KEY (t1_id), +CONSTRAINT a FOREIGN KEY (t1_id) REFERENCES t1 (id) ON DELETE CASCADE +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (90,1,NULL); +INSERT INTO t2 VALUES (91,2,default); +DELETE FROM t1 WHERE id=1; +connection slave; +# +# Verify data consistency on slave +# +include/diff_tables.inc [master:test.t1, slave:test.t1] +include/diff_tables.inc [master:test.t2, slave:test.t2] +connection master; +DROP TABLE t2,t1; +connection slave; +# +# Test case 2: Verify "ON DELETE CASCADE" for parent->child->child scenario +# Parent table: users +# Child tables: matchmaking_groups, matchmaking_group_users +# Parent table: matchmaking_groups +# Child tables: matchmaking_group_users, matchmaking_group_maps +# +# Deleting a row from parent table should be reflected in +# child tables. +# matchmaking_groups->matchmaking_group_users->matchmaking_group_maps +# users->matchmaking_group_users->matchmaking_group_maps +# +connection master; +CREATE TABLE users (id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, +name VARCHAR(32) NOT NULL DEFAULT '' +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE matchmaking_groups ( +id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, +host_user_id INT UNSIGNED NOT NULL UNIQUE, +v_col INT AS (host_user_id+1) VIRTUAL, KEY (v_col), +CONSTRAINT FOREIGN KEY (host_user_id) REFERENCES users (id) +ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE matchmaking_group_users ( +matchmaking_group_id BIGINT UNSIGNED NOT NULL, +user_id INT UNSIGNED NOT NULL, +v_col1 int as (user_id+1) virtual, KEY (v_col1), +PRIMARY KEY (matchmaking_group_id,user_id), +UNIQUE KEY user_id (user_id), +CONSTRAINT FOREIGN KEY (matchmaking_group_id) +REFERENCES matchmaking_groups (id) ON DELETE CASCADE ON UPDATE CASCADE, +CONSTRAINT FOREIGN KEY (user_id) +REFERENCES users (id) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE matchmaking_group_maps ( +matchmaking_group_id BIGINT UNSIGNED NOT NULL, +map_id TINYINT UNSIGNED NOT NULL, +v_col2 INT AS (map_id+1) VIRTUAL, KEY (v_col2), +PRIMARY KEY (matchmaking_group_id,map_id), +CONSTRAINT FOREIGN KEY (matchmaking_group_id) +REFERENCES matchmaking_groups (id) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +connection slave; +connection master; +INSERT INTO users VALUES (NULL,'foo'),(NULL,'bar'); +INSERT INTO matchmaking_groups VALUES (10,1,default),(11,2,default); +INSERT INTO matchmaking_group_users VALUES (10,1,default),(11,2,default); +INSERT INTO matchmaking_group_maps VALUES (10,55,default),(11,66,default); +DELETE FROM matchmaking_groups WHERE id = 10; +connection slave; +# +# No rows should be returned as ON DELETE CASCASE should have removed +# corresponding rows from child tables. There should not any mismatch +# of 'id' field between parent->child. +# +SELECT * FROM matchmaking_group_users WHERE matchmaking_group_id NOT IN (SELECT id FROM matchmaking_groups); +matchmaking_group_id user_id v_col1 +SELECT * FROM matchmaking_group_maps WHERE matchmaking_group_id NOT IN (SELECT id FROM matchmaking_groups); +matchmaking_group_id map_id v_col2 +# +# Rows with id=11 should be present +# +SELECT * FROM matchmaking_group_users; +matchmaking_group_id user_id v_col1 +11 2 3 +SELECT * FROM matchmaking_group_maps; +matchmaking_group_id map_id v_col2 +11 66 67 +connection master; +DELETE FROM users WHERE id = 2; +connection slave; +# +# No rows should be present in both the child tables +# +SELECT * FROM matchmaking_group_users; +matchmaking_group_id user_id v_col1 +SELECT * FROM matchmaking_group_maps; +matchmaking_group_id map_id v_col2 +connection master; +DROP TABLE matchmaking_group_maps, matchmaking_group_users, matchmaking_groups, users; +connection slave; +# +# Test case 3: KEY on a virtual column with ON UPDATE CASCADE +# +connection master; +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT NOT NULL) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 80); +CREATE TABLE t2 (a INT KEY, b INT, +v_col int as (b+1) virtual, KEY (v_col), +CONSTRAINT b FOREIGN KEY (b) REFERENCES t1(a) ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (51, 1, default); +connection slave; +connection master; +UPDATE t1 SET a = 50 WHERE a = 1; +# +# Master: Verify that ON UPDATE CASCADE works fine +# old_row: (51, 1, 2) ON UPDATE New_row: (51, 50, 51) +# +SELECT * FROM t2 WHERE b=50; +a b v_col +51 50 51 +connection slave; +# +# Slave: Verify that ON UPDATE CASCADE works fine +# old_row: (51, 1, 2) ON UPDATE New_row: (51, 50, 51) +# +SELECT * FROM t2 WHERE b=50; +a b v_col +51 50 51 +connection master; +DROP TABLE t2, t1; +connection slave; +# +# Test case 4: Define triggers on master, their results should be +# replicated as part of row events and they should be +# applied on slave with the default +# slave_run_triggers_for_rbr=NO +# +connection master; +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (count INT NOT NULL) ENGINE=InnoDB; +CREATE TRIGGER trg AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (1); +INSERT INTO t1 VALUES (2),(3); +connection slave; +SHOW GLOBAL VARIABLES LIKE 'slave_run_triggers_for_rbr'; +Variable_name Value +slave_run_triggers_for_rbr NO +# +# As two rows are inserted in table 't1', two rows should get inserted +# into table 't2' as part of trigger. +# +include/assert.inc [Table t2 should have two rows.] +connection master; +DROP TABLE t1,t2; +connection slave; +# +# Test case 5: Define triggers + Foreign Keys on master, their results +# should be replicated as part of row events and master +# and slave should be in sync. +# +connection master; +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (t1_id INT NOT NULL, +v_col INT AS (t1_id+1) VIRTUAL, KEY (v_col), KEY (t1_id), +CONSTRAINT a FOREIGN KEY (t1_id) REFERENCES t1 (id) ON DELETE CASCADE +) ENGINE=InnoDB; +CREATE TABLE t3 (count INT NOT NULL) ENGINE=InnoDB; +CREATE TRIGGER trg AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t3 VALUES (1); +INSERT INTO t1 VALUES (2),(3); +INSERT INTO t2 VALUES (2, default), (3, default); +connection slave; +# +# As two rows are inserted in table 't1', two rows should get inserted +# into table 't3' as part of trigger. +# +include/assert.inc [Table t3 should have two rows.] +# +# Verify ON DELETE CASCASE correctness +# +connection master; +DELETE FROM t1 WHERE id=2; +connection slave; +connection master; +include/diff_tables.inc [master:test.t1, slave:test.t1] +include/diff_tables.inc [master:test.t2, slave:test.t2] +include/diff_tables.inc [master:test.t3, slave:test.t3] +DROP TABLE t3,t2,t1; +connection slave; +# +# Test case 6: Triggers are present only on slave and +# 'slave_run_triggers_for_rbr=NO' +# +connection slave; +SET @save_slave_run_triggers_for_rbr= @@GLOBAL.slave_run_triggers_for_rbr; +SET GLOBAL slave_run_triggers_for_rbr= NO;; +SHOW GLOBAL VARIABLES LIKE '%slave_run_triggers_for_rbr%'; +Variable_name Value +slave_run_triggers_for_rbr NO +connection master; +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (t1_id INT NOT NULL, +v_col INT AS (t1_id+1) VIRTUAL, KEY (v_col), +KEY (t1_id), CONSTRAINT a FOREIGN KEY (t1_id) REFERENCES t1 (id) ON DELETE CASCADE +) ENGINE=InnoDB; +CREATE TABLE t3 (count INT NOT NULL) ENGINE=InnoDB; +connection slave; +CREATE TRIGGER trg AFTER INSERT ON t2 FOR EACH ROW INSERT INTO t3 VALUES (1); +connection master; +INSERT INTO t1 VALUES (2),(3); +INSERT INTO t2 VALUES (2, default), (3, default); +connection slave; +# +# Count must be 0 +# +include/assert.inc [Table t3 should have zero rows.] +connection master; +DELETE FROM t1 WHERE id=2; +connection slave; +SET GLOBAL slave_run_triggers_for_rbr= @save_slave_run_triggers_for_rbr; +# +# Verify t1, t2 are consistent on slave. +# +include/diff_tables.inc [master:test.t1, slave:test.t1] +include/diff_tables.inc [master:test.t2, slave:test.t2] +connection master; +DROP TABLE t3,t2,t1; +connection slave; +# +# Test case 7: Triggers are present only on slave and +# 'slave_run_triggers_for_rbr=YES' +# +connection slave; +SET @save_slave_run_triggers_for_rbr= @@GLOBAL.slave_run_triggers_for_rbr; +SET GLOBAL slave_run_triggers_for_rbr= YES;; +SHOW GLOBAL VARIABLES LIKE '%slave_run_triggers_for_rbr%'; +Variable_name Value +slave_run_triggers_for_rbr YES +connection master; +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (t1_id INT NOT NULL, +v_col INT AS (t1_id+1) VIRTUAL, KEY (v_col), +KEY (t1_id), CONSTRAINT a FOREIGN KEY (t1_id) REFERENCES t1 (id) ON DELETE CASCADE +) ENGINE=InnoDB; +CREATE TABLE t3 (count INT NOT NULL) ENGINE=InnoDB; +connection slave; +CREATE TRIGGER trg AFTER INSERT ON t2 FOR EACH ROW INSERT INTO t3 VALUES (1); +connection master; +INSERT INTO t1 VALUES (2),(3); +INSERT INTO t2 VALUES (2, default), (3, default); +connection slave; +# +# Count must be 2 +# +include/assert.inc [Table t3 should have two rows.] +connection master; +DELETE FROM t1 WHERE id=2; +connection slave; +SET GLOBAL slave_run_triggers_for_rbr= @save_slave_run_triggers_for_rbr; +# +# Verify t1, t2 are consistent on slave. +# +include/diff_tables.inc [master:test.t1, slave:test.t1] +include/diff_tables.inc [master:test.t2, slave:test.t2] +connection master; +DROP TABLE t3,t2,t1; +connection slave; +# +# Test case 8: Triggers and Foreign Keys are present only on slave and +# 'slave_run_triggers_for_rbr=NO' +# +connection slave; +SET @save_slave_run_triggers_for_rbr= @@GLOBAL.slave_run_triggers_for_rbr; +SET GLOBAL slave_run_triggers_for_rbr= NO;; +SHOW GLOBAL VARIABLES LIKE '%slave_run_triggers_for_rbr%'; +Variable_name Value +slave_run_triggers_for_rbr NO +connection master; +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +SET sql_log_bin=0; +CREATE TABLE t2 (t1_id INT NOT NULL,v_col INT AS (t1_id+1) VIRTUAL) ENGINE=INNODB; +SET sql_log_bin=1; +CREATE TABLE t3 (count INT NOT NULL) ENGINE=InnoDB; +connection slave; +CREATE TABLE t2 (t1_id INT NOT NULL, +v_col INT AS (t1_id+1) VIRTUAL, KEY (v_col), KEY (t1_id), +CONSTRAINT a FOREIGN KEY (t1_id) REFERENCES t1 (id) ON DELETE CASCADE +) ENGINE=InnoDB; +CREATE TRIGGER trg AFTER INSERT ON t2 FOR EACH ROW INSERT INTO t3 VALUES (1); +connection master; +INSERT INTO t1 VALUES (2),(3); +INSERT INTO t2 VALUES (2, default), (3, default); +connection slave; +# +# Count must be 0 +# +include/assert.inc [Table t3 should have zero rows.] +connection master; +DELETE FROM t1 WHERE id=2; +# t1: Should have one row +SELECT * FROM t1; +id +3 +# t2: Should have two rows +SELECT * FROM t2; +t1_id v_col +2 3 +3 4 +connection slave; +# t1: Should have one row +SELECT * FROM t1; +id +3 +# t2: Should have one row on slave due to ON DELETE CASCASE +SELECT * FROM t2; +t1_id v_col +3 4 +SET GLOBAL slave_run_triggers_for_rbr= @save_slave_run_triggers_for_rbr; +connection master; +DROP TABLE t3,t2,t1; +connection slave; +# +# Test case 9: Triggers are Foreign Keys are present only on slave and +# 'slave_run_triggers_for_rbr=YES' +# +connection slave; +SET @save_slave_run_triggers_for_rbr= @@GLOBAL.slave_run_triggers_for_rbr; +SET GLOBAL slave_run_triggers_for_rbr= YES;; +SHOW GLOBAL VARIABLES LIKE '%slave_run_triggers_for_rbr%'; +Variable_name Value +slave_run_triggers_for_rbr YES +connection master; +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +SET sql_log_bin=0; +CREATE TABLE t2 (t1_id INT NOT NULL,v_col INT AS (t1_id+1) VIRTUAL) ENGINE=INNODB; +SET sql_log_bin=1; +CREATE TABLE t3 (count INT NOT NULL) ENGINE=InnoDB; +connection slave; +CREATE TABLE t2 (t1_id INT NOT NULL, +v_col INT AS (t1_id+1) VIRTUAL, KEY (v_col), KEY (t1_id), +CONSTRAINT a FOREIGN KEY (t1_id) REFERENCES t1 (id) ON DELETE CASCADE +) ENGINE=InnoDB; +CREATE TRIGGER trg AFTER INSERT ON t2 FOR EACH ROW INSERT INTO t3 VALUES (1); +connection master; +INSERT INTO t1 VALUES (2),(3); +INSERT INTO t2 VALUES (2, default), (3, default); +connection slave; +# +# Count must be 2 +# +include/assert.inc [Table t3 should have two rows.] +connection master; +DELETE FROM t1 WHERE id=2; +# t1: Should have one row +SELECT * FROM t1; +id +3 +# t2: Should have two rows +SELECT * FROM t2; +t1_id v_col +2 3 +3 4 +connection slave; +# t1: Should have one row +SELECT * FROM t1; +id +3 +# t2: Should have one row on slave due to ON DELETE CASCASE +SELECT * FROM t2; +t1_id v_col +3 4 +SET GLOBAL slave_run_triggers_for_rbr= @save_slave_run_triggers_for_rbr; +connection master; +DROP TABLE t3,t2,t1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result index 106efb555d3..d18bd1efda7 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result @@ -164,20 +164,15 @@ connection slave; connection slave; include/stop_slave.inc connection master; +include/kill_binlog_dump_threads.inc set global rpl_semi_sync_master_timeout= 5000; [ master status should be ON ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 0 show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 14 -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 [ semi-sync replication of these transactions will fail ] insert into t1 values (500); [ master status should be OFF ] @@ -235,9 +230,6 @@ max(a) 500 connection master; [ master status should be ON again after slave catches up ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 12 @@ -304,8 +296,6 @@ connection master; create table t1 (a int) engine = ENGINE_TYPE; drop table t1; connection slave; -show status like 'Rpl_relay%'; -Variable_name Value [ test reset master ] connection master; reset master; @@ -321,7 +311,7 @@ Rpl_semi_sync_master_yes_tx 0 connection slave; include/stop_slave.inc reset slave; -connection master; +include/kill_binlog_dump_threads.inc connection slave; include/start_slave.inc connection master; @@ -353,6 +343,7 @@ include/stop_slave.inc reset slave; connection master; reset master; +include/kill_binlog_dump_threads.inc set sql_log_bin=0; grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password'; flush privileges; @@ -403,10 +394,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status OFF connection master; +include/kill_binlog_dump_threads.inc [ Semi-sync status on master should be ON ] -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 show status like 'Rpl_semi_sync_master_status'; Variable_name Value Rpl_semi_sync_master_status ON diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result index c61340f3967..f2240817489 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result @@ -165,20 +165,15 @@ connection slave; connection slave; include/stop_slave.inc connection master; +include/kill_binlog_dump_threads.inc set global rpl_semi_sync_master_timeout= 5000; [ master status should be ON ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 0 show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 16 -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 [ semi-sync replication of these transactions will fail ] insert into t1 values (500); [ master status should be OFF ] @@ -236,9 +231,6 @@ max(a) 500 connection master; [ master status should be ON again after slave catches up ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 12 @@ -305,8 +297,6 @@ connection master; create table t1 (a int) engine = ENGINE_TYPE; drop table t1; connection slave; -show status like 'Rpl_relay%'; -Variable_name Value [ test reset master ] connection master; reset master; @@ -322,7 +312,7 @@ Rpl_semi_sync_master_yes_tx 0 connection slave; include/stop_slave.inc reset slave; -connection master; +include/kill_binlog_dump_threads.inc connection slave; include/start_slave.inc connection master; @@ -354,6 +344,7 @@ include/stop_slave.inc reset slave; connection master; reset master; +include/kill_binlog_dump_threads.inc set sql_log_bin=0; grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password'; flush privileges; @@ -404,10 +395,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status OFF connection master; +include/kill_binlog_dump_threads.inc [ Semi-sync status on master should be ON ] -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 show status like 'Rpl_semi_sync_master_status'; Variable_name Value Rpl_semi_sync_master_status ON diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result index 6a23f24b66d..fcced801d65 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result @@ -165,20 +165,15 @@ connection slave; connection slave; include/stop_slave.inc connection master; +include/kill_binlog_dump_threads.inc set global rpl_semi_sync_master_timeout= 5000; [ master status should be ON ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 0 show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 14 -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 [ semi-sync replication of these transactions will fail ] insert into t1 values (500); [ master status should be OFF ] @@ -236,9 +231,6 @@ max(a) 500 connection master; [ master status should be ON again after slave catches up ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 12 @@ -305,8 +297,6 @@ connection master; create table t1 (a int) engine = ENGINE_TYPE; drop table t1; connection slave; -show status like 'Rpl_relay%'; -Variable_name Value [ test reset master ] connection master; reset master; @@ -322,7 +312,7 @@ Rpl_semi_sync_master_yes_tx 0 connection slave; include/stop_slave.inc reset slave; -connection master; +include/kill_binlog_dump_threads.inc connection slave; include/start_slave.inc connection master; @@ -354,6 +344,7 @@ include/stop_slave.inc reset slave; connection master; reset master; +include/kill_binlog_dump_threads.inc set sql_log_bin=0; grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password'; flush privileges; @@ -404,10 +395,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status OFF connection master; +include/kill_binlog_dump_threads.inc [ Semi-sync status on master should be ON ] -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 show status like 'Rpl_semi_sync_master_status'; Variable_name Value Rpl_semi_sync_master_status ON diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_slave_compressed_protocol.result b/mysql-test/suite/rpl/r/rpl_semi_sync_slave_compressed_protocol.result new file mode 100644 index 00000000000..b0fe083f928 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_slave_compressed_protocol.result @@ -0,0 +1,19 @@ +include/master-slave.inc +[connection master] +SET @@GLOBAL.rpl_semi_sync_master_enabled = 1; +connection slave; +include/stop_slave.inc +SET @@GLOBAL.rpl_semi_sync_slave_enabled = 1; +include/start_slave.inc +connection master; +CREATE TABLE t1 (i INT); +DROP TABLE t1; +include/rpl_sync.inc +include/assert_grep.inc [Check that there is no 'Read semi-sync reply magic number error' in error log.] +connection master; +SET @@GLOBAL. rpl_semi_sync_master_enabled = $sav_enabled_master; +connection slave; +include/stop_slave.inc +SET @@GLOBAL. rpl_semi_sync_slave_enabled = $sav_enabled_slave; +include/start_slave.inc +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result index 686380427b5..5216a3b0a44 100644 --- a/mysql-test/suite/rpl/r/rpl_sp.result +++ b/mysql-test/suite/rpl/r/rpl_sp.result @@ -1,7 +1,6 @@ include/master-slave.inc [connection master] set local sql_mode=''; -set global sql_mode=''; drop database if exists mysqltest1; create database mysqltest1; use mysqltest1; @@ -175,16 +174,16 @@ fn1(20) insert into t2 values(fn1(21)); select * from t1; a -21 20 +21 select * from t2; a 23 connection slave; select * from t1; a -21 20 +21 select * from t2; a 23 @@ -243,7 +242,7 @@ return unix_timestamp(); end NONE mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin return unix_timestamp(); -end zedjzlcsjhd@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +end zedjzlcsjhd@localhost # # STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci begin return unix_timestamp(); end NONE mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin @@ -268,7 +267,7 @@ return unix_timestamp(); end NONE mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin return unix_timestamp(); -end zedjzlcsjhd@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin +end zedjzlcsjhd@localhost # # STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci begin return unix_timestamp(); end NONE mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin @@ -865,6 +864,7 @@ SET TIMESTAMP=t/*!*/; grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1 /*!*/; SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=1411383296/*!*/; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` PROCEDURE `foo4`() DETERMINISTIC begin @@ -883,6 +883,7 @@ COMMIT START TRANSACTION /*!*/; SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=0/*!*/; insert into t1 values (15) /*!*/; SET TIMESTAMP=t/*!*/; @@ -891,17 +892,20 @@ COMMIT START TRANSACTION /*!*/; SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=1411383296/*!*/; insert into t2 values(3) /*!*/; SET TIMESTAMP=t/*!*/; COMMIT /*!*/; SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=0/*!*/; alter procedure foo4 sql security invoker /*!*/; START TRANSACTION /*!*/; SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=1411383296/*!*/; insert into t2 values(3) /*!*/; SET TIMESTAMP=t/*!*/; @@ -918,6 +922,7 @@ COMMIT START TRANSACTION /*!*/; SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=0/*!*/; delete from t2 /*!*/; SET TIMESTAMP=t/*!*/; @@ -1015,6 +1020,7 @@ SET TIMESTAMP=t/*!*/; COMMIT /*!*/; SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=1411383296/*!*/; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11) NO SQL begin @@ -1022,6 +1028,7 @@ return unix_timestamp(); end /*!*/; SET TIMESTAMP=t/*!*/; +SET @@session.sql_mode=0/*!*/; CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS int(11) READS SQL DATA begin @@ -1384,4 +1391,3 @@ drop procedure p1; # End of 5.5 tests. connection slave; include/rpl_end.inc -set global sql_mode=default; diff --git a/mysql-test/suite/rpl/r/rpl_spec_variables.result b/mysql-test/suite/rpl/r/rpl_spec_variables.result index 96f63a50ea9..8b4c398f308 100644 --- a/mysql-test/suite/rpl/r/rpl_spec_variables.result +++ b/mysql-test/suite/rpl/r/rpl_spec_variables.result @@ -2,14 +2,17 @@ include/master-slave.inc [connection master] * auto_increment_increment, auto_increment_offset * +connection master; SET @@global.auto_increment_increment=2; SET @@session.auto_increment_increment=2; SET @@global.auto_increment_offset=10; SET @@session.auto_increment_offset=10; +connection slave; SET @@global.auto_increment_increment=3; SET @@session.auto_increment_increment=3; SET @@global.auto_increment_offset=20; SET @@session.auto_increment_offset=20; +connection master; CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM; INSERT INTO t1 (b) VALUES ('master'); INSERT INTO t1 (b) VALUES ('master'); @@ -17,6 +20,7 @@ SELECT * FROM t1 ORDER BY a; a b 2 master 4 master +connection slave; CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM; INSERT INTO t1 (b) VALUES ('slave'); INSERT INTO t1 (b) VALUES ('slave'); @@ -32,102 +36,123 @@ SELECT * FROM t2 ORDER BY a; a b 1 slave 4 slave +connection master; DROP TABLE IF EXISTS t1,t2; SET @@global.auto_increment_increment=1; SET @@session.auto_increment_increment=1; SET @@global.auto_increment_offset=1; SET @@session.auto_increment_offset=1; +connection slave; SET @@global.auto_increment_increment=1; SET @@session.auto_increment_increment=1; SET @@global.auto_increment_offset=1; SET @@session.auto_increment_offset=1; +connection slave; SET auto_increment_increment=1; SET auto_increment_offset=1; * character_set_database, collation_server * +connection master; SET @restore_master_character_set_database=@@global.character_set_database; SET @restore_master_collation_server=@@global.collation_server; SET @@global.character_set_database=latin1; SET @@session.character_set_database=latin1; SET @@global.collation_server=latin1_german1_ci; SET @@session.collation_server=latin1_german1_ci; +connection slave; SET @restore_slave_character_set_database=@@global.character_set_database; SET @restore_slave_collation_server=@@global.collation_server; SET @@global.character_set_database=utf8; SET @@session.character_set_database=utf8; SET @@global.collation_server=utf8_bin; SET @@session.collation_server=utf8_bin; +connection master; CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, - `b` varchar(10) COLLATE latin1_german1_ci DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +connection slave; CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, - `b` varchar(10) COLLATE latin1_german1_ci DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci +) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) NOT NULL, - `b` varchar(10) COLLATE utf8_bin DEFAULT NULL, + `b` varchar(10) DEFAULT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin +) ENGINE=MyISAM DEFAULT CHARSET=latin1 SET @@global.collation_server=latin1_swedish_ci; SET @@session.collation_server=latin1_swedish_ci; +connection master; SET @@global.collation_server=latin1_swedish_ci; SET @@session.collation_server=latin1_swedish_ci; DROP TABLE IF EXISTS t1,t2; * default_week_format * +connection master; SET @@global.default_week_format=0; SET @@session.default_week_format=0; +connection slave; SET @@global.default_week_format=1; SET @@session.default_week_format=1; +connection master; CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c INT) ENGINE=MyISAM; INSERT INTO t1 VALUES (1, 'master ', WEEK('2008-01-07')); SELECT * FROM t1 ORDER BY a; a b c 1 master 1 +connection slave; INSERT INTO t1 VALUES (2, 'slave ', WEEK('2008-01-07')); SELECT * FROM t1 ORDER BY a; a b c 1 master 1 2 slave 2 +connection master; DROP TABLE t1; +connection slave; SET @@global.default_week_format=0; SET @@session.default_week_format=0; * local_infile * +connection slave; SET @@global.local_infile=0; +connection master; CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(20), c CHAR(254)) ENGINE=MyISAM; LOAD DATA LOCAL INFILE 'FILE' INTO TABLE t1 (b); SELECT COUNT(*) FROM t1; COUNT(*) 70 +connection slave; LOAD DATA LOCAL INFILE 'FILE2' INTO TABLE t1 (b); -ERROR 42000: The used command is not allowed with this MySQL version +ERROR 42000: The used command is not allowed with this MariaDB version SELECT COUNT(*) FROM t1; COUNT(*) 70 SET @@global.local_infile=1; +connection master; DROP TABLE t1; * max_heap_table_size * +connection slave; SET @restore_slave_max_heap_table_size=@@global.max_heap_table_size; SET @@global.max_heap_table_size=16384; SET @@session.max_heap_table_size=16384; +connection master; CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10), c CHAR(254)) ENGINE=MEMORY; SELECT COUNT(*)=2000 FROM t1; COUNT(*)=2000 1 +connection slave; SELECT COUNT(*)=2000 FROM t1 WHERE b='master' GROUP BY b ORDER BY b; COUNT(*)=2000 1 @@ -137,18 +162,24 @@ COUNT(*)<2000 AND COUNT(*)>0 SELECT COUNT(*)<2000 AND COUNT(*)>0 FROM t2 WHERE b='slave' GROUP BY b ORDER BY b; COUNT(*)<2000 AND COUNT(*)>0 1 +connection master; DROP TABLE IF EXISTS t1,t2; * storage_engine * +connection master; SET @restore_master_storage_engine=@@global.storage_engine; SET @@global.storage_engine=InnoDB; SET @@session.storage_engine=InnoDB; +connection slave; SET @restore_slave_storage_engine=@@global.storage_engine; SET @@global.storage_engine=Memory; SET @@session.storage_engine=Memory; +connection master; CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)); CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB; +connection slave; CREATE TABLE t3 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)); +connection master; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -163,6 +194,7 @@ t2 CREATE TABLE `t2` ( `b` varchar(10) DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 +connection slave; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -186,37 +218,49 @@ t3 CREATE TABLE `t3` ( ) ENGINE=MEMORY DEFAULT CHARSET=latin1 SET @@global.storage_engine=InnoDB; SET @@session.storage_engine=InnoDB; +connection master; DROP TABLE IF EXISTS t1,t2,t3; * sql_mode * +connection master; +SET @old_sql_mode_master= @@global.sql_mode; SET @@global.sql_mode=ANSI; SET @@session.sql_mode=ANSI; +connection slave; +SET @old_sql_mode_slave= @@global.sql_mode; SET @@global.sql_mode=TRADITIONAL; SET @@session.sql_mode=TRADITIONAL; +connection master; CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c DATE); INSERT INTO t1 VALUES (1, 'master', '0000-00-00'); SELECT * FROM t1 ORDER BY a; a b c 1 master 0000-00-00 +connection slave; INSERT INTO t1 VALUES (1, 'slave', '0000-00-00'); -ERROR 22007: Incorrect date value: '0000-00-00' for column 'c' at row 1 +ERROR 22007: Incorrect date value: '0000-00-00' for column `test`.`t1`.`c` at row 1 SELECT * FROM t1 ORDER BY a; a b c 1 master 0000-00-00 SET @@global.sql_mode=''; SET @@session.sql_mode=''; +connection master; SET @@global.sql_mode=''; SET @@session.sql_mode=''; DROP TABLE t1; *** clean up *** +connection master; SET @@global.character_set_database=@restore_master_character_set_database; SET @@global.collation_server=@restore_master_collation_server; SET @@global.storage_engine=@restore_master_storage_engine; +SET @@global.sql_mode=@old_sql_mode_master; +connection slave; SET @@global.character_set_database=@restore_slave_character_set_database; SET @@global.collation_server=@restore_slave_collation_server; SET @@global.max_heap_table_size=@restore_slave_max_heap_table_size; SET @@global.storage_engine=@restore_slave_storage_engine; +SET @@global.sql_mode=@old_sql_mode_slave; call mtr.add_suppression("The table 't[12]' is full"); include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_table_options.result b/mysql-test/suite/rpl/r/rpl_table_options.result index 87fd8c2b2fb..14af4e390c2 100644 --- a/mysql-test/suite/rpl/r/rpl_table_options.result +++ b/mysql-test/suite/rpl/r/rpl_table_options.result @@ -5,24 +5,27 @@ set storage_engine=example; connection slave; connection master; create table t1 (a int not null) ull=12340; +alter table t1 ull=12350; +Warnings: +Note 1105 EXAMPLE DEBUG: ULL 12340 -> 12350 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL -) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340 +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12350 connection slave; connection slave; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /* `ull`=12340 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /* `ull`=12350 */ set sql_mode=ignore_bad_table_options; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 `ull`=12340 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 `ull`=12350 connection master; drop table t1; set storage_engine=default; diff --git a/mysql-test/suite/rpl/t/rpl_change_master.test b/mysql-test/suite/rpl/t/rpl_change_master.test index 5e170d5acce..9ab49a585e6 100644 --- a/mysql-test/suite/rpl/t/rpl_change_master.test +++ b/mysql-test/suite/rpl/t/rpl_change_master.test @@ -101,4 +101,11 @@ connection master; drop table t1; } +--connection master +# MDEV-22741: *SAN: ERROR: AddressSanitizer: use-after-poison on address in +# instrings/strmake.c:36 from change_master (on optimized builds) +CHANGE MASTER TO MASTER_USER='root', MASTER_SSL=0, MASTER_SSL_CA='', MASTER_SSL_CERT='', + MASTER_SSL_KEY='', MASTER_SSL_CRL='', MASTER_SSL_CRLPATH=''; +CHANGE MASTER TO MASTER_USER='root', MASTER_PASSWORD='', MASTER_SSL=0; + --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_ignore_grant.test b/mysql-test/suite/rpl/t/rpl_ignore_grant.test index ee049a515d7..58457c14817 100644 --- a/mysql-test/suite/rpl/t/rpl_ignore_grant.test +++ b/mysql-test/suite/rpl/t/rpl_ignore_grant.test @@ -6,16 +6,12 @@ source include/master-slave.inc; # do not be influenced by other tests. connection master; -set global sql_mode=""; -set local sql_mode=""; +set sql_mode=""; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; -save_master_pos; -connection slave; -set global sql_mode=""; -set local sql_mode=""; -sync_with_master; +--sync_slave_with_master +set sql_mode=""; # as these DELETE were not replicated, we need to do them manually on the # slave. delete from mysql.user where user=_binary'rpl_ignore_grant'; @@ -27,9 +23,7 @@ connection master; grant select on *.* to rpl_ignore_grant@localhost; grant drop on test.* to rpl_ignore_grant@localhost; show grants for rpl_ignore_grant@localhost; -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master --error 1141 #("no such grant for user") show grants for rpl_ignore_grant@localhost; # check it another way @@ -43,9 +37,7 @@ select count(*) from mysql.db where user=_binary'rpl_ignore_grant'; grant select on *.* to rpl_ignore_grant@localhost; connection master; set password for rpl_ignore_grant@localhost=password("does it work?"); -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant'; # clear what we have done, to not influence other tests. @@ -53,15 +45,11 @@ connection master; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; -set global sql_mode=default; connection master; -set global sql_mode=default; # End of 4.1 tests --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table_update.test b/mysql-test/suite/rpl/t/rpl_ignore_table_update.test index 840052e2f25..6591dbbc6ad 100644 --- a/mysql-test/suite/rpl/t/rpl_ignore_table_update.test +++ b/mysql-test/suite/rpl/t/rpl_ignore_table_update.test @@ -24,15 +24,11 @@ create table mysqltest_bar (m int); insert into mysqltest_bar values(15); create table t1 (k int); insert into t1 values(55); -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master select mysqltest_foo.n,mysqltest_bar.m,t1.k from mysqltest_foo,mysqltest_bar,t1; connection master; drop table mysqltest_foo,mysqltest_bar,t1; -save_master_pos; -connection slave; -sync_with_master; +--sync_slave_with_master drop table mysqltest_foo,mysqltest_bar,t1; # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test index d8c8162ed9f..437d8412086 100644 --- a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test +++ b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test @@ -10,6 +10,7 @@ explain extended select master_pos_wait('master-bin.999999',0,2); send select master_pos_wait('master-bin.999999',0); connection slave1; stop slave sql_thread; +--source include/wait_for_slave_sql_to_stop.inc connection slave; reap; diff --git a/mysql-test/suite/rpl/t/rpl_parallel_retry.test b/mysql-test/suite/rpl/t/rpl_parallel_retry.test index 55da54e3c8c..97a3a709eb5 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_retry.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_retry.test @@ -436,6 +436,9 @@ SET @@DEBUG_SYNC='now SIGNAL proceed_by_1000'; --connection spoiler_21 ROLLBACK; +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE '%debug sync point%'; +--source include/wait_condition.inc + --echo # Release the 2nd worker to proceed --connection spoiler_22 ROLLBACK; diff --git a/mysql-test/suite/rpl/t/rpl_relay_max_extension.test b/mysql-test/suite/rpl/t/rpl_relay_max_extension.test new file mode 100644 index 00000000000..e1e087f2e0e --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_relay_max_extension.test @@ -0,0 +1,109 @@ +# ==== Purpose ==== +# +# Test verifies that auto purging mechanism of relay logs works fine when the +# file extension grows beyond 999999. +# +# ==== Implementation ==== +# +# Steps: +# 0 - In master-slave setup clear all the relay logs on the slave server. +# 1 - Start the slave so that new relay logs starting from +# 'slave-relay-bin.000001' are created. +# 2 - Get the active relay-log file name by using SHOW SLAVE STATUS. +# Shutdown the slave server. +# 3 - Rename active relay log to '999997' in both 'relay-log.info' and +# 'slave-relay-bin.index' files. +# 4 - Restart the slave server by configuring 'slave_parallel_threads=1' +# and 'max_relay_log_size=100K'. +# 5 - Generate load on master such that few relay logs are generated on +# slave. The relay log sequence number will change to 7 digits. +# 6 - Sync slave with master to ensure that relay logs are applied on +# slave. They should have been automatically purged. +# 7 - Assert that there is no 'slave-relay-bin.999999' file in +# 'relay-log.info'. +# +# ==== References ==== +# +# MDEV-8134: The relay-log is not flushed after the slave-relay-log.999999 +# showed +# + +--source include/have_innodb.inc +--source include/have_binlog_format_row.inc +--let $rpl_topology=1->2 +--source include/rpl_init.inc + +--connection server_2 +--source include/stop_slave.inc +RESET SLAVE; +--source include/start_slave.inc +--source include/stop_slave.inc +--let $relay_log=query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1) + +--echo # +--echo # Stop slave server +--echo # + +--let $datadir = `select @@datadir` +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--shutdown_server 10 +--source include/wait_until_disconnected.inc + +--exec sed -i "s/$relay_log/slave-relay-bin.999997/g" $datadir/relay-log.info +--exec sed -i "s/$relay_log/slave-relay-bin.999997/g" $datadir/slave-relay-bin.index + +--echo # +--echo # Simulate file number get close to 999997 +--echo # by renaming relay logs and modifying index/info files + +--move_file $datadir/$relay_log $datadir/slave-relay-bin.999997 + +--echo # +--echo # Restart slave server +--echo # + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--enable_reconnect +--source include/wait_until_connected_again.inc +SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads; +SET @save_max_relay_log_size= @@GLOBAL.max_relay_log_size; + +SET GLOBAL slave_parallel_threads=1; +SET GLOBAL max_relay_log_size=100 * 1024; +--source include/start_slave.inc + +--connection server_1 +create table t1 (i int, c varchar(1024)); +--echo # +--echo # Insert some data to generate enough amount of binary logs +--echo # +--let $count = 1000 +--disable_query_log +while ($count) +{ + eval insert into t1 values (1001 - $count, repeat('a',1000)); + dec $count; +} +--enable_query_log +--save_master_pos + +--connection server_2 +--sync_with_master + +--let $relay_log=query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1) + +--echo # +--echo # Assert that 'slave-relay-bin.999999' is purged. +--echo # +let SEARCH_FILE=$datadir/slave-relay-bin.index; +let SEARCH_PATTERN=slave-relay-bin.999999; +source include/search_pattern_in_file.inc; + +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads= @save_slave_parallel_threads; +SET GLOBAL max_relay_log_size= @save_max_relay_log_size; +--source include/start_slave.inc + +--connection server_1 +DROP TABLE t1; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_USER.test b/mysql-test/suite/rpl/t/rpl_row_USER.test index 31826812efa..405f609f0f6 100644 --- a/mysql-test/suite/rpl/t/rpl_row_USER.test +++ b/mysql-test/suite/rpl/t/rpl_row_USER.test @@ -11,7 +11,6 @@ # Includes -- source include/have_binlog_format_row.inc -- source include/master-slave.inc -set global sql_mode=""; set local sql_mode=""; # Begin clean up test section @@ -43,23 +42,18 @@ delimiter ;| CALL mysqltest1.p1(); connection master; SELECT * FROM mysqltest1.t1 ORDER BY a; -sync_slave_with_master; +--sync_slave_with_master SELECT * FROM mysqltest1.t1 ORDER BY a; connection master; # Lets cleanup -#show binlog events; DROP DATABASE mysqltest1; REVOKE ALL ON mysqltest1.* FROM 'tester'@'%'; REVOKE ALL ON mysqltest1.* FROM ''@'localhost%'; DROP USER tester@'%'; DROP USER ''@'localhost%'; - -sync_slave_with_master; - +FLUSH PRIVILEGES; +--sync_slave_with_master # End of 5.0 test case --source include/rpl_end.inc - -set global sql_mode=default; -set local sql_mode=default; diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test index 65f14295c19..cb76d6c4dcb 100644 --- a/mysql-test/suite/rpl/t/rpl_row_create_table.test +++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test @@ -7,11 +7,6 @@ connection slave; --source include/have_innodb.inc connection master; -# Bug#18326: Do not lock table for writing during prepare of statement -# The use of the ps protocol causes extra table maps in the binlog, so -# we disable the ps-protocol for this statement. ---disable_ps_protocol - # Set the default storage engine to different values on master and # slave. We need to stop the slave for the server variable to take # effect, since the variable is only read on start-up. diff --git a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test index 2d5cde82dcc..c10b3570ed6 100644 --- a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test +++ b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test @@ -4,10 +4,4 @@ let $rename_event_pos= `select @binlog_start_pos + 819`; -# Bug#18326: Do not lock table for writing during prepare of statement -# The use of the ps protocol causes extra table maps in the binlog, so -# we disable the ps-protocol for this statement. - ---disable_ps_protocol -- source include/rpl_flsh_tbls.test ---enable_ps_protocol diff --git a/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test b/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test index b0588cb2d58..d3a115e986a 100644 --- a/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test +++ b/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test @@ -329,7 +329,7 @@ while($ntables) -- echo ### detect failure. Before the patch mysqlbinlog would find -- echo ### a corrupted event, thence would fail. -- let $MYSQLD_DATADIR= `SELECT @@datadir` --- exec $MYSQL_BINLOG -v --hex $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug50018.binlog +-- exec $MYSQL_BINLOG -v --hexdump $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug50018.binlog ## clean up ## For debugging purposes you might want not to remove these diff --git a/mysql-test/suite/rpl/t/rpl_row_trig002.test b/mysql-test/suite/rpl/t/rpl_row_trig002.test index 46f9ad91a3d..f04d1e6d478 100644 --- a/mysql-test/suite/rpl/t/rpl_row_trig002.test +++ b/mysql-test/suite/rpl/t/rpl_row_trig002.test @@ -48,9 +48,11 @@ INSERT INTO test.t3 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming'); INSERT INTO test.t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming'); select * from test.t2; +--sorted_result select * from test.t3; sync_slave_with_master; select * from test.t2; +--sorted_result select * from test.t3; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_row_vcol_crash.test b/mysql-test/suite/rpl/t/rpl_row_vcol_crash.test new file mode 100644 index 00000000000..84ee14977f3 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_vcol_crash.test @@ -0,0 +1,425 @@ +# ==== Purpose ==== +# +# Test verifies that, slave doesn't report any assert on UPDATE or DELETE of +# row which tries to update the virtual columns with associated KEYs. +# +# Test scenarios are listed below. +# 1) KEY on a virtual column with ON DELETE CASCADE +# 2) Verify "ON DELETE CASCADE" for parent->child->child scenario +# 3) KEY on a virtual column with ON UPDATE CASCADE +# 4) Define triggers on master, their results should be replicated +# as part of row events and they should be applied on slave with +# the default slave_run_triggers_for_rbr=NO +# 5) Define triggers + Foreign Keys on master, their results should be +# replicated as part of row events and master and slave should be in sync. +# 6) Triggers are present only on slave and 'slave_run_triggers_for_rbr=NO' +# 7) Triggers are present only on slave and 'slave_run_triggers_for_rbr=YES' +# 8) Triggers and Foreign Keys are present only on slave and +# 'slave_run_triggers_for_rbr=NO' +# 9) Triggers are Foreign Keys are present only on slave and +# 'slave_run_triggers_for_rbr=YES' +# +# ==== References ==== +# +# MDEV-23033: All slaves crash once in ~24 hours and loop restart with signal 11 +# + +--source include/have_binlog_format_row.inc +--source include/have_innodb.inc +--source include/master-slave.inc + + +--echo # +--echo # Test case 1: KEY on a virtual column with ON DELETE CASCADE +--echo # +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1),(2),(3); + +CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY, + t1_id INT NOT NULL, + v_col INT AS (t1_id+1) VIRTUAL, KEY (v_col), KEY (t1_id), + CONSTRAINT a FOREIGN KEY (t1_id) REFERENCES t1 (id) ON DELETE CASCADE +) ENGINE=InnoDB; + +INSERT INTO t2 VALUES (90,1,NULL); +INSERT INTO t2 VALUES (91,2,default); + +# Following query results in an assert on slave +DELETE FROM t1 WHERE id=1; +--sync_slave_with_master + +--echo # +--echo # Verify data consistency on slave +--echo # +--let $diff_tables= master:test.t1, slave:test.t1 +--source include/diff_tables.inc +--let $diff_tables= master:test.t2, slave:test.t2 +--source include/diff_tables.inc + +--connection master +DROP TABLE t2,t1; +--sync_slave_with_master + +--echo # +--echo # Test case 2: Verify "ON DELETE CASCADE" for parent->child->child scenario +--echo # Parent table: users +--echo # Child tables: matchmaking_groups, matchmaking_group_users +--echo # Parent table: matchmaking_groups +--echo # Child tables: matchmaking_group_users, matchmaking_group_maps +--echo # +--echo # Deleting a row from parent table should be reflected in +--echo # child tables. +--echo # matchmaking_groups->matchmaking_group_users->matchmaking_group_maps +--echo # users->matchmaking_group_users->matchmaking_group_maps +--echo # + +--connection master +CREATE TABLE users (id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(32) NOT NULL DEFAULT '' +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE matchmaking_groups ( + id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, + host_user_id INT UNSIGNED NOT NULL UNIQUE, + v_col INT AS (host_user_id+1) VIRTUAL, KEY (v_col), + CONSTRAINT FOREIGN KEY (host_user_id) REFERENCES users (id) + ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE matchmaking_group_users ( + matchmaking_group_id BIGINT UNSIGNED NOT NULL, + user_id INT UNSIGNED NOT NULL, + v_col1 int as (user_id+1) virtual, KEY (v_col1), + PRIMARY KEY (matchmaking_group_id,user_id), + UNIQUE KEY user_id (user_id), + CONSTRAINT FOREIGN KEY (matchmaking_group_id) + REFERENCES matchmaking_groups (id) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT FOREIGN KEY (user_id) + REFERENCES users (id) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE matchmaking_group_maps ( + matchmaking_group_id BIGINT UNSIGNED NOT NULL, + map_id TINYINT UNSIGNED NOT NULL, + v_col2 INT AS (map_id+1) VIRTUAL, KEY (v_col2), + PRIMARY KEY (matchmaking_group_id,map_id), + CONSTRAINT FOREIGN KEY (matchmaking_group_id) + REFERENCES matchmaking_groups (id) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +--sync_slave_with_master + +--connection master +INSERT INTO users VALUES (NULL,'foo'),(NULL,'bar'); +INSERT INTO matchmaking_groups VALUES (10,1,default),(11,2,default); +INSERT INTO matchmaking_group_users VALUES (10,1,default),(11,2,default); +INSERT INTO matchmaking_group_maps VALUES (10,55,default),(11,66,default); + +DELETE FROM matchmaking_groups WHERE id = 10; +--sync_slave_with_master + +--echo # +--echo # No rows should be returned as ON DELETE CASCASE should have removed +--echo # corresponding rows from child tables. There should not any mismatch +--echo # of 'id' field between parent->child. +--echo # +SELECT * FROM matchmaking_group_users WHERE matchmaking_group_id NOT IN (SELECT id FROM matchmaking_groups); +SELECT * FROM matchmaking_group_maps WHERE matchmaking_group_id NOT IN (SELECT id FROM matchmaking_groups); + +--echo # +--echo # Rows with id=11 should be present +--echo # +SELECT * FROM matchmaking_group_users; +SELECT * FROM matchmaking_group_maps; + +--connection master +DELETE FROM users WHERE id = 2; +--sync_slave_with_master + +--echo # +--echo # No rows should be present in both the child tables +--echo # +SELECT * FROM matchmaking_group_users; +SELECT * FROM matchmaking_group_maps; + +--connection master +DROP TABLE matchmaking_group_maps, matchmaking_group_users, matchmaking_groups, users; +--sync_slave_with_master + +--echo # +--echo # Test case 3: KEY on a virtual column with ON UPDATE CASCADE +--echo # + +--connection master +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT NOT NULL) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 80); + +CREATE TABLE t2 (a INT KEY, b INT, + v_col int as (b+1) virtual, KEY (v_col), + CONSTRAINT b FOREIGN KEY (b) REFERENCES t1(a) ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (51, 1, default); +--sync_slave_with_master + +--connection master +UPDATE t1 SET a = 50 WHERE a = 1; + +--echo # +--echo # Master: Verify that ON UPDATE CASCADE works fine +--echo # old_row: (51, 1, 2) ON UPDATE New_row: (51, 50, 51) +--echo # +SELECT * FROM t2 WHERE b=50; +--sync_slave_with_master + +--echo # +--echo # Slave: Verify that ON UPDATE CASCADE works fine +--echo # old_row: (51, 1, 2) ON UPDATE New_row: (51, 50, 51) +--echo # +SELECT * FROM t2 WHERE b=50; + +--connection master +DROP TABLE t2, t1; +--sync_slave_with_master + +--echo # +--echo # Test case 4: Define triggers on master, their results should be +--echo # replicated as part of row events and they should be +--echo # applied on slave with the default +--echo # slave_run_triggers_for_rbr=NO +--echo # + +# In row-based replication, the binary log contains row changes. It will have +# both the changes made by the statement itself, and the changes made by the +# triggers that were invoked by the statement. Slave server(s) do not need to +# run triggers for row changes they are applying. Hence verify that this +# property remains the same and data should be available as if trigger was +# executed. Please note by default slave_run_triggers_for_rbr=NO. + +--connection master +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (count INT NOT NULL) ENGINE=InnoDB; +CREATE TRIGGER trg AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (1); +INSERT INTO t1 VALUES (2),(3); +--sync_slave_with_master + +SHOW GLOBAL VARIABLES LIKE 'slave_run_triggers_for_rbr'; +--echo # +--echo # As two rows are inserted in table 't1', two rows should get inserted +--echo # into table 't2' as part of trigger. +--echo # +--let $assert_cond= COUNT(*) = 2 FROM t2 +--let $assert_text= Table t2 should have two rows. +--source include/assert.inc + +--connection master +DROP TABLE t1,t2; +--sync_slave_with_master + +--echo # +--echo # Test case 5: Define triggers + Foreign Keys on master, their results +--echo # should be replicated as part of row events and master +--echo # and slave should be in sync. +--echo # +--connection master +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (t1_id INT NOT NULL, + v_col INT AS (t1_id+1) VIRTUAL, KEY (v_col), KEY (t1_id), + CONSTRAINT a FOREIGN KEY (t1_id) REFERENCES t1 (id) ON DELETE CASCADE +) ENGINE=InnoDB; +CREATE TABLE t3 (count INT NOT NULL) ENGINE=InnoDB; +CREATE TRIGGER trg AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t3 VALUES (1); + +INSERT INTO t1 VALUES (2),(3); +INSERT INTO t2 VALUES (2, default), (3, default); +--sync_slave_with_master + +--echo # +--echo # As two rows are inserted in table 't1', two rows should get inserted +--echo # into table 't3' as part of trigger. +--echo # +--let $assert_cond= COUNT(*) = 2 FROM t3 +--let $assert_text= Table t3 should have two rows. +--source include/assert.inc + +--echo # +--echo # Verify ON DELETE CASCASE correctness +--echo # +--connection master +DELETE FROM t1 WHERE id=2; +--sync_slave_with_master + +--connection master +--let $diff_tables= master:test.t1, slave:test.t1 +--source include/diff_tables.inc +--let $diff_tables= master:test.t2, slave:test.t2 +--source include/diff_tables.inc +--let $diff_tables= master:test.t3, slave:test.t3 +--source include/diff_tables.inc + +DROP TABLE t3,t2,t1; +--sync_slave_with_master + +# +# Test case: Triggers only on slave +# +--write_file $MYSQLTEST_VARDIR/tmp/trig_on_slave.inc PROCEDURE + if ($slave_run_triggers_for_rbr == '') { + --die !!!ERROR IN TEST: you must set $slave_run_triggers_for_rbr + } + +--connection slave +SET @save_slave_run_triggers_for_rbr= @@GLOBAL.slave_run_triggers_for_rbr; +--eval SET GLOBAL slave_run_triggers_for_rbr= $slave_run_triggers_for_rbr; +SHOW GLOBAL VARIABLES LIKE '%slave_run_triggers_for_rbr%'; + +--connection master +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (t1_id INT NOT NULL, + v_col INT AS (t1_id+1) VIRTUAL, KEY (v_col), + KEY (t1_id), CONSTRAINT a FOREIGN KEY (t1_id) REFERENCES t1 (id) ON DELETE CASCADE +) ENGINE=InnoDB; +CREATE TABLE t3 (count INT NOT NULL) ENGINE=InnoDB; +--sync_slave_with_master + +CREATE TRIGGER trg AFTER INSERT ON t2 FOR EACH ROW INSERT INTO t3 VALUES (1); + +--connection master +INSERT INTO t1 VALUES (2),(3); +INSERT INTO t2 VALUES (2, default), (3, default); +--sync_slave_with_master + +if ($slave_run_triggers_for_rbr == 'NO') { +--echo # +--echo # Count must be 0 +--echo # +--let $assert_cond= COUNT(*) = 0 FROM t3 +--let $assert_text= Table t3 should have zero rows. +--source include/assert.inc +} +if ($slave_run_triggers_for_rbr == 'YES') { +--echo # +--echo # Count must be 2 +--echo # +--let $assert_cond= COUNT(*) = 2 FROM t3 +--let $assert_text= Table t3 should have two rows. +--source include/assert.inc +} + +--connection master +DELETE FROM t1 WHERE id=2; +--sync_slave_with_master +SET GLOBAL slave_run_triggers_for_rbr= @save_slave_run_triggers_for_rbr; + +--echo # +--echo # Verify t1, t2 are consistent on slave. +--echo # +--let $diff_tables= master:test.t1, slave:test.t1 +--source include/diff_tables.inc +--let $diff_tables= master:test.t2, slave:test.t2 +--source include/diff_tables.inc + +--connection master +DROP TABLE t3,t2,t1; +--sync_slave_with_master +#END OF +PROCEDURE + +--echo # +--echo # Test case 6: Triggers are present only on slave and +--echo # 'slave_run_triggers_for_rbr=NO' +--echo # +--let $slave_run_triggers_for_rbr=NO +--source $MYSQLTEST_VARDIR/tmp/trig_on_slave.inc + +--echo # +--echo # Test case 7: Triggers are present only on slave and +--echo # 'slave_run_triggers_for_rbr=YES' +--echo # +--let $slave_run_triggers_for_rbr=YES +--source $MYSQLTEST_VARDIR/tmp/trig_on_slave.inc +--remove_file $MYSQLTEST_VARDIR/tmp/trig_on_slave.inc + +# +# Test case: Trigger and Foreign Key are present only on slave +# +--write_file $MYSQLTEST_VARDIR/tmp/trig_fk_on_slave.inc PROCEDURE + if ($slave_run_triggers_for_rbr == '') { + --die !!!ERROR IN TEST: you must set $slave_run_triggers_for_rbr + } + +--connection slave +SET @save_slave_run_triggers_for_rbr= @@GLOBAL.slave_run_triggers_for_rbr; +--eval SET GLOBAL slave_run_triggers_for_rbr= $slave_run_triggers_for_rbr; +SHOW GLOBAL VARIABLES LIKE '%slave_run_triggers_for_rbr%'; + +--connection master +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +SET sql_log_bin=0; +CREATE TABLE t2 (t1_id INT NOT NULL,v_col INT AS (t1_id+1) VIRTUAL) ENGINE=INNODB; +SET sql_log_bin=1; +CREATE TABLE t3 (count INT NOT NULL) ENGINE=InnoDB; +--sync_slave_with_master + +# Have foreign key and trigger on slave. +CREATE TABLE t2 (t1_id INT NOT NULL, + v_col INT AS (t1_id+1) VIRTUAL, KEY (v_col), KEY (t1_id), + CONSTRAINT a FOREIGN KEY (t1_id) REFERENCES t1 (id) ON DELETE CASCADE +) ENGINE=InnoDB; +CREATE TRIGGER trg AFTER INSERT ON t2 FOR EACH ROW INSERT INTO t3 VALUES (1); + +--connection master +INSERT INTO t1 VALUES (2),(3); +INSERT INTO t2 VALUES (2, default), (3, default); +--sync_slave_with_master + +if ($slave_run_triggers_for_rbr == 'NO') { +--echo # +--echo # Count must be 0 +--echo # +--let $assert_cond= COUNT(*) = 0 FROM t3 +--let $assert_text= Table t3 should have zero rows. +--source include/assert.inc +} +if ($slave_run_triggers_for_rbr == 'YES') { +--echo # +--echo # Count must be 2 +--echo # +--let $assert_cond= COUNT(*) = 2 FROM t3 +--let $assert_text= Table t3 should have two rows. +--source include/assert.inc +} + +--connection master +DELETE FROM t1 WHERE id=2; +--echo # t1: Should have one row +SELECT * FROM t1; +--echo # t2: Should have two rows +SELECT * FROM t2; +--sync_slave_with_master +--echo # t1: Should have one row +SELECT * FROM t1; +--echo # t2: Should have one row on slave due to ON DELETE CASCASE +SELECT * FROM t2; +SET GLOBAL slave_run_triggers_for_rbr= @save_slave_run_triggers_for_rbr; + +--connection master +DROP TABLE t3,t2,t1; +--sync_slave_with_master +#END OF +PROCEDURE + +--echo # +--echo # Test case 8: Triggers and Foreign Keys are present only on slave and +--echo # 'slave_run_triggers_for_rbr=NO' +--echo # +--let $slave_run_triggers_for_rbr=NO +--source $MYSQLTEST_VARDIR/tmp/trig_fk_on_slave.inc + +--echo # +--echo # Test case 9: Triggers are Foreign Keys are present only on slave and +--echo # 'slave_run_triggers_for_rbr=YES' +--echo # +--let $slave_run_triggers_for_rbr=YES +--source $MYSQLTEST_VARDIR/tmp/trig_fk_on_slave.inc +--remove_file $MYSQLTEST_VARDIR/tmp/trig_fk_on_slave.inc + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_slave_compressed_protocol-slave.opt b/mysql-test/suite/rpl/t/rpl_semi_sync_slave_compressed_protocol-slave.opt new file mode 100644 index 00000000000..a1b687d691e --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_slave_compressed_protocol-slave.opt @@ -0,0 +1 @@ +--slave_compressed_protocol diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_slave_compressed_protocol.test b/mysql-test/suite/rpl/t/rpl_semi_sync_slave_compressed_protocol.test new file mode 100644 index 00000000000..bc05bec2a96 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_slave_compressed_protocol.test @@ -0,0 +1,55 @@ +################################################################################ +# Bug#26027024 SLAVE_COMPRESSED_PROTOCOL DOESN'T WORK WITH SEMI-SYNC +# REPLICATION IN MYSQL-5.7 +# +# Steps to reproduce: +# 1) Set slave_compressed_protocol ON on Slave. +# 2) Do some sample work on Master +# 3) After the work is synced on Slave, check that there is no error +# (Read semi-sync reply magic number error) on Slave. +# 4) Cleanup +################################################################################ +# Test is independent of Binlog format. One of the three formats is enough +# for testing. Choosing 'Row' format. +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + +--let $sav_enabled_master=`SELECT @@GLOBAL.rpl_semi_sync_master_enabled ` +SET @@GLOBAL.rpl_semi_sync_master_enabled = 1; + +--connection slave +source include/stop_slave.inc; +--let $sav_enabled_slave=`SELECT @@GLOBAL.rpl_semi_sync_slave_enabled ` +SET @@GLOBAL.rpl_semi_sync_slave_enabled = 1; +source include/start_slave.inc; + +--connection master +# Do some sample work on Master with slave_compressed_protocol ON. +# (slave_compressed_protocol is set to ON in -slave.opt file of this test.) +CREATE TABLE t1 (i INT); +DROP TABLE t1; + +# Make sure sync is done, so that next 'assert' step can be executed without +# any issues. +--source include/rpl_sync.inc + +# Without the fix, the test would have generated few +# errors in the error log. With the fix, test will +# pass without any errors in the error log. +--let $assert_text= Check that there is no 'Read semi-sync reply magic number error' in error log. +--let $assert_select=Read semi-sync reply magic number error +--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err +--let $assert_count= 0 +--let $assert_only_after = CURRENT_TEST:rpl.rpl_semi_sync_slave_compressed_protocol.test +--source include/assert_grep.inc + +--connection master +--evalp SET @@GLOBAL. rpl_semi_sync_master_enabled = $sav_enabled_master + +--connection slave +source include/stop_slave.inc; +--evalp SET @@GLOBAL. rpl_semi_sync_slave_enabled = $sav_enabled_slave +source include/start_slave.inc; + +# Cleanup +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test b/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test index 52cd9e31753..f67c6e2ac0a 100644 --- a/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test +++ b/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test @@ -31,8 +31,12 @@ echo [ enable semi-sync on slave ]; stop slave; set global rpl_semi_sync_slave_enabled = 1; start slave; +let $status_var= rpl_semi_sync_slave_status; +let $status_var_value= ON; +source include/wait_for_status_var.inc; show status like 'rpl_semi_sync_slave%'; + connection master; CREATE TABLE t1(a INT) ENGINE=InnoDB; sync_slave_with_master; @@ -190,6 +194,12 @@ connection con1; INSERT INTO t1 values (2); sync_slave_with_master; connection con1; +let $status_var= Rpl_semi_sync_master_clients; +let $status_var_value= 1; +source include/wait_for_status_var.inc; +let $status_var= Rpl_semi_sync_master_status; +let $status_var_value= ON; +source include/wait_for_status_var.inc; show status like 'Rpl_semi_sync_master_clients'; show status like 'Rpl_semi_sync_master_status'; @@ -259,7 +269,12 @@ START SLAVE IO_THREAD; --echo ######################################################### connection con1; SET GLOBAL rpl_semi_sync_master_enabled = 0; + +let $status_var= Rpl_semi_sync_master_clients; +let $status_var_value= 1; +source include/wait_for_status_var.inc; show status like 'Rpl_semi_sync_master_clients'; + INSERT INTO t1 VALUES (1); SET GLOBAL rpl_semi_sync_master_enabled = 1; INSERT INTO t1 VALUES (2); diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test index fb30c5708bc..637dda47489 100644 --- a/mysql-test/suite/rpl/t/rpl_sp.test +++ b/mysql-test/suite/rpl/t/rpl_sp.test @@ -7,8 +7,6 @@ source include/have_binlog_format_mixed.inc; source include/master-slave.inc; set local sql_mode=''; -set global sql_mode=''; - # we need a db != test, where we don't have automatic grants --disable_warnings drop database if exists mysqltest1; @@ -199,9 +197,11 @@ delimiter ;| delete t1,t2 from t1,t2; select fn1(20); insert into t2 values(fn1(21)); +--sorted_result select * from t1; select * from t2; sync_slave_with_master; +--sorted_result select * from t1; select * from t2; @@ -728,4 +728,3 @@ drop procedure p1; # Cleanup sync_slave_with_master; --source include/rpl_end.inc -set global sql_mode=default; diff --git a/mysql-test/suite/rpl/t/rpl_spec_variables-slave.opt b/mysql-test/suite/rpl/t/rpl_spec_variables-slave.opt deleted file mode 100644 index 627becdbfb5..00000000000 --- a/mysql-test/suite/rpl/t/rpl_spec_variables-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb diff --git a/mysql-test/suite/rpl/t/rpl_spec_variables.test b/mysql-test/suite/rpl/t/rpl_spec_variables.test index 2cb580fce83..e2d5175036c 100644 --- a/mysql-test/suite/rpl/t/rpl_spec_variables.test +++ b/mysql-test/suite/rpl/t/rpl_spec_variables.test @@ -260,10 +260,12 @@ DROP TABLE IF EXISTS t1,t2,t3; --echo * sql_mode * --connection master +SET @old_sql_mode_master= @@global.sql_mode; SET @@global.sql_mode=ANSI; SET @@session.sql_mode=ANSI; --connection slave +SET @old_sql_mode_slave= @@global.sql_mode; SET @@global.sql_mode=TRADITIONAL; SET @@session.sql_mode=TRADITIONAL; @@ -292,14 +294,16 @@ DROP TABLE t1; SET @@global.character_set_database=@restore_master_character_set_database; SET @@global.collation_server=@restore_master_collation_server; SET @@global.storage_engine=@restore_master_storage_engine; +SET @@global.sql_mode=@old_sql_mode_master; --sync_slave_with_master SET @@global.character_set_database=@restore_slave_character_set_database; SET @@global.collation_server=@restore_slave_collation_server; SET @@global.max_heap_table_size=@restore_slave_max_heap_table_size; SET @@global.storage_engine=@restore_slave_storage_engine; - +SET @@global.sql_mode=@old_sql_mode_slave; # Put at the end since the test otherwise emptied the table. - +remove_file $MYSQLTEST_VARDIR/tmp/words.dat; +remove_file $MYSQLTEST_VARDIR/tmp/words2.dat; --echo call mtr.add_suppression("The table 't[12]' is full"); diff --git a/mysql-test/suite/rpl/t/rpl_table_options.test b/mysql-test/suite/rpl/t/rpl_table_options.test index 3f52444a3c7..6dd1c9bd20d 100644 --- a/mysql-test/suite/rpl/t/rpl_table_options.test +++ b/mysql-test/suite/rpl/t/rpl_table_options.test @@ -18,6 +18,7 @@ connection master; # the option is unknown. # create table t1 (a int not null) ull=12340; +alter table t1 ull=12350; show create table t1; sync_slave_with_master; diff --git a/mysql-test/suite/sql_sequence/concurrent_create.result b/mysql-test/suite/sql_sequence/concurrent_create.result index 7e68195f7e0..2473abef37d 100644 --- a/mysql-test/suite/sql_sequence/concurrent_create.result +++ b/mysql-test/suite/sql_sequence/concurrent_create.result @@ -31,3 +31,16 @@ connection con1; disconnect con1; connection default; DROP TABLE s1,s2; +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connect con1,localhost,root,,test; +CREATE SEQUENCE s1 ENGINE=InnoDB; +FLUSH TABLES; +disconnect con1; +connection default; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +1 +COMMIT; +DROP TABLE t1; +DROP SEQUENCE s1; diff --git a/mysql-test/suite/sql_sequence/concurrent_create.test b/mysql-test/suite/sql_sequence/concurrent_create.test index d6a57ff7d50..b27a6d3bdb9 100644 --- a/mysql-test/suite/sql_sequence/concurrent_create.test +++ b/mysql-test/suite/sql_sequence/concurrent_create.test @@ -56,3 +56,22 @@ FLUSH TABLES; --connection default DROP TABLE s1,s2; + +# +# MDEV-24545 Sequence created by one connection remains invisible to another +# +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +START TRANSACTION WITH CONSISTENT SNAPSHOT; + +--connect (con1,localhost,root,,test) +CREATE SEQUENCE s1 ENGINE=InnoDB; +FLUSH TABLES; +--disconnect con1 + +--connection default +SELECT NEXTVAL(s1); +COMMIT; + +# Cleanup +DROP TABLE t1; +DROP SEQUENCE s1; diff --git a/mysql-test/suite/sql_sequence/create.result b/mysql-test/suite/sql_sequence/create.result index 14464c60e99..5a53a66c9a8 100644 --- a/mysql-test/suite/sql_sequence/create.result +++ b/mysql-test/suite/sql_sequence/create.result @@ -666,7 +666,7 @@ create temporary sequence s; drop temporary table s; create temporary table s (i int); drop temporary sequence s; -ERROR 42S02: Unknown SEQUENCE: 'test.s' +ERROR 42S02: 'test.s' is not a SEQUENCE drop table s; # # MDEV-15115 Assertion failure in CREATE SEQUENCE...ROW_FORMAT=REDUNDANT diff --git a/mysql-test/suite/sql_sequence/create.test b/mysql-test/suite/sql_sequence/create.test index 2c41fb3658b..ac3aae845cd 100644 --- a/mysql-test/suite/sql_sequence/create.test +++ b/mysql-test/suite/sql_sequence/create.test @@ -489,7 +489,7 @@ drop table s; create temporary sequence s; drop temporary table s; create temporary table s (i int); ---error ER_UNKNOWN_SEQUENCES +--error ER_NOT_SEQUENCE2 drop temporary sequence s; drop table s; diff --git a/mysql-test/suite/sql_sequence/mysqldump.result b/mysql-test/suite/sql_sequence/mysqldump.result index e6aedb57ea6..fb023cc5e36 100644 --- a/mysql-test/suite/sql_sequence/mysqldump.result +++ b/mysql-test/suite/sql_sequence/mysqldump.result @@ -2,8 +2,46 @@ CREATE SEQUENCE a1 engine=aria; CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024; insert into t1 values (1),(2); CREATE SEQUENCE x1 engine=innodb; +# dump whole database CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria; SELECT SETVAL(`a1`, 1, 0); +CREATE SEQUENCE `x1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB; +SELECT SETVAL(`x1`, 1, 0); +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t1` VALUES (1),(2); +# dump by tables order 1 +CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria; +SELECT SETVAL(`a1`, 1, 0); +CREATE SEQUENCE `x1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB; +SELECT SETVAL(`x1`, 1, 0); +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t1` VALUES (1),(2); +# dump by tables order 2 +CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria; +SELECT SETVAL(`a1`, 1, 0); +CREATE SEQUENCE `x1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB; +SELECT SETVAL(`x1`, 1, 0); +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t1` VALUES (1),(2); +# dump by tables only tables /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( @@ -12,8 +50,12 @@ CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (1),(2); +# dump by tables only sequences +CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria; +SELECT SETVAL(`a1`, 1, 0); CREATE SEQUENCE `x1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB; SELECT SETVAL(`x1`, 1, 0); +# end of dumps DROP TABLE a1,t1,x1; set default_storage_engine=InnoDB; create sequence t1; diff --git a/mysql-test/suite/sql_sequence/mysqldump.test b/mysql-test/suite/sql_sequence/mysqldump.test index 308f06d5e8d..d2afb2fd675 100644 --- a/mysql-test/suite/sql_sequence/mysqldump.test +++ b/mysql-test/suite/sql_sequence/mysqldump.test @@ -11,7 +11,18 @@ CREATE SEQUENCE a1 engine=aria; CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024; insert into t1 values (1),(2); CREATE SEQUENCE x1 engine=innodb; +--echo # dump whole database --exec $MYSQL_DUMP --compact test +--echo # dump by tables order 1 +--exec $MYSQL_DUMP --compact --tables test t1 a1 x1 +--echo # dump by tables order 2 +--exec $MYSQL_DUMP --compact --tables test a1 t1 x1 +--echo # dump by tables only tables +--exec $MYSQL_DUMP --compact --tables test t1 +--echo # dump by tables only sequences +--exec $MYSQL_DUMP --compact --tables test a1 x1 +--echo # end of dumps + DROP TABLE a1,t1,x1; # diff --git a/mysql-test/suite/sql_sequence/other.result b/mysql-test/suite/sql_sequence/other.result index abc101b3c00..643233149d2 100644 --- a/mysql-test/suite/sql_sequence/other.result +++ b/mysql-test/suite/sql_sequence/other.result @@ -300,4 +300,63 @@ update t1 set p_first_name='Yunxi' where p_id=1; drop view v2; drop table t1,t2; drop sequence s1; +# +# MDEV-19273:Server crash in MDL_ticket::has_stronger_or_equal_type or +# Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, +# table->db.str, table->table_name.str, MDL_SHARED)' failed +# in mysql_rm_table_no_locks +# +CREATE TABLE t1 (a INT); +CREATE TEMPORARY TABLE tmp (b INT); +LOCK TABLE t1 READ; +DROP SEQUENCE tmp; +ERROR 42S02: 'test.tmp' is not a SEQUENCE +DROP TEMPORARY SEQUENCE tmp; +ERROR 42S02: 'test.tmp' is not a SEQUENCE +DROP SEQUENCE t1; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +DROP TEMPORARY SEQUENCE t1; +ERROR 42S02: Unknown SEQUENCE: 'test.t1' +UNLOCK TABLES; +DROP SEQUENCE t1; +ERROR 42S02: 'test.t1' is not a SEQUENCE +DROP TEMPORARY SEQUENCE t1; +ERROR 42S02: Unknown SEQUENCE: 'test.t1' +DROP TABLE t1; +CREATE TABLE t (a INT); +CREATE TEMPORARY TABLE s (f INT); +CREATE SEQUENCE s; +LOCK TABLE t WRITE; +DROP SEQUENCE s; +ERROR 42S02: 'test.s' is not a SEQUENCE +DROP TEMPORARY SEQUENCE s; +ERROR 42S02: 'test.s' is not a SEQUENCE +UNLOCK TABLES; +CREATE TEMPORARY SEQUENCE s; +LOCK TABLE t WRITE; +DROP TEMPORARY SEQUENCE s; +UNLOCK TABLES; +DROP TEMPORARY TABLE s; +DROP SEQUENCE s; +create table s(a INT); +CREATE TEMPORARY TABLE s (f INT); +LOCK TABLE t WRITE; +DROP TEMPORARY TABLE s; +CREATE TEMPORARY TABLE s (f INT); +DROP TABLE s; +DROP TABLE s; +ERROR HY000: Table 's' was not locked with LOCK TABLES +UNLOCK TABLES; +DROP TABLE s; +CREATE VIEW v1 as SELECT * FROM t; +CREATE SEQUENCE s; +DROP SEQUENCE IF EXISTS v1; +Warnings: +Note 4091 Unknown SEQUENCE: 'test.v1' +DROP VIEW IF EXISTS s; +Warnings: +Note 4092 Unknown VIEW: 'test.s' +DROP VIEW v1; +DROP SEQUENCE s; +DROP TABLE t; # End of 10.3 tests diff --git a/mysql-test/suite/sql_sequence/other.test b/mysql-test/suite/sql_sequence/other.test index 70c4efa40e5..0fbb2d0e2f9 100644 --- a/mysql-test/suite/sql_sequence/other.test +++ b/mysql-test/suite/sql_sequence/other.test @@ -315,4 +315,68 @@ drop view v2; drop table t1,t2; drop sequence s1; +--echo # +--echo # MDEV-19273:Server crash in MDL_ticket::has_stronger_or_equal_type or +--echo # Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, +--echo # table->db.str, table->table_name.str, MDL_SHARED)' failed +--echo # in mysql_rm_table_no_locks +--echo # + +CREATE TABLE t1 (a INT); +CREATE TEMPORARY TABLE tmp (b INT); +LOCK TABLE t1 READ; +--error ER_NOT_SEQUENCE2 +DROP SEQUENCE tmp; +--error ER_NOT_SEQUENCE2 +DROP TEMPORARY SEQUENCE tmp; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +DROP SEQUENCE t1; +--error ER_UNKNOWN_SEQUENCES +DROP TEMPORARY SEQUENCE t1; +UNLOCK TABLES; +--error ER_NOT_SEQUENCE2 +DROP SEQUENCE t1; +--error ER_UNKNOWN_SEQUENCES +DROP TEMPORARY SEQUENCE t1; + +# Cleanup +DROP TABLE t1; + + +CREATE TABLE t (a INT); +CREATE TEMPORARY TABLE s (f INT); +CREATE SEQUENCE s; +LOCK TABLE t WRITE; +--error ER_NOT_SEQUENCE2 +DROP SEQUENCE s; +--error ER_NOT_SEQUENCE2 +DROP TEMPORARY SEQUENCE s; +UNLOCK TABLES; +CREATE TEMPORARY SEQUENCE s; +LOCK TABLE t WRITE; +DROP TEMPORARY SEQUENCE s; +UNLOCK TABLES; +DROP TEMPORARY TABLE s; +DROP SEQUENCE s; + +create table s(a INT); +CREATE TEMPORARY TABLE s (f INT); +LOCK TABLE t WRITE; +DROP TEMPORARY TABLE s; +CREATE TEMPORARY TABLE s (f INT); +DROP TABLE s; +--error ER_TABLE_NOT_LOCKED +DROP TABLE s; +UNLOCK TABLES; +DROP TABLE s; + +CREATE VIEW v1 as SELECT * FROM t; +CREATE SEQUENCE s; + +DROP SEQUENCE IF EXISTS v1; +DROP VIEW IF EXISTS s; + +DROP VIEW v1; +DROP SEQUENCE s; +DROP TABLE t; --echo # End of 10.3 tests diff --git a/mysql-test/suite/sys_vars/inc/sysvars_server.inc b/mysql-test/suite/sys_vars/inc/sysvars_server.inc index 36b41cbdc09..025f8a8922d 100644 --- a/mysql-test/suite/sys_vars/inc/sysvars_server.inc +++ b/mysql-test/suite/sys_vars/inc/sysvars_server.inc @@ -23,7 +23,7 @@ select VARIABLE_NAME,VARIABLE_SCOPE,VARIABLE_TYPE,VARIABLE_COMMENT,NUMERIC_MIN_V variable_name not like 'wsrep%' and variable_name not like 's3%' and variable_name not in ( - 'log_tc_size' + 'log_tc_size','have_sanitizer' ) order by variable_name; diff --git a/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result b/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result index eec16411144..5a9c201f494 100644 --- a/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result @@ -11,18 +11,26 @@ SELECT @@global.innodb_checksum_algorithm; @@global.innodb_checksum_algorithm strict_crc32 SET GLOBAL innodb_checksum_algorithm = 'innodb'; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. SELECT @@global.innodb_checksum_algorithm; @@global.innodb_checksum_algorithm innodb SET GLOBAL innodb_checksum_algorithm = 'strict_innodb'; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. SELECT @@global.innodb_checksum_algorithm; @@global.innodb_checksum_algorithm strict_innodb SET GLOBAL innodb_checksum_algorithm = 'none'; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. SELECT @@global.innodb_checksum_algorithm; @@global.innodb_checksum_algorithm none SET GLOBAL innodb_checksum_algorithm = 'strict_none'; +Warnings: +Warning 138 Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6. SELECT @@global.innodb_checksum_algorithm; @@global.innodb_checksum_algorithm strict_none diff --git a/mysql-test/suite/sys_vars/r/innodb_idle_flush_pct_basic.result b/mysql-test/suite/sys_vars/r/innodb_idle_flush_pct_basic.result index a2c328f38fd..915343fcff2 100644 --- a/mysql-test/suite/sys_vars/r/innodb_idle_flush_pct_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_idle_flush_pct_basic.result @@ -24,6 +24,8 @@ select * from information_schema.session_variables where variable_name='innodb_i VARIABLE_NAME VARIABLE_VALUE INNODB_IDLE_FLUSH_PCT 100 set global innodb_idle_flush_pct=10; +Warnings: +Warning 131 innodb_idle_flush_pct is DEPRECATED and has no effect. select @@global.innodb_idle_flush_pct; @@global.innodb_idle_flush_pct 10 @@ -44,6 +46,7 @@ ERROR 42000: Incorrect argument type to variable 'innodb_idle_flush_pct' set global innodb_idle_flush_pct=-7; Warnings: Warning 1292 Truncated incorrect innodb_idle_flush_pct value: '-7' +Warning 131 innodb_idle_flush_pct is DEPRECATED and has no effect. select @@global.innodb_idle_flush_pct; @@global.innodb_idle_flush_pct 0 @@ -53,6 +56,7 @@ INNODB_IDLE_FLUSH_PCT 0 set global innodb_idle_flush_pct=106; Warnings: Warning 1292 Truncated incorrect innodb_idle_flush_pct value: '106' +Warning 131 innodb_idle_flush_pct is DEPRECATED and has no effect. select @@global.innodb_idle_flush_pct; @@global.innodb_idle_flush_pct 100 @@ -60,18 +64,26 @@ select * from information_schema.global_variables where variable_name='innodb_id VARIABLE_NAME VARIABLE_VALUE INNODB_IDLE_FLUSH_PCT 100 set global innodb_idle_flush_pct=0; +Warnings: +Warning 131 innodb_idle_flush_pct is DEPRECATED and has no effect. select @@global.innodb_idle_flush_pct; @@global.innodb_idle_flush_pct 0 set global innodb_idle_flush_pct=100; +Warnings: +Warning 131 innodb_idle_flush_pct is DEPRECATED and has no effect. select @@global.innodb_idle_flush_pct; @@global.innodb_idle_flush_pct 100 set global innodb_idle_flush_pct=DEFAULT; +Warnings: +Warning 131 innodb_idle_flush_pct is DEPRECATED and has no effect. select @@global.innodb_idle_flush_pct; @@global.innodb_idle_flush_pct 100 SET @@global.innodb_idle_flush_pct = @start_global_value; +Warnings: +Warning 131 innodb_idle_flush_pct is DEPRECATED and has no effect. SELECT @@global.innodb_idle_flush_pct; @@global.innodb_idle_flush_pct 100 diff --git a/mysql-test/suite/sys_vars/r/innodb_simulate_comp_failures_basic.result b/mysql-test/suite/sys_vars/r/innodb_simulate_comp_failures_basic.result deleted file mode 100644 index 7a6c9ca2db6..00000000000 --- a/mysql-test/suite/sys_vars/r/innodb_simulate_comp_failures_basic.result +++ /dev/null @@ -1,77 +0,0 @@ -SET @start_global_value = @@global.innodb_simulate_comp_failures; -SELECT @start_global_value; -@start_global_value -0 -Valid values are between 0 and 99 -select @@global.innodb_simulate_comp_failures between 0 and 99; -@@global.innodb_simulate_comp_failures between 0 and 99 -1 -select @@global.innodb_simulate_comp_failures; -@@global.innodb_simulate_comp_failures -0 -select @@session.innodb_simulate_comp_failures; -ERROR HY000: Variable 'innodb_simulate_comp_failures' is a GLOBAL variable -show global variables like 'innodb_simulate_comp_failures'; -Variable_name Value -innodb_simulate_comp_failures 0 -show session variables like 'innodb_simulate_comp_failures'; -Variable_name Value -innodb_simulate_comp_failures 0 -select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_SIMULATE_COMP_FAILURES 0 -select * from information_schema.session_variables where variable_name='innodb_simulate_comp_failures'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_SIMULATE_COMP_FAILURES 0 -set global innodb_simulate_comp_failures=10; -select @@global.innodb_simulate_comp_failures; -@@global.innodb_simulate_comp_failures -10 -select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_SIMULATE_COMP_FAILURES 10 -select * from information_schema.session_variables where variable_name='innodb_simulate_comp_failures'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_SIMULATE_COMP_FAILURES 10 -set session innodb_simulate_comp_failures=1; -ERROR HY000: Variable 'innodb_simulate_comp_failures' is a GLOBAL variable and should be set with SET GLOBAL -set global innodb_simulate_comp_failures=1.1; -ERROR 42000: Incorrect argument type to variable 'innodb_simulate_comp_failures' -set global innodb_simulate_comp_failures=1e1; -ERROR 42000: Incorrect argument type to variable 'innodb_simulate_comp_failures' -set global innodb_simulate_comp_failures="foo"; -ERROR 42000: Incorrect argument type to variable 'innodb_simulate_comp_failures' -set global innodb_simulate_comp_failures=-7; -Warnings: -Warning 1292 Truncated incorrect innodb_simulate_comp_failures value: '-7' -select @@global.innodb_simulate_comp_failures; -@@global.innodb_simulate_comp_failures -0 -select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_SIMULATE_COMP_FAILURES 0 -set global innodb_simulate_comp_failures=106; -Warnings: -Warning 1292 Truncated incorrect innodb_simulate_comp_failures value: '106' -select @@global.innodb_simulate_comp_failures; -@@global.innodb_simulate_comp_failures -99 -select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; -VARIABLE_NAME VARIABLE_VALUE -INNODB_SIMULATE_COMP_FAILURES 99 -set global innodb_simulate_comp_failures=0; -select @@global.innodb_simulate_comp_failures; -@@global.innodb_simulate_comp_failures -0 -set global innodb_simulate_comp_failures=99; -select @@global.innodb_simulate_comp_failures; -@@global.innodb_simulate_comp_failures -99 -set global innodb_simulate_comp_failures=DEFAULT; -select @@global.innodb_simulate_comp_failures; -@@global.innodb_simulate_comp_failures -0 -SET @@global.innodb_simulate_comp_failures = @start_global_value; -SELECT @@global.innodb_simulate_comp_failures; -@@global.innodb_simulate_comp_failures -0 diff --git a/mysql-test/suite/sys_vars/r/max_sort_length_basic.result b/mysql-test/suite/sys_vars/r/max_sort_length_basic.result deleted file mode 100644 index b48b045897c..00000000000 --- a/mysql-test/suite/sys_vars/r/max_sort_length_basic.result +++ /dev/null @@ -1,199 +0,0 @@ -SET @start_global_value = @@global.max_sort_length; -SELECT @start_global_value; -@start_global_value -1024 -SET @start_session_value = @@session.max_sort_length; -SELECT @start_session_value; -@start_session_value -1024 -'#--------------------FN_DYNVARS_084_01-------------------------#' -SET @@global.max_sort_length = 1000; -SET @@global.max_sort_length = DEFAULT; -SELECT @@global.max_sort_length; -@@global.max_sort_length -1024 -SET @@session.max_sort_length = 1000; -SET @@session.max_sort_length = DEFAULT; -SELECT @@session.max_sort_length; -@@session.max_sort_length -1024 -'#--------------------FN_DYNVARS_084_02-------------------------#' -SET @@global.max_sort_length = DEFAULT; -SELECT @@global.max_sort_length = 1024; -@@global.max_sort_length = 1024 -1 -SET @@session.max_sort_length = DEFAULT; -SELECT @@session.max_sort_length = 1024; -@@session.max_sort_length = 1024 -1 -'#--------------------FN_DYNVARS_084_03-------------------------#' -SET @@global.max_sort_length = 8; -SELECT @@global.max_sort_length; -@@global.max_sort_length -8 -SET @@global.max_sort_length = 9; -SELECT @@global.max_sort_length; -@@global.max_sort_length -9 -SET @@global.max_sort_length = 8388608; -SELECT @@global.max_sort_length; -@@global.max_sort_length -8388608 -SET @@global.max_sort_length = 8388607; -SELECT @@global.max_sort_length; -@@global.max_sort_length -8388607 -SET @@global.max_sort_length = 65536; -SELECT @@global.max_sort_length; -@@global.max_sort_length -65536 -'#--------------------FN_DYNVARS_084_04-------------------------#' -SET @@session.max_sort_length = 8; -SELECT @@session.max_sort_length; -@@session.max_sort_length -8 -SET @@session.max_sort_length = 9; -SELECT @@session.max_sort_length; -@@session.max_sort_length -9 -SET @@session.max_sort_length = 8388608; -SELECT @@session.max_sort_length; -@@session.max_sort_length -8388608 -SET @@session.max_sort_length = 8388607; -SELECT @@session.max_sort_length; -@@session.max_sort_length -8388607 -SET @@session.max_sort_length = 65536; -SELECT @@session.max_sort_length; -@@session.max_sort_length -65536 -'#------------------FN_DYNVARS_084_05-----------------------#' -SET @@global.max_sort_length = -1024; -Warnings: -Warning 1292 Truncated incorrect max_sort_length value: '-1024' -SELECT @@global.max_sort_length; -@@global.max_sort_length -8 -SET @@global.max_sort_length = 3; -Warnings: -Warning 1292 Truncated incorrect max_sort_length value: '3' -SELECT @@global.max_sort_length; -@@global.max_sort_length -8 -SET @@global.max_sort_length = 8388609; -Warnings: -Warning 1292 Truncated incorrect max_sort_length value: '8388609' -SELECT @@global.max_sort_length; -@@global.max_sort_length -8388608 -SET @@global.max_sort_length = 0; -Warnings: -Warning 1292 Truncated incorrect max_sort_length value: '0' -SELECT @@global.max_sort_length; -@@global.max_sort_length -8 -SET @@global.max_sort_length = 65530.34; -ERROR 42000: Incorrect argument type to variable 'max_sort_length' -SELECT @@global.max_sort_length; -@@global.max_sort_length -8 -SET @@global.max_sort_length = test; -ERROR 42000: Incorrect argument type to variable 'max_sort_length' -SELECT @@global.max_sort_length; -@@global.max_sort_length -8 -SET @@session.max_sort_length = 8388610; -Warnings: -Warning 1292 Truncated incorrect max_sort_length value: '8388610' -SELECT @@session.max_sort_length; -@@session.max_sort_length -8388608 -SET @@session.max_sort_length = -1; -Warnings: -Warning 1292 Truncated incorrect max_sort_length value: '-1' -SELECT @@session.max_sort_length; -@@session.max_sort_length -8 -SET @@session.max_sort_length = 3; -Warnings: -Warning 1292 Truncated incorrect max_sort_length value: '3' -SELECT @@session.max_sort_length; -@@session.max_sort_length -8 -SET @@session.max_sort_length = 0; -Warnings: -Warning 1292 Truncated incorrect max_sort_length value: '0' -SELECT @@session.max_sort_length; -@@session.max_sort_length -8 -SET @@session.max_sort_length = 65530.34; -ERROR 42000: Incorrect argument type to variable 'max_sort_length' -SET @@session.max_sort_length = 10737418241; -Warnings: -Warning 1292 Truncated incorrect max_sort_length value: '10737418241' -SELECT @@session.max_sort_length; -@@session.max_sort_length -8388608 -SET @@session.max_sort_length = test; -ERROR 42000: Incorrect argument type to variable 'max_sort_length' -SELECT @@session.max_sort_length; -@@session.max_sort_length -8388608 -'#------------------FN_DYNVARS_084_06-----------------------#' -SELECT @@global.max_sort_length = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_sort_length'; -@@global.max_sort_length = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_084_07-----------------------#' -SELECT @@session.max_sort_length = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_sort_length'; -@@session.max_sort_length = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_084_08-----------------------#' -SET @@global.max_sort_length = TRUE; -Warnings: -Warning 1292 Truncated incorrect max_sort_length value: '1' -SELECT @@global.max_sort_length; -@@global.max_sort_length -8 -SET @@global.max_sort_length = FALSE; -Warnings: -Warning 1292 Truncated incorrect max_sort_length value: '0' -SELECT @@global.max_sort_length; -@@global.max_sort_length -8 -'#---------------------FN_DYNVARS_084_09----------------------#' -SET @@global.max_sort_length = 2048; -SELECT @@max_sort_length = @@global.max_sort_length; -@@max_sort_length = @@global.max_sort_length -0 -'#---------------------FN_DYNVARS_084_10----------------------#' -SET @@max_sort_length = 100000; -SELECT @@max_sort_length = @@local.max_sort_length; -@@max_sort_length = @@local.max_sort_length -1 -SELECT @@local.max_sort_length = @@session.max_sort_length; -@@local.max_sort_length = @@session.max_sort_length -1 -'#---------------------FN_DYNVARS_084_11----------------------#' -SET max_sort_length = 1024; -SELECT @@max_sort_length; -@@max_sort_length -1024 -SELECT local.max_sort_length; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.max_sort_length; -ERROR 42S02: Unknown table 'session' in field list -SELECT max_sort_length = @@session.max_sort_length; -ERROR 42S22: Unknown column 'max_sort_length' in 'field list' -SET @@global.max_sort_length = @start_global_value; -SELECT @@global.max_sort_length; -@@global.max_sort_length -1024 -SET @@session.max_sort_length = @start_session_value; -SELECT @@session.max_sort_length; -@@session.max_sort_length -1024 diff --git a/mysql-test/suite/sys_vars/r/max_sort_length_func.result b/mysql-test/suite/sys_vars/r/max_sort_length_func.result index 36f5518287a..3ec8faf1b7e 100644 --- a/mysql-test/suite/sys_vars/r/max_sort_length_func.result +++ b/mysql-test/suite/sys_vars/r/max_sort_length_func.result @@ -1,301 +1,279 @@ SET @start_value= @@global.max_sort_length; -SET @session_max_sort_length = @@Session.max_sort_length; -DROP TABLE IF EXISTS t; ** creating tables ** -CREATE TABLE t -( -id INT AUTO_INCREMENT PRIMARY KEY, -c TEXT(30) -); -CREATE TABLE t1 -( -id INT AUTO_INCREMENT PRIMARY KEY, -c BLOB(30) -); -CREATE TABLE t2 -( -id INT AUTO_INCREMENT PRIMARY KEY, -c TEXT(30) -); +CREATE TABLE t (id INT AUTO_INCREMENT PRIMARY KEY, c TEXT); +CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY, c BLOB); +CREATE TABLE t2 (id INT AUTO_INCREMENT PRIMARY KEY, c TEXT); '#--------------------FN_DYNVARS_098_01-------------------------#' connect test_con1,localhost,root,,; -connection test_con1; -SELECT @@global.max_sort_length = 10; -@@global.max_sort_length = 10 -0 -SELECT @@session.max_sort_length = 10; -@@session.max_sort_length = 10 -0 -** Setting value to 30 and inserting data ** -SET @@global.max_sort_length = 30; +** Setting value to 70 and inserting data ** +SET @@global.max_sort_length = 70; SELECT @@global.max_sort_length; @@global.max_sort_length -30 -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); +70 +INSERT INTO t set c = repeat('x',69); +INSERT INTO t set c = concat(repeat('x',68),'r','x'); +INSERT INTO t set c = concat(repeat('x',68),'s','y'); +INSERT INTO t set c = concat(repeat('x',68),'g','w'); SELECT c from t ORDER BY c, id; c -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ** Results should be sorted ** -SET @@session.max_sort_length = 29; +SET @@session.max_sort_length = 69; SELECT @@session.max_sort_length; @@session.max_sort_length -29 -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); +69 +INSERT INTO t set c = repeat('x',69); +INSERT INTO t set c = concat(repeat('x',68),'r','x'); +INSERT INTO t set c = concat(repeat('x',68),'s','y'); +INSERT INTO t set c = concat(repeat('x',68),'g','w'); SELECT c from t ORDER BY c, id; c -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ** Results should be sorted ** '#--------------------FN_DYNVARS_098_02-------------------------#' connect test_con2,localhost,root,,; -connection test_con2; -SET @@global.max_sort_length = 30; +SET @@global.max_sort_length = 70; SELECT @@global.max_sort_length; @@global.max_sort_length -30 -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); +70 +INSERT INTO t set c = repeat('x',69); +INSERT INTO t set c = concat(repeat('x',68),'r','x'); +INSERT INTO t set c = concat(repeat('x',68),'s','y'); +INSERT INTO t set c = concat(repeat('x',68),'g','w'); SELECT c from t ORDER BY c, id; c -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ** Results should be sorted ** -SET @@session.max_sort_length = 20; +SET @@session.max_sort_length = 64; SELECT @@session.max_sort_length; @@session.max_sort_length -20 -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); +64 +INSERT INTO t set c = repeat('x',69); +INSERT INTO t set c = concat(repeat('x',68),'r','x'); +INSERT INTO t set c = concat(repeat('x',68),'s','y'); +INSERT INTO t set c = concat(repeat('x',68),'g','w'); SELECT c from t ORDER BY c, id; c -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw ** Results should not be sorted ** '#--------------------FN_DYNVARS_098_03-------------------------#' -SET max_sort_length=20; -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); +SET max_sort_length=64; +INSERT INTO t set c = repeat('x',69); +INSERT INTO t set c = concat(repeat('x',68),'r','x'); +INSERT INTO t set c = concat(repeat('x',68),'s','y'); +INSERT INTO t set c = concat(repeat('x',68),'g','w'); SELECT c from t ORDER BY c, id; c -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw ** Results should not be sorted ** RESET QUERY CACHE; '#--------------------FN_DYNVARS_098_04-------------------------#' -SET max_sort_length=29; +SET max_sort_length=69; SELECT c from t ORDER BY c, id; c -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ** Results should be sorted ** '#--------------------FN_DYNVARS_098_05-------------------------#' -SET max_sort_length=30; +SET max_sort_length=70; SELECT c from t ORDER BY c, id; c -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ** Results should be sorted ** '#--------------------FN_DYNVARS_098_06-------------------------#' SET max_sort_length=default; +SELECT @@max_sort_length; +@@max_sort_length +70 SELECT c from t ORDER BY c, id; c -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ** Results should be sorted ** '#--------------------FN_DYNVARS_098_07-------------------------#' Testing type BLOB -SET @@global.max_sort_length = 30; -SELECT @@global.max_sort_length; -@@global.max_sort_length -30 -INSERT INTO t1 set c = repeat('x',29); -INSERT INTO t1 set c = concat(repeat('x',28),'r','x'); -INSERT INTO t1 set c = concat(repeat('x',28),'s','y'); -INSERT INTO t1 set c = concat(repeat('x',28),'g','w'); -SELECT c from t1 ORDER BY c, id; +SET @@max_sort_length = 70; +SELECT @@max_sort_length; +@@max_sort_length +70 +INSERT INTO t1 set c = repeat('x',69); +INSERT INTO t1 set c = concat(repeat('x',68),'r','x'); +INSERT INTO t1 set c = concat(repeat('x',68),'s','y'); +INSERT INTO t1 set c = concat(repeat('x',68),'g','w'); +SELECT c from t1 ORDER BY c, id DESC; c -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx ** Results should be sorted ** -SET @@session.max_sort_length = 20; +SET @@session.max_sort_length = 64; SELECT @@session.max_sort_length; @@session.max_sort_length -20 -INSERT INTO t1 set c = repeat('x',29); -INSERT INTO t1 set c = concat(repeat('x',28),'r','x'); -INSERT INTO t1 set c = concat(repeat('x',28),'s','y'); -INSERT INTO t1 set c = concat(repeat('x',28),'g','w'); +64 +INSERT INTO t1 set c = repeat('x',69); +INSERT INTO t1 set c = concat(repeat('x',68),'r','x'); +INSERT INTO t1 set c = concat(repeat('x',68),'s','y'); +INSERT INTO t1 set c = concat(repeat('x',68),'g','w'); SELECT c from t1 ORDER BY c, id; c -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw ** Results should not be sorted ** '#--------------------FN_DYNVARS_098_08-------------------------#' Testing type CHAR -SET @@global.max_sort_length = 30; +SET @@global.max_sort_length = 70; SELECT @@global.max_sort_length; @@global.max_sort_length -30 -INSERT INTO t2 set c = repeat('x',29); -INSERT INTO t2 set c = concat(repeat('x',28),'r','x'); -INSERT INTO t2 set c = concat(repeat('x',28),'s','y'); -INSERT INTO t2 set c = concat(repeat('x',28),'g','w'); +70 +INSERT INTO t2 set c = repeat('x',69); +INSERT INTO t2 set c = concat(repeat('x',68),'r','x'); +INSERT INTO t2 set c = concat(repeat('x',68),'s','y'); +INSERT INTO t2 set c = concat(repeat('x',68),'g','w'); SELECT c from t2 ORDER BY c, id; c -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw ** Results should not be sorted ** -SET @@session.max_sort_length = 20; +SET @@session.max_sort_length = 64; SELECT @@session.max_sort_length; @@session.max_sort_length -20 -INSERT INTO t2 set c = repeat('x',29); -INSERT INTO t2 set c = concat(repeat('x',28),'r','x'); -INSERT INTO t2 set c = concat(repeat('x',28),'s','y'); -INSERT INTO t2 set c = concat(repeat('x',28),'g','w'); +64 +INSERT INTO t2 set c = repeat('x',69); +INSERT INTO t2 set c = concat(repeat('x',68),'r','x'); +INSERT INTO t2 set c = concat(repeat('x',68),'s','y'); +INSERT INTO t2 set c = concat(repeat('x',68),'g','w'); SELECT c from t2 ORDER BY c, id; c -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw -xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx -xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy -xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsy +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw ** Results should not be sorted ** connection default; disconnect test_con1; disconnect test_con2; -SET @@SESSION.max_sort_length = @session_max_sort_length; -DROP TABLE IF EXISTS t; -DROP TABLE IF EXISTS t1; -DROP TABLE IF EXISTS t2; +DROP TABLE t, t1, t2; SET @@global.max_sort_length= @start_value; diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff index 50a1d1f197a..bfbbfb43c74 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff @@ -250,7 +250,7 @@ VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_TYPE INT UNSIGNED - VARIABLE_COMMENT Up to what percentage of dirty pages should be flushed when innodb finds it has spare resources to do so. + VARIABLE_COMMENT DEPRECATED. This setting has no effect. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 100 @@ -1141,22 +1141,22 @@ diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 849937ce3a4..8c4eb4a28f8 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -1106,7 +1106,7 @@ SESSION_VALUE NULL DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED -VARIABLE_COMMENT Up to what percentage of dirty pages should be flushed when innodb finds it has spare resources to do so. +VARIABLE_COMMENT DEPRECATED. This setting has no effect. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 100 NUMERIC_BLOCK_SIZE 0 @@ -1773,18 +1773,6 @@ NUMERIC_BLOCK_SIZE 0 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL -VARIABLE_NAME INNODB_SIMULATE_COMP_FAILURES -SESSION_VALUE NULL -DEFAULT_VALUE 0 -VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE INT UNSIGNED -VARIABLE_COMMENT Simulate compression failures. -NUMERIC_MIN_VALUE 0 -NUMERIC_MAX_VALUE 99 -NUMERIC_BLOCK_SIZE 0 -ENUM_VALUE_LIST NULL -READ_ONLY NO -COMMAND_LINE_ARGUMENT NONE VARIABLE_NAME INNODB_SORT_BUFFER_SIZE SESSION_VALUE NULL DEFAULT_VALUE 1048576 @@ -2138,7 +2126,7 @@ SESSION_VALUE NULL DEFAULT_VALUE ON VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN -VARIABLE_COMMENT Enable atomic writes, instead of using the doublewrite buffer, for files on devices that supports atomic writes. To use this option one must use innodb_file_per_table=1, innodb_flush_method=O_DIRECT. This option only works on Linux with either FusionIO cards using the directFS filesystem or with Shannon cards using any file system. +VARIABLE_COMMENT Enable atomic writes, instead of using the doublewrite buffer, for files on devices that supports atomic writes. This option only works on Linux with either FusionIO cards using the directFS filesystem or with Shannon cards using any file system. NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index 37cb483e50d..7a8984a3736 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -9,7 +9,7 @@ where variable_name not like 'debug%' and variable_name not like 'wsrep%' and variable_name not like 's3%' and variable_name not in ( -'log_tc_size' +'log_tc_size','have_sanitizer' ) order by variable_name; VARIABLE_NAME ALTER_ALGORITHM @@ -1044,10 +1044,10 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME GROUP_CONCAT_MAX_LEN VARIABLE_SCOPE SESSION -VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_TYPE INT UNSIGNED VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT() NUMERIC_MIN_VALUE 4 -NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_MAX_VALUE 4294967295 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO @@ -1946,7 +1946,7 @@ VARIABLE_NAME MAX_SORT_LENGTH VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored) -NUMERIC_MIN_VALUE 8 +NUMERIC_MIN_VALUE 64 NUMERIC_MAX_VALUE 8388608 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index 083469406eb..79512aa9032 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -9,7 +9,7 @@ where variable_name not like 'debug%' and variable_name not like 'wsrep%' and variable_name not like 's3%' and variable_name not in ( -'log_tc_size' +'log_tc_size','have_sanitizer' ) order by variable_name; VARIABLE_NAME ALTER_ALGORITHM @@ -1064,10 +1064,10 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME GROUP_CONCAT_MAX_LEN VARIABLE_SCOPE SESSION -VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_TYPE INT UNSIGNED VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT() NUMERIC_MIN_VALUE 4 -NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_MAX_VALUE 4294967295 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO @@ -2106,7 +2106,7 @@ VARIABLE_NAME MAX_SORT_LENGTH VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored) -NUMERIC_MIN_VALUE 8 +NUMERIC_MIN_VALUE 64 NUMERIC_MAX_VALUE 8388608 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result index 5ec5b9ccf30..4bff3d4441e 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result +++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result @@ -363,7 +363,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST NULL -READ_ONLY NO +READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME WSREP_ON SESSION_VALUE OFF @@ -419,7 +419,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST NULL -READ_ONLY NO +READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME WSREP_PROVIDER_OPTIONS SESSION_VALUE NULL diff --git a/mysql-test/suite/sys_vars/r/wsrep_debug_basic.result b/mysql-test/suite/sys_vars/r/wsrep_debug_basic.result index 47d00f5dede..1c9c2ddf3a3 100644 --- a/mysql-test/suite/sys_vars/r/wsrep_debug_basic.result +++ b/mysql-test/suite/sys_vars/r/wsrep_debug_basic.result @@ -16,9 +16,11 @@ SELECT @@global.wsrep_debug; @@global.wsrep_debug NONE SET @@global.wsrep_debug=1; +Warnings: +Warning 1231 Setting 'wsrep_debug' has no effect because wsrep is switched off SELECT @@global.wsrep_debug; @@global.wsrep_debug -SERVER +NONE # valid values SET @@global.wsrep_debug=NONE; @@ -26,9 +28,11 @@ SELECT @@global.wsrep_debug; @@global.wsrep_debug NONE SET @@global.wsrep_debug=SERVER; +Warnings: +Warning 1231 Setting 'wsrep_debug' has no effect because wsrep is switched off SELECT @@global.wsrep_debug; @@global.wsrep_debug -SERVER +NONE SET @@global.wsrep_debug=default; SELECT @@global.wsrep_debug; @@global.wsrep_debug diff --git a/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result b/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result deleted file mode 100644 index 056ff8c817b..00000000000 --- a/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result +++ /dev/null @@ -1,47 +0,0 @@ -# -# wsrep_notify_cmd -# -call mtr.add_suppression("WSREP: Failed to get provider options"); -# save the initial value -SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd; -# default -SELECT @@global.wsrep_notify_cmd; -@@global.wsrep_notify_cmd - - -# scope -SELECT @@session.wsrep_notify_cmd; -ERROR HY000: Variable 'wsrep_notify_cmd' is a GLOBAL variable -SET @@global.wsrep_notify_cmd='notify_cmd'; -SELECT @@global.wsrep_notify_cmd; -@@global.wsrep_notify_cmd -notify_cmd - -# valid values -SET @@global.wsrep_notify_cmd='command'; -SELECT @@global.wsrep_notify_cmd; -@@global.wsrep_notify_cmd -command -SET @@global.wsrep_notify_cmd='hyphenated-command'; -SELECT @@global.wsrep_notify_cmd; -@@global.wsrep_notify_cmd -hyphenated-command -SET @@global.wsrep_notify_cmd=default; -SELECT @@global.wsrep_notify_cmd; -@@global.wsrep_notify_cmd - -SET @@global.wsrep_notify_cmd=NULL; -SELECT @@global.wsrep_notify_cmd; -@@global.wsrep_notify_cmd -NULL - -# invalid values -SET @@global.wsrep_notify_cmd=1; -ERROR 42000: Incorrect argument type to variable 'wsrep_notify_cmd' -SELECT @@global.wsrep_notify_cmd; -@@global.wsrep_notify_cmd -NULL - -# restore the initial value -SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved; -# End of test diff --git a/mysql-test/suite/sys_vars/r/wsrep_on_without_provider.result b/mysql-test/suite/sys_vars/r/wsrep_on_without_provider.result new file mode 100644 index 00000000000..525619dba29 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/wsrep_on_without_provider.result @@ -0,0 +1,5 @@ +SET GLOBAL wsrep_on=ON; +ERROR HY000: WSREP (galera) can't be enabled if the wsrep_provider is unset or set to 'none' +SELECT @@global.wsrep_on; +@@global.wsrep_on +0 diff --git a/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result b/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result deleted file mode 100644 index 3e4ac8ca883..00000000000 --- a/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result +++ /dev/null @@ -1,40 +0,0 @@ -# -# wsrep_provider -# -# save the initial value -SET @wsrep_provider_global_saved = @@global.wsrep_provider; -# default -SELECT @@global.wsrep_provider; -@@global.wsrep_provider -none - -# scope -SELECT @@session.wsrep_provider; -ERROR HY000: Variable 'wsrep_provider' is a GLOBAL variable -SELECT @@global.wsrep_provider; -@@global.wsrep_provider -none - -# valid values -SET @@global.wsrep_provider=default; -SELECT @@global.wsrep_provider; -@@global.wsrep_provider -none - -# invalid values -SET @@global.wsrep_provider='/invalid/libgalera_smm.so'; -ERROR 42000: Variable 'wsrep_provider' can't be set to the value of '/invalid/libgalera_smm.so' -SET @@global.wsrep_provider=NULL; -ERROR 42000: Variable 'wsrep_provider' can't be set to the value of 'NULL' -SELECT @@global.wsrep_provider; -@@global.wsrep_provider -none -SET @@global.wsrep_provider=1; -ERROR 42000: Incorrect argument type to variable 'wsrep_provider' -SELECT @@global.wsrep_provider; -@@global.wsrep_provider -none - -# restore the initial value -SET @@global.wsrep_provider = @wsrep_provider_global_saved; -# End of test diff --git a/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result b/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result deleted file mode 100644 index 15949a14e39..00000000000 --- a/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result +++ /dev/null @@ -1,46 +0,0 @@ -# -# wsrep_provider_options -# -call mtr.add_suppression("WSREP: Failed to get provider options"); -# default -SELECT @@global.wsrep_provider_options; -@@global.wsrep_provider_options - - -# scope -SELECT @@session.wsrep_provider_options; -ERROR HY000: Variable 'wsrep_provider_options' is a GLOBAL variable -SET @@global.wsrep_provider_options='option1'; -SELECT @@global.wsrep_provider_options; -@@global.wsrep_provider_options - - -# valid values -SET @@global.wsrep_provider_options='name1=value1;name2=value2'; -ERROR HY000: WSREP (galera) not started -SELECT @@global.wsrep_provider_options; -@@global.wsrep_provider_options - -SET @@global.wsrep_provider_options='hyphenated-name:value'; -ERROR HY000: WSREP (galera) not started -SELECT @@global.wsrep_provider_options; -@@global.wsrep_provider_options - -SET @@global.wsrep_provider_options=default; -ERROR HY000: WSREP (galera) not started -SELECT @@global.wsrep_provider_options; -@@global.wsrep_provider_options - - -# invalid values -SET @@global.wsrep_provider_options=1; -ERROR 42000: Incorrect argument type to variable 'wsrep_provider_options' -SELECT @@global.wsrep_provider_options; -@@global.wsrep_provider_options - -SET @@global.wsrep_provider_options=NULL; -Got one of the listed errors -SELECT @@global.wsrep_provider_options; -@@global.wsrep_provider_options - -# End of test diff --git a/mysql-test/suite/sys_vars/t/innodb_simulate_comp_failures_basic.test b/mysql-test/suite/sys_vars/t/innodb_simulate_comp_failures_basic.test deleted file mode 100644 index 07e70bf7343..00000000000 --- a/mysql-test/suite/sys_vars/t/innodb_simulate_comp_failures_basic.test +++ /dev/null @@ -1,65 +0,0 @@ ---source include/have_innodb.inc ---source include/have_debug.inc - -SET @start_global_value = @@global.innodb_simulate_comp_failures; -SELECT @start_global_value; - -# -# exists as global only -# - ---echo Valid values are between 0 and 99 -select @@global.innodb_simulate_comp_failures between 0 and 99; -select @@global.innodb_simulate_comp_failures; - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -select @@session.innodb_simulate_comp_failures; - -show global variables like 'innodb_simulate_comp_failures'; -show session variables like 'innodb_simulate_comp_failures'; -select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; -select * from information_schema.session_variables where variable_name='innodb_simulate_comp_failures'; - -# -# show that it's writable -# - -set global innodb_simulate_comp_failures=10; -select @@global.innodb_simulate_comp_failures; -select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; -select * from information_schema.session_variables where variable_name='innodb_simulate_comp_failures'; - ---error ER_GLOBAL_VARIABLE -set session innodb_simulate_comp_failures=1; - -# -# incorrect types -# - ---error ER_WRONG_TYPE_FOR_VAR -set global innodb_simulate_comp_failures=1.1; ---error ER_WRONG_TYPE_FOR_VAR -set global innodb_simulate_comp_failures=1e1; ---error ER_WRONG_TYPE_FOR_VAR -set global innodb_simulate_comp_failures="foo"; - -set global innodb_simulate_comp_failures=-7; -select @@global.innodb_simulate_comp_failures; -select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; -set global innodb_simulate_comp_failures=106; -select @@global.innodb_simulate_comp_failures; -select * from information_schema.global_variables where variable_name='innodb_simulate_comp_failures'; - -# -# min/max/DEFAULT values -# - -set global innodb_simulate_comp_failures=0; -select @@global.innodb_simulate_comp_failures; -set global innodb_simulate_comp_failures=99; -select @@global.innodb_simulate_comp_failures; -set global innodb_simulate_comp_failures=DEFAULT; -select @@global.innodb_simulate_comp_failures; - -SET @@global.innodb_simulate_comp_failures = @start_global_value; -SELECT @@global.innodb_simulate_comp_failures; diff --git a/mysql-test/suite/sys_vars/t/max_sort_length_basic.test b/mysql-test/suite/sys_vars/t/max_sort_length_basic.test deleted file mode 100644 index fcd6db017f1..00000000000 --- a/mysql-test/suite/sys_vars/t/max_sort_length_basic.test +++ /dev/null @@ -1,225 +0,0 @@ -############## mysql-test\t\max_sort_length_basic.test ############### -# # -# Variable Name: max_sort_length # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 1024 # -# Range: 4-8388608 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_sort_length # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -############################################ -# START OF max_sort_length TESTS # -############################################ - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.max_sort_length; -SELECT @start_global_value; -SET @start_session_value = @@session.max_sort_length; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_084_01-------------------------#' -####################################################### -# Display the DEFAULT value of max_sort_length # -####################################################### - -SET @@global.max_sort_length = 1000; -SET @@global.max_sort_length = DEFAULT; -SELECT @@global.max_sort_length; - - -SET @@session.max_sort_length = 1000; -SET @@session.max_sort_length = DEFAULT; -SELECT @@session.max_sort_length; - - ---echo '#--------------------FN_DYNVARS_084_02-------------------------#' -####################################################### -# Check the DEFAULT value of max_sort_length # -####################################################### - -SET @@global.max_sort_length = DEFAULT; -SELECT @@global.max_sort_length = 1024; - -SET @@session.max_sort_length = DEFAULT; -SELECT @@session.max_sort_length = 1024; - - - ---echo '#--------------------FN_DYNVARS_084_03-------------------------#' -######################################################################### -# Change the value of max_sort_length to a valid value for GLOBAL Scope # -######################################################################### - -SET @@global.max_sort_length = 8; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 9; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 8388608; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 8388607; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 65536; -SELECT @@global.max_sort_length; - ---echo '#--------------------FN_DYNVARS_084_04-------------------------#' -########################################################################## -# Change the value of max_sort_length to a valid value for SESSION Scope # -########################################################################## - -SET @@session.max_sort_length = 8; -SELECT @@session.max_sort_length; - -SET @@session.max_sort_length = 9; -SELECT @@session.max_sort_length; - -SET @@session.max_sort_length = 8388608; -SELECT @@session.max_sort_length; - -SET @@session.max_sort_length = 8388607; -SELECT @@session.max_sort_length; - -SET @@session.max_sort_length = 65536; -SELECT @@session.max_sort_length; - - ---echo '#------------------FN_DYNVARS_084_05-----------------------#' -########################################################### -# Change the value of max_sort_length to an invalid value # -########################################################### - -SET @@global.max_sort_length = -1024; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 3; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 8388609; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 0; -SELECT @@global.max_sort_length; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_sort_length = 65530.34; -SELECT @@global.max_sort_length; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_sort_length = test; -SELECT @@global.max_sort_length; - -SET @@session.max_sort_length = 8388610; -SELECT @@session.max_sort_length; -SET @@session.max_sort_length = -1; -SELECT @@session.max_sort_length; -SET @@session.max_sort_length = 3; -SELECT @@session.max_sort_length; -SET @@session.max_sort_length = 0; -SELECT @@session.max_sort_length; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.max_sort_length = 65530.34; -SET @@session.max_sort_length = 10737418241; -SELECT @@session.max_sort_length; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.max_sort_length = test; -SELECT @@session.max_sort_length; - - ---echo '#------------------FN_DYNVARS_084_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.max_sort_length = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_sort_length'; - ---echo '#------------------FN_DYNVARS_084_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.max_sort_length = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_sort_length'; - - ---echo '#------------------FN_DYNVARS_084_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.max_sort_length = TRUE; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = FALSE; -SELECT @@global.max_sort_length; - - ---echo '#---------------------FN_DYNVARS_084_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.max_sort_length = 2048; -SELECT @@max_sort_length = @@global.max_sort_length; - - ---echo '#---------------------FN_DYNVARS_084_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@max_sort_length = 100000; -SELECT @@max_sort_length = @@local.max_sort_length; -SELECT @@local.max_sort_length = @@session.max_sort_length; - - ---echo '#---------------------FN_DYNVARS_084_11----------------------#' -########################################################################## -# Check if max_sort_length can be accessed with and without @@ sign # -########################################################################## - - -SET max_sort_length = 1024; -SELECT @@max_sort_length; ---Error ER_UNKNOWN_TABLE -SELECT local.max_sort_length; ---Error ER_UNKNOWN_TABLE -SELECT session.max_sort_length; ---Error ER_BAD_FIELD_ERROR -SELECT max_sort_length = @@session.max_sort_length; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.max_sort_length = @start_global_value; -SELECT @@global.max_sort_length; -SET @@session.max_sort_length = @start_session_value; -SELECT @@session.max_sort_length; - - -#################################################### -# END OF max_sort_length TESTS # -#################################################### - diff --git a/mysql-test/suite/sys_vars/t/max_sort_length_func.test b/mysql-test/suite/sys_vars/t/max_sort_length_func.test index fd0b87750a1..d54453a57b6 100644 --- a/mysql-test/suite/sys_vars/t/max_sort_length_func.test +++ b/mysql-test/suite/sys_vars/t/max_sort_length_func.test @@ -26,70 +26,40 @@ SET @start_value= @@global.max_sort_length; -SET @session_max_sort_length = @@Session.max_sort_length; - - ---disable_warnings -DROP TABLE IF EXISTS t; ---enable_warnings - ######################### # Creating new table # ######################### - --echo ** creating tables ** -CREATE TABLE t -( -id INT AUTO_INCREMENT PRIMARY KEY, -c TEXT(30) -); - -CREATE TABLE t1 -( -id INT AUTO_INCREMENT PRIMARY KEY, -c BLOB(30) -); - -CREATE TABLE t2 -( -id INT AUTO_INCREMENT PRIMARY KEY, -c TEXT(30) -); - - +CREATE TABLE t (id INT AUTO_INCREMENT PRIMARY KEY, c TEXT); +CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY, c BLOB); +CREATE TABLE t2 (id INT AUTO_INCREMENT PRIMARY KEY, c TEXT); --echo '#--------------------FN_DYNVARS_098_01-------------------------#' ########################################################## # Test behavior of variable on new connection # 01 # ########################################################## - connect (test_con1,localhost,root,,); -connection test_con1; - -# Value of session & global vairable here should be 10 -SELECT @@global.max_sort_length = 10; -SELECT @@session.max_sort_length = 10; # Setting global value of variable and inserting data in table ---echo ** Setting value to 30 and inserting data ** -SET @@global.max_sort_length = 30; +--echo ** Setting value to 70 and inserting data ** +SET @@global.max_sort_length = 70; SELECT @@global.max_sort_length; -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); +INSERT INTO t set c = repeat('x',69); +INSERT INTO t set c = concat(repeat('x',68),'r','x'); +INSERT INTO t set c = concat(repeat('x',68),'s','y'); +INSERT INTO t set c = concat(repeat('x',68),'g','w'); SELECT c from t ORDER BY c, id; --echo ** Results should be sorted ** # Setting session value of variable and inserting data in table -SET @@session.max_sort_length = 29; +SET @@session.max_sort_length = 69; SELECT @@session.max_sort_length; -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); +INSERT INTO t set c = repeat('x',69); +INSERT INTO t set c = concat(repeat('x',68),'r','x'); +INSERT INTO t set c = concat(repeat('x',68),'s','y'); +INSERT INTO t set c = concat(repeat('x',68),'g','w'); SELECT c from t ORDER BY c, id; --echo ** Results should be sorted ** @@ -99,72 +69,69 @@ SELECT c from t ORDER BY c, id; ########################################################## connect (test_con2,localhost,root,,); -connection test_con2; - ## Setting global value of variable and inserting data in table -SET @@global.max_sort_length = 30; +SET @@global.max_sort_length = 70; SELECT @@global.max_sort_length; -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); +INSERT INTO t set c = repeat('x',69); +INSERT INTO t set c = concat(repeat('x',68),'r','x'); +INSERT INTO t set c = concat(repeat('x',68),'s','y'); +INSERT INTO t set c = concat(repeat('x',68),'g','w'); SELECT c from t ORDER BY c, id; --echo ** Results should be sorted ** # Setting session value of variable and inserting data in table -SET @@session.max_sort_length = 20; +SET @@session.max_sort_length = 64; SELECT @@session.max_sort_length; -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); +INSERT INTO t set c = repeat('x',69); +INSERT INTO t set c = concat(repeat('x',68),'r','x'); +INSERT INTO t set c = concat(repeat('x',68),'s','y'); +INSERT INTO t set c = concat(repeat('x',68),'g','w'); SELECT c from t ORDER BY c, id; --echo ** Results should not be sorted ** --echo '#--------------------FN_DYNVARS_098_03-------------------------#' ######################################################### -#Check if sorting is applied with the max_sort_length=20# +#Check if sorting is applied with the max_sort_length=64# ######################################################### ########################################### # Setting new value for max_sort_length # ########################################### -SET max_sort_length=20; +SET max_sort_length=64; ################################### # Inserting values in table t # ################################### -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); +INSERT INTO t set c = repeat('x',69); +INSERT INTO t set c = concat(repeat('x',68),'r','x'); +INSERT INTO t set c = concat(repeat('x',68),'s','y'); +INSERT INTO t set c = concat(repeat('x',68),'g','w'); SELECT c from t ORDER BY c, id; --echo ** Results should not be sorted ** RESET QUERY CACHE; - --echo '#--------------------FN_DYNVARS_098_04-------------------------#' ######################################################### -#Check if sorting is applied with the max_sort_length=29# +#Check if sorting is applied with the max_sort_length=69# ######################################################### -SET max_sort_length=29; +SET max_sort_length=69; SELECT c from t ORDER BY c, id; --echo ** Results should be sorted ** --echo '#--------------------FN_DYNVARS_098_05-------------------------#' ######################################################### -#Check if sorting is applied with the max_sort_length=30# +#Check if sorting is applied with the max_sort_length=70# ######################################################### -SET max_sort_length=30; +SET max_sort_length=70; SELECT c from t ORDER BY c, id; --echo ** Results should be sorted ** @@ -173,34 +140,33 @@ SELECT c from t ORDER BY c, id; #Check if sorting is applied with the max_sort_length=Default# ############################################################## - SET max_sort_length=default; +SELECT @@max_sort_length; SELECT c from t ORDER BY c, id; --echo ** Results should be sorted ** - --echo '#--------------------FN_DYNVARS_098_07-------------------------#' ########################################### #Check if sorting is applied on BLOB type # ########################################### --echo Testing type BLOB # Setting global value of variable and inserting data in table -SET @@global.max_sort_length = 30; -SELECT @@global.max_sort_length; -INSERT INTO t1 set c = repeat('x',29); -INSERT INTO t1 set c = concat(repeat('x',28),'r','x'); -INSERT INTO t1 set c = concat(repeat('x',28),'s','y'); -INSERT INTO t1 set c = concat(repeat('x',28),'g','w'); -SELECT c from t1 ORDER BY c, id; +SET @@max_sort_length = 70; +SELECT @@max_sort_length; +INSERT INTO t1 set c = repeat('x',69); +INSERT INTO t1 set c = concat(repeat('x',68),'r','x'); +INSERT INTO t1 set c = concat(repeat('x',68),'s','y'); +INSERT INTO t1 set c = concat(repeat('x',68),'g','w'); +SELECT c from t1 ORDER BY c, id DESC; --echo ** Results should be sorted ** # Setting session value of variable and inserting data in table -SET @@session.max_sort_length = 20; +SET @@session.max_sort_length = 64; SELECT @@session.max_sort_length; -INSERT INTO t1 set c = repeat('x',29); -INSERT INTO t1 set c = concat(repeat('x',28),'r','x'); -INSERT INTO t1 set c = concat(repeat('x',28),'s','y'); -INSERT INTO t1 set c = concat(repeat('x',28),'g','w'); +INSERT INTO t1 set c = repeat('x',69); +INSERT INTO t1 set c = concat(repeat('x',68),'r','x'); +INSERT INTO t1 set c = concat(repeat('x',68),'s','y'); +INSERT INTO t1 set c = concat(repeat('x',68),'g','w'); SELECT c from t1 ORDER BY c, id; --echo ** Results should not be sorted ** @@ -210,26 +176,25 @@ SELECT c from t1 ORDER BY c, id; ########################################### --echo Testing type CHAR # Setting global value of variable and inserting data in table -SET @@global.max_sort_length = 30; +SET @@global.max_sort_length = 70; SELECT @@global.max_sort_length; -INSERT INTO t2 set c = repeat('x',29); -INSERT INTO t2 set c = concat(repeat('x',28),'r','x'); -INSERT INTO t2 set c = concat(repeat('x',28),'s','y'); -INSERT INTO t2 set c = concat(repeat('x',28),'g','w'); +INSERT INTO t2 set c = repeat('x',69); +INSERT INTO t2 set c = concat(repeat('x',68),'r','x'); +INSERT INTO t2 set c = concat(repeat('x',68),'s','y'); +INSERT INTO t2 set c = concat(repeat('x',68),'g','w'); SELECT c from t2 ORDER BY c, id; --echo ** Results should not be sorted ** # Setting session value of variable and inserting data in table -SET @@session.max_sort_length = 20; +SET @@session.max_sort_length = 64; SELECT @@session.max_sort_length; -INSERT INTO t2 set c = repeat('x',29); -INSERT INTO t2 set c = concat(repeat('x',28),'r','x'); -INSERT INTO t2 set c = concat(repeat('x',28),'s','y'); -INSERT INTO t2 set c = concat(repeat('x',28),'g','w'); +INSERT INTO t2 set c = repeat('x',69); +INSERT INTO t2 set c = concat(repeat('x',68),'r','x'); +INSERT INTO t2 set c = concat(repeat('x',68),'s','y'); +INSERT INTO t2 set c = concat(repeat('x',68),'g','w'); SELECT c from t2 ORDER BY c, id; --echo ** Results should not be sorted ** - # # Cleanup # @@ -239,12 +204,6 @@ connection default; disconnect test_con1; disconnect test_con2; -SET @@SESSION.max_sort_length = @session_max_sort_length; - ---disable_warnings -DROP TABLE IF EXISTS t; -DROP TABLE IF EXISTS t1; -DROP TABLE IF EXISTS t2; ---enable_warnings +DROP TABLE t, t1, t2; SET @@global.max_sort_length= @start_value; diff --git a/mysql-test/suite/sys_vars/t/thread_stack_basic.test b/mysql-test/suite/sys_vars/t/thread_stack_basic.test index 41015033fe9..39f120e0de1 100644 --- a/mysql-test/suite/sys_vars/t/thread_stack_basic.test +++ b/mysql-test/suite/sys_vars/t/thread_stack_basic.test @@ -1,6 +1,8 @@ # # only global # +--source include/not_asan.inc +--source include/not_ubsan.inc --replace_result 392192 299008 select @@global.thread_stack; --error ER_INCORRECT_GLOBAL_LOCAL_VAR diff --git a/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test b/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test deleted file mode 100644 index 6d1535ba148..00000000000 --- a/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test +++ /dev/null @@ -1,43 +0,0 @@ ---source include/have_wsrep.inc - ---echo # ---echo # wsrep_notify_cmd ---echo # - -call mtr.add_suppression("WSREP: Failed to get provider options"); - ---echo # save the initial value -SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd; - ---echo # default -SELECT @@global.wsrep_notify_cmd; - ---echo ---echo # scope ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.wsrep_notify_cmd; -SET @@global.wsrep_notify_cmd='notify_cmd'; -SELECT @@global.wsrep_notify_cmd; - ---echo ---echo # valid values -SET @@global.wsrep_notify_cmd='command'; -SELECT @@global.wsrep_notify_cmd; -SET @@global.wsrep_notify_cmd='hyphenated-command'; -SELECT @@global.wsrep_notify_cmd; -SET @@global.wsrep_notify_cmd=default; -SELECT @@global.wsrep_notify_cmd; -SET @@global.wsrep_notify_cmd=NULL; -SELECT @@global.wsrep_notify_cmd; - ---echo ---echo # invalid values ---error ER_WRONG_TYPE_FOR_VAR -SET @@global.wsrep_notify_cmd=1; -SELECT @@global.wsrep_notify_cmd; - ---echo ---echo # restore the initial value -SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved; - ---echo # End of test diff --git a/mysql-test/suite/sys_vars/t/wsrep_on_without_provider.test b/mysql-test/suite/sys_vars/t/wsrep_on_without_provider.test new file mode 100644 index 00000000000..5bee3c9a356 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/wsrep_on_without_provider.test @@ -0,0 +1,9 @@ +--source include/not_embedded.inc + +# +# @@global.wsrep_on is not allowed if there +# is no wsrep_provider +# +--error ER_WRONG_ARGUMENTS +SET GLOBAL wsrep_on=ON; +SELECT @@global.wsrep_on;
\ No newline at end of file diff --git a/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test b/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test deleted file mode 100644 index 1190ab41bb0..00000000000 --- a/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test +++ /dev/null @@ -1,39 +0,0 @@ ---source include/have_wsrep.inc - ---echo # ---echo # wsrep_provider ---echo # - ---echo # save the initial value -SET @wsrep_provider_global_saved = @@global.wsrep_provider; - ---echo # default -SELECT @@global.wsrep_provider; - ---echo ---echo # scope ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.wsrep_provider; -SELECT @@global.wsrep_provider; - ---echo ---echo # valid values -SET @@global.wsrep_provider=default; -SELECT @@global.wsrep_provider; - ---echo ---echo # invalid values ---error ER_WRONG_VALUE_FOR_VAR -SET @@global.wsrep_provider='/invalid/libgalera_smm.so'; ---error ER_WRONG_VALUE_FOR_VAR -SET @@global.wsrep_provider=NULL; -SELECT @@global.wsrep_provider; ---error ER_WRONG_TYPE_FOR_VAR -SET @@global.wsrep_provider=1; -SELECT @@global.wsrep_provider; - ---echo ---echo # restore the initial value -SET @@global.wsrep_provider = @wsrep_provider_global_saved; - ---echo # End of test diff --git a/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test b/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test deleted file mode 100644 index 6eb3a94b6a4..00000000000 --- a/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test +++ /dev/null @@ -1,41 +0,0 @@ ---source include/have_wsrep.inc - ---echo # ---echo # wsrep_provider_options ---echo # - -call mtr.add_suppression("WSREP: Failed to get provider options"); - ---echo # default -SELECT @@global.wsrep_provider_options; - ---echo ---echo # scope ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.wsrep_provider_options; ---error 0,ER_WRONG_ARGUMENTS -SET @@global.wsrep_provider_options='option1'; -SELECT @@global.wsrep_provider_options; - ---echo ---echo # valid values ---error ER_WRONG_ARGUMENTS -SET @@global.wsrep_provider_options='name1=value1;name2=value2'; -SELECT @@global.wsrep_provider_options; ---error ER_WRONG_ARGUMENTS -SET @@global.wsrep_provider_options='hyphenated-name:value'; -SELECT @@global.wsrep_provider_options; ---error ER_WRONG_ARGUMENTS -SET @@global.wsrep_provider_options=default; -SELECT @@global.wsrep_provider_options; - ---echo ---echo # invalid values ---error ER_WRONG_TYPE_FOR_VAR -SET @@global.wsrep_provider_options=1; -SELECT @@global.wsrep_provider_options; ---error ER_WRONG_ARGUMENTS,ER_WRONG_ARGUMENTS -SET @@global.wsrep_provider_options=NULL; -SELECT @@global.wsrep_provider_options; - ---echo # End of test diff --git a/mysql-test/suite/unit/suite.pm b/mysql-test/suite/unit/suite.pm index b7a1f9ae871..53f8923777a 100644 --- a/mysql-test/suite/unit/suite.pm +++ b/mysql-test/suite/unit/suite.pm @@ -20,7 +20,6 @@ sub start_test { ($path, $args) = ($cmd, , [ ]) } - my $oldpwd=getcwd(); chdir $::opt_vardir; my $proc=My::SafeProcess->new @@ -49,12 +48,12 @@ sub start_test { my ($command, %tests, $prefix); for (@ctest_list) { chomp; - if (/^\d+: Test command: +/) { - $command= $'; + if (/^\d+: Test command: +([^ \t]+.*)/) { + $command= $1; $prefix= /libmariadb/ ? 'conc_' : ''; - } elsif (/^ +Test +#\d+: +/) { - if ($command ne "NOT_AVAILABLE") { - $tests{$prefix.$'}=$command; + } elsif (/^ +Test +#\d+: ([^ \t]+.*)/) { + if ($command ne "NOT_AVAILABLE" && $command ne "/bin/sh") { + $tests{$prefix.$1}=$command; } } } diff --git a/mysql-test/suite/vcol/r/vcol_syntax.result b/mysql-test/suite/vcol/r/vcol_syntax.result index 16e30e57230..c8983f34c93 100644 --- a/mysql-test/suite/vcol/r/vcol_syntax.result +++ b/mysql-test/suite/vcol/r/vcol_syntax.result @@ -50,3 +50,41 @@ t1 CREATE TABLE "t1" ( ) drop table t1; set session sql_mode=@OLD_SQL_MODE; +# +# MDEV-25091 CREATE TABLE: field references qualified by a wrong table name succeed +# +create table t2 (x int); +create table t1 (x int, y int generated always as (t2.x)); +ERROR 42S22: Unknown column '`t2`.`x`' in 'GENERATED ALWAYS' +create table t1 (x int, y int check (y > t2.x)); +ERROR 42S22: Unknown column '`t2`.`x`' in 'CHECK' +create table t1 (x int, y int default t2.x); +ERROR 42S22: Unknown column '`t2`.`x`' in 'DEFAULT' +create table t1 (x int, check (t2.x > 0)); +ERROR 42S22: Unknown column '`t2`.`x`' in 'CHECK' +create table t1 (x int); +alter table t1 add column y int generated always as (t2.x); +ERROR 42S22: Unknown column '`t2`.`x`' in 'GENERATED ALWAYS' +alter table t1 add column y int check (z > t2.x); +ERROR 42S22: Unknown column '`t2`.`x`' in 'CHECK' +alter table t1 add column y int default t2.x; +ERROR 42S22: Unknown column '`t2`.`x`' in 'DEFAULT' +alter table t1 add constraint check (t2.x > 0); +ERROR 42S22: Unknown column '`t2`.`x`' in 'CHECK' +create or replace table t1 (x int, y int generated always as (t1.x)); +create or replace table t1 (x int, y int check (y > t1.x)); +create or replace table t1 (x int, y int default t1.x); +create or replace table t1 (x int, check (t1.x > 0)); +create or replace table t1 (x int, y int generated always as (test.t1.x)); +create or replace table t1 (x int, y int check (y > test.t1.x)); +create or replace table t1 (x int, y int default test.t1.x); +create or replace table t1 (x int, check (test.t1.x > 0)); +drop tables t1, t2; +create table t1 (x int, y int generated always as (test2.t1.x)); +ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'GENERATED ALWAYS' +create table t1 (x int, y int check (y > test2.t1.x)); +ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'CHECK' +create table t1 (x int, y int default test2.t1.x); +ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'DEFAULT' +create table t1 (x int, check (test2.t1.x > 0)); +ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'CHECK' diff --git a/mysql-test/suite/vcol/t/vcol_syntax.test b/mysql-test/suite/vcol/t/vcol_syntax.test index 6dc3cf43317..f425b52ab79 100644 --- a/mysql-test/suite/vcol/t/vcol_syntax.test +++ b/mysql-test/suite/vcol/t/vcol_syntax.test @@ -28,3 +28,47 @@ show create table t1; drop table t1; set session sql_mode=@OLD_SQL_MODE; +--echo # +--echo # MDEV-25091 CREATE TABLE: field references qualified by a wrong table name succeed +--echo # +create table t2 (x int); + +--error ER_BAD_FIELD_ERROR +create table t1 (x int, y int generated always as (t2.x)); +--error ER_BAD_FIELD_ERROR +create table t1 (x int, y int check (y > t2.x)); +--error ER_BAD_FIELD_ERROR +create table t1 (x int, y int default t2.x); +--error ER_BAD_FIELD_ERROR +create table t1 (x int, check (t2.x > 0)); + +create table t1 (x int); +--error ER_BAD_FIELD_ERROR +alter table t1 add column y int generated always as (t2.x); +--error ER_BAD_FIELD_ERROR +alter table t1 add column y int check (z > t2.x); +--error ER_BAD_FIELD_ERROR +alter table t1 add column y int default t2.x; +--error ER_BAD_FIELD_ERROR +alter table t1 add constraint check (t2.x > 0); + +create or replace table t1 (x int, y int generated always as (t1.x)); +create or replace table t1 (x int, y int check (y > t1.x)); +create or replace table t1 (x int, y int default t1.x); +create or replace table t1 (x int, check (t1.x > 0)); + +create or replace table t1 (x int, y int generated always as (test.t1.x)); +create or replace table t1 (x int, y int check (y > test.t1.x)); +create or replace table t1 (x int, y int default test.t1.x); +create or replace table t1 (x int, check (test.t1.x > 0)); + +drop tables t1, t2; + +--error ER_BAD_FIELD_ERROR +create table t1 (x int, y int generated always as (test2.t1.x)); +--error ER_BAD_FIELD_ERROR +create table t1 (x int, y int check (y > test2.t1.x)); +--error ER_BAD_FIELD_ERROR +create table t1 (x int, y int default test2.t1.x); +--error ER_BAD_FIELD_ERROR +create table t1 (x int, check (test2.t1.x > 0)); diff --git a/mysql-test/suite/versioning/common.inc b/mysql-test/suite/versioning/common.inc index efb081a02e4..25adf15dd50 100644 --- a/mysql-test/suite/versioning/common.inc +++ b/mysql-test/suite/versioning/common.inc @@ -70,6 +70,11 @@ returns int deterministic return sys_trx_end = $sys_datatype_max; +eval create or replace function current_row_ts(sys_trx_end timestamp(6)) +returns int +deterministic + return convert_tz(sys_trx_end, '+00:00', @@time_zone) = TIMESTAMP'2038-01-19 03:14:07.999999'; + delimiter ~~; eval create or replace function check_row(row_start $sys_datatype_expl, row_end $sys_datatype_expl) returns varchar(255) @@ -86,4 +91,20 @@ begin end~~ delimiter ;~~ +delimiter ~~; +eval create or replace function check_row_ts(row_start timestamp(6), row_end timestamp(6)) +returns varchar(255) +deterministic +begin + if row_end < row_start then + return "ERROR: row_end < row_start"; + elseif row_end = row_start then + return "ERROR: row_end == row_start"; + elseif current_row_ts(row_end) then + return "CURRENT ROW"; + end if; + return "HISTORICAL ROW"; +end~~ +delimiter ;~~ + --enable_query_log diff --git a/mysql-test/suite/versioning/common_finish.inc b/mysql-test/suite/versioning/common_finish.inc index 61641c6c5ce..3c4e7b66ff3 100644 --- a/mysql-test/suite/versioning/common_finish.inc +++ b/mysql-test/suite/versioning/common_finish.inc @@ -4,5 +4,7 @@ drop procedure if exists verify_trt; drop procedure if exists verify_trt_dummy; drop function if exists current_row; drop function if exists check_row; +drop function if exists current_row_ts; +drop function if exists check_row_ts; --enable_warnings --enable_query_log diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result index 33c1d499088..b2dbbba7027 100644 --- a/mysql-test/suite/versioning/r/alter.result +++ b/mysql-test/suite/versioning/r/alter.result @@ -80,7 +80,7 @@ t CREATE TABLE `t` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t add column trx_start timestamp(6) as row start; -ERROR HY000: Duplicate ROW START column `trx_start` +ERROR HY000: Table `t` is not system-versioned alter table t add system versioning; show create table t; Table Create Table @@ -696,3 +696,69 @@ delete from t1; set statement system_versioning_alter_history=keep for alter table t1 drop system versioning, modify column a tinyint; drop table t1; +# +# MDEV-24690 Dropping primary key column from versioned table always fails with 1072 +# +create table t1 (a int, b int primary key) with system versioning; +alter table t1 drop column b; +create or replace table t1 ( +a int, b int primary key, +row_start timestamp(6) as row start, +row_end timestamp(6) as row end, +period for system_time(row_start, row_end) +) with system versioning; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) NOT NULL, + `row_start` timestamp(6) GENERATED ALWAYS AS ROW START, + `row_end` timestamp(6) GENERATED ALWAYS AS ROW END, + PRIMARY KEY (`b`,`row_end`), + PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING +alter table t1 drop column b; +ERROR 42000: Key column 'b' doesn't exist in table +create or replace table t1 ( +a int, b int primary key, +row_start timestamp(6) as row start invisible, +row_end timestamp(6) as row end invisible, +period for system_time(row_start, row_end) +) with system versioning; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) NOT NULL, + `row_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE, + `row_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE, + PRIMARY KEY (`b`,`row_end`), + PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING +alter table t1 drop column b; +ERROR 42000: Key column 'b' doesn't exist in table +drop table t1; +# +# MDEV-25172 Wrong error message for ADD COLUMN .. AS ROW START +# +create or replace table t1 (x int); +alter table t1 add column y timestamp(6) as row start; +ERROR HY000: Table `t1` is not system-versioned +drop table t1; +# +# MDEV-25327 Unexpected ER_DUP_ENTRY upon dropping PK column from system-versioned table +# +create table t1 (pk int, a int, primary key (pk), key (a)) +with system versioning; +insert into t1 values (1, 1), (2, 2); +delete from t1; +set system_versioning_alter_history= keep; +alter table t1 drop pk; +drop table t1; +create table t1 (pk int, a int, primary key (pk), key (a)) +with system versioning; +insert into t1 values (1, 2), (2, 8), (3, 4), (4, 4), (5, 0); +delete from t1; +set system_versioning_alter_history= keep; +alter ignore table t1 drop pk; +drop table t1; diff --git a/mysql-test/suite/versioning/r/auto_increment.result b/mysql-test/suite/versioning/r/autoinc.result index 8ff1bed8fe3..e785c5d300e 100644 --- a/mysql-test/suite/versioning/r/auto_increment.result +++ b/mysql-test/suite/versioning/r/autoinc.result @@ -63,3 +63,13 @@ A x y x y 1 7 17 7 17 drop table t1; drop table t2; +# +# MDEV-22562 Assertion `next_insert_id == 0' upon UPDATE on system-versioned table +# +create table t1 (pk integer auto_increment primary key) engine=myisam with system versioning; +insert delayed into t1 (pk) values (1); +lock tables t1 write; +update t1 set pk= 0; +update t1 set pk= 0; +unlock tables; +drop table t1; diff --git a/mysql-test/suite/versioning/r/delete.result b/mysql-test/suite/versioning/r/delete.result index 5aa239b9cb8..0f9e2c22130 100644 --- a/mysql-test/suite/versioning/r/delete.result +++ b/mysql-test/suite/versioning/r/delete.result @@ -130,3 +130,22 @@ ERROR 42S02: Table 'test.xx' doesn't exist drop procedure pr; drop trigger tr; drop table t1; +# +# MDEV-21138 Assertion `col->ord_part' or `f.col->ord_part' failed in row_build_index_entry_low +# +create table t1 ( +f1 int, f2 text, f3 int, fulltext (f2), key(f1), key(f3), +foreign key r (f3) references t1 (f1) on delete set null) +with system versioning engine innodb; +insert into t1 values (1, repeat('a', 8193), 1), (1, repeat('b', 8193), 1); +select f1, f3, check_row_ts(row_start, row_end) from t1; +f1 f3 check_row_ts(row_start, row_end) +1 1 CURRENT ROW +1 1 CURRENT ROW +delete from t1; +select f1, f3, check_row_ts(row_start, row_end) from t1 for system_time all; +f1 f3 check_row_ts(row_start, row_end) +1 1 HISTORICAL ROW +1 NULL ERROR: row_end == row_start +1 1 HISTORICAL ROW +drop table t1; diff --git a/mysql-test/suite/versioning/r/foreign.result b/mysql-test/suite/versioning/r/foreign.result index 1b9925b1e62..288909bbc37 100644 --- a/mysql-test/suite/versioning/r/foreign.result +++ b/mysql-test/suite/versioning/r/foreign.result @@ -400,6 +400,8 @@ Warning 1265 Data truncated for column 'f12' at row 7 SET timestamp = 9; REPLACE INTO t2 SELECT * FROM t2; DROP TABLE t1, t2; +set timestamp= default; +set time_zone='+00:00'; # # MDEV-16210 FK constraints on versioned tables use historical rows, which may cause constraint violation # @@ -429,3 +431,17 @@ insert into t2 values (1), (1); # DELETE from foreign table is allowed delete from t2; drop tables t2, t1; +# +# MDEV-23644 Assertion on evaluating foreign referential action for self-reference in system versioned table +# +create table t1 (pk int primary key, f1 int,f2 int, f3 text, +key(f1), fulltext(f3), key(f3(10)), +foreign key (f2) references t1 (f1) on delete set null +) engine=innodb with system versioning; +insert into t1 values (1, 8, 8, 'SHORT'), (2, 8, 8, repeat('LONG', 8071)); +delete from t1; +select pk, f1, f2, left(f3, 4), check_row_ts(row_start, row_end) from t1 for system_time all order by pk; +pk f1 f2 left(f3, 4) check_row_ts(row_start, row_end) +1 8 8 SHOR HISTORICAL ROW +2 8 8 LONG HISTORICAL ROW +drop table t1; diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result index 9e25dc6910b..9eeec045ef7 100644 --- a/mysql-test/suite/versioning/r/partition.result +++ b/mysql-test/suite/versioning/r/partition.result @@ -538,6 +538,7 @@ set timestamp=1523466002.799571; insert into t1 values (11),(12); set timestamp=1523466004.169435; delete from t1 where pk in (11, 12); +set timestamp= default; # # MDEV-18136 Server crashes in Item_func_dyncol_create::prepare_arguments # @@ -690,6 +691,48 @@ create table t1 (a int) with system versioning partition by system_time (partition p1 history, partition pn current); alter table t1 add partition (partition p2); ERROR HY000: Wrong partitioning type, expected type: `SYSTEM_TIME` +# MDEV-17891 Assertion failures in select_insert::abort_result_set and +# mysql_load upon attempt to replace into a full table +set @@max_heap_table_size= 1024*1024; +create or replace table t1 ( +pk integer auto_increment, +primary key (pk), +f varchar(45000) +) with system versioning engine=memory +partition by system_time interval 1 year (partition p1 history, +partition pn current); +# fill the table until full +insert into t1 () values (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(); +insert into t1 (f) select f from t1; +ERROR HY000: The table 't1' is full +# leave space for exactly one record in current partition +delete from t1 where pk = 1; +# copy all data into history partition +replace into t1 select * from t1; +replace into t1 select * from t1; +ERROR HY000: The table 't1' is full +create or replace table t1 ( +pk integer auto_increment, +primary key (pk), +f varchar(45000) +) with system versioning engine=memory +partition by system_time interval 1 year (partition p1 history, +partition pn current); +insert into t1 () values (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(); +select * into outfile 'load.data' from t1; +load data infile 'load.data' replace into table t1; +load data infile 'load.data' replace into table t1; +ERROR HY000: The table 't1' is full +load data infile 'load.data' replace into table t1; +ERROR HY000: The table 't1' is full +set @@max_heap_table_size= 1048576; +drop table t1; +# +# MDEV-22178 Assertion `info->alias.str' failed in partition_info::check_partition_info instead of ER_VERS_WRONG_PARTS +# +create or replace table t1 (a int) with system versioning; +alter table t1 partition by system_time (partition pn current); +ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT drop table t1; # End of 10.3 tests # diff --git a/mysql-test/suite/versioning/r/replace.result b/mysql-test/suite/versioning/r/replace.result index bda61f118b0..57a992cce49 100644 --- a/mysql-test/suite/versioning/r/replace.result +++ b/mysql-test/suite/versioning/r/replace.result @@ -48,3 +48,16 @@ INSERT INTO t1 () VALUES (),(),(),(),(),(); UPDATE IGNORE t1 SET f = 1; REPLACE t1 SELECT * FROM t1; DROP TABLE t1; +# MDEV-22540 ER_DUP_ENTRY upon REPLACE or Assertion failed +set timestamp=1589245268.41934; +create table t1 (a int primary key) with system versioning; +insert into t1 values (1),(2); +connect con1,localhost,root,,test; +set timestamp=1589245268.52093; +replace into t1 values (1),(2); +connection default; +replace into t1 values (1),(2); +connection con1; +replace into t1 values (1),(2); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +drop table t1; diff --git a/mysql-test/suite/versioning/r/trx_id.result b/mysql-test/suite/versioning/r/trx_id.result index 8475fc88258..03ef20a6a9e 100644 --- a/mysql-test/suite/versioning/r/trx_id.result +++ b/mysql-test/suite/versioning/r/trx_id.result @@ -5,7 +5,15 @@ sys_trx_start bigint(20) unsigned as row start invisible, sys_trx_end bigint(20) unsigned as row end invisible, period for system_time (sys_trx_start, sys_trx_end) ) with system versioning; +# No history inside the transaction +start transaction; insert into t1 (x) values (1); +update t1 set x= x + 1; +update t1 set x= x + 1; +commit; +select *, sys_trx_start > 1, sys_trx_end from t1 for system_time all; +x sys_trx_start > 1 sys_trx_end +3 1 18446744073709551615 # ALTER ADD SYSTEM VERSIONING should write to mysql.transaction_registry set @@system_versioning_alter_history=keep; create or replace table t1 (x int); diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result index cd26c341113..da893432749 100644 --- a/mysql-test/suite/versioning/r/update.result +++ b/mysql-test/suite/versioning/r/update.result @@ -241,6 +241,26 @@ B2 salary 1 2500 drop table t1; drop table t2; +# Ensure FTS retains correct history +create table t1 ( +x int, y text, fulltext (y), +row_start SYS_DATATYPE as row start invisible, +row_end SYS_DATATYPE as row end invisible, +period for system_time (row_start, row_end)) +with system versioning engine innodb; +insert into t1 values (1, repeat('LONG', 2048)); +update t1 set x= x + 1; +select x, left(y, 4), length(y), check_row(row_start, row_end) from t1 for system_time all order by x, y; +x left(y, 4) length(y) check_row(row_start, row_end) +1 LONG 8192 HISTORICAL ROW +2 LONG 8192 CURRENT ROW +update t1 set y= 'SHORT'; +select x, left(y, 4), length(y), check_row(row_start, row_end) from t1 for system_time all order by x, y; +x left(y, 4) length(y) check_row(row_start, row_end) +1 LONG 8192 HISTORICAL ROW +2 LONG 8192 HISTORICAL ROW +2 SHOR 5 CURRENT ROW +drop tables t1; ### Issue tempesta-tech/mariadb#365, bug 7 (duplicate of historical row) create or replace table t1 (a int primary key, b int) with system versioning engine myisam; @@ -350,3 +370,48 @@ insert into t1 (a) values (1), (2); update ignore t1 set a= 3; delete history from t1; drop table t1; +# +# MDEV-23446 UPDATE does not insert history row if the row is not changed +# +create table t1 ( +a int, +row_start SYS_DATATYPE as row start invisible, +row_end SYS_DATATYPE as row end invisible, +period for system_time (row_start, row_end)) with system versioning; +insert into t1 values (1); +update t1 set a= 1; +select *, check_row(row_start, row_end) from t1 for system_time all order by row_end; +a check_row(row_start, row_end) +1 HISTORICAL ROW +1 CURRENT ROW +# multi-update +create or replace table t2 like t1; +create or replace table t3 like t1; +insert into t2 values (1); +insert into t3 values (1); +update t2, t3 set t2.a= 1, t3.a= 1 where t2.a = t3.a; +select *, check_row(row_start, row_end) from t2 for system_time all order by row_end; +a check_row(row_start, row_end) +1 HISTORICAL ROW +1 CURRENT ROW +select *, check_row(row_start, row_end) from t2 for system_time all order by row_end; +a check_row(row_start, row_end) +1 HISTORICAL ROW +1 CURRENT ROW +drop tables t1, t2, t3; +# +# MDEV-24522 Assertion `inited==NONE' fails upon UPDATE on versioned table with unique blob + +create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning; +insert into t1 values (1, 1, 'foo'), (2, 11, 'bar'); +update t1 set a = 3 where b <= 9; +update t1 set a = 3 where b <= 10; +drop table t1; +create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning; +create table t2 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning; +insert into t1 values (1, 1, 'foo'), (2, 11, 'bar'); +insert into t2 values (1, 1, 'foo'), (2, 11, 'bar'); +update t1 set a = 3 where b <= 9; +update t2 set a = 3 where b <= 9; +update t1, t2 set t1.a = 3, t2.a = 3 where t1.b <= 10 and t2.b <= 10 and t1.b = t2.b; +drop tables t1, t2; diff --git a/mysql-test/suite/versioning/t/alter.test b/mysql-test/suite/versioning/t/alter.test index 83c3e911fad..16f391b1454 100644 --- a/mysql-test/suite/versioning/t/alter.test +++ b/mysql-test/suite/versioning/t/alter.test @@ -68,7 +68,7 @@ select row_start from t; alter table t drop system versioning; show create table t; ---error ER_VERS_DUPLICATE_ROW_START_END +--error ER_VERS_NOT_VERSIONED alter table t add column trx_start timestamp(6) as row start; alter table t add system versioning; @@ -593,3 +593,63 @@ alter table t1 drop system versioning, modify column a tinyint; # cleanup drop table t1; + +--echo # +--echo # MDEV-24690 Dropping primary key column from versioned table always fails with 1072 +--echo # +create table t1 (a int, b int primary key) with system versioning; +alter table t1 drop column b; + +create or replace table t1 ( + a int, b int primary key, + row_start timestamp(6) as row start, + row_end timestamp(6) as row end, + period for system_time(row_start, row_end) +) with system versioning; +show create table t1; +--error ER_KEY_COLUMN_DOES_NOT_EXITS +alter table t1 drop column b; + +create or replace table t1 ( +a int, b int primary key, + row_start timestamp(6) as row start invisible, + row_end timestamp(6) as row end invisible, + period for system_time(row_start, row_end) +) with system versioning; +show create table t1; +--error ER_KEY_COLUMN_DOES_NOT_EXITS +alter table t1 drop column b; + +# cleanup +drop table t1; + +--echo # +--echo # MDEV-25172 Wrong error message for ADD COLUMN .. AS ROW START +--echo # +create or replace table t1 (x int); +--error ER_VERS_NOT_VERSIONED +alter table t1 add column y timestamp(6) as row start; +# cleanup +drop table t1; + + +--echo # +--echo # MDEV-25327 Unexpected ER_DUP_ENTRY upon dropping PK column from system-versioned table +--echo # +create table t1 (pk int, a int, primary key (pk), key (a)) +with system versioning; +insert into t1 values (1, 1), (2, 2); +delete from t1; +set system_versioning_alter_history= keep; +alter table t1 drop pk; +# cleanup +drop table t1; + +create table t1 (pk int, a int, primary key (pk), key (a)) +with system versioning; +insert into t1 values (1, 2), (2, 8), (3, 4), (4, 4), (5, 0); +delete from t1; +set system_versioning_alter_history= keep; +alter ignore table t1 drop pk; +# cleanup +drop table t1; diff --git a/mysql-test/suite/versioning/t/auto_increment.test b/mysql-test/suite/versioning/t/autoinc.test index 804c0424179..7c87c17301a 100644 --- a/mysql-test/suite/versioning/t/auto_increment.test +++ b/mysql-test/suite/versioning/t/autoinc.test @@ -47,4 +47,17 @@ select t1.x = t2.x and t1.y = t2.y as A, t1.x, t1.y, t2.x, t2.y from t1 inner jo drop table t1; drop table t2; +--echo # +--echo # MDEV-22562 Assertion `next_insert_id == 0' upon UPDATE on system-versioned table +--echo # +create table t1 (pk integer auto_increment primary key) engine=myisam with system versioning; +insert delayed into t1 (pk) values (1); +lock tables t1 write; +update t1 set pk= 0; +update t1 set pk= 0; +unlock tables; + +# cleanup +drop table t1; + -- source suite/versioning/common_finish.inc diff --git a/mysql-test/suite/versioning/t/delete.test b/mysql-test/suite/versioning/t/delete.test index 492463f9395..a5a0497fef2 100644 --- a/mysql-test/suite/versioning/t/delete.test +++ b/mysql-test/suite/versioning/t/delete.test @@ -94,4 +94,19 @@ drop procedure pr; drop trigger tr; drop table t1; +--echo # +--echo # MDEV-21138 Assertion `col->ord_part' or `f.col->ord_part' failed in row_build_index_entry_low +--echo # +create table t1 ( + f1 int, f2 text, f3 int, fulltext (f2), key(f1), key(f3), + foreign key r (f3) references t1 (f1) on delete set null) +with system versioning engine innodb; +insert into t1 values (1, repeat('a', 8193), 1), (1, repeat('b', 8193), 1); +select f1, f3, check_row_ts(row_start, row_end) from t1; +delete from t1; +select f1, f3, check_row_ts(row_start, row_end) from t1 for system_time all; + +# cleanup +drop table t1; + --source suite/versioning/common_finish.inc diff --git a/mysql-test/suite/versioning/t/foreign.test b/mysql-test/suite/versioning/t/foreign.test index 453ddd34034..4143cd59048 100644 --- a/mysql-test/suite/versioning/t/foreign.test +++ b/mysql-test/suite/versioning/t/foreign.test @@ -421,6 +421,8 @@ REPLACE INTO t2 SELECT * FROM t2; # Cleanup DROP TABLE t1, t2; +set timestamp= default; +set time_zone='+00:00'; --let $datadir= `select @@datadir` --remove_file $datadir/test/t1.data --remove_file $datadir/test/t1.data.2 @@ -458,4 +460,20 @@ insert into t2 values (1), (1); delete from t2; drop tables t2, t1; +--echo # +--echo # MDEV-23644 Assertion on evaluating foreign referential action for self-reference in system versioned table +--echo # +create table t1 (pk int primary key, f1 int,f2 int, f3 text, + key(f1), fulltext(f3), key(f3(10)), + foreign key (f2) references t1 (f1) on delete set null +) engine=innodb with system versioning; + +insert into t1 values (1, 8, 8, 'SHORT'), (2, 8, 8, repeat('LONG', 8071)); + +delete from t1; +select pk, f1, f2, left(f3, 4), check_row_ts(row_start, row_end) from t1 for system_time all order by pk; + +# cleanup +drop table t1; + --source suite/versioning/common_finish.inc diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test index 03d396b5e6c..f50e6c07b64 100644 --- a/mysql-test/suite/versioning/t/partition.test +++ b/mysql-test/suite/versioning/t/partition.test @@ -473,6 +473,7 @@ set timestamp=1523466002.799571; insert into t1 values (11),(12); set timestamp=1523466004.169435; delete from t1 where pk in (11, 12); +set timestamp= default; --echo # --echo # MDEV-18136 Server crashes in Item_func_dyncol_create::prepare_arguments @@ -640,6 +641,59 @@ create table t1 (a int) with system versioning partition by system_time --error ER_PARTITION_WRONG_TYPE alter table t1 add partition (partition p2); +--echo # MDEV-17891 Assertion failures in select_insert::abort_result_set and +--echo # mysql_load upon attempt to replace into a full table + +--let $max_heap_table_size_orig= `select @@max_heap_table_size;` +set @@max_heap_table_size= 1024*1024; +create or replace table t1 ( + pk integer auto_increment, + primary key (pk), + f varchar(45000) +) with system versioning engine=memory + partition by system_time interval 1 year (partition p1 history, + partition pn current); + +--echo # fill the table until full +insert into t1 () values (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(); +--error ER_RECORD_FILE_FULL +insert into t1 (f) select f from t1; +--echo # leave space for exactly one record in current partition +delete from t1 where pk = 1; +--echo # copy all data into history partition +replace into t1 select * from t1; +--error ER_RECORD_FILE_FULL +replace into t1 select * from t1; + +create or replace table t1 ( + pk integer auto_increment, + primary key (pk), + f varchar(45000) +) with system versioning engine=memory + partition by system_time interval 1 year (partition p1 history, + partition pn current); + +insert into t1 () values (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(); + +select * into outfile 'load.data' from t1; +load data infile 'load.data' replace into table t1; +--error ER_RECORD_FILE_FULL +load data infile 'load.data' replace into table t1; +--error ER_RECORD_FILE_FULL +load data infile 'load.data' replace into table t1; + +# Cleanup +--let $datadir= `select @@datadir` +--remove_file $datadir/test/load.data +eval set @@max_heap_table_size= $max_heap_table_size_orig; +drop table t1; + +--echo # +--echo # MDEV-22178 Assertion `info->alias.str' failed in partition_info::check_partition_info instead of ER_VERS_WRONG_PARTS +--echo # +create or replace table t1 (a int) with system versioning; +--error ER_VERS_WRONG_PARTS +alter table t1 partition by system_time (partition pn current); # Cleanup drop table t1; diff --git a/mysql-test/suite/versioning/t/replace.test b/mysql-test/suite/versioning/t/replace.test index 392c0ffcf35..83489f4a4b9 100644 --- a/mysql-test/suite/versioning/t/replace.test +++ b/mysql-test/suite/versioning/t/replace.test @@ -59,4 +59,22 @@ UPDATE IGNORE t1 SET f = 1; REPLACE t1 SELECT * FROM t1; DROP TABLE t1; +--echo # MDEV-22540 ER_DUP_ENTRY upon REPLACE or Assertion failed +set timestamp=1589245268.41934; +create table t1 (a int primary key) with system versioning; +insert into t1 values (1),(2); + +--connect (con1,localhost,root,,test) +set timestamp=1589245268.52093; +replace into t1 values (1),(2); + +--connection default +replace into t1 values (1),(2); + +--connection con1 +--error ER_DUP_ENTRY +replace into t1 values (1),(2); + +drop table t1; + --source suite/versioning/common_finish.inc diff --git a/mysql-test/suite/versioning/t/trx_id.test b/mysql-test/suite/versioning/t/trx_id.test index 38724a47fd1..7dfc8acb080 100644 --- a/mysql-test/suite/versioning/t/trx_id.test +++ b/mysql-test/suite/versioning/t/trx_id.test @@ -14,7 +14,13 @@ create or replace table t1 ( period for system_time (sys_trx_start, sys_trx_end) ) with system versioning; +--echo # No history inside the transaction +start transaction; insert into t1 (x) values (1); +update t1 set x= x + 1; +update t1 set x= x + 1; +commit; +select *, sys_trx_start > 1, sys_trx_end from t1 for system_time all; --echo # ALTER ADD SYSTEM VERSIONING should write to mysql.transaction_registry set @@system_versioning_alter_history=keep; diff --git a/mysql-test/suite/versioning/t/update.test b/mysql-test/suite/versioning/t/update.test index 06f81ea9064..47a56a71bd3 100644 --- a/mysql-test/suite/versioning/t/update.test +++ b/mysql-test/suite/versioning/t/update.test @@ -147,6 +147,21 @@ select @tmp2 = sys_trx_start as B2, salary from t2; drop table t1; drop table t2; +--echo # Ensure FTS retains correct history +replace_result $sys_datatype_expl SYS_DATATYPE; +eval create table t1 ( + x int, y text, fulltext (y), + row_start $sys_datatype_expl as row start invisible, + row_end $sys_datatype_expl as row end invisible, + period for system_time (row_start, row_end)) +with system versioning engine innodb; +insert into t1 values (1, repeat('LONG', 2048)); +update t1 set x= x + 1; +select x, left(y, 4), length(y), check_row(row_start, row_end) from t1 for system_time all order by x, y; +update t1 set y= 'SHORT'; +select x, left(y, 4), length(y), check_row(row_start, row_end) from t1 for system_time all order by x, y; +drop tables t1; + --echo ### Issue tempesta-tech/mariadb#365, bug 7 (duplicate of historical row) create or replace table t1 (a int primary key, b int) with system versioning engine myisam; @@ -286,4 +301,53 @@ delete history from t1; # cleanup drop table t1; +--echo # +--echo # MDEV-23446 UPDATE does not insert history row if the row is not changed +--echo # +replace_result $sys_datatype_expl SYS_DATATYPE; +eval create table t1 ( + a int, + row_start $sys_datatype_expl as row start invisible, + row_end $sys_datatype_expl as row end invisible, + period for system_time (row_start, row_end)) with system versioning; +insert into t1 values (1); +update t1 set a= 1; +select *, check_row(row_start, row_end) from t1 for system_time all order by row_end; + +--echo # multi-update +create or replace table t2 like t1; +create or replace table t3 like t1; +insert into t2 values (1); +insert into t3 values (1); +update t2, t3 set t2.a= 1, t3.a= 1 where t2.a = t3.a; +select *, check_row(row_start, row_end) from t2 for system_time all order by row_end; +select *, check_row(row_start, row_end) from t2 for system_time all order by row_end; + +# cleanup +drop tables t1, t2, t3; + +--echo # +--echo # MDEV-24522 Assertion `inited==NONE' fails upon UPDATE on versioned table with unique blob +--echo +create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning; +insert into t1 values (1, 1, 'foo'), (2, 11, 'bar'); + +update t1 set a = 3 where b <= 9; +update t1 set a = 3 where b <= 10; + +# cleanup +drop table t1; + +create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning; +create table t2 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning; +insert into t1 values (1, 1, 'foo'), (2, 11, 'bar'); +insert into t2 values (1, 1, 'foo'), (2, 11, 'bar'); + +update t1 set a = 3 where b <= 9; +update t2 set a = 3 where b <= 9; +update t1, t2 set t1.a = 3, t2.a = 3 where t1.b <= 10 and t2.b <= 10 and t1.b = t2.b; + +# cleanup +drop tables t1, t2; + source suite/versioning/common_finish.inc; diff --git a/mysql-test/suite/wsrep/disabled.def b/mysql-test/suite/wsrep/disabled.def index 11577bfe8b0..991109d72b8 100644 --- a/mysql-test/suite/wsrep/disabled.def +++ b/mysql-test/suite/wsrep/disabled.def @@ -10,3 +10,8 @@ # ############################################################################## + +mdev_6832: wsrep_provider is read-only for security reasons +MDEV-23092: wsrep_provider is read-only for security reasons +wsrep_variables_no_provider: wsrep_provider is read-only for security reasons +MDEV-22443: it is no longer allowed enable wsrep_on if wsrep_provider is 'none' diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result index 1c427b34d2b..97fabd58de6 100644 --- a/mysql-test/suite/wsrep/r/variables.result +++ b/mysql-test/suite/wsrep/r/variables.result @@ -1,98 +1,156 @@ -call mtr.add_suppression("WSREP: Initial position was provided by configuration or SST, avoiding override"); -SET @wsrep_provider_options_saved= @@global.wsrep_provider_options; -SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address; - -# MDEV#5534: mysql_tzinfo_to_sql generates wrong query -# -# Testing wsrep_replicate_myisam variable. -SELECT @@session.wsrep_replicate_myisam; -ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable -SELECT @@global.wsrep_replicate_myisam; -@@global.wsrep_replicate_myisam -0 -SET SESSION wsrep_replicate_myisam= ON; -ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable and should be set with SET GLOBAL -SET GLOBAL wsrep_replicate_myisam= ON; -SET GLOBAL wsrep_replicate_myisam= OFF; -SET GLOBAL wsrep_provider=none; +# Correct Galera library found # # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of # variables when using "_" # CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*"); -SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment'; +SHOW GLOBAL STATUS LIKE 'wsrep%'; Variable_name Value +wsrep_local_state_uuid # +wsrep_protocol_version # +wsrep_last_committed # +wsrep_replicated # +wsrep_replicated_bytes # +wsrep_repl_keys # +wsrep_repl_keys_bytes # +wsrep_repl_data_bytes # +wsrep_repl_other_bytes # +wsrep_received # +wsrep_received_bytes # +wsrep_local_commits # +wsrep_local_cert_failures # +wsrep_local_replays # +wsrep_local_send_queue # +wsrep_local_send_queue_max # +wsrep_local_send_queue_min # +wsrep_local_send_queue_avg # +wsrep_local_recv_queue # +wsrep_local_recv_queue_max # +wsrep_local_recv_queue_min # +wsrep_local_recv_queue_avg # +wsrep_local_cached_downto # +wsrep_flow_control_paused_ns # +wsrep_flow_control_paused # +wsrep_flow_control_sent # +wsrep_flow_control_recv # +wsrep_flow_control_active # +wsrep_flow_control_requested # +wsrep_cert_deps_distance # +wsrep_apply_oooe # +wsrep_apply_oool # +wsrep_apply_window # +wsrep_commit_oooe # +wsrep_commit_oool # +wsrep_commit_window # +wsrep_local_state # wsrep_local_state_comment # -# Should show nothing. -SHOW STATUS LIKE 'x'; -Variable_name Value -SET GLOBAL wsrep_provider=none; +wsrep_cert_index_size # +wsrep_causal_reads # +wsrep_cert_interval # +wsrep_open_transactions # +wsrep_open_connections # +wsrep_incoming_addresses # +wsrep_cluster_weight # +wsrep_desync_count # +wsrep_evs_delayed # +wsrep_evs_evict_list # +wsrep_evs_repl_latency # +wsrep_evs_state # +wsrep_gcomm_uuid # +wsrep_gmcast_segment # +wsrep_applier_thread_count # +wsrep_cluster_capabilities # +wsrep_cluster_conf_id # +wsrep_cluster_size # +wsrep_cluster_state_uuid # +wsrep_cluster_status # +wsrep_connected # +wsrep_local_bf_aborts # +wsrep_local_index # +wsrep_provider_capabilities # +wsrep_provider_name # +wsrep_provider_vendor # +wsrep_provider_version # +wsrep_ready # +wsrep_rollbacker_thread_count # +wsrep_thread_count # -SHOW STATUS LIKE 'wsrep_local_state_uuid'; +SHOW GLOBAL STATUS LIKE 'wsrep_%'; Variable_name Value wsrep_local_state_uuid # - -SHOW STATUS LIKE 'wsrep_last_committed'; -Variable_name Value +wsrep_protocol_version # wsrep_last_committed # -SET GLOBAL wsrep_provider=none; - -# -# MDEV#6206: wsrep_slave_threads subtracts from max_connections -# -call mtr.add_suppression("WSREP: Failed to get provider options"); -SELECT @@global.wsrep_provider; -@@global.wsrep_provider -libgalera_smm.so -SELECT @@global.wsrep_slave_threads; -@@global.wsrep_slave_threads -1 -SELECT @@global.wsrep_cluster_address; -@@global.wsrep_cluster_address - -SELECT @@global.wsrep_on; -@@global.wsrep_on -1 -SHOW STATUS LIKE 'threads_connected'; -Variable_name Value -Threads_connected 1 -SHOW STATUS LIKE 'wsrep_thread_count'; -Variable_name Value -wsrep_thread_count 0 - -SELECT @@global.wsrep_provider; -@@global.wsrep_provider -libgalera_smm.so -SELECT @@global.wsrep_cluster_address; -@@global.wsrep_cluster_address - -SELECT @@global.wsrep_on; -@@global.wsrep_on -1 -SHOW STATUS LIKE 'threads_connected'; +wsrep_replicated # +wsrep_replicated_bytes # +wsrep_repl_keys # +wsrep_repl_keys_bytes # +wsrep_repl_data_bytes # +wsrep_repl_other_bytes # +wsrep_received # +wsrep_received_bytes # +wsrep_local_commits # +wsrep_local_cert_failures # +wsrep_local_replays # +wsrep_local_send_queue # +wsrep_local_send_queue_max # +wsrep_local_send_queue_min # +wsrep_local_send_queue_avg # +wsrep_local_recv_queue # +wsrep_local_recv_queue_max # +wsrep_local_recv_queue_min # +wsrep_local_recv_queue_avg # +wsrep_local_cached_downto # +wsrep_flow_control_paused_ns # +wsrep_flow_control_paused # +wsrep_flow_control_sent # +wsrep_flow_control_recv # +wsrep_flow_control_active # +wsrep_flow_control_requested # +wsrep_cert_deps_distance # +wsrep_apply_oooe # +wsrep_apply_oool # +wsrep_apply_window # +wsrep_commit_oooe # +wsrep_commit_oool # +wsrep_commit_window # +wsrep_local_state # +wsrep_local_state_comment # +wsrep_cert_index_size # +wsrep_causal_reads # +wsrep_cert_interval # +wsrep_open_transactions # +wsrep_open_connections # +wsrep_incoming_addresses # +wsrep_cluster_weight # +wsrep_desync_count # +wsrep_evs_delayed # +wsrep_evs_evict_list # +wsrep_evs_repl_latency # +wsrep_evs_state # +wsrep_gcomm_uuid # +wsrep_gmcast_segment # +wsrep_applier_thread_count # +wsrep_cluster_capabilities # +wsrep_cluster_conf_id # +wsrep_cluster_size # +wsrep_cluster_state_uuid # +wsrep_cluster_status # +wsrep_connected # +wsrep_local_bf_aborts # +wsrep_local_index # +wsrep_provider_capabilities # +wsrep_provider_name # +wsrep_provider_vendor # +wsrep_provider_version # +wsrep_ready # +wsrep_rollbacker_thread_count # +wsrep_thread_count # +SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment'; Variable_name Value -Threads_connected 1 -SHOW STATUS LIKE 'wsrep_thread_count'; +wsrep_local_state_comment # +# Should show nothing. +SHOW STATUS LIKE 'x'; Variable_name Value -wsrep_thread_count 0 - -# Setting wsrep_cluster_address triggers the creation of -# applier/rollbacker threads. -SET GLOBAL wsrep_cluster_address= 'gcomm://'; -# Wait for applier thread to get created 1. -# Wait for applier thread to get created 2. -SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; -EXPECT_1 -1 -SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count'; -EXPECT_1 -1 -SELECT VARIABLE_VALUE AS EXPECT_2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count'; -EXPECT_2 -2 -SELECT @@global.wsrep_provider; -@@global.wsrep_provider -libgalera_smm.so SELECT @@global.wsrep_cluster_address; @@global.wsrep_cluster_address gcomm:// @@ -105,47 +163,112 @@ Threads_connected 1 SHOW STATUS LIKE 'wsrep_thread_count'; Variable_name Value wsrep_thread_count 2 - -SET @wsrep_slave_threads_saved= @@global.wsrep_slave_threads; -SET GLOBAL wsrep_slave_threads= 10; -# Wait for 9 applier threads to get created. -SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; -EXPECT_10 -10 -SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count'; -EXPECT_1 -1 -SELECT VARIABLE_VALUE AS EXPECT_11 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count'; -EXPECT_11 -11 -SHOW STATUS LIKE 'threads_connected'; -Variable_name Value -Threads_connected 1 -set wsrep_on=0; -set wsrep_on=1; -create user test@localhost; -connect con1,localhost,test; -set auto_increment_increment=10; -set wsrep_on=0; -ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation -disconnect con1; -connection default; -drop user test@localhost; -# -# MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash -# -SET @wsrep_sst_auth_saved= @@global.wsrep_sst_auth; -SET @@global.wsrep_sst_auth= 'user:pass'; -SELECT @@global.wsrep_sst_auth; -@@global.wsrep_sst_auth -******** -SET @@global.wsrep_sst_auth= ''; -SELECT @@global.wsrep_sst_auth; -@@global.wsrep_sst_auth - -SET @@global.wsrep_sst_auth= NULL; -SELECT @@global.wsrep_sst_auth; -@@global.wsrep_sst_auth -NULL -SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved; -# End of test. +# variables +SELECT COUNT(*) AS EXPECT_49 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%"; +EXPECT_49 +49 +SELECT COUNT(*) AS EXPECT_49 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%"; +EXPECT_49 +49 +SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME; +VARIABLE_NAME +WSREP_AUTO_INCREMENT_CONTROL +WSREP_CAUSAL_READS +WSREP_CERTIFICATION_RULES +WSREP_CERTIFY_NONPK +WSREP_CLUSTER_ADDRESS +WSREP_CLUSTER_NAME +WSREP_CONVERT_LOCK_TO_TRX +WSREP_DATA_HOME_DIR +WSREP_DBUG_OPTION +WSREP_DEBUG +WSREP_DESYNC +WSREP_DIRTY_READS +WSREP_DRUPAL_282555_WORKAROUND +WSREP_FORCED_BINLOG_FORMAT +WSREP_GTID_DOMAIN_ID +WSREP_GTID_MODE +WSREP_IGNORE_APPLY_ERRORS +WSREP_LOAD_DATA_SPLITTING +WSREP_LOG_CONFLICTS +WSREP_MAX_WS_ROWS +WSREP_MAX_WS_SIZE +WSREP_MYSQL_REPLICATION_BUNDLE +WSREP_NODE_ADDRESS +WSREP_NODE_INCOMING_ADDRESS +WSREP_NODE_NAME +WSREP_NOTIFY_CMD +WSREP_ON +WSREP_OSU_METHOD +WSREP_PATCH_VERSION +WSREP_PROVIDER +WSREP_PROVIDER_OPTIONS +WSREP_RECOVER +WSREP_REJECT_QUERIES +WSREP_REPLICATE_MYISAM +WSREP_RESTART_SLAVE +WSREP_RETRY_AUTOCOMMIT +WSREP_SLAVE_FK_CHECKS +WSREP_SLAVE_THREADS +WSREP_SLAVE_UK_CHECKS +WSREP_SR_STORE +WSREP_SST_AUTH +WSREP_SST_DONOR +WSREP_SST_DONOR_REJECTS_QUERIES +WSREP_SST_METHOD +WSREP_SST_RECEIVE_ADDRESS +WSREP_START_POSITION +WSREP_SYNC_WAIT +WSREP_TRX_FRAGMENT_SIZE +WSREP_TRX_FRAGMENT_UNIT +SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME; +VARIABLE_NAME +WSREP_AUTO_INCREMENT_CONTROL +WSREP_CAUSAL_READS +WSREP_CERTIFICATION_RULES +WSREP_CERTIFY_NONPK +WSREP_CLUSTER_ADDRESS +WSREP_CLUSTER_NAME +WSREP_CONVERT_LOCK_TO_TRX +WSREP_DATA_HOME_DIR +WSREP_DBUG_OPTION +WSREP_DEBUG +WSREP_DESYNC +WSREP_DIRTY_READS +WSREP_DRUPAL_282555_WORKAROUND +WSREP_FORCED_BINLOG_FORMAT +WSREP_GTID_DOMAIN_ID +WSREP_GTID_MODE +WSREP_IGNORE_APPLY_ERRORS +WSREP_LOAD_DATA_SPLITTING +WSREP_LOG_CONFLICTS +WSREP_MAX_WS_ROWS +WSREP_MAX_WS_SIZE +WSREP_MYSQL_REPLICATION_BUNDLE +WSREP_NODE_ADDRESS +WSREP_NODE_INCOMING_ADDRESS +WSREP_NODE_NAME +WSREP_NOTIFY_CMD +WSREP_ON +WSREP_OSU_METHOD +WSREP_PATCH_VERSION +WSREP_PROVIDER +WSREP_PROVIDER_OPTIONS +WSREP_RECOVER +WSREP_REJECT_QUERIES +WSREP_REPLICATE_MYISAM +WSREP_RESTART_SLAVE +WSREP_RETRY_AUTOCOMMIT +WSREP_SLAVE_FK_CHECKS +WSREP_SLAVE_THREADS +WSREP_SLAVE_UK_CHECKS +WSREP_SR_STORE +WSREP_SST_AUTH +WSREP_SST_DONOR +WSREP_SST_DONOR_REJECTS_QUERIES +WSREP_SST_METHOD +WSREP_SST_RECEIVE_ADDRESS +WSREP_START_POSITION +WSREP_SYNC_WAIT +WSREP_TRX_FRAGMENT_SIZE +WSREP_TRX_FRAGMENT_UNIT diff --git a/mysql-test/suite/wsrep/r/variables_debug.result b/mysql-test/suite/wsrep/r/variables_debug.result index 886325acf53..9a140f26ec3 100644 --- a/mysql-test/suite/wsrep/r/variables_debug.result +++ b/mysql-test/suite/wsrep/r/variables_debug.result @@ -1,20 +1,4 @@ -call mtr.add_suppression("WSREP: Initial position was provided by configuration or SST, avoiding override"); -SET @wsrep_provider_options_saved= @@global.wsrep_provider_options; -SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address; - -# MDEV#5534: mysql_tzinfo_to_sql generates wrong query -# -# Testing wsrep_replicate_myisam variable. -SELECT @@session.wsrep_replicate_myisam; -ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable -SELECT @@global.wsrep_replicate_myisam; -@@global.wsrep_replicate_myisam -0 -SET SESSION wsrep_replicate_myisam= ON; -ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable and should be set with SET GLOBAL -SET GLOBAL wsrep_replicate_myisam= ON; -SET GLOBAL wsrep_replicate_myisam= OFF; -SET GLOBAL wsrep_provider=none; +# Correct Galera library found # # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of # variables when using "_" @@ -66,7 +50,15 @@ wsrep_cert_interval # wsrep_open_transactions # wsrep_open_connections # wsrep_incoming_addresses # +wsrep_cluster_weight # wsrep_debug_sync_waiters # +wsrep_desync_count # +wsrep_evs_delayed # +wsrep_evs_evict_list # +wsrep_evs_repl_latency # +wsrep_evs_state # +wsrep_gcomm_uuid # +wsrep_gmcast_segment # wsrep_applier_thread_count # wsrep_cluster_capabilities # wsrep_cluster_conf_id # @@ -130,7 +122,15 @@ wsrep_cert_interval # wsrep_open_transactions # wsrep_open_connections # wsrep_incoming_addresses # +wsrep_cluster_weight # wsrep_debug_sync_waiters # +wsrep_desync_count # +wsrep_evs_delayed # +wsrep_evs_evict_list # +wsrep_evs_repl_latency # +wsrep_evs_state # +wsrep_gcomm_uuid # +wsrep_gmcast_segment # wsrep_applier_thread_count # wsrep_cluster_capabilities # wsrep_cluster_conf_id # @@ -153,73 +153,6 @@ wsrep_local_state_comment # # Should show nothing. SHOW STATUS LIKE 'x'; Variable_name Value -SET GLOBAL wsrep_provider=none; - -SHOW STATUS LIKE 'wsrep_local_state_uuid'; -Variable_name Value -wsrep_local_state_uuid # - -SHOW STATUS LIKE 'wsrep_last_committed'; -Variable_name Value -wsrep_last_committed # -SET GLOBAL wsrep_provider=none; - -# -# MDEV#6206: wsrep_slave_threads subtracts from max_connections -# -call mtr.add_suppression("WSREP: Failed to get provider options"); -SELECT @@global.wsrep_provider; -@@global.wsrep_provider -libgalera_smm.so -SELECT @@global.wsrep_slave_threads; -@@global.wsrep_slave_threads -1 -SELECT @@global.wsrep_cluster_address; -@@global.wsrep_cluster_address - -SELECT @@global.wsrep_on; -@@global.wsrep_on -1 -SHOW STATUS LIKE 'threads_connected'; -Variable_name Value -Threads_connected 1 -SHOW STATUS LIKE 'wsrep_thread_count'; -Variable_name Value -wsrep_thread_count 0 - -SELECT @@global.wsrep_provider; -@@global.wsrep_provider -libgalera_smm.so -SELECT @@global.wsrep_cluster_address; -@@global.wsrep_cluster_address - -SELECT @@global.wsrep_on; -@@global.wsrep_on -1 -SHOW STATUS LIKE 'threads_connected'; -Variable_name Value -Threads_connected 1 -SHOW STATUS LIKE 'wsrep_thread_count'; -Variable_name Value -wsrep_thread_count 0 - -# Setting wsrep_cluster_address triggers the creation of -# applier/rollbacker threads. -SET GLOBAL wsrep_cluster_address= 'gcomm://'; -# Wait for applier thread to get created 1. -# Wait for applier thread to get created 2. -SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; -EXPECT_1 -1 -SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count'; -EXPECT_1 -1 -SELECT VARIABLE_VALUE AS EXPECT_2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count'; -EXPECT_2 -2 -SELECT @@global.wsrep_provider; -@@global.wsrep_provider -libgalera_smm.so SELECT @@global.wsrep_cluster_address; @@global.wsrep_cluster_address gcomm:// @@ -232,47 +165,112 @@ Threads_connected 1 SHOW STATUS LIKE 'wsrep_thread_count'; Variable_name Value wsrep_thread_count 2 - -SET @wsrep_slave_threads_saved= @@global.wsrep_slave_threads; -SET GLOBAL wsrep_slave_threads= 10; -# Wait for 9 applier threads to get created. -SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; -EXPECT_10 -10 -SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count'; -EXPECT_1 -1 -SELECT VARIABLE_VALUE AS EXPECT_11 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count'; -EXPECT_11 -11 -SHOW STATUS LIKE 'threads_connected'; -Variable_name Value -Threads_connected 1 -set wsrep_on=0; -set wsrep_on=1; -create user test@localhost; -connect con1,localhost,test; -set auto_increment_increment=10; -set wsrep_on=0; -ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation -disconnect con1; -connection default; -drop user test@localhost; -# -# MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash -# -SET @wsrep_sst_auth_saved= @@global.wsrep_sst_auth; -SET @@global.wsrep_sst_auth= 'user:pass'; -SELECT @@global.wsrep_sst_auth; -@@global.wsrep_sst_auth -******** -SET @@global.wsrep_sst_auth= ''; -SELECT @@global.wsrep_sst_auth; -@@global.wsrep_sst_auth - -SET @@global.wsrep_sst_auth= NULL; -SELECT @@global.wsrep_sst_auth; -@@global.wsrep_sst_auth -NULL -SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved; -# End of test. +# variables +SELECT COUNT(*) AS EXPECT_49 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%"; +EXPECT_49 +49 +SELECT COUNT(*) AS EXPECT_49 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%"; +EXPECT_49 +49 +SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME; +VARIABLE_NAME +WSREP_AUTO_INCREMENT_CONTROL +WSREP_CAUSAL_READS +WSREP_CERTIFICATION_RULES +WSREP_CERTIFY_NONPK +WSREP_CLUSTER_ADDRESS +WSREP_CLUSTER_NAME +WSREP_CONVERT_LOCK_TO_TRX +WSREP_DATA_HOME_DIR +WSREP_DBUG_OPTION +WSREP_DEBUG +WSREP_DESYNC +WSREP_DIRTY_READS +WSREP_DRUPAL_282555_WORKAROUND +WSREP_FORCED_BINLOG_FORMAT +WSREP_GTID_DOMAIN_ID +WSREP_GTID_MODE +WSREP_IGNORE_APPLY_ERRORS +WSREP_LOAD_DATA_SPLITTING +WSREP_LOG_CONFLICTS +WSREP_MAX_WS_ROWS +WSREP_MAX_WS_SIZE +WSREP_MYSQL_REPLICATION_BUNDLE +WSREP_NODE_ADDRESS +WSREP_NODE_INCOMING_ADDRESS +WSREP_NODE_NAME +WSREP_NOTIFY_CMD +WSREP_ON +WSREP_OSU_METHOD +WSREP_PATCH_VERSION +WSREP_PROVIDER +WSREP_PROVIDER_OPTIONS +WSREP_RECOVER +WSREP_REJECT_QUERIES +WSREP_REPLICATE_MYISAM +WSREP_RESTART_SLAVE +WSREP_RETRY_AUTOCOMMIT +WSREP_SLAVE_FK_CHECKS +WSREP_SLAVE_THREADS +WSREP_SLAVE_UK_CHECKS +WSREP_SR_STORE +WSREP_SST_AUTH +WSREP_SST_DONOR +WSREP_SST_DONOR_REJECTS_QUERIES +WSREP_SST_METHOD +WSREP_SST_RECEIVE_ADDRESS +WSREP_START_POSITION +WSREP_SYNC_WAIT +WSREP_TRX_FRAGMENT_SIZE +WSREP_TRX_FRAGMENT_UNIT +SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME; +VARIABLE_NAME +WSREP_AUTO_INCREMENT_CONTROL +WSREP_CAUSAL_READS +WSREP_CERTIFICATION_RULES +WSREP_CERTIFY_NONPK +WSREP_CLUSTER_ADDRESS +WSREP_CLUSTER_NAME +WSREP_CONVERT_LOCK_TO_TRX +WSREP_DATA_HOME_DIR +WSREP_DBUG_OPTION +WSREP_DEBUG +WSREP_DESYNC +WSREP_DIRTY_READS +WSREP_DRUPAL_282555_WORKAROUND +WSREP_FORCED_BINLOG_FORMAT +WSREP_GTID_DOMAIN_ID +WSREP_GTID_MODE +WSREP_IGNORE_APPLY_ERRORS +WSREP_LOAD_DATA_SPLITTING +WSREP_LOG_CONFLICTS +WSREP_MAX_WS_ROWS +WSREP_MAX_WS_SIZE +WSREP_MYSQL_REPLICATION_BUNDLE +WSREP_NODE_ADDRESS +WSREP_NODE_INCOMING_ADDRESS +WSREP_NODE_NAME +WSREP_NOTIFY_CMD +WSREP_ON +WSREP_OSU_METHOD +WSREP_PATCH_VERSION +WSREP_PROVIDER +WSREP_PROVIDER_OPTIONS +WSREP_RECOVER +WSREP_REJECT_QUERIES +WSREP_REPLICATE_MYISAM +WSREP_RESTART_SLAVE +WSREP_RETRY_AUTOCOMMIT +WSREP_SLAVE_FK_CHECKS +WSREP_SLAVE_THREADS +WSREP_SLAVE_UK_CHECKS +WSREP_SR_STORE +WSREP_SST_AUTH +WSREP_SST_DONOR +WSREP_SST_DONOR_REJECTS_QUERIES +WSREP_SST_METHOD +WSREP_SST_RECEIVE_ADDRESS +WSREP_START_POSITION +WSREP_SYNC_WAIT +WSREP_TRX_FRAGMENT_SIZE +WSREP_TRX_FRAGMENT_UNIT diff --git a/mysql-test/suite/sys_vars/r/wsrep_on_basic.result b/mysql-test/suite/wsrep/r/wsrep_on_basic.result index 735e2d77180..b3186fa674f 100644 --- a/mysql-test/suite/sys_vars/r/wsrep_on_basic.result +++ b/mysql-test/suite/wsrep/r/wsrep_on_basic.result @@ -7,10 +7,10 @@ SET @wsrep_on_session_saved = @@session.wsrep_on; # default SELECT @@global.wsrep_on; @@global.wsrep_on -0 +1 SELECT @@session.wsrep_on; @@session.wsrep_on -0 +1 # scope and valid values SET @@global.wsrep_on=OFF; diff --git a/mysql-test/suite/wsrep/r/wsrep_variables_no_provider.result b/mysql-test/suite/wsrep/r/wsrep_variables_no_provider.result new file mode 100644 index 00000000000..ad35dc8dbcd --- /dev/null +++ b/mysql-test/suite/wsrep/r/wsrep_variables_no_provider.result @@ -0,0 +1,44 @@ +SELECT @@wsrep_on; +@@wsrep_on +1 +SET @wsrep_slave_threads_global_saved = @@global.wsrep_slave_threads; +SET @wsrep_debug_saved = @@global.wsrep_debug; +SET @wsrep_provider_options_saved= @@global.wsrep_provider_options; +SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address; +SET GLOBAL wsrep_provider=none; +SET SESSION wsrep_trx_fragment_size=DEFAULT; +ERROR HY000: Incorrect arguments to SET +SELECT @@session.wsrep_trx_fragment_size; +@@session.wsrep_trx_fragment_size +0 +SET GLOBAL wsrep_start_position='12345678-1234-1234-1234-123456789012:100'; +ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:100' +SHOW WARNINGS; +Level Code Message +Warning 1231 Cannot set 'wsrep_start_position' because wsrep is switched off or provider is not loaded +Error 1231 Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:100' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 +SET GLOBAL wsrep_debug=1; +Warnings: +Warning 1231 Setting 'wsrep_debug' has no effect because wsrep is switched off +SELECT @@global.wsrep_debug; +@@global.wsrep_debug +NONE +SET GLOBAL wsrep_slave_threads=5; +SELECT @@global.wsrep_slave_threads; +@@global.wsrep_slave_threads +5 +SET GLOBAL wsrep_desync=1; +ERROR HY000: WSREP (galera) not started +SELECT @@global.wsrep_desync; +@@global.wsrep_desync +0 +SET SESSION wsrep_trx_fragment_unit='rows'; +ERROR HY000: Incorrect arguments to SET +SELECT @@session.wsrep_trx_fragment_unit; +@@session.wsrep_trx_fragment_unit +rows +SET @@global.wsrep_slave_threads = @wsrep_slave_threads_global_saved; +SET @@global.wsrep_debug = @wsrep_debug_saved; diff --git a/mysql-test/suite/wsrep/r/wsrep_variables_wsrep_off.result b/mysql-test/suite/wsrep/r/wsrep_variables_wsrep_off.result new file mode 100644 index 00000000000..7cae89eae8e --- /dev/null +++ b/mysql-test/suite/wsrep/r/wsrep_variables_wsrep_off.result @@ -0,0 +1,39 @@ +SELECT @@wsrep_on; +@@wsrep_on +0 +SET @wsrep_slave_threads_global_saved = @@global.wsrep_slave_threads; +SET @wsrep_debug_saved = @@global.wsrep_debug; +SET SESSION wsrep_trx_fragment_size=DEFAULT; +ERROR HY000: Incorrect arguments to SET +SELECT @@session.wsrep_trx_fragment_size; +@@session.wsrep_trx_fragment_size +0 +SET GLOBAL wsrep_start_position='12345678-1234-1234-1234-123456789012:100'; +ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:100' +SHOW WARNINGS; +Level Code Message +Warning 1231 Cannot set 'wsrep_start_position' because wsrep is switched off or provider is not loaded +Error 1231 Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:100' +SELECT @@global.wsrep_start_position; +@@global.wsrep_start_position +00000000-0000-0000-0000-000000000000:-1 +SET GLOBAL wsrep_debug=1; +Warnings: +Warning 1231 Setting 'wsrep_debug' has no effect because wsrep is switched off +SELECT @@global.wsrep_debug; +@@global.wsrep_debug +NONE +SET GLOBAL wsrep_slave_threads=5; +SELECT @@global.wsrep_slave_threads; +@@global.wsrep_slave_threads +5 +SET GLOBAL wsrep_desync=1; +ERROR HY000: WSREP (galera) not started +SELECT @@global.wsrep_desync; +@@global.wsrep_desync +0 +SET SESSION wsrep_trx_fragment_unit='rows'; +ERROR HY000: Incorrect arguments to SET +SELECT @@session.wsrep_trx_fragment_unit; +@@session.wsrep_trx_fragment_unit +rows diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test index cae2fe5d6db..8b94275a646 100644 --- a/mysql-test/suite/wsrep/t/variables.test +++ b/mysql-test/suite/wsrep/t/variables.test @@ -1,28 +1,10 @@ --source include/have_wsrep.inc --source include/force_restart.inc --source include/have_innodb.inc +--source include/galera_no_debug_sync.inc -call mtr.add_suppression("WSREP: Initial position was provided by configuration or SST, avoiding override"); - -SET @wsrep_provider_options_saved= @@global.wsrep_provider_options; -SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address; - ---echo ---echo # MDEV#5534: mysql_tzinfo_to_sql generates wrong query ---echo # ---echo # Testing wsrep_replicate_myisam variable. - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.wsrep_replicate_myisam; -SELECT @@global.wsrep_replicate_myisam; - ---error ER_GLOBAL_VARIABLE -SET SESSION wsrep_replicate_myisam= ON; -SET GLOBAL wsrep_replicate_myisam= ON; - -# Reset it back. -SET GLOBAL wsrep_replicate_myisam= OFF; -SET GLOBAL wsrep_provider=none; +--let $galera_version=26.4.8 +source ../../wsrep/include/check_galera_version.inc; --echo # --echo # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of @@ -31,138 +13,27 @@ SET GLOBAL wsrep_provider=none; CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*"); ---disable_query_log -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; ---enable_query_log - --replace_column 2 # -SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment'; - ---echo # Should show nothing. -SHOW STATUS LIKE 'x'; - -# Reset it back. -SET GLOBAL wsrep_provider=none; +SHOW GLOBAL STATUS LIKE 'wsrep%'; ---disable_query_log -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; ---enable_query_log - -# The following 2 variables are used by mariabackup -# SST. ---echo ---replace_column 2 # -SHOW STATUS LIKE 'wsrep_local_state_uuid'; --echo --replace_column 2 # -SHOW STATUS LIKE 'wsrep_last_committed'; - -# Reset it back. -SET GLOBAL wsrep_provider=none; - ---echo ---echo # ---echo # MDEV#6206: wsrep_slave_threads subtracts from max_connections ---echo # -call mtr.add_suppression("WSREP: Failed to get provider options"); - ---disable_query_log -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; ---enable_query_log - ---replace_regex /.*libgalera.*smm.*/libgalera_smm.so/ -SELECT @@global.wsrep_provider; -SELECT @@global.wsrep_slave_threads; -SELECT @@global.wsrep_cluster_address; -SELECT @@global.wsrep_on; -SHOW STATUS LIKE 'threads_connected'; -SHOW STATUS LIKE 'wsrep_thread_count'; ---echo +SHOW GLOBAL STATUS LIKE 'wsrep_%'; ---disable_query_log -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; ---enable_query_log - ---replace_regex /.*libgalera.*smm.*/libgalera_smm.so/ -SELECT @@global.wsrep_provider; -SELECT @@global.wsrep_cluster_address; -SELECT @@global.wsrep_on; -SHOW STATUS LIKE 'threads_connected'; -SHOW STATUS LIKE 'wsrep_thread_count'; ---echo - ---echo # Setting wsrep_cluster_address triggers the creation of ---echo # applier/rollbacker threads. -SET GLOBAL wsrep_cluster_address= 'gcomm://'; - ---echo # Wait for applier thread to get created 1. ---let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; ---source include/wait_condition.inc ---echo # Wait for applier thread to get created 2. ---let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count'; ---source include/wait_condition.inc +--replace_column 2 # +SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment'; -SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; -SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count'; -SELECT VARIABLE_VALUE AS EXPECT_2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count'; +--echo # Should show nothing. +SHOW STATUS LIKE 'x'; ---replace_regex /.*libgalera.*smm.*/libgalera_smm.so/ -SELECT @@global.wsrep_provider; SELECT @@global.wsrep_cluster_address; SELECT @@global.wsrep_on; SHOW STATUS LIKE 'threads_connected'; SHOW STATUS LIKE 'wsrep_thread_count'; ---echo - -SET @wsrep_slave_threads_saved= @@global.wsrep_slave_threads; -SET GLOBAL wsrep_slave_threads= 10; - ---echo # Wait for 9 applier threads to get created. ---let $wait_condition = SELECT VARIABLE_VALUE = 10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; ---source include/wait_condition.inc - -SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; -SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count'; -SELECT VARIABLE_VALUE AS EXPECT_11 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count'; - -SHOW STATUS LIKE 'threads_connected'; - -# -# privileges for wsrep_on -# -set wsrep_on=0; -set wsrep_on=1; ---source include/wait_until_connected_again.inc -create user test@localhost; -connect con1,localhost,test; -set auto_increment_increment=10; ---error ER_SPECIFIC_ACCESS_DENIED_ERROR -set wsrep_on=0; -disconnect con1; -connection default; -drop user test@localhost; - ---echo # ---echo # MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash ---echo # -SET @wsrep_sst_auth_saved= @@global.wsrep_sst_auth; -SET @@global.wsrep_sst_auth= 'user:pass'; -SELECT @@global.wsrep_sst_auth; -SET @@global.wsrep_sst_auth= ''; -SELECT @@global.wsrep_sst_auth; -SET @@global.wsrep_sst_auth= NULL; -SELECT @@global.wsrep_sst_auth; -SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved; - -# Reset (for mtr internal checks) - ---disable_query_log -SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved; -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; -SET GLOBAL wsrep_cluster_address= @wsrep_cluster_address_saved; -SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved; ---enable_query_log ---source include/galera_wait_ready.inc +--echo # variables ---echo # End of test. +SELECT COUNT(*) AS EXPECT_49 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%"; +SELECT COUNT(*) AS EXPECT_49 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%"; +SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME; +SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME; diff --git a/mysql-test/suite/wsrep/t/variables_debug.test b/mysql-test/suite/wsrep/t/variables_debug.test index f2c3a0a3b78..f1b0194dee0 100644 --- a/mysql-test/suite/wsrep/t/variables_debug.test +++ b/mysql-test/suite/wsrep/t/variables_debug.test @@ -1,29 +1,12 @@ --source include/have_wsrep.inc --source include/force_restart.inc --source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc --source include/galera_have_debug_sync.inc -call mtr.add_suppression("WSREP: Initial position was provided by configuration or SST, avoiding override"); - -SET @wsrep_provider_options_saved= @@global.wsrep_provider_options; -SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address; - ---echo ---echo # MDEV#5534: mysql_tzinfo_to_sql generates wrong query ---echo # ---echo # Testing wsrep_replicate_myisam variable. - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.wsrep_replicate_myisam; -SELECT @@global.wsrep_replicate_myisam; - ---error ER_GLOBAL_VARIABLE -SET SESSION wsrep_replicate_myisam= ON; -SET GLOBAL wsrep_replicate_myisam= ON; - -# Reset it back. -SET GLOBAL wsrep_replicate_myisam= OFF; -SET GLOBAL wsrep_provider=none; +--let $galera_version=26.4.8 +source ../../wsrep/include/check_galera_version.inc; --echo # --echo # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of @@ -32,10 +15,6 @@ SET GLOBAL wsrep_provider=none; CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*"); ---disable_query_log -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; ---enable_query_log - --replace_column 2 # SHOW GLOBAL STATUS LIKE 'wsrep%'; @@ -49,128 +28,14 @@ SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment'; --echo # Should show nothing. SHOW STATUS LIKE 'x'; -# Reset it back. -SET GLOBAL wsrep_provider=none; - ---disable_query_log -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; ---enable_query_log - -# The following 2 variables are used by mariabackup -# SST. ---echo ---replace_column 2 # -SHOW STATUS LIKE 'wsrep_local_state_uuid'; ---echo ---replace_column 2 # -SHOW STATUS LIKE 'wsrep_last_committed'; - -# Reset it back. -SET GLOBAL wsrep_provider=none; - ---echo ---echo # ---echo # MDEV#6206: wsrep_slave_threads subtracts from max_connections ---echo # -call mtr.add_suppression("WSREP: Failed to get provider options"); - ---disable_query_log -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; ---enable_query_log - ---replace_regex /.*libgalera_smm.*/libgalera_smm.so/ -SELECT @@global.wsrep_provider; -SELECT @@global.wsrep_slave_threads; SELECT @@global.wsrep_cluster_address; SELECT @@global.wsrep_on; SHOW STATUS LIKE 'threads_connected'; SHOW STATUS LIKE 'wsrep_thread_count'; ---echo - ---disable_query_log -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; ---enable_query_log - ---replace_regex /.*libgalera_smm.*/libgalera_smm.so/ -SELECT @@global.wsrep_provider; -SELECT @@global.wsrep_cluster_address; -SELECT @@global.wsrep_on; -SHOW STATUS LIKE 'threads_connected'; -SHOW STATUS LIKE 'wsrep_thread_count'; ---echo - ---echo # Setting wsrep_cluster_address triggers the creation of ---echo # applier/rollbacker threads. -SET GLOBAL wsrep_cluster_address= 'gcomm://'; - ---echo # Wait for applier thread to get created 1. ---let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; ---source include/wait_condition.inc ---echo # Wait for applier thread to get created 2. ---let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count'; ---source include/wait_condition.inc - -SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; -SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count'; -SELECT VARIABLE_VALUE AS EXPECT_2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count'; - ---replace_regex /.*libgalera_smm.*/libgalera_smm.so/ -SELECT @@global.wsrep_provider; -SELECT @@global.wsrep_cluster_address; -SELECT @@global.wsrep_on; -SHOW STATUS LIKE 'threads_connected'; -SHOW STATUS LIKE 'wsrep_thread_count'; ---echo - -SET @wsrep_slave_threads_saved= @@global.wsrep_slave_threads; -SET GLOBAL wsrep_slave_threads= 10; - ---echo # Wait for 9 applier threads to get created. ---let $wait_condition = SELECT VARIABLE_VALUE = 10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; ---source include/wait_condition.inc - -SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; -SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_rollbacker_thread_count'; -SELECT VARIABLE_VALUE AS EXPECT_11 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_thread_count'; - -SHOW STATUS LIKE 'threads_connected'; - -# -# privileges for wsrep_on -# -set wsrep_on=0; -set wsrep_on=1; ---source include/wait_until_connected_again.inc -create user test@localhost; -connect con1,localhost,test; -set auto_increment_increment=10; ---error ER_SPECIFIC_ACCESS_DENIED_ERROR -set wsrep_on=0; -disconnect con1; -connection default; -drop user test@localhost; - ---echo # ---echo # MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash ---echo # -SET @wsrep_sst_auth_saved= @@global.wsrep_sst_auth; -SET @@global.wsrep_sst_auth= 'user:pass'; -SELECT @@global.wsrep_sst_auth; -SET @@global.wsrep_sst_auth= ''; -SELECT @@global.wsrep_sst_auth; -SET @@global.wsrep_sst_auth= NULL; -SELECT @@global.wsrep_sst_auth; -SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved; - -# Reset (for mtr internal checks) - ---disable_query_log -SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved; -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; -SET GLOBAL wsrep_cluster_address= @wsrep_cluster_address_saved; -SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved; ---enable_query_log ---source include/galera_wait_ready.inc +--echo # variables ---echo # End of test. +SELECT COUNT(*) AS EXPECT_49 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%"; +SELECT COUNT(*) AS EXPECT_49 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%"; +SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME; +SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME; diff --git a/mysql-test/suite/wsrep/t/wsrep_on_basic.opt b/mysql-test/suite/wsrep/t/wsrep_on_basic.opt new file mode 100644 index 00000000000..9da4dd32881 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_on_basic.opt @@ -0,0 +1 @@ +--wsrep-provider=$WSREP_PROVIDER --binlog_format=ROW --wsrep-cluster-address=gcomm:// diff --git a/mysql-test/suite/sys_vars/t/wsrep_on_basic.test b/mysql-test/suite/wsrep/t/wsrep_on_basic.test index 229d771b5e7..98062dbec83 100644 --- a/mysql-test/suite/sys_vars/t/wsrep_on_basic.test +++ b/mysql-test/suite/wsrep/t/wsrep_on_basic.test @@ -1,4 +1,6 @@ --source include/have_wsrep.inc +--source include/have_wsrep_provider.inc +--source include/have_innodb.inc --echo # --echo # wsrep_on diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.cnf b/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.cnf new file mode 100644 index 00000000000..b73146d26e7 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.cnf @@ -0,0 +1,12 @@ +# Use default setting for mysqld processes +!include include/default_mysqld.cnf + +[mysqld.1] +wsrep-on=ON +binlog-format=ROW +wsrep-provider=@ENV.WSREP_PROVIDER +wsrep-cluster-address='gcomm://' +#galera_port=@OPT.port +#ist_port=@OPT.port +#sst_port=@OPT.port + diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.test b/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.test new file mode 100644 index 00000000000..b44c9c5ebc8 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.test @@ -0,0 +1,38 @@ +--source include/have_wsrep.inc +--source include/have_innodb.inc + +SELECT @@wsrep_on; + +SET @wsrep_slave_threads_global_saved = @@global.wsrep_slave_threads; +SET @wsrep_debug_saved = @@global.wsrep_debug; +SET @wsrep_provider_options_saved= @@global.wsrep_provider_options; +SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address; + +SET GLOBAL wsrep_provider=none; + +--error ER_WRONG_ARGUMENTS +SET SESSION wsrep_trx_fragment_size=DEFAULT; +SELECT @@session.wsrep_trx_fragment_size; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL wsrep_start_position='12345678-1234-1234-1234-123456789012:100'; +SHOW WARNINGS; +SELECT @@global.wsrep_start_position; +SET GLOBAL wsrep_debug=1; +SELECT @@global.wsrep_debug; +SET GLOBAL wsrep_slave_threads=5; +SELECT @@global.wsrep_slave_threads; +--error ER_WRONG_ARGUMENTS +SET GLOBAL wsrep_desync=1; +SELECT @@global.wsrep_desync; +--error ER_WRONG_ARGUMENTS +SET SESSION wsrep_trx_fragment_unit='rows'; +SELECT @@session.wsrep_trx_fragment_unit; + +--disable_query_log +eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; +SET GLOBAL wsrep_cluster_address= @wsrep_cluster_address_saved; +SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved; +--source include/galera_wait_ready.inc +SET @@global.wsrep_slave_threads = @wsrep_slave_threads_global_saved; +SET @@global.wsrep_debug = @wsrep_debug_saved; +--enable_query_log diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf new file mode 100644 index 00000000000..2e66b1ef23c --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf @@ -0,0 +1,12 @@ +# Use default setting for mysqld processes +!include include/default_mysqld.cnf + +[mysqld] +wsrep-on=OFF + +[mysqld.1] +wsrep-on=OFF +#galera_port=@OPT.port +#ist_port=@OPT.port +#sst_port=@OPT.port + diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.test b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.test new file mode 100644 index 00000000000..4a9cd2bad5f --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.test @@ -0,0 +1,30 @@ +--source include/have_wsrep.inc +--source include/have_innodb.inc + +SELECT @@wsrep_on; + +SET @wsrep_slave_threads_global_saved = @@global.wsrep_slave_threads; +SET @wsrep_debug_saved = @@global.wsrep_debug; + +--error ER_WRONG_ARGUMENTS +SET SESSION wsrep_trx_fragment_size=DEFAULT; +SELECT @@session.wsrep_trx_fragment_size; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL wsrep_start_position='12345678-1234-1234-1234-123456789012:100'; +SHOW WARNINGS; +SELECT @@global.wsrep_start_position; +SET GLOBAL wsrep_debug=1; +SELECT @@global.wsrep_debug; +SET GLOBAL wsrep_slave_threads=5; +SELECT @@global.wsrep_slave_threads; +--error ER_WRONG_ARGUMENTS +SET GLOBAL wsrep_desync=1; +SELECT @@global.wsrep_desync; +--error ER_WRONG_ARGUMENTS +SET SESSION wsrep_trx_fragment_unit='rows'; +SELECT @@session.wsrep_trx_fragment_unit; + +--disable_query_log +SET @@global.wsrep_slave_threads = @wsrep_slave_threads_global_saved; +SET @@global.wsrep_debug = @wsrep_debug_saved; +--enable_query_log diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index 30171bfe084..df4a1e74447 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,190 +23,174 @@ # ############################################################################## # -# Based on bb-10.4-release 80c951ce2875aac521b82323b5b6ebf638593445 -# Sat Oct 31 21:06:49 2020 +0100 : Merge branch '10.3' into 10.4 +# Based on bb-10.4-release d348555cd (MDEV-23328 Server hang due to Galera lock conflict resolution) +# for main suite changes and failures, and +# bb-10.4-release 80c951ce2875aac521b82323b5b6ebf638593445 +# for the rest + -main.alter_table : Modified in 10.4.16 main.alter_table_trans : MDEV-12084 - timeout main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result -main.aria_icp_debug : Added in 10.4.16 main.auth_named_pipe : MDEV-14724 - System error 2 -main.backup_locks : Modified in 10.4.16 +main.auto_increment_ranges_innodb : Modified in 10.4.18 main.backup_stages : MDEV-23401 - Bad file descriptor main.binary_to_hex : MDEV-20211 - Wrong result -main.blackhole : Modified in 10.4.16 -main.bootstrap_innodb : Added in 10.4.16 +main.check_constraint : Modified in 10.4.18 main.connect : MDEV-17282 - Wrong result main.connect-abstract : MDEV-20162 - Could not execute 'check-testcase' main.connect2 : MDEV-13885 - Server crash -main.count_distinct2 : MDEV-11768 - timeout +main.create : Modified in 10.4.18 main.create_delayed : MDEV-10605 - failed with timeout main.create_drop_event : MDEV-16271 - Wrong result -main.ctype_binary : MDEV-24080 - Data too long for column; include file modified in 10.4.16 -main.ctype_cp1251 : Include file modified in 10.4.16 +main.cte_nonrecursive : Modified in 10.4.18 +main.cte_nonrecursive_not_embedded : Added in 10.4.18 +main.cte_recursive : Modified in 10.4.18 +main.ctype_binary : MDEV-24080 - Data too long for column main.ctype_cp932_binlog_stm : MDEV-20534 - Wrong result -main.ctype_filename : Modified in 10.4.16 -main.ctype_latin1 : Include file modified in 10.4.16 -main.ctype_ucs : MDEV-17681 - Data too long for column; include file modified in 10.4.16 +main.ctype_ucs : MDEV-17681 - Data too long for column main.ctype_upgrade : MDEV-16945 - Error upon mysql_upgrade main.ctype_utf16 : MDEV-10675: timeout or extra warnings main.ctype_utf16le : MDEV-10675: timeout or extra warnings -main.ctype_utf8 : Modified in 10.4.16 -main.ctype_utf8mb4_innodb : MDEV-17744 - Timeout; MDEV-18567 - ASAN use-after-poison +main.ctype_utf8mb4 : Modified in 10.4.18 +main.ctype_utf8mb4_heap : Include file modified in 10.4.18 +main.ctype_utf8mb4_innodb : MDEV-17744 - Timeout; MDEV-18567 - ASAN use-after-poison; include file modified in 10.4.18 +main.ctype_utf8mb4_myisam : Include file modified in 10.4.18 main.debug_sync : MDEV-10607 - internal error main.delayed : MDEV-20961 - Assertion failure -main.derived_cond_pushdown : MDEV-20532 - Floating point differences -main.derived_opt : MDEV-11768 - timeout +main.derived_cond_pushdown : MDEV-20532 - Floating point differences; modified in 10.4.18 main.dirty_close : MDEV-19368 - mysqltest failed but provided no output main.distinct : MDEV-14194 - Crash main.drop_bad_db_type : MDEV-15676 - Wrong result main.dyncol : MDEV-19455 - Extra warning -main.empty_server_name-8224 : Modified in 10.4.16 -main.errors : Modified in 10.4.16 +main.empty_string_literal : Modified in 10.4.18 main.events_2 : MDEV-13277 - Crash main.events_bugs : MDEV-12892 - Crash main.events_restart : MDEV-12236 - Server shutdown problem main.events_slowlog : MDEV-12821 - Wrong result -main.fast_prefix_index_fetch_innodb : Modified in 10.4.16 main.flush : MDEV-19368 - mysqltest failed but provided no output main.flush_ssl : MDEV-21276 - Aria recovery failure -main.func_gconcat : MDEV-21379 - Valgrind warnings -main.func_json : Modified in 10.4.16 -main.func_math : MDEV-20966 - Wrong error code; modified in 10.4.16 -main.func_test : Modified in 10.4.16 +main.func_gconcat : MDEV-21379 - Valgrind warnings; modified in 10.4.18 +main.func_like : Modified in 10.4.18 +main.func_math : MDEV-20966 - Wrong error code main.gis : MDEV-13411 - wrong result on P8 +main.gis-json : Modified in 10.4.18 main.gis_notembedded : MDEV-21264 - Wrong result with non-default charset -main.grant : Modified in 10.4.16 -main.grant5 : Modified in 10.4.16 +main.group_by : Modified in 10.4.18 main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown -main.implicit_commit : Modified in 10.4.16 main.index_intersect_innodb : MDEV-10643 - failed with timeout main.index_merge_innodb : MDEV-7142 - Plan mismatch -main.information_schema : Modified in 10.4.16 -main.innodb_ext_key : Modified in 10.4.16 +main.information_schema : Modified in 10.4.18 main.innodb_icp : MDEV-20168 - Wrong execution plans -main.innodb_icp_debug : Added in 10.4.16 -main.invisible_field : Modified in 10.4.16 +main.innodb_mrr_cpk : MDEV-24737 - Server crash main.invisible_field_grant_completely : MDEV-22254 - Syscall param write points to uninitialised bytes main.ipv4_and_ipv6 : MDEV-20964 - Wrong result main.ipv6 : MDEV-20964 - Wrong result main.join_cache : MDEV-17743 - Bad address from storage engine MyISAM -main.kill : Modified in 10.4.16 +main.kill : MDEV-24801 - Wrong errno on reap; modified in 10.4.18 main.kill-2 : MDEV-13257 - Wrong result main.kill_processlist-6619 : MDEV-10793 - Wrong result -main.limit_rows_examined : Modified in 10.4.16 main.loaddata : MDEV-19368 - mysqltest failed but provided no output main.locale : MDEV-20521 - Missing warning -main.lock_view : Added in 10.4.16 +main.lock_tables_lost_commit : MDEV-24624 - Timeout +main.lock_user : Modified in 10.4.18 +main.lock_view : Modified in 10.4.18 main.log_slow : MDEV-13263 - Wrong result -main.log_tables : Modified in 10.4.16 main.log_tables-big : MDEV-13408 - wrong result main.log_tables_upgrade : MDEV-20962 - Wrong result main.mdev-504 : MDEV-15171 - warning main.mdev375 : MDEV-10607 - sporadic "can't connect" main.merge : MDEV-10607 - sporadic "can't connect" -main.multi_update_big : Modified in 10.4.16 -main.myisam_icp_debug : Added in 10.4.16 -main.myisam_repair : Added in 10.4.16 +main.myisam : Modified in 10.4.18 main.mysql : MDEV-20156 - Wrong result main.mysql_client_test : MDEV-19369 - error: 5888, status: 23, errno: 2; MDEV-19511 - Big endian issue main.mysql_client_test_comp : MDEV-16641 - Error in exec main.mysql_client_test_nonblock : CONC-208 - Error on Power; MDEV-15096 - exec failed main.mysql_cp932 : MDEV-21275 - Wrong result -main.mysql_upgrade : MDEV-20161 - Wrong result; MDEV-20166 - FATAL ERROR: Upgrade failed; modified in 10.4.16 +main.mysql_upgrade : MDEV-20161 - Wrong result; MDEV-20166 - FATAL ERROR: Upgrade failed; modified in 10.4.18 main.mysql_upgrade-6984 : MDEV-22514 - Wrong result main.mysql_upgrade_no_innodb : MDEV-20537 - Wrong result main.mysql_upgrade_noengine : MDEV-14355 - Wrong result main.mysql_upgrade_view : MDEV-20161 - Wrong result; MDEV-23392 - Wrong result main.mysqladmin : MDEV-20535 - Wrong result -main.mysqlbinlog_row_minimal : Modified in 10.4.16 main.mysqlcheck : MDEV-20164 - Wrong result -main.mysqld--help : Modified in 10.4.16 main.mysqld_option_err : MDEV-21236 - Wrong error; MDEV-21571 - Crash on bootstrap -main.mysqldump : MDEV-14800 - Stack smashing detected; modified in 10.4.16 +main.mysqldump : Modified in 10.4.18 main.mysqldump-max : MDEV-21272 - Wrong result -main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug +main.mysqldump-system : Modified in 10.4.18 main.mysqlshow : MDEV-20965 - Wrong result main.mysqlslap : MDEV-11801 - timeout main.mysqltest : MDEV-13887 - Wrong result -main.named_pipe : Modified in 10.4.16 main.old-mode : MDEV-19373 - Wrong result main.openssl_6975 : MDEV-17184 - Failures with OpenSSL 1.1.1 -main.order_by : Modified in 10.4.16 +main.order_by : Modified in 10.4.18 main.order_by_optimizer_innodb : MDEV-10683 - Wrong result -main.parser : Modified in 10.4.16 -main.partition : Modified in 10.4.16 +main.parser : Modified in 10.4.18 main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock main.partition_innodb : MDEV-20169 - Wrong result; MDEV-23427 - Server crash main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings main.partition_innodb_semi_consistent : MDEV-19411 - Failed to start mysqld.1 main.plugin_auth : MDEV-20957 - Upgrade file was not properly created main.plugin_auth_qa_2 : MDEV-20165 - Wrong result -main.plugin_innodb : Modified in 10.4.16 -main.pool_of_threads : MDEV-18135 - SSL error: key too small; modified in 10.4.16 -main.precedence : Added in 10.4.16 -main.precedence_bugs : Added in 10.4.16 -main.processlist_notembedded : Modified in 10.4.16 +main.pool_of_threads : MDEV-18135 - SSL error: key too small +main.precedence : Modified in 10.4.18 +main.processlist_notembedded : MDEV-23752 - Not explainable command; modified in 10.4.18 main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count main.ps_error : MDEV-24079 - Memory not freed -main.query_cache : MDEV-16180 - Wrong result +main.ps_show_log : Added in 10.4.18 +main.query_cache : MDEV-16180 - Wrong result; modified in 10.4.18 main.query_cache_debug : MDEV-15281 - Query cache is disabled -main.range : Modified in 10.4.16 +main.range : Modified in 10.4.18 main.range_innodb : MDEV-23371 - Server crash +main.range_notembedded : Added in 10.4.18 main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away -main.rowid_filter : Modified in 10.4.16 main.rowid_filter_innodb : MDEV-20538 - Wrong result -main.rowid_filter_innodb_debug : Added in 10.4.16 -main.rowid_filter_myisam_debug : Added in 10.4.16 main.select : MDEV-20532 - Floating point differences main.select_jcl6 : MDEV-20532 - Floating point differences main.select_pkeycache : MDEV-20532 - Floating point differences +main.set_password : Modified in 10.4.18 main.set_statement : MDEV-13183 - Wrong result -main.set_statement_notembedded : MDEV-19414 - Wrong result; modified in 10.4.16 +main.set_statement_notembedded : MDEV-19414 - Wrong result main.shm : MDEV-12727 - Mismatch, ERROR 2013 main.show_explain : MDEV-10674 - Wrong result code -main.sp : MDEV-7866 - Mismatch; modified in 10.4.16 -main.sp-destruct : Modified in 10.4.16 +main.skip_grants : Modified in 10.4.18 +main.sp : MDEV-7866 - Mismatch; modified in 10.4.18 main.sp-security : MDEV-10607 - sporadic "can't connect" +main.sp-ucs2 : Modified in 10.4.18 main.sp_notembedded : MDEV-10607 - internal error main.ssl : MDEV-17184 - Failures with OpenSSL 1.1.1 main.ssl_7937 : MDEV-20958 - Wrong result main.ssl_ca : MDEV-10895 - SSL connection error on Power main.ssl_cipher : MDEV-17184 - Failures with OpenSSL 1.1.1 main.ssl_timeout : MDEV-11244 - Crash +main.stat_tables : Modified in 10.4.18 main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding main.status : MDEV-13255 - Wrong result main.subselect : MDEV-20551 - Valgrind failure -main.subselect4 : Modified in 10.4.16 -main.subselect_innodb : MDEV-10614 - Wrong result; modified in 10.4.16 -main.sum_distinct-big : Modified in 10.4.16 +main.subselect4 : Modified in 10.4.18 +main.subselect_innodb : MDEV-10614 - Wrong result +main.table_value_constr : Modified in 10.4.18 main.tc_heuristic_recover : MDEV-14189 - Wrong result -main.temp_table_symlink : MDEV-24058 - Wrong error code; added in 10.4.16 -main.type_blob : MDEV-15195 - Wrong result; modified in 10.4.16 -main.type_date : Modified in 10.4.16 -main.type_datetime : Modified in 10.4.16 +main.temp_table_symlink : MDEV-24058 - Wrong error code +main.type_blob : MDEV-15195 - Wrong result main.type_datetime_hires : MDEV-10687 - Timeout -main.type_float : MDEV-20532 - Floating point differences; modified in 10.4.16 -main.type_newdecimal : MDEV-20532 - Floating point differences; modified in 10.4.16 +main.type_float : MDEV-20532 - Floating point differences +main.type_newdecimal : MDEV-20532 - Floating point differences main.type_ranges : MDEV-20532 - Floating point differences main.type_temporal_innodb : MDEV-24025 - Wrong result -main.type_time : Modified in 10.4.16 -main.udf : Modified in 10.4.16 -main.upgrade_MDEV-19650 : Re-enabled in 10.4.16 +main.type_year : Modified in 10.4.18 +main.union : Modified in 10.4.18 +main.user_limits : Modified in 10.4.18 main.userstat : MDEV-12904 - SSL errors -main.view : Modified in 10.4.16 +main.view : Modified in 10.4.18 main.wait_timeout : MDEV-19023 - Lost connection to MySQL server during query -main.win : Modified in 10.4.16 -main.windows_debug : Added in 10.4.16 -main.xa : MDEV-11769 - lock wait timeout +main.xa : MDEV-11769 - lock wait timeout; modified in 10.4.18 #----------------------------------------------------------------------- -archive.archive-big : MDEV-20167 - Wrong error code -archive.archive_bitfield : MDEV-11771 - table is marked as crashed -archive.archive_symlink : MDEV-12170 - unexpected error on rmdir -archive.discover : MDEV-10510 - Table is marked as crashed -archive.mysqlhotcopy_archive : MDEV-10995 - Hang on debug +archive.archive-big : MDEV-20167 - Wrong error code +archive.archive_bitfield : MDEV-11771 - table is marked as crashed +archive.archive_symlink : MDEV-12170 - unexpected error on rmdir +archive.discover : MDEV-10510 - Table is marked as crashed #----------------------------------------------------------------------- @@ -214,56 +198,45 @@ archive-test_sql_discovery.discover : MDEV-16817 - Table marked as crashed #----------------------------------------------------------------------- -binlog.binlog_commit_wait : MDEV-10150 - Mismatch -binlog.binlog_innodb : MDEV-22516 - Wrong result -binlog.binlog_ioerr : MDEV-20159 - Assertion failure -binlog.binlog_killed : MDEV-12925 - Wrong result -binlog.binlog_max_extension : MDEV-19762 - Crash on shutdown -binlog.binlog_mysqlbinlog_row : Modified in 10.4.16 -binlog.binlog_mysqlbinlog_row_frag : Modified in 10.4.16 -binlog.binlog_mysqlbinlog_row_innodb : MDEV-20530 - Binary files differ -binlog.binlog_mysqlbinlog_row_myisam : MDEV-20530 - Binary files differ -binlog.binlog_no_uniqfile_crash : MDEV-24078 - Server crash upon shutdown -binlog.binlog_recover_checksum_error : Added in 10.4.16 -binlog.binlog_row_binlog : MDEV-23402 - Wrong result -binlog.binlog_show_binlog_event_random_pos : Modified in 10.4.16 -binlog.binlog_stm_binlog : MDEV-20412 - Wrong result -binlog.binlog_stm_mix_innodb_myisam : MDEV-24057 - Wrong result -binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint -binlog.flashback-largebinlog : MDEV-19764 - Out of memory -binlog.load_data_stm_view : MDEV-16948 - Wrong result -binlog.show_concurrent_rotate : MDEV-20215 - Wrong result - -#----------------------------------------------------------------------- - -binlog_encryption.binlog_xa_recover : MDEV-12908 - Extra checkpoint -binlog_encryption.encrypted_master : MDEV-23637 - Assertion failure; MDEV-14201 - Extra warnings -binlog_encryption.encrypted_master_switch_to_unencrypted : MDEV-14190 - Can't init tc log -binlog_encryption.encrypted_slave : MDEV-18135 - SSL error: key too small -binlog_encryption.encryption_combo : MDEV-14199 - Table is marked as crashed -binlog_encryption.multisource : MDEV-21289 - Wrong error code -binlog_encryption.rpl_binlog_errors : MDEV-12742 - Crash -binlog_encryption.rpl_checksum : MDEV-16951 - Wrong result -binlog_encryption.rpl_corruption : MDEV-20159 - Assertion failure; MDEV-20953 - Wrong error code -binlog_encryption.rpl_gtid_basic : MDEV-16947 - Server failed to start -binlog_encryption.rpl_incident : MDEV-21569 - mutex: LOCK_global_system_variables unlocking -binlog_encryption.rpl_loadfile : MDEV-16645 - Timeout in include -binlog_encryption.rpl_mixed_binlog_max_cache_size : MDEV-20956 - Incorrect checksum for freed object -binlog_encryption.rpl_parallel : MDEV-10653 - Timeout in include -binlog_encryption.rpl_parallel_ignored_errors : MDEV-22471 - Slave crash -binlog_encryption.rpl_relayrotate : MDEV-15194 - Timeout -binlog_encryption.rpl_semi_sync : MDEV-11673 - Valgrind -binlog_encryption.rpl_skip_replication : MDEV-13571 - Unexpected warning; MDEV-20573 - Wrong result -binlog_encryption.rpl_ssl : MDEV-14507 - Timeouts -binlog_encryption.rpl_stm_relay_ign_space : MDEV-19375 - Test assertion failed -binlog_encryption.rpl_temporal_format_default_to_default : MDEV-21273 - Timeout -binlog_encryption.rpl_temporal_format_mariadb53_to_mysql56 : MDEV-20159 - Assertion failure -binlog_encryption.rpl_typeconv : MDEV-14362 - Lost connection to MySQL server during query - -#----------------------------------------------------------------------- - -compat/oracle.parser : Modified in 10.4.16 -compat/oracle.sp-package : Modified in 10.4.16 +binlog.binlog_commit_wait : MDEV-10150 - Mismatch +binlog.binlog_innodb : MDEV-22516 - Wrong result +binlog.binlog_killed : MDEV-12925 - Wrong result +binlog.binlog_max_extension : MDEV-19762 - Crash on shutdown +binlog.binlog_mysqlbinlog_row_innodb : MDEV-20530 - Binary files differ +binlog.binlog_mysqlbinlog_row_myisam : MDEV-20530 - Binary files differ +binlog.binlog_no_uniqfile_crash : MDEV-24078 - Server crash upon shutdown +binlog.binlog_row_binlog : MDEV-23402 - Wrong result +binlog.binlog_stm_binlog : MDEV-20412 - Wrong result +binlog.binlog_stm_mix_innodb_myisam : MDEV-24057 - Wrong result +binlog.binlog_xa_recover : MDEV-12908 - Extra checkpoint +binlog.flashback-largebinlog : MDEV-19764 - Out of memory +binlog.load_data_stm_view : MDEV-16948 - Wrong result +binlog.show_concurrent_rotate : MDEV-20215 - Wrong result + +#----------------------------------------------------------------------- + +binlog_encryption.binlog_xa_recover : MDEV-12908 - Extra checkpoint +binlog_encryption.encrypted_master : MDEV-23637 - Assertion failure; MDEV-14201 - Extra warnings +binlog_encryption.encrypted_master_switch_to_unencrypted : MDEV-14190 - Can't init tc log +binlog_encryption.encrypted_slave : MDEV-18135 - SSL error: key too small +binlog_encryption.encryption_combo : MDEV-14199 - Table is marked as crashed +binlog_encryption.multisource : MDEV-21289 - Wrong error code +binlog_encryption.rpl_binlog_errors : MDEV-12742 - Crash +binlog_encryption.rpl_checksum : MDEV-16951 - Wrong result +binlog_encryption.rpl_corruption : MDEV-20953 - Wrong error code +binlog_encryption.rpl_gtid_basic : MDEV-16947 - Server failed to start +binlog_encryption.rpl_incident : MDEV-21569 - mutex: LOCK_global_system_variables unlocking +binlog_encryption.rpl_loadfile : MDEV-16645 - Timeout in include +binlog_encryption.rpl_mixed_binlog_max_cache_size : MDEV-20956 - Incorrect checksum for freed object +binlog_encryption.rpl_parallel : MDEV-10653 - Timeout in include +binlog_encryption.rpl_parallel_ignored_errors : MDEV-22471 - Slave crash +binlog_encryption.rpl_relayrotate : MDEV-15194 - Timeout +binlog_encryption.rpl_semi_sync : MDEV-11673 - Valgrind +binlog_encryption.rpl_skip_replication : MDEV-13571 - Unexpected warning; MDEV-20573 - Wrong result +binlog_encryption.rpl_ssl : MDEV-14507 - Timeouts +binlog_encryption.rpl_stm_relay_ign_space : MDEV-19375 - Test assertion failed +binlog_encryption.rpl_temporal_format_default_to_default : MDEV-21273 - Timeout +binlog_encryption.rpl_typeconv : MDEV-14362 - Lost connection to MySQL server during query #----------------------------------------------------------------------- @@ -274,7 +247,6 @@ connect.part_file : MDEV-18135 - SSL error: key too small connect.part_table : MDEV-18135 - SSL error: key too small connect.pivot : MDEV-14803 - Failed to discover table connect.secure_file_priv : MDEV-18135 - SSL error: key too small -connect.updelx : Modified in 10.4.16 connect.vcol : MDEV-12374 - Fails on Windows connect.zip : MDEV-13884 - Wrong result @@ -284,9 +256,7 @@ disks.disks_notembedded : MDEV-21587 - Wrong result #----------------------------------------------------------------------- -encryption.corrupted_during_recovery : MDEV-20159 - Assertion failure -encryption.create_or_replace : MDEV-24081 - Lock wait timeout exceeded; modified in 10.4.16 -encryption.create_or_replace_big : Added in 10.4.16 +encryption.create_or_replace : MDEV-24081 - Lock wait timeout exceeded encryption.debug_key_management : MDEV-13841 - Timeout encryption.encrypt_and_grep : MDEV-13765 - Wrong result encryption.innochecksum : MDEV-13644 - Assertion failure @@ -298,11 +268,8 @@ encryption.innodb-first-page-read : MDEV-14356 - Timeout in wait encryption.innodb-force-corrupt : MDEV-17286 - SSL error encryption.innodb-missing-key : MDEV-14728 - SSL error encryption.innodb-page_encryption : MDEV-10641 - mutex problem -encryption.innodb-page_encryption_compression : Modified in 10.4.16 -encryption.innodb-page_encryption_log_encryption : MDEV-17339 - Crash on restart; modified in 10.4.16 +encryption.innodb-page_encryption_log_encryption : MDEV-17339 - Crash on restart encryption.innodb-read-only : MDEV-16563 - Crash on startup -encryption.innodb-redo-badkey : MDEV-12898 - Server hang on startup -encryption.innodb-redo-nokeys : MDEV-20159 - Assertion failure encryption.innodb-remove-encryption : MDEV-16493 - Timeout in wait condition encryption.innodb-spatial-index : MDEV-13746 - Wrong result encryption.innodb_encrypt_key_rotation_age : MDEV-19763 - Timeout @@ -313,7 +280,6 @@ encryption.innodb_encryption : MDEV-14728 - Unable to get ce encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure encryption.innodb_encryption_discard_import : MDEV-16116 - Wrong result encryption.innodb_encryption_filekeys : MDEV-15673 - Timeout -encryption.innodb_encryption_is : MDEV-12898 - Server hang on startup encryption.innodb_encryption_row_compressed : MDEV-16113 - Crash encryption.innodb_encryption_tables : MDEV-17339 - Crash on restart encryption.innodb_first_page : MDEV-10689 - Crash @@ -321,7 +287,6 @@ encryption.innodb_onlinealter_encryption : MDEV-17287 - SIGABRT on serve encryption.innodb_scrub : MDEV-8139 - scrubbing tests need fixing (fixed in 10.5+) encryption.innodb_scrub_background : MDEV-8139 - scrubbing tests need fixing (fixed in 10.5+) encryption.innodb_scrub_compressed : MDEV-8139 - scrubbing tests need fixing (fixed in 10.5+) -encryption.tempfiles_encrypted : Modified in 10.4.16 #----------------------------------------------------------------------- @@ -338,13 +303,12 @@ engines/rr_trx.* : MDEV-10998 - Not maintained #----------------------------------------------------------------------- -federated.federated_bug_35333 : MDEV-13410 - Wrong result -federated.federated_bug_585688 : MDEV-14805 - Server crash, MDEV-12907 - Valgrind -federated.federated_innodb : MDEV-10617 - Wrong checksum -federated.federated_partition : MDEV-10417 - Fails on Mips -federated.federated_transactions : MDEV-10617 - Wrong checksum -federated.federatedx : MDEV-10617 - Wrong checksum -federated.federatedx_create_handlers : Modified in 10.4.16 +federated.federated_bug_35333 : MDEV-13410 - Wrong result +federated.federated_bug_585688 : MDEV-14805 - Server crash, MDEV-12907 - Valgrind +federated.federated_innodb : MDEV-10617 - Wrong checksum +federated.federated_partition : MDEV-10417 - Fails on Mips +federated.federated_transactions : MDEV-10617 - Wrong checksum +federated.federatedx : MDEV-10617 - Wrong checksum #----------------------------------------------------------------------- @@ -371,18 +335,12 @@ galera_3nodes.* : Suite is not stable yet #----------------------------------------------------------------------- -gcol.gcol_keys_innodb : Include file modified in 10.4.16 -gcol.gcol_keys_myisam : Include file modified in 10.4.16 -gcol.gcol_partition_innodb : Include file modified in 10.4.16 -gcol.gcol_update : Include file modified in 10.4.16 -gcol.innodb_virtual_basic : MDEV-16950 - Failing assertion -gcol.innodb_virtual_debug : MDEV-23404 - Server crash -gcol.innodb_virtual_debug_purge : Include file modified in 10.4.16 -gcol.innodb_virtual_fk : MDEV-20640 - Assertion failure; modified in 10.4.16 -gcol.innodb_virtual_fk_restart : MDEV-17466 - Assertion failure -gcol.innodb_virtual_index : Modified in 10.4.16 -gcol.innodb_virtual_purge : MDEV-22952 - Lock wait timeout; include file modified in 10.4.16 -gcol.main_alter_table : MDEV-23403 - Wrong result +gcol.innodb_virtual_basic : MDEV-16950 - Failing assertion +gcol.innodb_virtual_debug : MDEV-23111 - Server crash +gcol.innodb_virtual_fk : MDEV-20640 - Assertion failure +gcol.innodb_virtual_fk_restart : MDEV-17466 - Assertion failure +gcol.innodb_virtual_purge : MDEV-22952 - Lock wait timeout +gcol.main_alter_table : MDEV-23403 - Wrong result #----------------------------------------------------------------------- @@ -390,31 +348,21 @@ innodb.101_compatibility : MDEV-13891 - Wrong result innodb.alter_copy : MDEV-16181 - Assertion failure innodb.alter_crash : MDEV-16944 - The process cannot access the file innodb.alter_large_dml : MDEV-20148 - Debug sync point wait timed out -innodb.alter_table : Modified in 10.4.16 innodb.binlog_consistent : MDEV-10618 - Server fails to start innodb.blob-crash : MDEV-20481 - Crash during recovery -innodb.create-index : MDEV-20159 - Assertion failure -innodb.default_row_format_compatibility : MDEV-20159 - Assertion failure innodb.doublewrite : MDEV-12905 - Server crash -innodb.foreign-keys : Modified in 10.4.16 -innodb.foreign_key : Modified in 10.4.16 innodb.group_commit_crash : MDEV-14191 - InnoDB registration failed innodb.group_commit_crash_no_optimize_thread : MDEV-11770 - Checksum mismatch innodb.ibuf_not_empty : MDEV-19021 - Wrong result -innodb.innodb : Modified in 10.4.16 innodb.innodb-32k-crash : MDEV-20194 - Extra warnings -innodb.innodb-64k : Modified in 10.4.16 innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS innodb.innodb-alter-table : MDEV-10619 - Testcase timeout innodb.innodb-bigblob : MDEV-18655 - ASAN unknown crash innodb.innodb-blob : MDEV-12053 - Client crash innodb.innodb-change-buffer-recovery : MDEV-19115 - Lost connection to MySQL server during query -innodb.innodb-dict : MDEV-20159 - Assertion failure innodb.innodb-fk : MDEV-13832 - Assertion failure on shutdown innodb.innodb-get-fk : MDEV-13276 - Server crash -innodb.innodb-index : Include file modified in 10.4.16 -innodb.innodb-index-debug : Include file modified in 10.4.16 innodb.innodb-index-online : MDEV-14809 - Cannot save statistics innodb.innodb-page_compression_default : MDEV-13644 - Assertion failure innodb.innodb-page_compression_lzma : MDEV-14353 - Wrong result @@ -422,15 +370,14 @@ innodb.innodb-page_compression_snappy : MDEV-13644 - Assertion failure innodb.innodb-page_compression_tables : MDEV-13644 - Assertion failure innodb.innodb-page_compression_zip : MDEV-10641 - mutex problem innodb.innodb-table-online : MDEV-13894 - Wrong result -innodb.innodb-timeout : MDEV-20159 - Assertion failure +innodb.innodb-ucs2 : MDEV-24505 - Assertion failure innodb.innodb-wl5522 : MDEV-13644 - Assertion failure innodb.innodb-wl5522-1 : MDEV-22945 - Server crash innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno innodb.innodb_buffer_pool_dump_pct : MDEV-20139 - Timeout in wait_condition.inc -innodb.innodb_buffer_pool_resize : MDEV-16964 - Assertion failure +innodb.innodb_buffer_pool_resize : MDEV-23637 - Assertion failure innodb.innodb_buffer_pool_resize_debug : MDEV-22515 - Timeout in wait_condition -innodb.innodb_buffer_pool_resize_with_chunks : MDEV-16964 - Assertion failure -innodb.innodb_bug14147491 : MDEV-11808 - Index is corrupt +innodb.innodb_buffer_pool_resize_with_chunks : MDEV-23637 - Assertion failure innodb.innodb_bug30423 : MDEV-7311 - Wrong result innodb.innodb_bug47167 : MDEV-20524 - Table 'user' is marked as crashed and should be repaired innodb.innodb_bug48024 : MDEV-14352 - Assertion failure @@ -440,50 +387,36 @@ innodb.innodb_force_recovery_rollback : MDEV-22889 - Wrong result innodb.innodb_information_schema : MDEV-8851 - Wrong result innodb.innodb_max_recordsize_32k : MDEV-14801 - Operation failed innodb.innodb_max_recordsize_64k : MDEV-15203 - Wrong result -innodb.innodb_monitor : MDEV-10939 - Testcase timeout innodb.innodb_mysql : MDEV-19873 - Wrong result innodb.innodb_simulate_comp_failures_small : MDEV-20526 - ASAN use-after-poison innodb.innodb_stats : MDEV-10682 - wrong result -innodb.innodb_stats_drop_locked : Modified in 10.4.16 innodb.innodb_stats_persistent : MDEV-21567 - Wrong result in execution plan innodb.innodb_stats_persistent_debug : MDEV-14801 - Operation failed innodb.innodb_sys_semaphore_waits : MDEV-10331 - Semaphore wait -innodb.innodb_trx_weight : Configuration deleted in 10.4.16 innodb.innodb_zip_innochecksum2 : MDEV-13882 - Warning: difficult to find free blocks -innodb.instant_alter_bugs : Modified in 10.4.16 -innodb.instant_alter_crash : Modified in 10.4.16 innodb.instant_alter_extend : MDEV-20963 - Binary files differ -innodb.instant_alter_index_rename : Modified in 10.4.16 -innodb.instant_alter_purge : Modified in 10.4.16 innodb.log_corruption : MDEV-13251 - Wrong result innodb.log_data_file_size : MDEV-14204 - Server failed to start; MDEV-20648 - Assertion failure -innodb.log_file : MDEV-20159 - Assertion failure innodb.log_file_name : MDEV-14193 - Exception innodb.log_file_size : MDEV-15668 - Not found pattern innodb.monitor : MDEV-16179 - Wrong result -innodb.page_id_innochecksum : MDEV-20159 - Assertion failure innodb.purge_secondary : MDEV-15681 - Wrong result innodb.purge_thread_shutdown : MDEV-13792 - Wrong result innodb.read_only_recovery : MDEV-13886 - Server crash innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile -innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace; modified in 10.4.16 -innodb.stats_persistent : Added in 10.4.16 +innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace innodb.table_definition_cache_debug : MDEV-14206 - Extra warning -innodb.table_flags : MDEV-13572 - Wrong result; MDEV-19374 - Server failed to start; modified in 10.4.16 +innodb.table_flags : MDEV-13572 - Wrong result; MDEV-19374 - Server failed to start innodb.temp_table_savepoint : MDEV-24077 - Assertion failure innodb.temporary_table : MDEV-13265 - Wrong result -innodb.truncate : Modified in 10.4.16 innodb.undo_truncate : MDEV-17340 - Server hung; MDEV-20840 - Sporadic timeout innodb.undo_truncate_recover : MDEV-17679 - Server has gone away; MDEV-19200 - Shutdown fails -innodb.update-cascade : Combinations added in 10.4.16 innodb.update_time : MDEV-14804 - Wrong result innodb.xa_recovery : MDEV-15279 - mysqld got exception #----------------------------------------------------------------------- -innodb_fts.basic : Modified in 10.4.16 innodb_fts.fulltext2 : MDEV-24074 - Server crash -innodb_fts.innodb_fts_misc_1 : Modified in 10.4.16 innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning innodb_fts.innodb_fts_plugin : MDEV-13888 - Errors in server log innodb_fts.innodb_fts_stopword_charset : MDEV-13259 - Table crashed @@ -493,20 +426,18 @@ innodb_fts.sync_ddl : MDEV-21568 - Errno: 2000; MDEV-18654 - innodb_gis.alter_spatial_index : MDEV-13745 - Server crash innodb_gis.gis_split_nan : MDEV-21678 - Cannot get geometry object -innodb_gis.rtree_add_index : Include file modified in 10.4.16 -innodb_gis.rtree_compress : Include file modified in 10.4.16 innodb_gis.rtree_compress2 : MDEV-16269 - Wrong result innodb_gis.rtree_concurrent_srch : MDEV-15284 - Wrong result with embedded -innodb_gis.rtree_purge : MDEV-15275 - Timeout; include file modified in 10.4.16 +innodb_gis.rtree_purge : MDEV-15275 - Timeout innodb_gis.rtree_recovery : MDEV-15274 - Error on check innodb_gis.rtree_split : MDEV-14208 - Too many arguments -innodb_gis.rtree_undo : MDEV-14456 - Timeout in include file; include file modified in 10.4.16 +innodb_gis.rtree_undo : MDEV-14456 - Timeout in include file innodb_gis.types : MDEV-15679 - Table is marked as crashed #----------------------------------------------------------------------- innodb_zip.cmp_per_index : MDEV-14490 - Table is marked as crashed -innodb_zip.create_options : MDEV-21329 - Assertion failure; MDEV-24076 - Assertion failure +innodb_zip.create_options : MDEV-24076 - Assertion failure innodb_zip.index_large_prefix_4k : MDEV-21679 - Row size too large innodb_zip.innochecksum : MDEV-14486 - Server failed to shut down innodb_zip.innochecksum_3 : MDEV-13279 - Extra warnings @@ -518,39 +449,32 @@ innodb_zip.wl6501_scale_1 : MDEV-13254 - Timeout, MDEV-14104 - Error 192 #----------------------------------------------------------------------- -maria.alter : Modified in 10.4.16 -maria.create : Modified in 10.4.16 maria.insert_select : MDEV-12757 - Timeout maria.insert_select-7314 : MDEV-16492 - Timeout maria.maria : MDEV-14430 - Extra warning -maria.maria-no-logging : MDEV-20196 - Crash on shutdown or server can't start; modified in 10.4.16 - -#----------------------------------------------------------------------- - -mariabackup.absolute_ibdata_paths : MDEV-16571 - Wrong result -mariabackup.apply-log-only : MDEV-20135 - Timeout -mariabackup.backup_ssl : MDEV-24073 - Server crash upon shutdown -mariabackup.create_with_data_directory_during_backup : MDEV-20159 - Assertion failure -mariabackup.data_directory : MDEV-15270 - Error on exec -mariabackup.ddl_incremental_encrypted : Added in 10.4.16 -mariabackup.full_backup : MDEV-16571 - Wrong result -mariabackup.huge_lsn : MDEV-18569 - Table doesn't exist -mariabackup.incremental_backup : MDEV-21222 - Memory allocation failure -mariabackup.incremental_ddl_during_backup : Modified in 10.4.16 -mariabackup.incremental_encrypted : MDEV-15667 - timeout -mariabackup.incremental_rocksdb : MDEV-20954 - Cannot access the file -mariabackup.innodb_redo_overwrite : MDEV-24023 - Wrong result; added in 10.4.16 -mariabackup.log_checksum_mismatch : MDEV-16571 - Wrong result -mariabackup.mdev-14447 : MDEV-15201 - Timeout -mariabackup.mlog_index_load : Modified in 10.4.16 -mariabackup.partial_exclude : MDEV-15270 - Error on exec -mariabackup.rpl_slave_info : Added in 10.4.16 -mariabackup.unencrypted_page_compressed : MDEV-18653 - Wrong error; include file modified in 10.4.16 -mariabackup.xb_compressed_encrypted : MDEV-14812 - Segmentation fault -mariabackup.xb_file_key_management : MDEV-16571 - Wrong result -mariabackup.xb_page_compress : MDEV-14810 - status: 1, errno: 11 -mariabackup.xb_partition : MDEV-17584 - Crash upon shutdown -mariabackup.xb_rocksdb : MDEV-17338 - Server hung on shutdown +maria.maria-no-logging : MDEV-20196 - Crash on shutdown or server can't start + +#----------------------------------------------------------------------- + +mariabackup.absolute_ibdata_paths : MDEV-16571 - Wrong result +mariabackup.apply-log-only : MDEV-20135 - Timeout +mariabackup.backup_ssl : MDEV-24073 - Server crash upon shutdown +mariabackup.data_directory : MDEV-15270 - Error on exec +mariabackup.full_backup : MDEV-16571 - Wrong result +mariabackup.huge_lsn : MDEV-18569 - Table doesn't exist +mariabackup.incremental_backup : MDEV-21222 - Memory allocation failure +mariabackup.incremental_encrypted : MDEV-15667 - timeout +mariabackup.incremental_rocksdb : MDEV-20954 - Cannot access the file +mariabackup.innodb_redo_overwrite : MDEV-24023 - Wrong result +mariabackup.log_checksum_mismatch : MDEV-16571 - Wrong result +mariabackup.mdev-14447 : MDEV-15201 - Timeout +mariabackup.partial_exclude : MDEV-15270 - Error on exec +mariabackup.unencrypted_page_compressed : MDEV-18653 - Wrong error +mariabackup.xb_compressed_encrypted : MDEV-14812 - Segmentation fault +mariabackup.xb_file_key_management : MDEV-16571 - Wrong result +mariabackup.xb_page_compress : MDEV-14810 - status: 1, errno: 11 +mariabackup.xb_partition : MDEV-17584 - Crash upon shutdown +mariabackup.xb_rocksdb : MDEV-17338 - Server hung on shutdown #----------------------------------------------------------------------- @@ -575,8 +499,6 @@ multi_source.load_data : MDEV-21235 - Slave crash multi_source.mdev-8874 : MDEV-19415 - AddressSanitizer: heap-use-after-free multi_source.mdev-9544 : MDEV-19415 - AddressSanitizer: heap-use-after-free multi_source.multisource : MDEV-10417 - Fails on Mips -multi_source.reset_slave : MDEV-10690 - Wrong result -multi_source.simple : MDEV-4633 - Wrong result multi_source.status_vars : MDEV-4632 - failed while waiting for Slave_received_heartbeats #----------------------------------------------------------------------- @@ -596,7 +518,6 @@ parts.partition_debug_innodb : MDEV-10891 - Can't create UNIX socket; parts.partition_exch_qa_10 : MDEV-11765 - wrong result parts.partition_innodb_status_file : MDEV-12901 - Valgrind parts.partition_special_innodb : MDEV-16942 - Timeout -parts.reorganize : Added in 10.4.16 #----------------------------------------------------------------------- @@ -635,16 +556,10 @@ perfschema_stress.* : MDEV-10996 - Not maintained #----------------------------------------------------------------------- -period.delete : Modified in 10.4.16 -period.update : Modified in 10.4.16 -period.versioning : MDEV-20159 - Assertion failure - -#----------------------------------------------------------------------- - plugins.feedback_plugin_send : MDEV-7932, MDEV-11118 - Connection problems and such plugins.multiauth : MDEV-20163 - Plugin could not be loaded plugins.processlist : MDEV-16574 - Wrong result -plugins.server_audit : MDEV-14295 - Wrong result; modified in 10.4.16 +plugins.server_audit : MDEV-14295 - Wrong result plugins.thread_pool_server_audit : MDEV-14295 - Wrong result #----------------------------------------------------------------------- @@ -684,124 +599,105 @@ rocksdb_sys_vars.rocksdb_rate_limiter_bytes_per_sec_basic : MDEV-16639 - Crash #----------------------------------------------------------------------- -roles.acl_load_mutex-5170 : Modified in 10.4.16 roles.create_and_grant_role : MDEV-11772 - wrong result #----------------------------------------------------------------------- -rpl.circular_serverid0 : MDEV-19372 - ASAN heap-use-after-free -rpl.create_or_replace2 : MDEV-19412 - Lost connection to MySQL server -rpl.create_or_replace_mix : MDEV-20523 - Wrong result -rpl.create_or_replace_statement : MDEV-20523 - Wrong result -rpl.create_select : MDEV-14121 - Assertion failure -rpl.last_insert_id : MDEV-10625 - warnings in error log -rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips -rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips -rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log -rpl.rpl_binlog_errors : MDEV-12742 - Crash -rpl.rpl_binlog_grant : MDEV-21274 - Lost connection at handshake -rpl.rpl_binlog_index : Modified in 10.4.16 -rpl.rpl_cant_read_event_incident : MDEV-20960 - Abort on shutdown -rpl.rpl_checksum_cache : MDEV-22510 - Server crash -rpl.rpl_circular_for_4_hosts : MDEV-20536 - Server crash -rpl.rpl_colSize : MDEV-16112 - Server crash -rpl.rpl_corruption : MDEV-20527 - Slave stopped with wrong error code -rpl.rpl_create_tmp_table_if_not_exists : MDEV-20159 - Assertion failure -rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac -rpl.rpl_ddl : MDEV-10417 - Fails on Mips -rpl.rpl_domain_id_filter_io_crash : MDEV-12729 - Timeout in include file, MDEV-13677 - Server crash -rpl.rpl_domain_id_filter_master_crash : MDEV-19043 - Table marked as crashed -rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result; MDEV-19043 - Table marked as crashed -rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start -rpl.rpl_extra_col_master_innodb : MDEV-16570 - Extra warning -rpl.rpl_extra_col_master_myisam : MDEV-23372 - Extra warning -rpl.rpl_filter_tables_dynamic : Modified in 10.4.16 -rpl.rpl_filter_wild_tables_dynamic : Modified in 10.4.16 -rpl.rpl_flushlog_loop : MDEV-21570 - Server crash -rpl.rpl_get_lock : MDEV-19368 - mysqltest failed but provided no output -rpl.rpl_gtid_basic : MDEV-10681 - server startup problem -rpl.rpl_gtid_crash : MDEV-13643 - Lost connection; modified in 10.4.16 -rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout; MDEV-23103 - Could not delete gtid domain; modified in 10.4.16 -rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash -rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings -rpl.rpl_gtid_reconnect : MDEV-14497 - Crash -rpl.rpl_gtid_startpos : MDEV-20141 - mysqltest failed but provided no output -rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings -rpl.rpl_gtid_until : MDEV-10625 - warnings in error log -rpl.rpl_ignore_grant : MDEV-20159 - Assertion failure -rpl.rpl_ignore_table_update : MDEV-20159 - Assertion failure -rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips -rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_insert_id : MDEV-15197 - Wrong result -rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure -rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query -rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips -rpl.rpl_ipv4_as_ipv6 : MDEV-20147 - Incorrect checksum for freed object -rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog -rpl.rpl_mdev12179 : MDEV-19043 - Table marked as crashed -rpl.rpl_mdev6020 : MDEV-23426 - Server crash, ASAN failures; MDEV-15272 - Server crash -rpl.rpl_mixed_mixing_engines : MDEV-21266 - Timeout -rpl.rpl_mysql_upgrade : Modified in 10.4.16 -rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master_pos_wait -rpl.rpl_old_master : MDEV-22956 - Failing assertion -rpl.rpl_parallel : MDEV-10653 - Timeouts -rpl.rpl_parallel2 : MDEV-17390 - Operation cannot be performed -rpl.rpl_parallel_conflicts : MDEV-15272 - Server crash -rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure -rpl.rpl_parallel_multilevel : MDEV-20160 - Server crash -rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout -rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master -rpl.rpl_parallel_optimistic_nobinlog : MDEV-15278 - Failed to sync with master -rpl.rpl_parallel_optimistic_until : MDEV-23021 - Query didn't return a result set -rpl.rpl_parallel_retry : MDEV-11119 - Crash; MDEV-17109 - Timeout; modified in 10.4.16 -rpl.rpl_parallel_temptable : MDEV-10356 - Crash; MDEV-19076 - Wrong result -rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips -rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings -rpl.rpl_read_only : MDEV-20159 - Assertion failure -rpl.rpl_rewrt_db : MDEV-24060 - Server did not start -rpl.rpl_row_001 : MDEV-16653 - MTR's internal check fails -rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start -rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_corruption : MDEV-21569 - mutex: LOCK_global_system_variables unlocking -rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result -rpl.rpl_row_end_of_statement_loss : MDEV-21237 - Server crash -rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed -rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_index_choice : MDEV-15196 - Slave crash -rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_row_until : MDEV-14052 - Master will not send events with checksum -rpl.rpl_semi_sync : MDEV-11220 - Wrong result -rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result -rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result -rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings -rpl.rpl_semi_sync_skip_repl : MDEV-23371 - Server crash -rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Assorted failures -rpl.rpl_semi_sync_wait_no_slave : MDEV-20159 - Assertion failure -rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition -rpl.rpl_semisync_ali_issues : MDEV-16272 - Wrong result -rpl.rpl_show_slave_hosts : MDEV-10681 - Crash -rpl.rpl_shutdown_wait_slaves : MDEV-22517 - Timeout on sync_with_master -rpl.rpl_skip_replication : MDEV-23372 - Extra warning -rpl.rpl_slave_grp_exec : MDEV-10514 - Deadlock; re-enabled in 10.4.16; modified in 10.4.16 -rpl.rpl_slave_load_in : MDEV-20159 - Assertion failure -rpl.rpl_slave_load_tmpdir_not_exist : MDEV-23372 - Extra warning -rpl.rpl_slow_query_log : MDEV-13250 - Test abort -rpl.rpl_sp_effects : MDEV-13249 - Crash -rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout; modified in 10.4.16 -rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion -rpl.rpl_stm_stop_middle_group : MDEV-13791 - Server crash -rpl.rpl_sync : MDEV-10633 - Database page corruption -rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries -rpl.rpl_test_framework : MDEV-19368 - mysqltest failed but provided no output -rpl.rpl_trigger : MDEV-18055 - Wrong result -rpl.rpl_truncate_3innodb : MDEV-19454 - Syntax error -rpl.rpl_upgrade_master_info : MDEV-16567 - Assertion failure -rpl.rpl_user_variables : MDEV-20522 - Wrong result -rpl.rpl_variables : MDEV-20150 - Server crash -rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result -rpl.show_status_stop_slave_race-7126 : Modified in 10.4.16 +rpl.circular_serverid0 : MDEV-19372 - ASAN heap-use-after-free +rpl.create_or_replace2 : MDEV-19412 - Lost connection to MySQL server +rpl.create_or_replace_mix : MDEV-20523 - Wrong result +rpl.create_or_replace_statement : MDEV-20523 - Wrong result +rpl.create_select : MDEV-14121 - Assertion failure +rpl.last_insert_id : MDEV-10625 - warnings in error log +rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips +rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips +rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log +rpl.rpl_binlog_errors : MDEV-12742 - Crash +rpl.rpl_binlog_grant : MDEV-21274 - Lost connection at handshake +rpl.rpl_cant_read_event_incident : MDEV-20960 - Abort on shutdown +rpl.rpl_checksum_cache : MDEV-22510 - Server crash +rpl.rpl_circular_for_4_hosts : MDEV-20536 - Server crash +rpl.rpl_colSize : MDEV-16112 - Server crash +rpl.rpl_corruption : MDEV-20527 - Slave stopped with wrong error code +rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac +rpl.rpl_ddl : MDEV-10417 - Fails on Mips +rpl.rpl_domain_id_filter_io_crash : MDEV-12729 - Timeout in include file, MDEV-13677 - Server crash +rpl.rpl_domain_id_filter_master_crash : MDEV-19043 - Table marked as crashed +rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result; MDEV-19043 - Table marked as crashed +rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start +rpl.rpl_extra_col_master_innodb : MDEV-16570 - Extra warning +rpl.rpl_extra_col_master_myisam : MDEV-23372 - Extra warning +rpl.rpl_flushlog_loop : MDEV-21570 - Server crash +rpl.rpl_get_lock : MDEV-19368 - mysqltest failed but provided no output +rpl.rpl_gtid_basic : MDEV-10681 - server startup problem +rpl.rpl_gtid_crash : MDEV-13643 - Lost connection +rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash +rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings +rpl.rpl_gtid_reconnect : MDEV-14497 - Crash +rpl.rpl_gtid_startpos : MDEV-20141 - mysqltest failed but provided no output +rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings +rpl.rpl_gtid_until : MDEV-10625 - warnings in error log +rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips +rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_insert_id : MDEV-15197 - Wrong result +rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure +rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query +rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips +rpl.rpl_ipv4_as_ipv6 : MDEV-20147 - Incorrect checksum for freed object +rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog +rpl.rpl_mdev12179 : MDEV-19043 - Table marked as crashed +rpl.rpl_mdev6020 : MDEV-23426 - Server crash, ASAN failures; MDEV-15272 - Server crash +rpl.rpl_mixed_mixing_engines : MDEV-21266 - Timeout +rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master_pos_wait +rpl.rpl_old_master : MDEV-22956 - Failing assertion +rpl.rpl_parallel : MDEV-10653 - Timeouts; MDEV-24110 - Slave crash +rpl.rpl_parallel_conflicts : MDEV-15272 - Server crash +rpl.rpl_parallel_multilevel : MDEV-20160 - Server crash +rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout +rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master +rpl.rpl_parallel_optimistic_nobinlog : MDEV-15278 - Failed to sync with master +rpl.rpl_parallel_optimistic_until : MDEV-23021 - Query didn't return a result set +rpl.rpl_parallel_retry : MDEV-11119 - Crash; MDEV-17109 - Timeout +rpl.rpl_parallel_stop_on_con_kill : MDEV-24110 - Slave crash +rpl.rpl_parallel_temptable : MDEV-10356 - Crash; MDEV-19076 - Wrong result +rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips +rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings +rpl.rpl_rewrt_db : MDEV-24060 - Server did not start +rpl.rpl_row_001 : MDEV-16653 - MTR's internal check fails +rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start +rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_corruption : MDEV-21569 - mutex: LOCK_global_system_variables unlocking +rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result +rpl.rpl_row_end_of_statement_loss : MDEV-21237 - Server crash +rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed +rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_index_choice : MDEV-15196 - Slave crash +rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_row_until : MDEV-14052 - Master will not send events with checksum +rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings +rpl.rpl_semi_sync_skip_repl : MDEV-23371 - Server crash +rpl.rpl_semi_sync_uninstall_plugin : MDEV-24561 - Wrong usage of mutex; MDEV-7140 - Assorted failures +rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition +rpl.rpl_show_slave_hosts : MDEV-10681 - Crash +rpl.rpl_shutdown_wait_slaves : MDEV-22517 - Timeout on sync_with_master +rpl.rpl_skip_replication : MDEV-23372 - Extra warning +rpl.rpl_slave_load_tmpdir_not_exist : MDEV-23372 - Extra warning +rpl.rpl_slow_query_log : MDEV-13250 - Test abort +rpl.rpl_sp_effects : MDEV-13249 - Crash +rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout +rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion +rpl.rpl_stm_stop_middle_group : MDEV-13791 - Server crash +rpl.rpl_sync : MDEV-10633 - Database page corruption +rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries +rpl.rpl_test_framework : MDEV-19368 - mysqltest failed but provided no output +rpl.rpl_trigger : MDEV-18055 - Wrong result +rpl.rpl_truncate_3innodb : MDEV-19454 - Syntax error +rpl.rpl_upgrade_master_info : MDEV-16567 - Assertion failure +rpl.rpl_user_variables : MDEV-20522 - Wrong result +rpl.rpl_variables : MDEV-20150 - Server crash +rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result #----------------------------------------------------------------------- @@ -826,19 +722,13 @@ spider.basic_sql : MDEV-11186 - Internal check fails #----------------------------------------------------------------------- -spider/bg.* : MDEV-24059 - Timeout -spider/bg.ha : MDEV-9329 - failures on s390x -spider/bg.ha_part : MDEV-9329 - Fails on Ubuntu/s390x -spider/bg.spider3_fixes : MDEV-12639 - Syntax error -spider/bg.spider_fixes : MDEV-9329 - failures on s390x -spider/bg.vp_fixes : MDEV-9329 - Fails on Ubuntu/s390x - -#----------------------------------------------------------------------- - -spider/bugfix.direct_sql_with_comma_pwd : Added in 10.4.16 -spider/bugfix.mdev_20100 : Added in 10.4.16 -spider/bugfix.mdev_22246 : Added in 10.4.16 -spider/bugfix.xa_cmd : Added in 10.4.16 +spider/bg.* : MDEV-24059 - Timeout +spider/bg.ha : MDEV-9329 - failures on s390x +spider/bg.ha_part : MDEV-9329 - Fails on Ubuntu/s390x +spider/bg.spider3_fixes : MDEV-12639 - Syntax error +spider/bg.spider3_fixes_part : MDEV-24809 - Timeout +spider/bg.spider_fixes : MDEV-9329 - failures on s390x +spider/bg.vp_fixes : MDEV-9329 - Fails on Ubuntu/s390x #----------------------------------------------------------------------- @@ -848,7 +738,6 @@ spider/handler.* : MDEV-10987, MDEV-10990 - Tests have not been maintained sql_sequence.concurrent_create : MDEV-16635 - Server crash sql_sequence.kill : MDEV-23393 - Server crash -sql_sequence.next : Modified in 10.4.16 sql_sequence.read_only : MDEV-22956 - Failing assertion #----------------------------------------------------------------------- @@ -865,16 +754,12 @@ sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu sys_vars.host_cache_size_auto : MDEV-20112 - Wrong result sys_vars.innodb_buffer_pool_dump_at_shutdown_basic : MDEV-14280 - Unexpected error sys_vars.innodb_checksum_algorithm_basic : MDEV-21568 - Errno: 2000 +sys_vars.innodb_flush_method_func : MDEV-24810 - Server failed to restart sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash -sys_vars.replicate_do_db_basic : Modified in 10.4.16 -sys_vars.rpl_init_slave_func : Modified in 10.4.16 -sys_vars.session_track_system_variables_basic : Modified in 10.4.16 sys_vars.slow_query_log_func : MDEV-14273 - Wrong result sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result sys_vars.wait_timeout_func : MDEV-12896 - Wrong result -sys_vars.wsrep_cluster_address_basic : Modified in 10.4.16 -sys_vars.wsrep_on_basic : Configuration deleted in 10.4.16 #----------------------------------------------------------------------- @@ -906,7 +791,7 @@ tokudb_alter_table.hcad_all_add2 : MDEV-15269 - Timeout #----------------------------------------------------------------------- -tokudb_backup.* : MDEV-11001 - Missing include file +tokudb_backup.* : MDEV-11001 - Missing include file (Won't fix) #----------------------------------------------------------------------- @@ -925,11 +810,11 @@ tokudb_parts.partition_alter4_tokudb : MDEV-12640 - Lost connection #----------------------------------------------------------------------- -tokudb_rpl.* : MDEV-11001 - Missing include file +tokudb_rpl.* : MDEV-11001 - Missing include file (Won't fix) #----------------------------------------------------------------------- -tokudb_sys_vars.* : MDEV-11001 - Missing include file +tokudb_sys_vars.* : MDEV-11001 - Missing include file (Won't fix) #----------------------------------------------------------------------- @@ -947,28 +832,17 @@ unit.mf_iocache : MDEV-20952 - ASAN stack-buffer-overflow vcol.not_supported : MDEV-10639 - Testcase timeout vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout -vcol.vcol_misc : MDEV-16651 - Wrong error message; modified in 10.4.16 +vcol.vcol_misc : MDEV-16651 - Wrong error message #----------------------------------------------------------------------- -versioning.create : Modified in 10.4.16 -versioning.select : Modified in 10.4.16 -versioning.sysvars : Modified in 10.4.16 -versioning.update : MDEV-22475 - Wrong result code -versioning.view : Modified in 10.4.16 +versioning.update : MDEV-22475 - Wrong result code #----------------------------------------------------------------------- -wsrep.MDEV-22443 : Added in 10.4.16 -wsrep.MDEV-23081 : Added in 10.4.16 -wsrep.MDEV-23092 : Added in 10.4.16 -wsrep.MDEV-23466 : Added in 10.4.16 wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node -wsrep.mdev_22681 : Added in 10.4.16 wsrep.mdev_6832 : MDEV-14195 - Check testcase failed wsrep.pool_of_threads : MDEV-17345 - WSREP has not yet prepared node for application use -wsrep.variables : Modified in 10.4.16 -wsrep.variables_debug : Added in 10.4.16 #----------------------------------------------------------------------- |