diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-04-21 09:01:01 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-04-21 09:01:01 +0300 |
commit | 80ed136e6dd4a021b1fc9b7bd7077bf989c3d247 (patch) | |
tree | cc24f0e4e9241920329865a1b66c1d086aaeaa9a | |
parent | 675c22c065110be03a5fab82442d2c3dc32aefff (diff) | |
parent | a0588d54a20488b17a178244989e1abc5151a88a (diff) | |
download | mariadb-git-80ed136e6dd4a021b1fc9b7bd7077bf989c3d247.tar.gz |
Merge 10.4 into 10.5
163 files changed, 8185 insertions, 3346 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index d9d8b977644..9dbb4edf75c 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -141,7 +141,7 @@ elif [ "x$warning_mode" = "xmaintainer" ]; then debug_extra_cflags="-g3" else # Both C and C++ warnings - warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized -Wno-strict-aliasing" + warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized -Wno-strict-aliasing -Wimplicit-fallthrough=2 -Wformat-security -Wvla" # For more warnings, uncomment the following line # warnings="$warnings -Wshadow" diff --git a/BUILD/compile-pentium64-ubsan b/BUILD/compile-pentium64-ubsan new file mode 100755 index 00000000000..bf56d84283f --- /dev/null +++ b/BUILD/compile-pentium64-ubsan @@ -0,0 +1,29 @@ +#! /bin/sh +# Copyright (c) 2018, MariaDB Corporation. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +# Compilation with UBSAN, The Undefined Behavior Sanitizer +# We have to use -Wno-uninitialized and -Wno-unitialized we get a lot of false +# positive warnings for this when compiling with -fsanitize=undefined. +# We also have to compile without Spider as linking with Spider library does +# not work. (errno: 11, undefined symbol: _ZTI12ha_partition) + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium64_cflags $debug_cflags -fsanitize=undefined -DWITH_UBSAN -Wno-conversion -Wno-uninitialized" +extra_configs="$pentium_configs $debug_configs -DWITH_UBSAN=ON -DMYSQL_MAINTAINER_MODE=NO --without-spider --without-tokudb" + +. "$path/FINISH.sh" diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 13282153cfb..4c4e747e69d 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -10957,7 +10957,7 @@ int get_next_bit(REP_SET *set,uint lastpos) start=set->bits+ ((lastpos+1) / WORD_BIT); end=set->bits + set->size_of_bits; - bits=start[0] & ~((1 << ((lastpos+1) % WORD_BIT)) -1); + bits=start[0] & ~((1U << ((lastpos+1) % WORD_BIT)) -1); while (! bits && ++start < end) bits=start[0]; diff --git a/cmake/configure.pl b/cmake/configure.pl index c296c5ba4b8..4085110b6fa 100644 --- a/cmake/configure.pl +++ b/cmake/configure.pl @@ -93,6 +93,11 @@ foreach my $option (@ARGV) { $option = substr($option, 2); } + elsif (substr ($option, 0, 2) eq "-D") + { + # Must be cmake config option + $option = substr($option, 1); + } else { # This must be environment variable @@ -119,6 +124,11 @@ foreach my $option (@ARGV) $just_print=1; next; } + if ($option =~ /D.*=/) + { + $cmakeargs = $cmakeargs." -".$option; + next; + } if($option =~ /with-plugins=/) { my @plugins= split(/,/, substr($option,13)); diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index a8c8050cb1d..1dec667949f 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -93,7 +93,7 @@ static void usage() { version(); puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n"); - puts("Prints all arguments that is give to some program using the default files"); + puts("Displays the options from option groups of option files, which is useful to see which options a particular tool will use"); printf("Usage: %s [OPTIONS] [groups]\n", my_progname); my_print_help(my_long_options); my_print_default_files(config_file); diff --git a/include/byte_order_generic.h b/include/byte_order_generic.h index 8381941b9b9..d2b729a241d 100644 --- a/include/byte_order_generic.h +++ b/include/byte_order_generic.h @@ -28,10 +28,10 @@ (((uint32) (uchar) (A)[2]) << 16) |\ (((uint32) (uchar) (A)[1]) << 8) | \ ((uint32) (uchar) (A)[0]))) -#define sint4korr(A) (int32) (((int32) ((uchar) (A)[0])) |\ - (((int32) ((uchar) (A)[1]) << 8)) |\ - (((int32) ((uchar) (A)[2]) << 16)) |\ - (((int32) ((int16) (A)[3]) << 24))) +#define sint4korr(A) (int32) (((uint32) ((uchar) (A)[0])) |\ + (((uint32) ((uchar) (A)[1]) << 8)) |\ + (((uint32) ((uchar) (A)[2]) << 16)) |\ + (((uint32) ((uchar) (A)[3]) << 24))) #define sint8korr(A) (longlong) uint8korr(A) #define uint2korr(A) (uint16) (((uint16) ((uchar) (A)[0])) |\ ((uint16) ((uchar) (A)[1]) << 8)) diff --git a/include/byte_order_generic_x86.h b/include/byte_order_generic_x86.h index 72e00be8c2c..c47564478c6 100644 --- a/include/byte_order_generic_x86.h +++ b/include/byte_order_generic_x86.h @@ -17,6 +17,7 @@ /* Optimized function-like macros for the x86 architecture (_WIN32 included). */ + #define sint2korr(A) (*((const int16 *) (A))) #define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ (((uint32) 255L << 24) | \ diff --git a/include/json_lib.h b/include/json_lib.h index b6add6d13a3..bb649928eaa 100644 --- a/include/json_lib.h +++ b/include/json_lib.h @@ -172,6 +172,7 @@ enum json_states { enum json_value_types { + JSON_VALUE_UNINITALIZED=0, JSON_VALUE_OBJECT=1, JSON_VALUE_ARRAY=2, JSON_VALUE_STRING=3, diff --git a/include/my_byteorder.h b/include/my_byteorder.h index c302781d9fc..abdf19a3632 100644 --- a/include/my_byteorder.h +++ b/include/my_byteorder.h @@ -31,10 +31,10 @@ format (low byte first). There are 'korr' (assume 'corrector') variants for integer types, but 'get' (assume 'getter') for floating point types. */ -#if defined(__i386__) || defined(_WIN32) +#if (defined(__i386__) || defined(_WIN32)) && !defined(WITH_UBSAN) #define MY_BYTE_ORDER_ARCH_OPTIMIZED #include "byte_order_generic_x86.h" -#elif defined(__x86_64__) +#elif defined(__x86_64__) && !defined(WITH_UBSAN) #include "byte_order_generic_x86_64.h" #else #include "byte_order_generic.h" diff --git a/include/my_compare.h b/include/my_compare.h index e9c0513d11c..f936bbe6b0c 100644 --- a/include/my_compare.h +++ b/include/my_compare.h @@ -1,5 +1,5 @@ /* Copyright (c) 2011, Oracle and/or its affiliates. - Copyright (c) 1991, 2020, MariaDB Corporation. + Copyright (c) 1991, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -95,7 +95,7 @@ static inline uchar get_rec_bits(const uchar *ptr, uchar ofs, uint len) { uint16 val= ptr[0]; if (ofs + len > 8) - val|= (uint16)((uint16)(ptr[1]) << 8); + val|= (uint16)(((uint) ptr[1]) << 8); return (uchar) ((val >> ofs) & ((1 << len) - 1)); } diff --git a/include/myisampack.h b/include/myisampack.h index 6bfe1958fbc..f3c5fe7114a 100644 --- a/include/myisampack.h +++ b/include/myisampack.h @@ -30,7 +30,7 @@ #define mi_uint1korr(A) ((uint8)(*A)) #define mi_sint2korr(A) ((int16) (((int16) (((const uchar*) (A))[1])) |\ - ((int16) ((int16) ((const char*) (A))[0]) << 8))) + ((int16) ((uint16) ((const uchar*) (A))[0]) << 8))) #define mi_sint3korr(A) ((int32) (((((const uchar*) (A))[0]) & 128) ? \ (((uint32) 255L << 24) | \ (((uint32) ((const uchar*) (A))[0]) << 16) |\ @@ -39,10 +39,10 @@ (((uint32) ((const uchar*) (A))[0]) << 16) |\ (((uint32) ((const uchar*) (A))[1]) << 8) | \ ((uint32) ((const uchar*) (A))[2]))) -#define mi_sint4korr(A) ((int32) (((int32) (((const uchar*) (A))[3])) |\ - ((int32) (((const uchar*) (A))[2]) << 8) |\ - ((int32) (((const uchar*) (A))[1]) << 16) |\ - ((int32) ((int16) ((const char*) (A))[0]) << 24))) +#define mi_sint4korr(A) ((int32) (((uint32) (((const uchar*) (A))[3])) |\ + ((uint32) (((const uchar*) (A))[2]) << 8) |\ + ((uint32) (((const uchar*) (A))[1]) << 16) |\ + ((uint32) (((const uchar*) (A))[0]) << 24))) #define mi_sint8korr(A) ((longlong) mi_uint8korr(A)) #define mi_uint2korr(A) ((uint16) (((uint16) (((const uchar*) (A))[1])) |\ ((uint16) (((const uchar*) (A))[0]) << 8))) diff --git a/libmariadb b/libmariadb -Subproject fc431a035a21ac1d4ef25d9d3cd8c4d7e64a8ee +Subproject d19c7c69269fdf4e2af8943dd86c12e4e1664af diff --git a/man/mysqlbinlog.1 b/man/mysqlbinlog.1 index 243ae677268..c475f8a9887 100644 --- a/man/mysqlbinlog.1 +++ b/man/mysqlbinlog.1 @@ -1,6 +1,6 @@ '\" t .\" -.TH "\FBMYSQLBINLOG\FR" "1" "27 June 2019" "MariaDB 10\&.5" "MariaDB Database System" +.TH "\FBMYSQLBINLOG\FR" "1" "14 April 2021" "MariaDB 10\&.5" "MariaDB Database System" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -1091,6 +1091,23 @@ This option is useful for point\-in\-time recovery\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlbinlog: table option +.\" table option: mysqlbinlog +\fB\-\-table\fR, +\fB\-T\fR +.sp +List entries for just this table (local log only)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} + .\" mysqlbinlog: to-last-log option .\" to-last-log option: mysqlbinlog \fB\-\-to\-last\-log\fR, @@ -2107,7 +2124,7 @@ option can be used to prevent this header from being written\&. .SH "COPYRIGHT" .br .PP -Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2019 MariaDB Foundation +Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2021 MariaDB Foundation .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-test/include/not_asan.inc b/mysql-test/include/not_asan.inc index 91f39b80150..9fc86a8525a 100644 --- a/mysql-test/include/not_asan.inc +++ b/mysql-test/include/not_asan.inc @@ -2,7 +2,7 @@ # 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'`) +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/main/alter_table.result b/mysql-test/main/alter_table.result index a27b54d4b48..a43d9845947 100644 --- a/mysql-test/main/alter_table.result +++ b/mysql-test/main/alter_table.result @@ -2532,6 +2532,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 5fd1358e9a9..e65a4edf13e 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/join_outer.result b/mysql-test/main/join_outer.result index e882973043e..fcffeb6d161 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 9cbfa5d0fe5..721989c3368 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/mysqld--help.test b/mysql-test/main/mysqld--help.test index f7eb038a6f3..4405b198951 100644 --- a/mysql-test/main/mysqld--help.test +++ b/mysql-test/main/mysqld--help.test @@ -3,6 +3,7 @@ # --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/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/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c5c7ba6d03d..65254bf653c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2,7 +2,7 @@ # -*- cperl -*- # Copyright (c) 2004, 2014, Oracle and/or its affiliates. -# Copyright (c) 2009, 2020, MariaDB Corporation +# Copyright (c) 2009, 2021, MariaDB Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1749,7 +1749,6 @@ sub collect_mysqld_features { } - sub collect_mysqld_features_from_running_server () { my $mysql= mtr_exe_exists("$path_client_bindir/mysql"); @@ -4411,6 +4410,12 @@ sub extract_warning_lines ($$) { 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/WSREP: Failed to guess base node address/, qr/WSREP: Guessing address for incoming client/, + + # 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= []; 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/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/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/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 bd63a7fd1d8..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,24 +1,24 @@ --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_stop_replication.inc @@ -29,28 +29,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_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_start_replication.inc @@ -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/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 70a87c73df7..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_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_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 70a87c73df7..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_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_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 145b3a94775..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_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_var_wsrep_on_off.result b/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result index b3096afd387..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,12 +22,14 @@ 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); @@ -68,3 +70,58 @@ 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/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 45c6a3f660a..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_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/galera_var_wsrep_on_off.test b/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test index 1a48abc25eb..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 @@ -36,6 +36,7 @@ DROP TABLE t1; # active transaction. # +--connection node_1 START TRANSACTION; --error ER_CANT_DO_THIS_DURING_AN_TRANSACTION SET SESSION wsrep_on=OFF; @@ -49,6 +50,7 @@ COMMIT; # @@session.wsrep_on of current sessions # +--connection node_1 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); START TRANSACTION; INSERT INTO t1 VALUES (1); @@ -75,6 +77,7 @@ DROP TABLE t1; # # New connections inherit @@session.wsrep_on from @@global.wsrep_on # + --connection node_1 SET GLOBAL wsrep_on = OFF; @@ -87,3 +90,78 @@ 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_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/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/innodb/r/temporary_table.result b/mysql-test/suite/innodb/r/temporary_table.result index 871c4c62446..79b5a3de064 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/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test index 389e106a345..831ac33a0e8 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/plugins/t/multiauth.test b/mysql-test/suite/plugins/t/multiauth.test index 73538f23832..66f29bdbfec 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 let $REGEX_VERSION_ID=/$mysql_get_server_version/VERSION_ID/; let $REGEX_PASSWORD_LAST_CHANGED=/password_last_changed": [0-9]*/password_last_changed": #/; let $REGEX_GLOBAL_PRIV=$REGEX_PASSWORD_LAST_CHANGED $REGEX_VERSION_ID; diff --git a/mysql-test/suite/sys_vars/inc/sysvars_server.inc b/mysql-test/suite/sys_vars/inc/sysvars_server.inc index dff31cb2b97..025f8a8922d 100644 --- a/mysql-test/suite/sys_vars/inc/sysvars_server.inc +++ b/mysql-test/suite/sys_vars/inc/sysvars_server.inc @@ -23,8 +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 ( - 'have_sanitizer', - 'log_tc_size' + 'log_tc_size','have_sanitizer' ) order by variable_name; 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 e4ab38f611d..7d2ca937de2 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -9,8 +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 ( -'have_sanitizer', -'log_tc_size' +'log_tc_size','have_sanitizer' ) order by variable_name; VARIABLE_NAME ALTER_ALGORITHM 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 7cdfdff7129..3498d5de743 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -9,8 +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 ( -'have_sanitizer', -'log_tc_size' +'log_tc_size','have_sanitizer' ) order by variable_name; VARIABLE_NAME ALTER_ALGORITHM 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/t/thread_stack_basic.test b/mysql-test/suite/sys_vars/t/thread_stack_basic.test index 6aeda532fde..39f120e0de1 100644 --- a/mysql-test/suite/sys_vars/t/thread_stack_basic.test +++ b/mysql-test/suite/sys_vars/t/thread_stack_basic.test @@ -2,6 +2,7 @@ # 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_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/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result index d0aa49f2fde..e07f1408ab7 100644 --- a/mysql-test/suite/versioning/r/alter.result +++ b/mysql-test/suite/versioning/r/alter.result @@ -746,6 +746,23 @@ 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; +# # MDEV-21941 RENAME doesn't work for system time or period fields # create or replace table t1 (a int) with system versioning; diff --git a/mysql-test/suite/versioning/t/alter.test b/mysql-test/suite/versioning/t/alter.test index 786627da35e..9d3101fb4ad 100644 --- a/mysql-test/suite/versioning/t/alter.test +++ b/mysql-test/suite/versioning/t/alter.test @@ -632,6 +632,29 @@ 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; + + --echo # --echo # MDEV-21941 RENAME doesn't work for system time or period fields --echo # diff --git a/mysql-test/suite/wsrep/disabled.def b/mysql-test/suite/wsrep/disabled.def index a1c8165d165..991109d72b8 100644 --- a/mysql-test/suite/wsrep/disabled.def +++ b/mysql-test/suite/wsrep/disabled.def @@ -14,3 +14,4 @@ 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/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/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/mysys/ma_dyncol.c b/mysys/ma_dyncol.c index b3d3777d922..8e8ac8a98a4 100644 --- a/mysys/ma_dyncol.c +++ b/mysys/ma_dyncol.c @@ -865,7 +865,7 @@ dynamic_column_uint_read(DYNAMIC_COLUMN_VALUE *store_it_here, static size_t dynamic_column_sint_bytes(longlong val) { - return dynamic_column_uint_bytes((val << 1) ^ + return dynamic_column_uint_bytes((((ulonglong) val) << 1) ^ (val < 0 ? 0xffffffffffffffffull : 0)); } @@ -883,8 +883,8 @@ static enum enum_dyncol_func_result dynamic_column_sint_store(DYNAMIC_COLUMN *str, longlong val) { return dynamic_column_uint_store(str, - (val << 1) ^ - (val < 0 ? 0xffffffffffffffffULL : 0)); + (((ulonglong) val) << 1) ^ + (val < 0 ? 0xffffffffffffffffULL : 0)); } diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 82ab6f20646..2d6031fa8cd 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2011, Oracle and/or its affiliates - Copyright (c) 2010, 2020, MariaDB + Copyright (c) 2010, 2021, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/plugin/auth_ed25519/CMakeLists.txt b/plugin/auth_ed25519/CMakeLists.txt index 1a3d5cc4bce..1033dc053c8 100644 --- a/plugin/auth_ed25519/CMakeLists.txt +++ b/plugin/auth_ed25519/CMakeLists.txt @@ -19,6 +19,10 @@ IF(MSVC) SET_SOURCE_FILES_PROPERTIES(${REF10_SOURCES} PROPERTY COMPILE_FLAGS "/wd4244 /wd4146") ENDIF() +IF(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION LESS 11 AND CMAKE_C_COMPILER_VERSION GREATER 6) + SET_SOURCE_FILES_PROPERTIES(${REF10_SOURCES} PROPERTY COMPILE_FLAGS -fno-sanitize=shift) +ENDIF() + # server plugin *cannot* link with the library, it needs all sources to be # compiled with MYSQL_DYNAMIC_PLUGIN MYSQL_ADD_PLUGIN(auth_ed25519 server_ed25519.c ${REF10_SOURCES} MODULE_ONLY) diff --git a/sql/compat56.h b/sql/compat56.h index 347d6145048..65cd36dacfd 100644 --- a/sql/compat56.h +++ b/sql/compat56.h @@ -30,8 +30,8 @@ #define MY_PACKED_TIME_GET_INT_PART(x) ((x) >> 24) #define MY_PACKED_TIME_GET_FRAC_PART(x) ((x) % (1LL << 24)) -#define MY_PACKED_TIME_MAKE(i, f) ((((longlong) (i)) << 24) + (f)) -#define MY_PACKED_TIME_MAKE_INT(i) ((((longlong) (i)) << 24)) +#define MY_PACKED_TIME_MAKE(i, f) ((((ulonglong) (i)) << 24) + (f)) +#define MY_PACKED_TIME_MAKE_INT(i) ((((ulonglong) (i)) << 24)) longlong TIME_to_longlong_datetime_packed(const MYSQL_TIME *); longlong TIME_to_longlong_time_packed(const MYSQL_TIME *); diff --git a/sql/events.cc b/sql/events.cc index 33ddcdac3cb..9f0aef885df 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -662,8 +662,16 @@ Events::drop_schema_events(THD *thd, const char *db) */ if (event_queue) event_queue->drop_schema_events(thd, &db_lex); - db_repository->drop_schema_events(thd, &db_lex); - + if (db_repository) + db_repository->drop_schema_events(thd, &db_lex); + else + { + if ((db_repository= new Event_db_repository)) + { + db_repository->drop_schema_events(thd, &db_lex); + delete db_repository; + } + } DBUG_VOID_RETURN; } diff --git a/sql/field.h b/sql/field.h index 1a1b56b2c02..9fe4db3b521 100644 --- a/sql/field.h +++ b/sql/field.h @@ -4994,7 +4994,13 @@ public: void move_field_offset(my_ptrdiff_t ptr_diff) override { Field::move_field_offset(ptr_diff); - bit_ptr= ADD_TO_PTR(bit_ptr, ptr_diff, uchar*); + + /* + clang does not like when things are added to a null pointer, even if + it is never referenced. + */ + if (bit_ptr) + bit_ptr= ADD_TO_PTR(bit_ptr, ptr_diff, uchar*); } void hash(ulong *nr, ulong *nr2) override; diff --git a/sql/gcalc_tools.h b/sql/gcalc_tools.h index 77da791f0b9..e625b355d95 100644 --- a/sql/gcalc_tools.h +++ b/sql/gcalc_tools.h @@ -184,7 +184,11 @@ class Gcalc_result_receiver double first_x, first_y, prev_x, prev_y; double shape_area; public: - Gcalc_result_receiver() : collection_result(FALSE), n_shapes(0), n_holes(0) +Gcalc_result_receiver() : + n_points(0), + common_shapetype(Gcalc_function::shape_point), + collection_result(FALSE), n_shapes(0), n_holes(0), + cur_shape(Gcalc_function::shape_point), shape_pos(0) {} int start_shape(Gcalc_function::shape_type shape); int add_point(double x, double y); diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index d52f44f9b95..18c6ca5a63c 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -6589,6 +6589,7 @@ int ha_partition::multi_range_read_init(RANGE_SEQ_IF *seq, DBUG_ENTER("ha_partition::multi_range_read_init"); DBUG_PRINT("enter", ("partition this: %p", this)); + eq_range= 0; m_seq_if= seq; m_seq= seq->init(seq_init_param, n_ranges, mrr_mode); if (unlikely((error= multi_range_key_create_key(seq, m_seq)))) diff --git a/sql/item.cc b/sql/item.cc index 1d13fee58ed..8cad7111e07 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2653,9 +2653,7 @@ Item_sp::Item_sp(THD *thd, Name_resolution_context *context_arg, dummy_table= (TABLE*) thd->calloc(sizeof(TABLE) + sizeof(TABLE_SHARE) + sizeof(Query_arena)); dummy_table->s= (TABLE_SHARE*) (dummy_table + 1); - /* TODO(cvicentiu) Move this sp_query_arena in the class as a direct member. - Currently it can not be done due to header include dependencies. */ - sp_query_arena= (Query_arena *) (dummy_table->s + 1); + sp_query_arena= new(dummy_table->s + 1) Query_arena(); memset(&sp_mem_root, 0, sizeof(sp_mem_root)); } @@ -2666,7 +2664,7 @@ Item_sp::Item_sp(THD *thd, Item_sp *item): dummy_table= (TABLE*) thd->calloc(sizeof(TABLE)+ sizeof(TABLE_SHARE) + sizeof(Query_arena)); dummy_table->s= (TABLE_SHARE*) (dummy_table+1); - sp_query_arena= (Query_arena *) (dummy_table->s + 1); + sp_query_arena= new(dummy_table->s + 1) Query_arena(); memset(&sp_mem_root, 0, sizeof(sp_mem_root)); } @@ -6281,12 +6279,14 @@ Item *Item_field::replace_equal_field(THD *thd, uchar *arg) item_equal->compare_type_handler()->cmp_type()); return const_item2; } - Item_field *subst= - (Item_field *)(item_equal->get_first(param->context_tab, this)); + Item_ident *subst= + (Item_ident *) (item_equal->get_first(param->context_tab, this)); if (subst) - subst= (Item_field *) (subst->real_item()); - if (subst && !field->eq(subst->field)) - return subst; + { + Item_field *subst2= (Item_field *) (subst->real_item()); + if (subst2 && !field->eq(subst2->field)) + return subst2; + } } return this; } diff --git a/sql/item_buff.cc b/sql/item_buff.cc index 9c96fdb1a9a..05cef6871be 100644 --- a/sql/item_buff.cc +++ b/sql/item_buff.cc @@ -47,9 +47,9 @@ Cached_item *new_Cached_item(THD *thd, Item *item, bool pass_through_ref) } switch (item->result_type()) { case STRING_RESULT: - return new Cached_item_str(thd, (Item_field *) item); + return new Cached_item_str(thd, item); case INT_RESULT: - return new Cached_item_int((Item_field *) item); + return new Cached_item_int(item); case REAL_RESULT: return new Cached_item_real(item); case DECIMAL_RESULT: diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 4a134e99bfc..97c41373d12 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -5800,13 +5800,17 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) if (!res2) return FALSE; // Null argument - const size_t len = res2->length(); - const char* first = res2->ptr(); - const char* last = first + len - 1; + const size_t len= res2->length(); + /* len must be > 2 ('%pattern%') heuristic: only do TurboBM for pattern_len > 2 */ + if (len <= 2) + return FALSE; + + const char* first= res2->ptr(); + const char* last= first + len - 1; if (len > MIN_TURBOBM_PATTERN_LEN + 2 && *first == wild_many && diff --git a/sql/item_func.cc b/sql/item_func.cc index e133fead665..b3f60e052ae 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2015, Oracle and/or its affiliates. - Copyright (c) 2009, 2020, MariaDB + Copyright (c) 2009, 2021, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1104,17 +1104,20 @@ double Item_func_plus::real_op() return check_float_overflow(value); } +#if defined(__powerpc64__) && GCC_VERSION >= 6003 && GCC_VERSION <= 10002 +#pragma GCC push_options +#pragma GCC optimize ("no-expensive-optimizations") +#endif longlong Item_func_plus::int_op() { longlong val0= args[0]->val_int(); longlong val1= args[1]->val_int(); - longlong res= val0 + val1; bool res_unsigned= FALSE; + longlong res; if ((null_value= args[0]->null_value || args[1]->null_value)) return 0; - /* First check whether the result can be represented as a (bool unsigned_flag, longlong value) pair, then check if it is compatible @@ -1155,16 +1158,29 @@ longlong Item_func_plus::int_op() { if (val0 >=0 && val1 >= 0) res_unsigned= TRUE; - else if (val0 < 0 && val1 < 0 && res >= 0) + else if (val0 < 0 && val1 < 0 && val0 < (LONGLONG_MIN - val1)) goto err; } } + +#ifndef WITH_UBSAN + res= val0 + val1; +#else + if (res_unsigned) + res= (longlong) ((ulonglong) val0 + (ulonglong) val1); + else + res= val0+val1; +#endif /* WITH_UBSAN */ + return check_integer_overflow(res, res_unsigned); err: return raise_integer_overflow(); } +#if defined(__powerpc64__) && GCC_VERSION >= 6003 && GCC_VERSION <= 10002 +#pragma GCC pop_options +#endif /** Calculate plus of two decimals. @@ -1259,12 +1275,17 @@ double Item_func_minus::real_op() } +#if defined(__powerpc64__) && GCC_VERSION >= 6003 && GCC_VERSION <= 10002 +#pragma GCC push_options +#pragma GCC optimize ("no-expensive-optimizations") +#endif + longlong Item_func_minus::int_op() { longlong val0= args[0]->val_int(); longlong val1= args[1]->val_int(); - longlong res= val0 - val1; bool res_unsigned= FALSE; + longlong res; if ((null_value= args[0]->null_value || args[1]->null_value)) return 0; @@ -1279,12 +1300,8 @@ longlong Item_func_minus::int_op() if (args[1]->unsigned_flag) { if ((ulonglong) val0 < (ulonglong) val1) - { - if (res >= 0) - goto err; - } - else - res_unsigned= TRUE; + goto err; + res_unsigned= TRUE; } else { @@ -1305,23 +1322,35 @@ longlong Item_func_minus::int_op() { if (args[1]->unsigned_flag) { - if ((ulonglong) (val0 - LONGLONG_MIN) < (ulonglong) val1) + if (((ulonglong) val0 - (ulonglong) LONGLONG_MIN) < (ulonglong) val1) goto err; } else { if (val0 > 0 && val1 < 0) res_unsigned= TRUE; - else if (val0 < 0 && val1 > 0 && res >= 0) + else if (val0 < 0 && val1 > 0 && val0 < (LONGLONG_MIN + val1)) goto err; } } +#ifndef WITH_UBSAN + res= val0 - val1; +#else + if (res_unsigned) + res= (longlong) ((ulonglong) val0 - (ulonglong) val1); + else + res= val0 - val1; +#endif /* WITH_UBSAN */ + return check_integer_overflow(res, res_unsigned); err: return raise_integer_overflow(); } +#if defined(__powerpc64__) && GCC_VERSION >= 6003 && GCC_VERSION <= 10002 +#pragma GCC pop_options +#endif /** See Item_func_plus::decimal_op for comments. @@ -3114,10 +3143,11 @@ longlong Item_func_locate::val_int() if (arg_count == 3) { - start0= start= args[2]->val_int() - 1; + start0= start= args[2]->val_int(); - if ((start < 0) || (start > a->length())) + if ((start <= 0) || (start > a->length())) return 0; + start0--; start--; /* start is now sufficiently valid to pass to charpos function */ start= a->charpos((int) start); @@ -3281,7 +3311,7 @@ bool Item_func_find_in_set::fix_length_and_dec() find->length(), 0); enum_bit=0; if (enum_value) - enum_bit=1LL << (enum_value-1); + enum_bit= 1ULL << (enum_value-1); } } } diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 032ecb1bb91..220a3e8de92 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -613,8 +613,6 @@ String *Item_func_json_unquote::read_json(json_engine_t *je) json_scan_start(je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); - je->value_type= (enum json_value_types) -1; /* To report errors right. */ - if (json_read_value(je)) goto error; @@ -977,7 +975,8 @@ my_decimal *Item_func_json_extract::val_decimal(my_decimal *to) case JSON_VALUE_ARRAY: case JSON_VALUE_FALSE: case JSON_VALUE_NULL: - break; + case JSON_VALUE_UNINITALIZED: + break; }; } int2my_decimal(E_DEC_FATAL_ERROR, 0, false/*unsigned_flag*/, to); diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index b4f706984a5..27f00c308d4 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1496,17 +1496,18 @@ String *Item_func_insert::val_str(String *str) null_value=0; res=args[0]->val_str(str); res2=args[3]->val_str(&tmp_value); - start= args[1]->val_int() - 1; + start= args[1]->val_int(); length= args[2]->val_int(); if (args[0]->null_value || args[1]->null_value || args[2]->null_value || args[3]->null_value) goto null; /* purecov: inspected */ - if ((start < 0) || (start > res->length())) + if ((start <= 0) || (start > res->length())) return res; // Wrong param; skip insert if ((length < 0) || (length > res->length())) length= res->length(); + start--; /* There is one exception not handled (intentionaly) by the character set @@ -3775,13 +3776,12 @@ String *Item_func_unhex::val_str(String *str) } for (end=res->ptr()+res->length(); from < end ; from+=2, to++) { - int hex_char; - *to= (hex_char= hexchar_to_int(from[0])) << 4; - if ((null_value= (hex_char == -1))) - return 0; - *to|= hex_char= hexchar_to_int(from[1]); - if ((null_value= (hex_char == -1))) + int hex_char1, hex_char2; + hex_char1= hexchar_to_int(from[0]); + hex_char2= hexchar_to_int(from[1]); + if ((null_value= (hex_char1 == -1 || hex_char2 == -1))) return 0; + *to= (char) ((hex_char1 << 4) | hex_char2); } return str; } diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 1ae62a4a6e8..36300e57f03 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -42,8 +42,13 @@ protected: we don't want to free and potentially have to reallocate the buffer for each call. */ - str_value.length(0); - str_value.set_charset(collation.collation); + if (!str_value.is_alloced()) + str_value.set("", 0, collation.collation); /* Avoid null ptrs */ + else + { + str_value.length(0); /* Reuse allocated area */ + str_value.set_charset(collation.collation); + } return &str_value; } public: diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 34ae6f54f8c..7fc7f4139e9 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2002, 2016, Oracle and/or its affiliates. - Copyright (c) 2010, 2016, MariaDB + Copyright (c) 2010, 2021, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -685,6 +685,31 @@ bool Item_subselect::is_expensive() } +static +int walk_items_for_table_list(Item_processor processor, + bool walk_subquery, void *argument, + List<TABLE_LIST>& join_list) +{ + List_iterator<TABLE_LIST> li(join_list); + int res; + while (TABLE_LIST *table= li++) + { + if (table->on_expr) + { + if ((res= table->on_expr->walk(processor, walk_subquery, argument))) + return res; + } + if (table->nested_join) + { + if ((res= walk_items_for_table_list(processor, walk_subquery, argument, + table->nested_join->join_list))) + return res; + } + } + return 0; +} + + bool Item_subselect::unknown_splocal_processor(void *argument) { SELECT_LEX *sl= unit->first_select(); @@ -750,7 +775,10 @@ bool Item_subselect::walk(Item_processor processor, bool walk_subquery, if (lex->having && (lex->having)->walk(processor, walk_subquery, argument)) return 1; - /* TODO: why does this walk WHERE/HAVING but not ON expressions of outer joins? */ + + if (walk_items_for_table_list(processor, walk_subquery, argument, + *lex->join_list)) + return 1; while ((item=li++)) { diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 7106f72e237..537eaaf8dcd 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -2639,9 +2639,9 @@ bool Item_sum_bit::add_as_window(ulonglong value) void Item_sum_or::set_bits_from_counters() { ulonglong value= 0; - for (int i= 0; i < NUM_BIT_COUNTERS; i++) + for (uint i= 0; i < NUM_BIT_COUNTERS; i++) { - value|= bit_counters[i] > 0 ? (1 << i) : 0; + value|= bit_counters[i] > 0 ? (1ULL << i) : 0ULL; } bits= value | reset_bits; } @@ -3887,7 +3887,7 @@ Item_func_group_concat(THD *thd, Name_resolution_context *context_arg, arg_count_field(select_list->elements), row_count(0), distinct(distinct_arg), - warning_for_row(FALSE), + warning_for_row(FALSE), always_null(FALSE), force_copy_fields(0), row_limit(NULL), offset_limit(NULL), limit_clause(limit_clause), copy_offset_limit(0), copy_row_limit(0), original(0) diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index b8650a5c7e9..3707811f3f6 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -729,7 +729,10 @@ static bool make_date_time(const String *format, const MYSQL_TIME *l_time, For example, '1.1' -> '1.100000' */ -static bool get_interval_info(const char *str, size_t length,CHARSET_INFO *cs, size_t count, ulonglong *values, +#define MAX_DIGITS_IN_TIME_SPEC 20 + +static bool get_interval_info(const char *str, size_t length,CHARSET_INFO *cs, + size_t count, ulonglong *values, bool transform_msec) { const char *end=str+length; @@ -741,11 +744,21 @@ static bool get_interval_info(const char *str, size_t length,CHARSET_INFO *cs, s for (i=0 ; i < count ; i++) { - longlong value; + ulonglong value; const char *start= str; - for (value= 0; str != end && my_isdigit(cs, *str); str++) + const char *local_end= end; + + /* + We limit things to 19 digits to not get an overflow. This is ok as + this function is meant to read up to microseconds + */ + if ((local_end-str) > MAX_DIGITS_IN_TIME_SPEC) + local_end= str+ MAX_DIGITS_IN_TIME_SPEC; + + for (value= 0; str != local_end && my_isdigit(cs, *str) ; str++) value= value*10 + *str - '0'; - if ((field_length= (size_t)(str - start)) >= 20) + + if ((field_length= (size_t)(str - start)) >= MAX_DIGITS_IN_TIME_SPEC) return true; values[i]= value; while (str != end && !my_isdigit(cs,*str)) @@ -2070,9 +2083,9 @@ bool Func_handler_date_add_interval_datetime_arg0_time:: bool Item_date_add_interval::eq(const Item *item, bool binary_cmp) const { - Item_date_add_interval *other= (Item_date_add_interval*) item; if (!Item_func::eq(item, binary_cmp)) return 0; + Item_date_add_interval *other= (Item_date_add_interval*) item; return ((int_type == other->int_type) && (date_sub_interval == other->date_sub_interval)); } diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc index c9cff6ad930..877a49edbec 100644 --- a/sql/mf_iocache.cc +++ b/sql/mf_iocache.cc @@ -26,7 +26,7 @@ Used instead of FILE when reading or writing whole files. This will make mf_rec_cache obsolete. One can change info->pos_in_file to a higher value to skip bytes in file if - also info->rc_pos is set to info->rc_end. + also info->read_pos is set to info->read_end. If called through open_cached_file(), then the temporary file will only be created if a write exeeds the file buffer or if one calls flush_io_cache(). diff --git a/sql/opt_split.cc b/sql/opt_split.cc index 797401c9b42..28a54838169 100644 --- a/sql/opt_split.cc +++ b/sql/opt_split.cc @@ -204,7 +204,7 @@ struct SplM_field_info struct SplM_plan_info { /* The cached splitting execution plan P */ - struct st_position *best_positions; + POSITION *best_positions; /* The cost of the above plan */ double cost; /* Selectivity of splitting used in P */ diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 1c7fe20f12e..dd981a8fdcb 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -2998,7 +2998,7 @@ void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx, } -void Sj_materialization_picker::set_from_prev(struct st_position *prev) +void Sj_materialization_picker::set_from_prev(POSITION *prev) { if (prev->sjmat_picker.is_used) set_empty(); @@ -3184,7 +3184,7 @@ bool Sj_materialization_picker::check_qep(JOIN *join, } -void LooseScan_picker::set_from_prev(struct st_position *prev) +void LooseScan_picker::set_from_prev(POSITION *prev) { if (prev->loosescan_picker.is_used) set_empty(); @@ -3205,7 +3205,7 @@ bool LooseScan_picker::check_qep(JOIN *join, double *read_time, table_map *handled_fanout, sj_strategy_enum *strategy, - struct st_position *loose_scan_pos) + POSITION *loose_scan_pos) { POSITION *first= join->positions + first_loosescan_table; /* @@ -3283,7 +3283,7 @@ bool LooseScan_picker::check_qep(JOIN *join, return FALSE; } -void Firstmatch_picker::set_from_prev(struct st_position *prev) +void Firstmatch_picker::set_from_prev(POSITION *prev) { if (prev->firstmatch_picker.is_used) invalidate_firstmatch_prefix(); @@ -5819,8 +5819,8 @@ Item *and_new_conditions_to_optimized_cond(THD *thd, Item *cond, ((Item_func *) item)->functype() == Item_func::EQ_FUNC && check_simple_equality(thd, Item::Context(Item::ANY_SUBST, - ((Item_func_equal *)item)->compare_type_handler(), - ((Item_func_equal *)item)->compare_collation()), + ((Item_func_eq *)item)->compare_type_handler(), + ((Item_func_eq *)item)->compare_collation()), ((Item_func *)item)->arguments()[0], ((Item_func *)item)->arguments()[1], &new_cond_equal)) diff --git a/sql/partition_element.h b/sql/partition_element.h index ff0d0d59fc4..e0a519065cc 100644 --- a/sql/partition_element.h +++ b/sql/partition_element.h @@ -144,6 +144,7 @@ public: part_min_rows(part_elem->part_min_rows), range_value(0), partition_name(NULL), tablespace_name(part_elem->tablespace_name), + log_entry(NULL), part_comment(part_elem->part_comment), data_file_name(part_elem->data_file_name), index_file_name(part_elem->index_file_name), @@ -152,6 +153,8 @@ public: part_state(part_elem->part_state), nodegroup_id(part_elem->nodegroup_id), has_null_value(FALSE), + signed_flag(part_elem->signed_flag), + max_value(part_elem->max_value), id(part_elem->id), empty(part_elem->empty), type(CONVENTIONAL) diff --git a/sql/service_wsrep.cc b/sql/service_wsrep.cc index d0a96a85a60..91b1a48cad7 100644 --- a/sql/service_wsrep.cc +++ b/sql/service_wsrep.cc @@ -119,15 +119,23 @@ extern "C" my_bool wsrep_get_debug() return wsrep_debug; } +/* + Test if this connection is a true local (user) connection and not + a replication or wsrep applier thread. + + Note that this is only usable for galera (as there are other kinds + of system threads, and only if WSREP_NNULL() is tested by the caller. + */ extern "C" my_bool wsrep_thd_is_local(const THD *thd) { /* - async replication IO and background threads have nothing to replicate in the cluster, - marking them as non-local here to prevent write set population and replication + async replication IO and background threads have nothing to + replicate in the cluster, marking them as non-local here to + prevent write set population and replication - async replication SQL thread, applies client transactions from mariadb master - and will be replicated into cluster - */ + async replication SQL thread, applies client transactions from + mariadb master and will be replicated into cluster + */ return ( thd->system_thread != SYSTEM_THREAD_SLAVE_BACKGROUND && thd->system_thread != SYSTEM_THREAD_SLAVE_IO && diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index 2d3eaa609aa..6aac9ac5962 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -32,7 +32,7 @@ #endif -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__FreeBSD__) #include <sys/sysctl.h> #endif @@ -54,7 +54,7 @@ extern const char *optimizer_switch_names[]; static inline void output_core_info() { /* proc is optional on some BSDs so it can't hurt to look */ -#if defined(HAVE_READLINK) && !defined(__APPLE__) +#if defined(HAVE_READLINK) && !defined(__APPLE__) && !defined(__FreeBSD__) char buff[PATH_MAX]; ssize_t len; int fd; @@ -85,7 +85,7 @@ static inline void output_core_info() my_close(fd, MYF(0)); } #endif -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) char buff[PATH_MAX]; size_t len = sizeof(buff); if (sysctlbyname("kern.corefile", buff, &len, NULL, 0) == 0) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 3f6a13778a9..bba875d883c 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2018, Oracle and/or its affiliates. - Copyright (c) 2009, 2020, MariaDB + Copyright (c) 2009, 2021, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -5486,7 +5486,7 @@ routine_hash_search(const char *host, const char *ip, const char *db, const char *user, const char *tname, const Sp_handler *sph, bool exact) { - return (GRANT_TABLE*) + return (GRANT_NAME*) name_hash_search(sph->get_priv_hash(), host, ip, db, user, tname, exact, TRUE); } @@ -5500,6 +5500,10 @@ table_hash_search(const char *host, const char *ip, const char *db, user, tname, exact, FALSE); } +static bool column_priv_insert(GRANT_TABLE *grant) +{ + return my_hash_insert(&column_priv_hash,(uchar*) grant); +} static GRANT_COLUMN * column_hash_search(GRANT_TABLE *t, const char *cname, size_t length) @@ -5729,6 +5733,15 @@ static inline void get_grantor(THD *thd, char *grantor) strxmov(grantor, user, "@", host, NullS); } + +/** + Revoke rights from a grant table entry. + + @return 0 ok + @return 1 fatal error (error given) + @return -1 grant table was revoked +*/ + static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, TABLE *table, const LEX_USER &combo, const char *db, const char *table_name, @@ -5753,7 +5766,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, { my_message(ER_PASSWORD_NO_MATCH, ER_THD(thd, ER_PASSWORD_NO_MATCH), MYF(0)); /* purecov: deadcode */ - DBUG_RETURN(-1); /* purecov: deadcode */ + DBUG_RETURN(1); /* purecov: deadcode */ } } @@ -5784,7 +5797,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0), combo.user.str, combo.host.str, table_name); /* purecov: deadcode */ - DBUG_RETURN(-1); /* purecov: deadcode */ + DBUG_RETURN(1); /* purecov: deadcode */ } old_row_exists = 0; restore_record(table,record[1]); // Get saved record @@ -5846,13 +5859,14 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, else { my_hash_delete(&column_priv_hash,(uchar*) grant_table); + DBUG_RETURN(-1); // Entry revoked } DBUG_RETURN(0); /* This should never happen */ table_error: table->file->print_error(error,MYF(0)); /* purecov: deadcode */ - DBUG_RETURN(-1); /* purecov: deadcode */ + DBUG_RETURN(1); /* purecov: deadcode */ } @@ -6613,7 +6627,7 @@ static int update_role_table_columns(GRANT_TABLE *merged, privs, cols); merged->init_privs= merged->init_cols= NO_ACL; update_role_columns(merged, first, last); - my_hash_insert(&column_priv_hash,(uchar*) merged); + column_priv_insert(merged); return 2; } else if ((privs | cols) == NO_ACL) @@ -7077,12 +7091,12 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, result= TRUE; continue; } - grant_table = new GRANT_TABLE (Str->host.str, db_name, - Str->user.str, table_name, - rights, - column_priv); + grant_table= new (&grant_memroot) GRANT_TABLE(Str->host.str, db_name, + Str->user.str, table_name, + rights, + column_priv); if (!grant_table || - my_hash_insert(&column_priv_hash,(uchar*) grant_table)) + column_priv_insert(grant_table)) { result= TRUE; /* purecov: deadcode */ continue; /* purecov: deadcode */ @@ -7125,22 +7139,24 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, /* TODO(cvicentiu) refactor replace_table_table to use Tables_priv_table instead of TABLE directly. */ - if (replace_table_table(thd, grant_table, tables.tables_priv_table().table(), - *Str, db_name, table_name, - rights, column_priv, revoke_grant)) - { - /* Should only happen if table is crashed */ - result= TRUE; /* purecov: deadcode */ - } - else if (tables.columns_priv_table().table_exists()) + if (tables.columns_priv_table().table_exists()) { /* TODO(cvicentiu) refactor replace_column_table to use Columns_priv_table instead of TABLE directly. */ if (replace_column_table(grant_table, tables.columns_priv_table().table(), *Str, columns, db_name, table_name, rights, revoke_grant)) - { result= TRUE; + } + if (int res= replace_table_table(thd, grant_table, + tables.tables_priv_table().table(), + *Str, db_name, table_name, + rights, column_priv, revoke_grant)) + { + if (res > 0) + { + /* Should only happen if table is crashed */ + result= TRUE; /* purecov: deadcode */ } } if (Str->is_role()) @@ -7152,9 +7168,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, mysql_mutex_unlock(&acl_cache->lock); if (!result) /* success */ - { result= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); - } mysql_rwlock_unlock(&LOCK_grant); @@ -7846,7 +7860,7 @@ static bool grant_load(THD *thd, if (! mem_check->ok()) delete mem_check; - else if (my_hash_insert(&column_priv_hash,(uchar*) mem_check)) + else if (column_priv_insert(mem_check)) { delete mem_check; goto end_unlock; @@ -11336,46 +11350,44 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list) { for (counter= 0, revoked= 0 ; counter < column_priv_hash.records ; ) { - const char *user,*host; + const char *user,*host; GRANT_TABLE *grant_table= (GRANT_TABLE*) my_hash_element(&column_priv_hash, counter); user= grant_table->user; host= safe_str(grant_table->host.hostname); - if (!strcmp(lex_user->user.str,user) && + if (!strcmp(lex_user->user.str,user) && !strcmp(lex_user->host.str, host)) - { - /* TODO(cvicentiu) refactor replace_db_table to use - Db_table instead of TABLE directly. */ - if (replace_table_table(thd, grant_table, - tables.tables_priv_table().table(), - *lex_user, grant_table->db, - grant_table->tname, ALL_KNOWN_ACL, NO_ACL, 1)) - { - result= -1; - } - else - { - if (!grant_table->cols) - { - revoked= 1; - continue; - } - List<LEX_COLUMN> columns; - /* TODO(cvicentiu) refactor replace_db_table to use - Db_table instead of TABLE directly. */ - if (!replace_column_table(grant_table, - tables.columns_priv_table().table(), - *lex_user, columns, grant_table->db, - grant_table->tname, ALL_KNOWN_ACL, 1)) - { - revoked= 1; - continue; - } - result= -1; - } - } - counter++; + { + List<LEX_COLUMN> columns; + /* TODO(cvicentiu) refactor to use + Db_table instead of TABLE directly. */ + if (replace_column_table(grant_table, + tables.columns_priv_table().table(), + *lex_user, columns, + grant_table->db, grant_table->tname, + ALL_KNOWN_ACL, 1)) + result= -1; + if (int res= replace_table_table(thd, grant_table, + tables.tables_priv_table().table(), + *lex_user, + grant_table->db, grant_table->tname, + ALL_KNOWN_ACL, NO_ACL, 1)) + { + if (res > 0) + result= -1; + else + { + /* + Entry was deleted. We have to retry the loop as the + hash table has probably been reorganized. + */ + revoked= 1; + continue; + } + } + } + counter++; } } while (revoked); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 85318c60ec3..5f66ea9608f 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -7823,11 +7823,15 @@ bool setup_tables(THD *thd, Name_resolution_context *context, DBUG_RETURN(1); } tablenr++; - } - if (tablenr > MAX_TABLES) - { - my_error(ER_TOO_MANY_TABLES,MYF(0), static_cast<int>(MAX_TABLES)); - DBUG_RETURN(1); + /* + We test the max tables here as we setup_table_map() should not be called + with tablenr >= 64 + */ + if (tablenr > MAX_TABLES) + { + my_error(ER_TOO_MANY_TABLES,MYF(0), static_cast<int>(MAX_TABLES)); + DBUG_RETURN(1); + } } } else diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 8a01f1a9ae5..85fb0367dfb 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -820,7 +820,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier) net.reading_or_writing= 0; client_capabilities= 0; // minimalistic client system_thread= NON_SYSTEM_THREAD; - cleanup_done= free_connection_done= abort_on_warning= 0; + cleanup_done= free_connection_done= abort_on_warning= got_warning= 0; peer_port= 0; // For SHOW PROCESSLIST transaction= &default_transaction; transaction->m_pending_rows_event= 0; diff --git a/sql/sql_class.h b/sql/sql_class.h index a1b9fc0969e..b5c56f1e62e 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -6402,11 +6402,13 @@ public: - The sj-materialization temporary table - Members needed to make index lookup or a full scan of the temptable. */ +class POSITION; + class SJ_MATERIALIZATION_INFO : public Sql_alloc { public: /* Optimal join sub-order */ - struct st_position *positions; + POSITION *positions; uint tables; /* Number of tables in the sj-nest */ diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 35b4294707f..ecd5e7c21fe 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2002, 2011, Oracle and/or its affiliates. - Copyright (c) 2010, 2020, MariaDB + Copyright (c) 2010, 2021, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -596,6 +596,32 @@ bool mysql_derived_init(THD *thd, LEX *lex, TABLE_LIST *derived) } +/** + @brief + Prevent name resolution out of context of ON expressions in derived tables + + @param + join_list list of tables used in from list of a derived + + @details + The function sets the Name_resolution_context::outer_context to NULL + for all ON expressions contexts in the given join list. It does this + recursively for all nested joins the list contains. +*/ + +static void nullify_outer_context_for_on_clauses(List<TABLE_LIST>& join_list) +{ + List_iterator<TABLE_LIST> li(join_list); + while (TABLE_LIST *table= li++) + { + if (table->on_context) + table->on_context->outer_context= NULL; + if (table->nested_join) + nullify_outer_context_for_on_clauses(table->nested_join->join_list); + } +} + + /* Create temporary table structure (but do not fill it) @@ -760,7 +786,12 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) /* prevent name resolving out of derived table */ for (SELECT_LEX *sl= first_select; sl; sl= sl->next_select()) { + // Prevent it for the WHERE clause sl->context.outer_context= 0; + + // And for ON clauses, if there are any + nullify_outer_context_for_on_clauses(*sl->join_list); + if (!derived->is_with_table_recursive_reference() || (!derived->with->with_anchor && !derived->with->is_with_prepared_anchor())) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index ce5f78b84ad..2b6b3f87b58 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -2970,6 +2970,7 @@ void st_select_lex::init_query() is_service_select= 0; parsing_place= NO_MATTER; save_parsing_place= NO_MATTER; + context_analysis_place= NO_MATTER; exclude_from_table_unique_test= no_wrap_view_item= FALSE; nest_level= 0; link_next= 0; @@ -10084,7 +10085,7 @@ SELECT_LEX *LEX::parsed_subselect(SELECT_LEX_UNIT *unit) (curr_sel == NULL && current_select == &builtin_select)); if (curr_sel) { - curr_sel->register_unit(unit, &curr_sel->context); + curr_sel->register_unit(unit, context_stack.head()); curr_sel->add_statistics(unit); } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0e2b80beb78..344be7bf273 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -7710,6 +7710,7 @@ mysql_new_select(LEX *lex, bool move_down, SELECT_LEX *select_lex) bool new_select= select_lex == NULL; int old_nest_level= lex->current_select->nest_level; DBUG_ENTER("mysql_new_select"); + Name_resolution_context *curr_context; if (new_select) { @@ -7717,6 +7718,7 @@ mysql_new_select(LEX *lex, bool move_down, SELECT_LEX *select_lex) DBUG_RETURN(1); select_lex->select_number= ++thd->lex->stmt_lex->current_select_number; select_lex->parent_lex= lex; /* Used in init_query. */ + curr_context= lex->context_stack.head(); select_lex->init_query(); select_lex->init_select(); } @@ -7738,7 +7740,8 @@ mysql_new_select(LEX *lex, bool move_down, SELECT_LEX *select_lex) By default we assume that it is usual subselect and we have outer name resolution context, if no we will assign it to 0 later */ - select_lex->context.outer_context= &select_lex->outer_select()->context; + + select_lex->context.outer_context= curr_context; } else { diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 1a5ba7c320d..74f2e1b33f1 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -1505,7 +1505,7 @@ static bool check_list_constants(THD *thd, partition_info *part_info) List_iterator<part_elem_value> list_val_it2(part_def->list_val_list); while ((list_value= list_val_it2++)) { - calc_value= list_value->value - type_add; + calc_value= list_value->value ^ type_add; part_info->list_array[list_index].list_value= calc_value; part_info->list_array[list_index++].partition_id= i; } diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc index 8f87d633d19..2974c770252 100644 --- a/sql/sql_reload.cc +++ b/sql/sql_reload.cc @@ -417,6 +417,14 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options, { if (reinit_ssl()) result= 1; +#ifdef WITH_WSREP + if (!result && + WSREP_ON && wsrep_reload_ssl()) + { + my_message(ER_UNKNOWN_ERROR, "Failed to refresh WSREP SSL.", MYF(0)); + result= 1; + } +#endif } if (options & REFRESH_GENERIC) { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e87c1a989cd..dccd0dff1ae 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -357,7 +357,31 @@ bool dbug_user_var_equals_int(THD *thd, const char *name, int value) } return FALSE; } -#endif +#endif /* DBUG_OFF */ + +/* + Intialize POSITION structure. +*/ + +POSITION::POSITION() +{ + table= 0; + records_read= cond_selectivity= read_time= 0.0; + prefix_record_count= 0.0; + key= 0; + use_join_buffer= 0; + sj_strategy= SJ_OPT_NONE; + n_sj_tables= 0; + spl_plan= 0; + range_rowid_filter_info= 0; + ref_depend_map= dups_producing_tables= 0; + inner_tables_handled_with_other_sjs= 0; + dups_weedout_picker.set_empty(); + firstmatch_picker.set_empty(); + loosescan_picker.set_empty(); + sjmat_picker.set_empty(); +} + static void trace_table_dependencies(THD *thd, JOIN_TAB *join_tabs, uint table_count) @@ -1592,10 +1616,11 @@ bool JOIN::build_explain() curr_tab->tracker= thd->lex->explain->get_union(select_nr)-> get_tmptable_read_tracker(); } - else + else if (select_nr < INT_MAX) { - curr_tab->tracker= thd->lex->explain->get_select(select_nr)-> - get_using_temporary_read_tracker(); + Explain_select *tmp= thd->lex->explain->get_select(select_nr); + if (tmp) + curr_tab->tracker= tmp->get_using_temporary_read_tracker(); } } DBUG_RETURN(0); @@ -4933,6 +4958,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, /* The following should be optimized to only clear critical things */ bzero((void*)stat, sizeof(JOIN_TAB)* table_count); + /* Initialize POSITION objects */ for (i=0 ; i <= table_count ; i++) (void) new ((char*) (join->positions + i)) POSITION; @@ -16104,7 +16130,7 @@ static void update_const_equal_items(THD *thd, COND *cond, JOIN_TAB *tab, Item_func::COND_AND_FUNC)); } else if (cond->type() == Item::FUNC_ITEM && - ((Item_cond*) cond)->functype() == Item_func::MULT_EQUAL_FUNC) + ((Item_func*) cond)->functype() == Item_func::MULT_EQUAL_FUNC) { Item_equal *item_equal= (Item_equal *) cond; bool contained_const= item_equal->get_const() != NULL; @@ -16299,7 +16325,7 @@ propagate_cond_constants(THD *thd, I_List<COND_CMP> *save_list, (((Item_func*) cond)->functype() == Item_func::EQ_FUNC || ((Item_func*) cond)->functype() == Item_func::EQUAL_FUNC)) { - Item_func_eq *func=(Item_func_eq*) cond; + Item_bool_func2 *func= dynamic_cast<Item_bool_func2*>(cond); Item **args= func->arguments(); bool left_const= args[0]->const_item() && !args[0]->is_expensive(); bool right_const= args[1]->const_item() && !args[1]->is_expensive(); @@ -17241,7 +17267,7 @@ void propagate_new_equalities(THD *thd, Item *cond, } } else if (cond->type() == Item::FUNC_ITEM && - ((Item_cond*) cond)->functype() == Item_func::MULT_EQUAL_FUNC) + ((Item_func*) cond)->functype() == Item_func::MULT_EQUAL_FUNC) { Item_equal *equal_item; List_iterator<Item_equal> it(*new_equalities); @@ -17486,7 +17512,7 @@ Item_cond::remove_eq_conds(THD *thd, Item::cond_result *cond_value, } else if (and_level && new_item->type() == Item::FUNC_ITEM && - ((Item_cond*) new_item)->functype() == + ((Item_func*) new_item)->functype() == Item_func::MULT_EQUAL_FUNC) { li.remove(); @@ -25481,8 +25507,8 @@ copy_fields(TMP_TABLE_PARAM *param) (*ptr->do_copy)(ptr); List_iterator_fast<Item> it(param->copy_funcs); - Item_copy_string *item; - while ((item = (Item_copy_string*) it++)) + Item_copy *item; + while ((item= (Item_copy*) it++)) item->copy(); } @@ -29601,6 +29627,7 @@ void JOIN::init_join_cache_and_keyread() } + /** @} (end of group Query_Optimizer) */ diff --git a/sql/sql_select.h b/sql/sql_select.h index 9574c93cd7d..dd364e441cb 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -700,8 +700,6 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), bool end_of_records); -struct st_position; - class Semi_join_strategy_picker { public: @@ -712,7 +710,7 @@ public: Update internal state after another table has been added to the join prefix */ - virtual void set_from_prev(struct st_position *prev) = 0; + virtual void set_from_prev(POSITION *prev) = 0; virtual bool check_qep(JOIN *join, uint idx, @@ -722,7 +720,7 @@ public: double *read_time, table_map *handled_fanout, sj_strategy_enum *strategy, - struct st_position *loose_scan_pos) = 0; + POSITION *loose_scan_pos) = 0; virtual void mark_used() = 0; @@ -753,7 +751,7 @@ public: first_dupsweedout_table= MAX_TABLES; is_used= FALSE; } - void set_from_prev(struct st_position *prev); + void set_from_prev(POSITION *prev); bool check_qep(JOIN *join, uint idx, @@ -763,7 +761,7 @@ public: double *read_time, table_map *handled_fanout, sj_strategy_enum *stratey, - struct st_position *loose_scan_pos); + POSITION *loose_scan_pos); void mark_used() { is_used= TRUE; } friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join); @@ -799,7 +797,7 @@ public: is_used= FALSE; } - void set_from_prev(struct st_position *prev); + void set_from_prev(POSITION *prev); bool check_qep(JOIN *join, uint idx, table_map remaining_tables, @@ -808,7 +806,7 @@ public: double *read_time, table_map *handled_fanout, sj_strategy_enum *strategy, - struct st_position *loose_scan_pos); + POSITION *loose_scan_pos); void mark_used() { is_used= TRUE; } friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join); @@ -817,6 +815,7 @@ public: class LooseScan_picker : public Semi_join_strategy_picker { +public: /* The first (i.e. driving) table we're doing loose scan for */ uint first_loosescan_table; /* @@ -835,14 +834,13 @@ class LooseScan_picker : public Semi_join_strategy_picker uint loosescan_parts; /* Number of keyparts to be kept distinct */ bool is_used; -public: void set_empty() { first_loosescan_table= MAX_TABLES; is_used= FALSE; } - void set_from_prev(struct st_position *prev); + void set_from_prev(POSITION *prev); bool check_qep(JOIN *join, uint idx, table_map remaining_tables, @@ -851,19 +849,19 @@ public: double *read_time, table_map *handled_fanout, sj_strategy_enum *strategy, - struct st_position *loose_scan_pos); + POSITION *loose_scan_pos); void mark_used() { is_used= TRUE; } friend class Loose_scan_opt; friend void best_access_path(JOIN *join, JOIN_TAB *s, table_map remaining_tables, - const struct st_position *join_positions, + const POSITION *join_positions, uint idx, bool disable_jbuf, double record_count, - struct st_position *pos, - struct st_position *loose_scan_pos); + POSITION *pos, + POSITION *loose_scan_pos); friend bool get_best_combination(JOIN *join); friend int setup_semijoin_loosescan(JOIN *join); friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join); @@ -890,7 +888,7 @@ public: sjm_scan_last_inner= 0; is_used= FALSE; } - void set_from_prev(struct st_position *prev); + void set_from_prev(POSITION *prev); bool check_qep(JOIN *join, uint idx, table_map remaining_tables, @@ -899,7 +897,7 @@ public: double *read_time, table_map *handled_fanout, sj_strategy_enum *strategy, - struct st_position *loose_scan_pos); + POSITION *loose_scan_pos); void mark_used() { is_used= TRUE; } friend void fix_semijoin_strategies_for_picked_join_order(JOIN *join); @@ -914,8 +912,9 @@ class Rowid_filter; Information about a position of table within a join order. Used in join optimization. */ -typedef struct st_position +class POSITION { +public: /* The table that's put into join order */ JOIN_TAB *table; @@ -927,7 +926,7 @@ typedef struct st_position double records_read; /* The selectivity of the pushed down conditions */ - double cond_selectivity; + double cond_selectivity; /* Cost accessing the table in course of the entire complete join execution, @@ -936,8 +935,6 @@ typedef struct st_position */ double read_time; - /* Cumulative cost and record count for the join prefix */ - Cost_estimate prefix_cost; double prefix_record_count; /* @@ -946,29 +943,46 @@ typedef struct st_position */ KEYUSE *key; + /* Info on splitting plan used at this position */ + SplM_plan_info *spl_plan; + + /* Cost info for the range filter used at this position */ + Range_rowid_filter_cost_info *range_rowid_filter_info; + /* If ref-based access is used: bitmap of tables this table depends on */ table_map ref_depend_map; - + /* - TRUE <=> join buffering will be used. At the moment this is based on - *very* imprecise guesses made in best_access_path(). + Bitmap of semi-join inner tables that are in the join prefix and for + which there's no provision for how to eliminate semi-join duplicates + they produce. */ - bool use_join_buffer; - + table_map dups_producing_tables; + + table_map inner_tables_handled_with_other_sjs; + + Duplicate_weedout_picker dups_weedout_picker; + Firstmatch_picker firstmatch_picker; + LooseScan_picker loosescan_picker; + Sj_materialization_picker sjmat_picker; + + /* Cumulative cost and record count for the join prefix */ + Cost_estimate prefix_cost; + /* Current optimization state: Semi-join strategy to be used for this and preceding join tables. - + Join optimizer sets this for the *last* join_tab in the - duplicate-generating range. That is, in order to interpret this field, + duplicate-generating range. That is, in order to interpret this field, one needs to traverse join->[best_]positions array from right to left. When you see a join table with sj_strategy!= SJ_OPT_NONE, some other - field (depending on the strategy) tells how many preceding positions + field (depending on the strategy) tells how many preceding positions this applies to. The values of covered_preceding_positions->sj_strategy must be ignored. */ enum sj_strategy_enum sj_strategy; - + /* Valid only after fix_semijoin_strategies_for_picked_join_order() call: if sj_strategy!=SJ_OPT_NONE, this is the number of subsequent tables that @@ -977,26 +991,12 @@ typedef struct st_position uint n_sj_tables; /* - Bitmap of semi-join inner tables that are in the join prefix and for - which there's no provision for how to eliminate semi-join duplicates - they produce. + TRUE <=> join buffering will be used. At the moment this is based on + *very* imprecise guesses made in best_access_path(). */ - table_map dups_producing_tables; - - table_map inner_tables_handled_with_other_sjs; - - Duplicate_weedout_picker dups_weedout_picker; - Firstmatch_picker firstmatch_picker; - LooseScan_picker loosescan_picker; - Sj_materialization_picker sjmat_picker; - - /* Info on splitting plan used at this position */ - SplM_plan_info *spl_plan; - - /* Cost info for the range filter used at this position */ - Range_rowid_filter_cost_info *range_rowid_filter_info; - -} POSITION; + bool use_join_buffer; + POSITION(); +}; typedef Bounds_checked_array<Item_null_result*> Item_null_array; @@ -1592,6 +1592,7 @@ public: fields_list= fields_arg; non_agg_fields.empty(); bzero((char*) &keyuse,sizeof(keyuse)); + having_value= Item::COND_UNDEF; tmp_table_param.init(); tmp_table_param.end_write_records= HA_POS_ERROR; rollup.state= ROLLUP::STATE_NONE; diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc index f881f6a8cc6..307a0b29c57 100644 --- a/sql/sql_sequence.cc +++ b/sql/sql_sequence.cc @@ -727,8 +727,8 @@ longlong SEQUENCE::next_value(TABLE *table, bool second_round, int *error) if (real_increment > 0) { - if (reserved_until + add_to > max_value || - reserved_until > max_value - add_to) + if (reserved_until > max_value - add_to || + reserved_until + add_to > max_value) { reserved_until= max_value + 1; out_of_values= res_value >= reserved_until; diff --git a/sql/sql_sequence.h b/sql/sql_sequence.h index 2d609d8591b..29c589e67cd 100644 --- a/sql/sql_sequence.h +++ b/sql/sql_sequence.h @@ -111,8 +111,8 @@ public: { if (real_increment > 0) { - if (value + real_increment > max_value || - value > max_value - real_increment) + if (value > max_value - real_increment || + value + real_increment > max_value) value= max_value + 1; else value+= real_increment; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index ee4bf6ca7b6..d7050bcf2d1 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -7052,8 +7052,7 @@ static bool store_trigger(THD *thd, Trigger *trigger, (my_time_t)(trigger->create_time/100)); /* timestamp is with 6 digits */ timestamp.second_part= (trigger->create_time % 100) * 10000; - ((Field_temporal_with_date*) table->field[16])->store_time_dec(×tamp, - 2); + table->field[16]->store_time_dec(×tamp, 2); } sql_mode_string_representation(thd, trigger->sql_mode, &sql_mode_rep); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 99070bcd89c..00815fdd36c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -8667,7 +8667,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, If the '0000-00-00' value isn't allowed then raise the error_if_not_empty flag to allow ALTER TABLE only if the table to be altered is empty. */ - if (!alter_ctx->implicit_default_value_error_field && + if (!alter_ctx->implicit_default_value_error_field && !def->field && !(~def->flags & (NO_DEFAULT_VALUE_FLAG | NOT_NULL_FLAG)) && def->type_handler()->validate_implicit_default_value(thd, *def)) { @@ -8913,7 +8913,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, key_parts.push_back(new (thd->mem_root) Key_part_spec(&cfield->field_name, key_part_length, true), thd->mem_root); - if (cfield->invisible < INVISIBLE_SYSTEM) + if (!(cfield->invisible == INVISIBLE_SYSTEM && cfield->vers_sys_field())) user_keyparts= true; } if (table->s->tmp_table == NO_TMP_TABLE) @@ -8925,6 +8925,14 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, (void) delete_statistics_for_index(thd, table, key_info, TRUE); } + if (!user_keyparts && key_parts.elements) + { + /* + If we dropped all user key-parts we also drop implicit system fields. + */ + key_parts.empty(); + } + if (key_parts.elements) { KEY_CREATE_INFO key_create_info; @@ -8960,7 +8968,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, key_type= Key::PRIMARY; else key_type= Key::UNIQUE; - if (dropped_key_part && user_keyparts) + if (dropped_key_part) { my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), dropped_key_part); if (long_hash_key) diff --git a/sql/sql_test.cc b/sql/sql_test.cc index 6c1e5a2a578..07ebcc7a37a 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -295,7 +295,6 @@ print_plan(JOIN* join, uint idx, double record_count, double read_time, double current_read_time, const char *info) { uint i; - POSITION pos; JOIN_TAB *join_table; JOIN_TAB **plan_nodes; TABLE* table; @@ -322,8 +321,8 @@ print_plan(JOIN* join, uint idx, double record_count, double read_time, fputs(" POSITIONS: ", DBUG_FILE); for (i= 0; i < idx ; i++) { - pos = join->positions[i]; - table= pos.table->table; + POSITION *pos= join->positions + i; + table= pos->table->table; if (table) fputs(table->s->table_name.str, DBUG_FILE); fputc(' ', DBUG_FILE); @@ -339,8 +338,8 @@ print_plan(JOIN* join, uint idx, double record_count, double read_time, fputs("BEST_POSITIONS: ", DBUG_FILE); for (i= 0; i < idx ; i++) { - pos= join->best_positions[i]; - table= pos.table->table; + POSITION *pos= join->best_positions + i; + table= pos->table->table; if (table) fputs(table->s->table_name.str, DBUG_FILE); fputc(' ', DBUG_FILE); diff --git a/sql/sql_type_int.h b/sql/sql_type_int.h index 9fd4f0c46a0..fca00f25448 100644 --- a/sql/sql_type_int.h +++ b/sql/sql_type_int.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2018, MariaDB +/* Copyright (c) 2018, 2021, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -80,16 +80,20 @@ public: if (is_null() || llshift.is_null()) return Longlong_null(); uint shift= (uint) llshift.value(); - ulonglong res= ((ulonglong) value()) << shift; - return Longlong_null(shift < sizeof(longlong) * 8 ? (longlong) res : 0); + ulonglong res= (shift < sizeof(longlong) * 8) + ? ((ulonglong) value()) << shift + : 0; + return Longlong_null((longlong) res); } Longlong_null operator>>(const Longlong_null &llshift) const { if (is_null() || llshift.is_null()) return Longlong_null(); uint shift= (uint) llshift.value(); - ulonglong res= ((ulonglong) value()) >> shift; - return Longlong_null(shift < sizeof(longlong) * 8 ? (longlong) res : 0); + ulonglong res= (shift < sizeof(longlong) * 8) + ? ((ulonglong) value()) >> shift + : 0; + return Longlong_null((longlong) res); } Longlong_null bit_count() const { diff --git a/sql/strfunc.cc b/sql/strfunc.cc index c488ab1afbb..6c8fd24f780 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -81,14 +81,17 @@ ulonglong find_set(const TYPELIB *lib, var_len= (uint) (pos - start); uint find= cs ? find_type2(lib, start, var_len, cs) : find_type(lib, start, var_len, (bool) 0); - if (unlikely(!find && *err_len == 0)) + if (unlikely(!find)) { - // report the first error with length > 0 - *err_pos= (char*) start; - *err_len= var_len; - *set_warning= 1; + if (*err_len == 0) + { + // report the first error with length > 0 + *err_pos= (char*) start; + *err_len= var_len; + *set_warning= 1; + } } - else + else if (find <= sizeof(longlong) * 8) found|= 1ULL << (find - 1); if (pos >= end) break; @@ -402,4 +405,3 @@ const char *flagset_to_string(THD *thd, LEX_CSTRING *result, ulonglong set, return result->str; } - diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 814690ac35d..a8e4ff2dded 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2002, 2015, Oracle and/or its affiliates. - Copyright (c) 2012, 2020, MariaDB Corporation. + Copyright (c) 2012, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -5051,15 +5051,23 @@ static Sys_var_have Sys_have_symlink( "--skip-symbolic-links option.", READ_ONLY GLOBAL_VAR(have_symlink), NO_CMD_LINE); +#if defined(__SANITIZE_ADDRESS__) || defined(WITH_UBSAN) + #ifdef __SANITIZE_ADDRESS__ +#define SANITIZER_MODE "ASAN" +#else +#define SANITIZER_MODE "UBSAN" +#endif /* __SANITIZE_ADDRESS__ */ + static char *have_sanitizer; -static Sys_var_charptr_fscs Sys_have_santitizer( +static Sys_var_charptr Sys_have_santitizer( "have_sanitizer", - "If the server is compiled with ASan (Address sanitizer) this will be " - "set to ASAN", - READ_ONLY GLOBAL_VAR(have_sanitizer), NO_CMD_LINE, - DEFAULT("ASAN")); -#endif + "If the server is compiled with sanitize (compiler option), this " + "variable is set to the sanitizer mode used. Possible values are " + "ASAN (Address sanitizer) or UBSAN (The Undefined Behavior Sanitizer).", + READ_ONLY GLOBAL_VAR(have_sanitizer), NO_CMD_LINE, + DEFAULT(SANITIZER_MODE)); +#endif /* defined(__SANITIZE_ADDRESS__) || defined(WITH_UBSAN) */ static bool fix_log_state(sys_var *self, THD *thd, enum_var_type type); diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index 1a8b5c471bd..981958abdb2 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2016, 2019, MariaDB Corporation. + Copyright (c) 2016, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -872,10 +872,12 @@ void THD::restore_tmp_table_share(TMP_TABLE_SHARE *share) bool THD::has_temporary_tables() { DBUG_ENTER("THD::has_temporary_tables"); - bool result= (rgi_slave - ? (rgi_slave->rli->save_temporary_tables && - !rgi_slave->rli->save_temporary_tables->is_empty()) - : (has_thd_temporary_tables())); + bool result= +#ifdef HAVE_REPLICATION + rgi_slave ? (rgi_slave->rli->save_temporary_tables && + !rgi_slave->rli->save_temporary_tables->is_empty()) : +#endif + has_thd_temporary_tables(); DBUG_RETURN(result); } @@ -1506,12 +1508,14 @@ bool THD::lock_temporary_tables() DBUG_RETURN(false); } +#ifdef HAVE_REPLICATION if (rgi_slave) { mysql_mutex_lock(&rgi_slave->rli->data_lock); temporary_tables= rgi_slave->rli->save_temporary_tables; m_tmp_tables_locked= true; } +#endif DBUG_RETURN(m_tmp_tables_locked); } @@ -1532,6 +1536,7 @@ void THD::unlock_temporary_tables() DBUG_VOID_RETURN; } +#ifdef HAVE_REPLICATION if (rgi_slave) { rgi_slave->rli->save_temporary_tables= temporary_tables; @@ -1539,6 +1544,7 @@ void THD::unlock_temporary_tables() mysql_mutex_unlock(&rgi_slave->rli->data_lock); m_tmp_tables_locked= false; } +#endif DBUG_VOID_RETURN; } diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index d1529bf8547..d39646af082 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -1331,6 +1331,32 @@ exit: return fail; } +bool wsrep_reload_ssl() +{ + try + { + std::string opts= Wsrep_server_state::instance().provider().options(); + if (opts.find("socket.ssl_reload") == std::string::npos) + { + WSREP_DEBUG("Option `socket.ssl_reload` not found in parameters."); + return false; + } + const std::string reload_ssl_param("socket.ssl_reload=1"); + enum wsrep::provider::status ret= Wsrep_server_state::instance().provider().options(reload_ssl_param); + if (ret) + { + WSREP_ERROR("Set options returned %d", ret); + return true; + } + return false; + } + catch (...) + { + WSREP_ERROR("Failed to get provider options"); + return true; + } +} + /*! * @param db Database string * @param table Table string diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h index 9981b247f3f..04ea633ac53 100644 --- a/sql/wsrep_mysqld.h +++ b/sql/wsrep_mysqld.h @@ -218,6 +218,7 @@ extern void wsrep_last_committed_id (wsrep_gtid_t* gtid); extern int wsrep_check_opts(); extern void wsrep_prepend_PATH (const char* path); extern bool wsrep_append_fk_parent_table(THD* thd, TABLE_LIST* table, wsrep::key_array* keys); +extern bool wsrep_reload_ssl(); /* Other global variables */ extern wsrep_seqno_t wsrep_locked_seqno; diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc index f6ed684b3ea..f30b4d1f666 100644 --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@ -1252,6 +1252,19 @@ static ssize_t sst_prepare_mysqldump (const char* addr_in, *addr_out= addr_in; } + pthread_t monitor; + ret = mysql_thread_create (key_wsrep_sst_joiner_monitor, &monitor, NULL, wsrep_sst_joiner_monitor_thread, NULL); + + if (ret) + { + WSREP_ERROR("sst_prepare_other(): mysql_thread_create() failed: %d (%s)", + ret, strerror(ret)); + return -ret; + } + + sst_joiner_completed= false; + pthread_detach (monitor); + return ret; } diff --git a/sql/wsrep_trans_observer.h b/sql/wsrep_trans_observer.h index 942363d9886..d79bfa0b39b 100644 --- a/sql/wsrep_trans_observer.h +++ b/sql/wsrep_trans_observer.h @@ -466,6 +466,16 @@ static inline void wsrep_close(THD* thd) DBUG_VOID_RETURN; } +static inline void wsrep_cleanup(THD* thd) +{ + DBUG_ENTER("wsrep_cleanup"); + if (thd->wsrep_cs().state() != wsrep::client_state::s_none) + { + thd->wsrep_cs().cleanup(); + } + DBUG_VOID_RETURN; +} + static inline void wsrep_wait_rollback_complete_and_acquire_ownership(THD *thd) { diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index 2db3768f7fc..3c557554cf4 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -25,6 +25,7 @@ #include <my_dir.h> #include <cstdio> #include <cstdlib> +#include "wsrep_trans_observer.h" ulong wsrep_reject_queries; @@ -106,7 +107,8 @@ struct handlerton* innodb_hton_ptr __attribute__((weak)); bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type) { - if (var_type == OPT_GLOBAL) { + if (var_type == OPT_GLOBAL) + { my_bool saved_wsrep_on= global_system_variables.wsrep_on; thd->variables.wsrep_on= global_system_variables.wsrep_on; @@ -114,15 +116,15 @@ bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type) // If wsrep has not been inited we need to do it now if (global_system_variables.wsrep_on && wsrep_provider && !wsrep_inited) { - char* tmp= strdup(wsrep_provider); // wsrep_init() rewrites provider - //when fails - + // wsrep_init() rewrites provide if it fails + char* tmp= strdup(wsrep_provider); mysql_mutex_unlock(&LOCK_global_system_variables); if (wsrep_init()) { my_error(ER_CANT_OPEN_LIBRARY, MYF(0), tmp, my_error, "wsrep_init failed"); //rcode= true; + saved_wsrep_on= false; } free(tmp); @@ -134,6 +136,16 @@ bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type) wsrep_set_wsrep_on(); + if (var_type == OPT_GLOBAL) + { + if (thd->variables.wsrep_on && + thd->wsrep_cs().state() == wsrep::client_state::s_none) + { + wsrep_open(thd); + wsrep_before_command(thd); + } + } + return false; } @@ -144,11 +156,31 @@ bool wsrep_on_check(sys_var *self, THD* thd, set_var* var) if (check_has_super(self, thd, var)) return true; - if (new_wsrep_on && innodb_hton_ptr && innodb_lock_schedule_algorithm != 0) { - my_message(ER_WRONG_ARGUMENTS, " WSREP (galera) can't be enabled " - "if innodb_lock_schedule_algorithm=VATS. Please configure" - " innodb_lock_schedule_algorithm=FCFS and restart.", MYF(0)); - return true; + if (new_wsrep_on) + { + if (innodb_hton_ptr && innodb_lock_schedule_algorithm != 0) + { + my_message(ER_WRONG_ARGUMENTS, " WSREP (galera) can't be enabled " + "if innodb_lock_schedule_algorithm=VATS. Please configure" + " innodb_lock_schedule_algorithm=FCFS and restart.", MYF(0)); + return true; + } + + if (!WSREP_PROVIDER_EXISTS) + { + my_message(ER_WRONG_ARGUMENTS, "WSREP (galera) can't be enabled " + "if the wsrep_provider is unset or set to 'none'", MYF(0)); + return true; + } + + if (var->type == OPT_SESSION && + !global_system_variables.wsrep_on) + { + my_message(ER_WRONG_ARGUMENTS, + "Can't enable @@session.wsrep_on, " + "while @@global.wsrep_on is disabled", MYF(0)); + return true; + } } if (thd->in_active_multi_stmt_transaction()) @@ -157,6 +189,24 @@ bool wsrep_on_check(sys_var *self, THD* thd, set_var* var) return true; } + if (var->type == OPT_GLOBAL) + { + /* + The global value is about to change. Cleanup + the transaction state and close the client + state. wsrep_on_update() will take care of + reopening it should wsrep_on be re-enabled. + */ + if (global_system_variables.wsrep_on && !new_wsrep_on) + { + wsrep_commit_empty(thd, true); + wsrep_after_statement(thd); + wsrep_after_command_ignore_result(thd); + wsrep_close(thd); + wsrep_cleanup(thd); + } + } + return false; } diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 4f4d81ffdb2..2df54567285 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -242,6 +242,20 @@ Archive_share::Archive_share() } +Archive_share::~Archive_share() +{ + DBUG_PRINT("ha_archive", ("~Archive_share: %p", this)); + if (archive_write_open) + { + mysql_mutex_lock(&mutex); + (void) close_archive_writer(); // Will reset archive_write_open + mysql_mutex_unlock(&mutex); + } + thr_lock_delete(&lock); + mysql_mutex_destroy(&mutex); +} + + ha_archive::ha_archive(handlerton *hton, TABLE_SHARE *table_arg) :handler(hton, table_arg), delayed_insert(0), bulk_insert(0) { @@ -675,7 +689,6 @@ int ha_archive::close(void) if (azclose(&archive)) rc= 1; } - DBUG_RETURN(rc); } diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h index c1b4f27e45e..2bb5079868b 100644 --- a/storage/archive/ha_archive.h +++ b/storage/archive/ha_archive.h @@ -46,19 +46,7 @@ public: bool dirty; /* Flag for if a flush should occur */ bool crashed; /* Meta file is crashed */ Archive_share(); - ~Archive_share() - { - DBUG_PRINT("ha_archive", ("~Archive_share: %p", - this)); - if (archive_write_open) - { - mysql_mutex_lock(&mutex); - (void) close_archive_writer(); - mysql_mutex_unlock(&mutex); - } - thr_lock_delete(&lock); - mysql_mutex_destroy(&mutex); - } + virtual ~Archive_share(); int init_archive_writer(); void close_archive_writer(); int write_v1_metafile(); diff --git a/storage/connect/colblk.h b/storage/connect/colblk.h index b22933d9ebb..51ab32cfae2 100644 --- a/storage/connect/colblk.h +++ b/storage/connect/colblk.h @@ -62,7 +62,7 @@ class DllExport COLBLK : public XOBJECT { bool IsVirtual(void) {return Cdp->IsVirtual();} bool IsNullable(void) {return Nullable;} void SetNullable(bool b) {Nullable = b;} - + void SetName(PSZ name_var) { Name= name_var; } // Methods virtual void Reset(void); virtual bool Compare(PXOB xp); diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index 484f75d6a04..ee62e0cd03e 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -294,9 +294,9 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2, /* its column blocks in mode write (required by XML tables). */ /*******************************************************************/ if (mode == MODE_UPDATE) { - PTDBASE utp; + PTDB utp; - if (!(utp = (PTDBASE)tdbp->Duplicate(g))) { + if (!(utp = tdbp->Duplicate(g))) { sprintf(g->Message, MSG(INV_UPDT_TABLE), tdbp->GetName()); throw 4; } // endif tp @@ -591,7 +591,7 @@ int CntCloseTable(PGLOBAL g, PTDB tdbp, bool nox, bool abort) if (!tdbp->IsRemote()) { // Make all the eventual indexes - PTDBDOS tbxp = (PTDBDOS)tdbp; + PTDBASE tbxp = (PTDBASE)tdbp; tbxp->ResetKindex(g, NULL); tbxp->SetKey_Col(NULL); rc = tbxp->ResetTableOpt(g, true, tbxp->GetDef()->Indexable() == 1); diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp index 9b1e5d7689e..d2add16b31d 100644 --- a/storage/connect/filamvct.cpp +++ b/storage/connect/filamvct.cpp @@ -4117,7 +4117,8 @@ bool BGVFAM::CleanUnusedSpace(PGLOBAL g) } else { int req; - memset(To_Buf, 0, Buflen); + if (To_Buf) + memset(To_Buf, 0, Buflen); for (n = Fpos - Tpos; n > 0; n -= req) { /*****************************************************************/ diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index b1449af9636..95cbcd2b336 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -286,7 +286,12 @@ static char *strz(PGLOBAL g, LEX_CSTRING &ls) { char *str= (char*)PlugSubAlloc(g, NULL, ls.length + 1); - memcpy(str, ls.str, ls.length); + /* + ls.str can be NULL, for example when called with + create_info->connect_string + */ + if (ls.str) + memcpy(str, ls.str, ls.length); str[ls.length]= 0; return str; } // end of strz @@ -2829,7 +2834,6 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond) } else { char buff[256]; String *res, tmp(buff, sizeof(buff), &my_charset_bin); - Item_basic_constant *pval= (Item_basic_constant *)args[i]; PPARM pp= (PPARM)PlugSubAlloc(g, NULL, sizeof(PARM)); // IN and BETWEEN clauses should be col VOP list @@ -2838,6 +2842,8 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond) switch (args[i]->real_type()) { case COND::CONST_ITEM: + { + Item *pval= (Item *)args[i]; switch (args[i]->cmp_type()) { case STRING_RESULT: res= pval->val_str(&tmp); @@ -2864,6 +2870,7 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond) DBUG_ASSERT(0); return NULL; } + } break; case COND::CACHE_ITEM: // Possible ??? case COND::NULL_ITEM: // TODO: handle this @@ -3119,7 +3126,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond) } else { char buff[256]; String *res, tmp(buff, sizeof(buff), &my_charset_bin); - Item_basic_constant *pval= (Item_basic_constant *)args[i]; + Item *pval= (Item *)args[i]; Item::Type type= args[i]->real_type(); switch (type) { diff --git a/storage/connect/tabutil.cpp b/storage/connect/tabutil.cpp index 65361acfcd8..705f567f464 100644 --- a/storage/connect/tabutil.cpp +++ b/storage/connect/tabutil.cpp @@ -708,7 +708,7 @@ bool PRXCOL::Init(PGLOBAL g, PTDB tp) MODE mode = To_Tdb->GetMode(); // Needed for MYSQL subtables - ((XCOLBLK*)Colp)->Name = Decode(g, Colp->GetName()); + ((COLBLK*)Colp)->SetName(Decode(g, Colp->GetName())); // May not have been done elsewhere Colp->InitValue(g); diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 7cf3301bdb9..723096bd08c 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -3553,7 +3553,8 @@ fail_err: ut_ad(thr->graph->trx->id == trx_read_trx_id( static_cast<const byte*>( - trx_id->data))); + trx_id->data)) + || index->table->is_temporary()); } } #endif @@ -4271,7 +4272,8 @@ btr_cur_update_in_place( index = cursor->index; ut_ad(rec_offs_validate(rec, index, offsets)); ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); - ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG)); + ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG) + || index->table->is_temporary()); /* The insert buffer tree should never be updated in place. */ ut_ad(!dict_index_is_ibuf(index)); ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG) @@ -4569,7 +4571,8 @@ btr_cur_optimistic_update( page = buf_block_get_frame(block); rec = btr_cur_get_rec(cursor); index = cursor->index; - ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG)); + ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG) + || index->table->is_temporary()); ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); ut_ad(mtr->memo_contains_flagged(block, MTR_MEMO_PAGE_X_FIX)); /* This is intended only for leaf page updates */ @@ -4923,8 +4926,8 @@ btr_cur_pessimistic_update( ut_ad(!page_zip || !index->table->is_temporary()); /* The insert buffer tree should never be updated in place. */ ut_ad(!dict_index_is_ibuf(index)); - ut_ad(trx_id > 0 - || (flags & BTR_KEEP_SYS_FLAG)); + ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG) + || index->table->is_temporary()); ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG) || dict_index_is_clust(index)); ut_ad(thr_get_trx(thr)->id == trx_id diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 454d74d1015..395c8111d81 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -5756,8 +5756,10 @@ ha_innobase::open(const char* name, int, uint) innobase_copy_frm_flags_from_table_share(ib_table, table->s); - /* No point to init any statistics if tablespace is still encrypted. */ - if (ib_table->is_readable()) { + /* No point to init any statistics if tablespace is still encrypted + or if table is being opened by background thread */ + if (THDVAR(thd, background_thread)) { + } else if (ib_table->is_readable()) { dict_stats_init(ib_table); } else { ib_table->stat_initialized = 1; diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic index 2de2ad38080..6514886dd67 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2020, MariaDB Corporation. +Copyright (c) 2016, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -717,7 +717,7 @@ page_get_instant(const page_t* page) break; } #endif /* UNIV_DEBUG */ - return i / 8; + return static_cast<uint16_t>(i >> 3); /* i / 8 */ } #endif /* !UNIV_INNOCHECKSUM */ diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h index 9985932af13..752b3fcee0e 100644 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -87,7 +87,6 @@ void trx_write_trx_id(byte* db_trx_id, trx_id_t id) { compile_time_assert(DATA_TRX_ID_LEN == 6); - ut_ad(id); mach_write_to_6(db_trx_id, id); } diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h index dc9a9597b0f..9f11944cd67 100644 --- a/storage/innobase/include/ut0ut.h +++ b/storage/innobase/include/ut0ut.h @@ -151,7 +151,7 @@ ut_time_ms(void); store the given number of bits. @param b in: bits @return number of bytes (octets) needed to represent b */ -#define UT_BITS_IN_BYTES(b) (((b) + 7) / 8) +#define UT_BITS_IN_BYTES(b) (((b) + 7) >> 3) /** Determines if a number is zero or a power of two. @param[in] n number diff --git a/storage/innobase/pars/pars0pars.cc b/storage/innobase/pars/pars0pars.cc index 2f3791aeb5e..b955b94b4df 100644 --- a/storage/innobase/pars/pars0pars.cc +++ b/storage/innobase/pars/pars0pars.cc @@ -1220,6 +1220,7 @@ pars_update_statement( sel_node->row_lock_mode = LOCK_X; } else { node->has_clust_rec_x_lock = sel_node->set_x_locks; + ut_ad(node->has_clust_rec_x_lock); } ut_a(sel_node->n_tables == 1); diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc index 4a32cb0556c..c4886101499 100644 --- a/storage/innobase/rem/rem0rec.cc +++ b/storage/innobase/rem/rem0rec.cc @@ -1420,8 +1420,9 @@ rec_convert_dtuple_to_rec_old( /* If the data is not SQL null, store it */ len = dfield_get_len(field); - memcpy(rec + end_offset, - dfield_get_data(field), len); + if (len) + memcpy(rec + end_offset, + dfield_get_data(field), len); end_offset += len; ored_offset = end_offset; @@ -1448,8 +1449,9 @@ rec_convert_dtuple_to_rec_old( /* If the data is not SQL null, store it */ len = dfield_get_len(field); - memcpy(rec + end_offset, - dfield_get_data(field), len); + if (len) + memcpy(rec + end_offset, + dfield_get_data(field), len); end_offset += len; ored_offset = end_offset; diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 77d2fdfd171..4b1926c0ec0 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -3329,7 +3329,8 @@ row_ins_index_entry( dtuple_t* entry, /*!< in/out: index entry to insert */ que_thr_t* thr) /*!< in: query thread */ { - ut_ad(thr_get_trx(thr)->id || index->table->no_rollback()); + ut_ad(thr_get_trx(thr)->id || index->table->no_rollback() + || index->table->is_temporary()); DBUG_EXECUTE_IF("row_ins_index_entry_timeout", { DBUG_SET("-d,row_ins_index_entry_timeout"); @@ -3757,13 +3758,17 @@ row_ins_step( } if (UNIV_LIKELY(!node->table->skip_alter_undo)) { - trx_write_trx_id(&node->sys_buf[DATA_ROW_ID_LEN], trx->id); + trx_write_trx_id(&node->sys_buf[DATA_TRX_ID_LEN], trx->id); } if (node->state == INS_NODE_SET_IX_LOCK) { node->state = INS_NODE_ALLOC_ROW_ID; + if (node->table->is_temporary()) { + node->trx_id = trx->id; + } + /* It may be that the current session has not yet started its transaction, or it has been committed: */ diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc index d4e09431aae..4cf4a87333b 100644 --- a/storage/innobase/row/row0uins.cc +++ b/storage/innobase/row/row0uins.cc @@ -111,7 +111,8 @@ row_undo_ins_remove_clust_rec( rec_t* rec = btr_pcur_get_rec(&node->pcur); - ut_ad(rec_get_trx_id(rec, index) == node->trx->id); + ut_ad(rec_get_trx_id(rec, index) == node->trx->id + || node->table->is_temporary()); ut_ad(!rec_get_deleted_flag(rec, index->table->not_redundant()) || rec_is_alter_metadata(rec, index->table->not_redundant())); ut_ad(rec_is_metadata(rec, index->table->not_redundant()) diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc index a7af11bacb9..5c4d9a3e5b4 100644 --- a/storage/innobase/row/row0umod.cc +++ b/storage/innobase/row/row0umod.cc @@ -110,7 +110,8 @@ row_undo_mod_clust_low( ut_ad(success); ut_ad(rec_get_trx_id(btr_cur_get_rec(btr_cur), btr_cur_get_index(btr_cur)) - == thr_get_trx(thr)->id); + == thr_get_trx(thr)->id + || btr_cur_get_index(btr_cur)->table->is_temporary()); ut_ad(node->ref != &trx_undo_metadata || node->update->info_bits == REC_INFO_METADATA_ADD || node->update->info_bits == REC_INFO_METADATA_ALTER); diff --git a/storage/innobase/row/row0undo.cc b/storage/innobase/row/row0undo.cc index 6aaa8266316..a02f0467431 100644 --- a/storage/innobase/row/row0undo.cc +++ b/storage/innobase/row/row0undo.cc @@ -196,7 +196,7 @@ row_undo_search_clust_to_pcur( if (found) { ut_ad(row_get_rec_trx_id(rec, clust_index, offsets) - == node->trx->id); + == node->trx->id || node->table->is_temporary()); if (dict_table_has_atomic_blobs(node->table)) { /* There is no prefix of externally stored diff --git a/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp b/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp index 5536eecb255..73639685d0e 100644 --- a/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp +++ b/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp @@ -675,7 +675,8 @@ namespace mrn { &normalized, &normalized_length, NULL); uint16 new_blob_data_length; if (normalized_length <= UINT_MAX16) { - memcpy(grn_key, normalized, normalized_length); + if (normalized_length) + memcpy(grn_key, normalized, normalized_length); if (normalized_length < *mysql_key_size) { memset(grn_key + normalized_length, '\0', *mysql_key_size - normalized_length); diff --git a/storage/mroonga/vendor/groonga/lib/alloc.c b/storage/mroonga/vendor/groonga/lib/alloc.c index 2e28431595a..5e556b83712 100644 --- a/storage/mroonga/vendor/groonga/lib/alloc.c +++ b/storage/mroonga/vendor/groonga/lib/alloc.c @@ -310,13 +310,13 @@ grn_alloc_info_free(grn_ctx *ctx) } #endif /* USE_MEMORY_DEBUG */ -#define GRN_CTX_SEGMENT_SIZE (1<<22) +#define GRN_CTX_SEGMENT_SIZE (1U <<22) #define GRN_CTX_SEGMENT_MASK (GRN_CTX_SEGMENT_SIZE - 1) -#define GRN_CTX_SEGMENT_WORD (1<<31) -#define GRN_CTX_SEGMENT_VLEN (1<<30) -#define GRN_CTX_SEGMENT_LIFO (1<<29) -#define GRN_CTX_SEGMENT_DIRTY (1<<28) +#define GRN_CTX_SEGMENT_WORD (1U <<31) +#define GRN_CTX_SEGMENT_VLEN (1U <<30) +#define GRN_CTX_SEGMENT_LIFO (1U <<29) +#define GRN_CTX_SEGMENT_DIRTY (1U <<28) void grn_alloc_init_ctx_impl(grn_ctx *ctx) @@ -400,8 +400,8 @@ grn_ctx_alloc(grn_ctx *ctx, size_t size, int flags, header[0] = i; header[1] = (int32_t) size; } else { - i = ctx->impl->currseg; - mi = &ctx->impl->segs[i]; + if ((i = ctx->impl->currseg) >= 0) + mi = &ctx->impl->segs[i]; if (i < 0 || size + mi->nref > GRN_CTX_SEGMENT_SIZE) { for (i = 0, mi = ctx->impl->segs;; i++, mi++) { if (i >= GRN_CTX_N_SEGMENTS) { diff --git a/storage/mroonga/vendor/groonga/lib/db.c b/storage/mroonga/vendor/groonga/lib/db.c index 46f3f783e59..7749d4c0165 100644 --- a/storage/mroonga/vendor/groonga/lib/db.c +++ b/storage/mroonga/vendor/groonga/lib/db.c @@ -12494,7 +12494,7 @@ grn_db_init_builtin_types(grn_ctx *ctx) GRN_OBJ_KEY_VAR_SIZE, 1 << 16); if (!obj || DB_OBJ(obj)->id != GRN_DB_TEXT) { return GRN_FILE_CORRUPT; } obj = deftype(ctx, "LongText", - GRN_OBJ_KEY_VAR_SIZE, 1 << 31); + GRN_OBJ_KEY_VAR_SIZE, 1U << 31); if (!obj || DB_OBJ(obj)->id != GRN_DB_LONG_TEXT) { return GRN_FILE_CORRUPT; } obj = deftype(ctx, "TokyoGeoPoint", GRN_OBJ_KEY_GEO_POINT, sizeof(grn_geo_point)); diff --git a/storage/mroonga/vendor/groonga/lib/pat.c b/storage/mroonga/vendor/groonga/lib/pat.c index 642173e2fdc..01f6108fbd0 100644 --- a/storage/mroonga/vendor/groonga/lib/pat.c +++ b/storage/mroonga/vendor/groonga/lib/pat.c @@ -899,7 +899,7 @@ chop(grn_ctx *ctx, grn_pat *pat, const char **key, const char *end, uint32_t *lk case GRN_OBJ_KEY_FLOAT :\ if ((size) == sizeof(int64_t)) {\ int64_t v = *(int64_t *)(key);\ - v ^= ((v >> 63)|(1LL << 63));\ + v ^= ((v >> 63)|(1ULL << 63));\ grn_hton((keybuf), &v, (size));\ }\ break;\ @@ -924,7 +924,7 @@ chop(grn_ctx *ctx, grn_pat *pat, const char **key, const char *end, uint32_t *lk if ((size) == sizeof(int64_t)) {\ int64_t v;\ grn_hton(&v, (key), (size));\ - *((int64_t *)(keybuf)) = v ^ (((v^(1LL<<63))>> 63)|(1LL<<63)); \ + *((int64_t *)(keybuf)) = v ^ ((((int64_t)(v^(1ULL<<63)))>> 63)|(1ULL<<63)); \ }\ break;\ }\ diff --git a/storage/mroonga/vendor/groonga/lib/proc/proc_select.c b/storage/mroonga/vendor/groonga/lib/proc/proc_select.c index d17571c3470..a665b1cc898 100644 --- a/storage/mroonga/vendor/groonga/lib/proc/proc_select.c +++ b/storage/mroonga/vendor/groonga/lib/proc/proc_select.c @@ -2989,7 +2989,8 @@ grn_select(grn_ctx *ctx, grn_select_data *data) char *cp = cache_key; #define PUT_CACHE_KEY(string) \ - grn_memcpy(cp, (string).value, (string).length); \ + if ((string).value) \ + grn_memcpy(cp, (string).value, (string).length); \ cp += (string).length; \ *cp++ = '\0' diff --git a/storage/mroonga/vendor/groonga/lib/str.c b/storage/mroonga/vendor/groonga/lib/str.c index 6b2d17769ca..4f0a3a98699 100644 --- a/storage/mroonga/vendor/groonga/lib/str.c +++ b/storage/mroonga/vendor/groonga/lib/str.c @@ -46,7 +46,7 @@ grn_str_charlen_utf8(grn_ctx *ctx, const unsigned char *str, const unsigned char if (*str & 0x80) { int i; int len; - GRN_BIT_SCAN_REV(~(*str << 24), len); + GRN_BIT_SCAN_REV(~(((uint) *str) << 24), len); len = 31 - len; if ((unsigned int)(len - 2) >= 3) { /* (len == 1 || len >= 5) */ GRN_LOG(ctx, GRN_LOG_WARNING, @@ -1963,7 +1963,8 @@ grn_bulk_write(grn_ctx *ctx, grn_obj *buf, const char *str, unsigned int len) if ((rc = grn_bulk_resize(ctx, buf, GRN_BULK_VSIZE(buf) + len))) { return rc; } } curr = GRN_BULK_CURR(buf); - grn_memcpy(curr, str, len); + if (str) + grn_memcpy(curr, str, len); GRN_BULK_INCR_LEN(buf, len); return rc; } diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c index f7626f93acf..d6cd9334a55 100644 --- a/storage/myisam/myisampack.c +++ b/storage/myisam/myisampack.c @@ -1953,7 +1953,7 @@ static void make_traverse_code_tree(HUFF_TREE *huff_tree, { chr=element->a.leaf.element_nr; huff_tree->code_len[chr]= (uchar) (8 * sizeof(ulonglong) - size); - huff_tree->code[chr]= (code >> size); + huff_tree->code[chr]= (size == 8 * sizeof(ulonglong)) ? 0 : (code >> size); if (huff_tree->height < 8 * sizeof(ulonglong) - size) huff_tree->height= 8 * sizeof(ulonglong) - size; } @@ -2944,12 +2944,15 @@ static void flush_bits(void) ulonglong bit_buffer; bits= file_buffer.bits & ~7; - bit_buffer= file_buffer.bitbucket >> bits; - bits= BITS_SAVED - bits; - while (bits > 0) + if (bits != BITS_SAVED) { - bits-= 8; - *file_buffer.pos++= (uchar) (bit_buffer >> bits); + bit_buffer= file_buffer.bitbucket >> bits; + bits= BITS_SAVED - bits; + while (bits > 0) + { + bits-= 8; + *file_buffer.pos++= (uchar) (bit_buffer >> bits); + } } if (file_buffer.pos >= file_buffer.end) (void) flush_buffer(~ (ulong) 0); diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index eac05ea68f5..f9471f35f79 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -1795,9 +1795,10 @@ ret_sign: { if (negative) { - if (ull > (ulonglong) LONGLONG_MIN) + if (ull >= (ulonglong) LONGLONG_MIN) { - *error= MY_ERRNO_ERANGE; + if (ull != (ulonglong) LONGLONG_MIN) + *error= MY_ERRNO_ERANGE; return (ulonglong) LONGLONG_MIN; } *error= 0; diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 2d1fa5ef496..72f90ab79c6 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -31467,9 +31467,11 @@ static inline uint16 * my_uca_contraction_weight(const MY_CONTRACTIONS *list, my_wc_t *wc, size_t len) { MY_CONTRACTION *c, *last; + DBUG_ASSERT(len <= MY_UCA_MAX_CONTRACTION); + for (c= list->item, last= c + list->nitems; c < last; c++) { - if ((len == MY_UCA_MAX_CONTRACTION || c->ch[len] == 0) && + if ((len >= MY_UCA_MAX_CONTRACTION || c->ch[len] == 0) && !c->with_context && !my_wmemcmp(c->ch, wc, len)) return c->weight; @@ -33210,7 +33212,8 @@ my_char_weight_put(MY_UCA_WEIGHT_LEVEL *dst, for (chlen= len; chlen > 1; chlen--) { - if ((from= my_uca_contraction_weight(&dst->contractions, str, chlen))) + if (chlen <= MY_UCA_MAX_CONTRACTION && + (from= my_uca_contraction_weight(&dst->contractions, str, chlen))) { str+= chlen; len-= chlen; diff --git a/strings/json_lib.c b/strings/json_lib.c index 772f6029e77..49f29903ed5 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -948,6 +948,7 @@ int json_read_value(json_engine_t *j) { int t_next, c_len, res; + j->value_type= JSON_VALUE_UNINITALIZED; if (j->state == JST_KEY) { while (json_read_keyname_chr(j) == 0) {} |