mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
Merge 10.4 into 10.5
This commit is contained in:
commit
67ddb6507d
119 changed files with 2738 additions and 1304 deletions
|
@ -17,7 +17,7 @@
|
|||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$pentium64_cflags $debug_cflags -lasan -O -g -fsanitize=address"
|
||||
extra_flags="$pentium64_cflags $debug_cflags -lasan -O -g -fsanitize=address -USAFEMALLOC -UFORCE_INIT_OF_VARS -Wno-uninitialized -Wno-maybe-uninitialized"
|
||||
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs $disable_asan_plugins"
|
||||
export LDFLAGS="-ldl"
|
||||
|
||||
|
|
|
@ -1059,7 +1059,7 @@ extern "C" int write_history(const char *command);
|
|||
extern "C" HIST_ENTRY *history_get(int num);
|
||||
extern "C" int history_length;
|
||||
static int not_in_history(const char *line);
|
||||
static void initialize_readline (char *name);
|
||||
static void initialize_readline ();
|
||||
static void fix_history(String *final_command);
|
||||
#endif
|
||||
|
||||
|
@ -1240,7 +1240,7 @@ int main(int argc,char *argv[])
|
|||
}
|
||||
|
||||
#ifdef HAVE_READLINE
|
||||
initialize_readline((char*) my_progname);
|
||||
initialize_readline();
|
||||
if (!status.batch && !quick && !opt_html && !opt_xml)
|
||||
{
|
||||
/* read-history from file, default ~/.mysql_history*/
|
||||
|
@ -2665,10 +2665,11 @@ static int fake_magic_space(const char *, int)
|
|||
}
|
||||
|
||||
|
||||
static void initialize_readline (char *name)
|
||||
static void initialize_readline ()
|
||||
{
|
||||
/* Allow conditional parsing of the ~/.inputrc file. */
|
||||
rl_readline_name = name;
|
||||
rl_readline_name= "mysql";
|
||||
rl_terminal_name= getenv("TERM");
|
||||
|
||||
/* Tell the completer that we want a crack first. */
|
||||
#if defined(USE_NEW_READLINE_INTERFACE)
|
||||
|
|
|
@ -548,7 +548,8 @@ is_page_corrupted(
|
|||
|
||||
if (is_corrupted && log_file) {
|
||||
fprintf(log_file,
|
||||
"Page " ULINTPF ":%llu may be corrupted;"
|
||||
"[page id: space=" ULINTPF
|
||||
", page_number=%llu] may be corrupted;"
|
||||
" key_version=%u\n",
|
||||
space_id, cur_page_num, key_version);
|
||||
}
|
||||
|
@ -1556,10 +1557,8 @@ int main(
|
|||
byte* xdes = NULL;
|
||||
/* bytes read count */
|
||||
ulint bytes;
|
||||
/* current time */
|
||||
time_t now;
|
||||
/* last time */
|
||||
time_t lastt;
|
||||
time_t lastt = 0;
|
||||
/* stat, to get file size. */
|
||||
#ifdef _WIN32
|
||||
struct _stat64 st;
|
||||
|
@ -1902,7 +1901,6 @@ int main(
|
|||
/* main checksumming loop */
|
||||
cur_page_num = start_page ? start_page : cur_page_num + 1;
|
||||
|
||||
lastt = 0;
|
||||
while (!feof(fil_in)) {
|
||||
|
||||
bytes = read_file(buf, partial_page_read,
|
||||
|
@ -1981,12 +1979,10 @@ first_non_zero:
|
|||
|
||||
if (verbose && !read_from_stdin) {
|
||||
if ((cur_page_num % 64) == 0) {
|
||||
now = time(0);
|
||||
time_t now = time(0);
|
||||
if (!lastt) {
|
||||
lastt= now;
|
||||
}
|
||||
if (now - lastt >= 1
|
||||
&& is_log_enabled) {
|
||||
} else if (now - lastt >= 1 && is_log_enabled) {
|
||||
fprintf(log_file, "page::%llu "
|
||||
"okay: %.3f%% done\n",
|
||||
(cur_page_num - 1),
|
||||
|
|
|
@ -1295,7 +1295,7 @@ struct my_option xb_server_options[] =
|
|||
{"innodb_log_file_size", OPT_INNODB_LOG_FILE_SIZE,
|
||||
"Ignored for mysqld option compatibility",
|
||||
(G_PTR*) &srv_log_file_size, (G_PTR*) &srv_log_file_size, 0,
|
||||
GET_ULL, REQUIRED_ARG, 48 << 20, 1 << 20, 512ULL << 30, 0,
|
||||
GET_ULL, REQUIRED_ARG, 48 << 20, 1 << 20, log_group_max_size, 0,
|
||||
UNIV_PAGE_SIZE_MAX, 0},
|
||||
{"innodb_log_files_in_group", OPT_INNODB_LOG_FILES_IN_GROUP,
|
||||
"Ignored for mysqld option compatibility",
|
||||
|
|
|
@ -55,12 +55,19 @@ https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */
|
|||
#endif /* HAVE_VALGRIND_MEMCHECK_H */
|
||||
|
||||
#if defined(TRASH_FREED_MEMORY)
|
||||
/* NOTE: Do not invoke TRASH_FILL directly! Use TRASH_ALLOC or TRASH_FREE.
|
||||
|
||||
The MEM_UNDEFINED() call before memset() is for canceling the effect
|
||||
of any previous MEM_NOACCESS(). We must invoke MEM_UNDEFINED() after
|
||||
writing the dummy pattern, unless MEM_NOACCESS() is going to be invoked.
|
||||
On AddressSanitizer, the MEM_UNDEFINED() in TRASH_ALLOC() has no effect. */
|
||||
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); MEM_UNDEFINED(A, trash_tmp); memset(A, C, trash_tmp); } while (0)
|
||||
#else
|
||||
#define TRASH_FILL(A,B,C) do { MEM_UNDEFINED((A), (B)); } while (0)
|
||||
#define TRASH_FILL(A,B,C) while (0)
|
||||
#endif
|
||||
|
||||
/** Note that some memory became allocated or uninitialized. */
|
||||
#define TRASH_ALLOC(A,B) do { TRASH_FILL(A,B,0xA5); MEM_UNDEFINED(A,B); } while(0)
|
||||
/** Note that some memory became freed. (Prohibit further access to it.) */
|
||||
#define TRASH_FREE(A,B) do { TRASH_FILL(A,B,0x8F); MEM_NOACCESS(A,B); } while(0)
|
||||
|
||||
#endif /* MY_VALGRIND_INCLUDED */
|
||||
|
|
|
@ -69,7 +69,7 @@ if (!$_slave_param_comparison)
|
|||
|
||||
if ($rpl_debug)
|
||||
{
|
||||
--echo Waiting until '$slave_param' $_slave_param_comparison '$slave_param_value' [timeout='$_slave_timeout', \$slave_error_param='$slave_error_param']
|
||||
--echo Waiting until '$slave_param' $_slave_param_comparison '$slave_param_value' [\$slave_error_param='$slave_error_param']
|
||||
}
|
||||
|
||||
--let $_slave_check_configured= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1)
|
||||
|
|
|
@ -2540,3 +2540,21 @@ test.t1 analyze status OK
|
|||
set @@use_stat_tables= @save_use_stat_tables;
|
||||
set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-18154 Deadlock and assertion upon no-op ALTER under LOCK TABLES
|
||||
#
|
||||
create or replace table t1 (pk int, i int, primary key (pk)) engine myisam;
|
||||
create or replace view v1 as select * from t1;
|
||||
lock table v1 read, t1 write;
|
||||
alter table t1 change f1 f2 int;
|
||||
ERROR 42S22: Unknown column 'f1' in 't1'
|
||||
set max_statement_time= 1;
|
||||
alter table t1 add column if not exists i int after pk;
|
||||
Warnings:
|
||||
Note 1060 Duplicate column name 'i'
|
||||
set max_statement_time= 0;
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
#
|
||||
# End of 10.3 tests
|
||||
#
|
||||
|
|
|
@ -2057,3 +2057,21 @@ analyze table t1;
|
|||
set @@use_stat_tables= @save_use_stat_tables;
|
||||
set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18154 Deadlock and assertion upon no-op ALTER under LOCK TABLES
|
||||
--echo #
|
||||
create or replace table t1 (pk int, i int, primary key (pk)) engine myisam;
|
||||
create or replace view v1 as select * from t1;
|
||||
lock table v1 read, t1 write;
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
alter table t1 change f1 f2 int;
|
||||
set max_statement_time= 1;
|
||||
alter table t1 add column if not exists i int after pk;
|
||||
set max_statement_time= 0;
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.3 tests
|
||||
--echo #
|
||||
|
|
|
@ -17,6 +17,7 @@ drop user bad;
|
|||
#
|
||||
set global debug_dbug='+d,auth_invalid_plugin';
|
||||
create user 'bad' identified by 'worse';
|
||||
--replace_regex /loaded: [^\n]*/loaded: invalid plugin name/
|
||||
--error 1
|
||||
--exec $MYSQL --default-auth=mysql_old_password --user=bad --password=worse 2>&1
|
||||
set global debug_dbug=@old_dbug;
|
||||
|
|
|
@ -399,3 +399,19 @@ DROP USER u1@localhost;
|
|||
SET DEBUG_SYNC = 'RESET';
|
||||
DROP FUNCTION MY_KILL;
|
||||
set global sql_mode=default;
|
||||
#
|
||||
# MDEV-17998
|
||||
# Deadlock and eventual Assertion `!table->pos_in_locked_tables' failed
|
||||
# in tc_release_table on KILL_TIMEOUT
|
||||
#
|
||||
SET max_statement_time= 2;
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
CREATE TABLE t2 (b INT, c INT);
|
||||
LOCK TABLES v1 READ, t2 WRITE, t1 WRITE;
|
||||
ALTER TABLE t1 CHANGE f1 f2 DOUBLE;
|
||||
Got one of the listed errors
|
||||
ALTER TABLE t2 DROP c;
|
||||
UNLOCK TABLES;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1, t2;
|
||||
|
|
|
@ -642,3 +642,23 @@ SET DEBUG_SYNC = 'RESET';
|
|||
DROP FUNCTION MY_KILL;
|
||||
|
||||
set global sql_mode=default;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17998
|
||||
--echo # Deadlock and eventual Assertion `!table->pos_in_locked_tables' failed
|
||||
--echo # in tc_release_table on KILL_TIMEOUT
|
||||
--echo #
|
||||
|
||||
SET max_statement_time= 2;
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
CREATE TABLE t2 (b INT, c INT);
|
||||
|
||||
LOCK TABLES v1 READ, t2 WRITE, t1 WRITE;
|
||||
--error ER_BAD_FIELD_ERROR,ER_STATEMENT_TIMEOUT
|
||||
ALTER TABLE t1 CHANGE f1 f2 DOUBLE;
|
||||
ALTER TABLE t2 DROP c;
|
||||
UNLOCK TABLES;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1, t2;
|
||||
|
|
|
@ -2,9 +2,15 @@
|
|||
# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
|
||||
#
|
||||
# Verbose run
|
||||
set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
|
||||
prepare set_wsrep_myisam from @prep;
|
||||
set @toggle=1; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_name ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_transition ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=InnoDB;
|
||||
END IF|
|
||||
\d ;
|
||||
TRUNCATE TABLE time_zone;
|
||||
TRUNCATE TABLE time_zone_name;
|
||||
TRUNCATE TABLE time_zone_transition;
|
||||
|
@ -28,11 +34,25 @@ Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/ignored.tab' as time zo
|
|||
Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion.
|
||||
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
|
||||
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
|
||||
set @toggle=0; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=Aria;
|
||||
ALTER TABLE time_zone_name ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=Aria;
|
||||
END IF|
|
||||
\d ;
|
||||
# Silent run
|
||||
set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
|
||||
prepare set_wsrep_myisam from @prep;
|
||||
set @toggle=1; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_name ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_transition ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=InnoDB;
|
||||
END IF|
|
||||
\d ;
|
||||
TRUNCATE TABLE time_zone;
|
||||
TRUNCATE TABLE time_zone_name;
|
||||
TRUNCATE TABLE time_zone_transition;
|
||||
|
@ -53,39 +73,83 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
|
|||
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it.
|
||||
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
|
||||
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
|
||||
set @toggle=0; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=Aria;
|
||||
ALTER TABLE time_zone_name ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=Aria;
|
||||
END IF|
|
||||
\d ;
|
||||
#
|
||||
# Testing with explicit timezonefile
|
||||
#
|
||||
set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
|
||||
prepare set_wsrep_myisam from @prep;
|
||||
set @toggle=1; execute set_wsrep_myisam using @toggle;
|
||||
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
|
||||
SET @time_zone_id= LAST_INSERT_ID();
|
||||
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
|
||||
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
|
||||
(@time_zone_id, 0, 0, 0, 'GMT')
|
||||
;
|
||||
set @toggle=0; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=Aria;
|
||||
ALTER TABLE time_zone_name ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=Aria;
|
||||
END IF|
|
||||
\d ;
|
||||
#
|
||||
# Testing --leap
|
||||
#
|
||||
set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
|
||||
prepare set_wsrep_myisam from @prep;
|
||||
set @toggle=1; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone_leap_second ENGINE=InnoDB;
|
||||
END IF|
|
||||
\d ;
|
||||
TRUNCATE TABLE time_zone_leap_second;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone_leap_second ENGINE=Aria;
|
||||
END IF|
|
||||
\d ;
|
||||
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
|
||||
set @toggle=0; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=Aria;
|
||||
ALTER TABLE time_zone_name ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=Aria;
|
||||
END IF|
|
||||
\d ;
|
||||
#
|
||||
# MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL
|
||||
#
|
||||
set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
|
||||
prepare set_wsrep_myisam from @prep;
|
||||
set @toggle=1; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_name ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_transition ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=InnoDB;
|
||||
END IF|
|
||||
\d ;
|
||||
TRUNCATE TABLE time_zone;
|
||||
TRUNCATE TABLE time_zone_name;
|
||||
TRUNCATE TABLE time_zone_transition;
|
||||
TRUNCATE TABLE time_zone_transition_type;
|
||||
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
|
||||
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
|
||||
set @toggle=0; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=Aria;
|
||||
ALTER TABLE time_zone_name ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=Aria;
|
||||
END IF|
|
||||
\d ;
|
||||
|
|
|
@ -3654,6 +3654,41 @@ d x
|
|||
00:00:02 NULL
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-20351 Window function BIT_OR() OVER (..) return a wrong data type
|
||||
#
|
||||
CREATE TABLE t1 (pk INT, a INT, b BIGINT UNSIGNED);
|
||||
INSERT INTO t1 VALUES (1, 0, 1), (2, 0, 18446744073709551615);
|
||||
CREATE TABLE t2 AS
|
||||
SELECT pk, a, bit_or(b) AS bit_or FROM t1 GROUP BY pk;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`pk` int(11) DEFAULT NULL,
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`bit_or` bigint(21) unsigned NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t1;
|
||||
pk a b
|
||||
1 0 1
|
||||
2 0 18446744073709551615
|
||||
DROP TABLE t2;
|
||||
CREATE OR REPLACE TABLE t2 AS
|
||||
SELECT pk, a, BIT_OR(b) OVER (PARTITION BY a ORDER BY pk ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS bit_or
|
||||
FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`pk` int(11) DEFAULT NULL,
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`bit_or` bigint(21) unsigned NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t2;
|
||||
pk a bit_or
|
||||
1 0 18446744073709551615
|
||||
2 0 18446744073709551615
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.3 tests
|
||||
#
|
||||
#
|
||||
|
|
|
@ -2359,6 +2359,29 @@ INSERT INTO t1 VALUES ('00:00:01'),('00:00:02');
|
|||
SELECT *, LEAD(d) OVER (ORDER BY d) AS x FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-20351 Window function BIT_OR() OVER (..) return a wrong data type
|
||||
--echo #
|
||||
CREATE TABLE t1 (pk INT, a INT, b BIGINT UNSIGNED);
|
||||
INSERT INTO t1 VALUES (1, 0, 1), (2, 0, 18446744073709551615);
|
||||
|
||||
CREATE TABLE t2 AS
|
||||
SELECT pk, a, bit_or(b) AS bit_or FROM t1 GROUP BY pk;
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
CREATE OR REPLACE TABLE t2 AS
|
||||
SELECT pk, a, BIT_OR(b) OVER (PARTITION BY a ORDER BY pk ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS bit_or
|
||||
FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.3 tests
|
||||
--echo #
|
||||
|
|
|
@ -3370,6 +3370,7 @@ sub mysql_install_db {
|
|||
# Create the bootstrap.sql file
|
||||
# ----------------------------------------------------------------------
|
||||
my $bootstrap_sql_file= "$opt_vardir/log/bootstrap.sql";
|
||||
$ENV{'MYSQL_BOOTSTRAP_SQL_FILE'}= $bootstrap_sql_file;
|
||||
|
||||
if (! -e $bootstrap_sql_file)
|
||||
{
|
||||
|
|
|
@ -2675,6 +2675,8 @@ Warnings:
|
|||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave
|
||||
INSERT INTO insert_2_keys VALUES (1, 2)
|
||||
ON DUPLICATE KEY UPDATE a=VALUES(a)+10, b=VALUES(b)+10;
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
|
||||
DROP TABLE filler_table;
|
||||
DROP TABLE insert_table;
|
||||
DROP TABLE update_table;
|
||||
|
|
|
@ -12,9 +12,6 @@
|
|||
|
||||
MW-286 : MDEV-19992 Galera test failure on MW-286
|
||||
GCF-1081 : MDEV-18283 Galera test failure on galera.GCF-1081
|
||||
MW-328A : MDEV-17847 Galera test failure on MW-328[A|B|C]
|
||||
MW-328B : MDEV-17847 Galera test failure on MW-328[A|B|C]
|
||||
MW-328C : MDEV-17847 Galera test failure on MW-328[A|B|C]
|
||||
MW-329 : MDEV-19962 Galera test failure on MW-329
|
||||
MW-360 : needs rewrite to be MariaDB gtid compatible
|
||||
MW-388: MDEV-19803 Long semaphore wait error on galera.MW-388
|
||||
|
@ -50,3 +47,4 @@ galera_sst_mariabackup_encrypt_with_key : MDEV-19926 Galera SST tests fail
|
|||
galera_wan : MDEV-17259: Test failure on galera.galera_wan
|
||||
mysql-wsrep#198 : MDEV-18935 Galera test mysql-wsrep#198 sporaric assertion transaction.cpp:362: int wsrep::transaction::before_commit(): Assertion `state() == s_executing || state() == s_committing || state() == s_must_abort || state() == s_replaying' failed.
|
||||
partition : MDEV-19958 Galera test failure on galera.partition
|
||||
query_cache: MDEV-15805 Test failure on galera.query_cache
|
|
@ -22,7 +22,7 @@ Got one of the listed errors
|
|||
connection node_1;
|
||||
DROP PROCEDURE proc_update;
|
||||
DROP TABLE t1, t2;
|
||||
CALL mtr.add_suppression("conflict state 3 after post commit");
|
||||
CALL mtr.add_suppression("conflict state ABORTED after post commit");
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (i int primary key, j int) engine=innodb;
|
||||
INSERT INTO t1 values (1,0);
|
||||
|
|
|
@ -22,4 +22,4 @@ Got one of the listed errors
|
|||
connection node_1;
|
||||
DROP PROCEDURE proc_update;
|
||||
DROP TABLE t1, t2;
|
||||
CALL mtr.add_suppression("conflict state 3 after post commit");
|
||||
CALL mtr.add_suppression("conflict state ABORTED after post commit");
|
||||
|
|
|
@ -22,4 +22,4 @@ Got one of the listed errors
|
|||
connection node_1;
|
||||
DROP PROCEDURE proc_update;
|
||||
DROP TABLE t1, t2;
|
||||
CALL mtr.add_suppression("conflict state 3 after post commit");
|
||||
CALL mtr.add_suppression("conflict state ABORTED after post commit");
|
||||
|
|
50
mysql-test/suite/galera/r/galera_performance_schema.result
Normal file
50
mysql-test/suite/galera/r/galera_performance_schema.result
Normal file
|
@ -0,0 +1,50 @@
|
|||
connection node_2;
|
||||
connection node_1;
|
||||
use performance_schema;
|
||||
SELECT name
|
||||
FROM threads
|
||||
WHERE name LIKE 'thread/sql/wsrep%'
|
||||
ORDER BY name;
|
||||
name thread/sql/wsrep_applier_thread
|
||||
name thread/sql/wsrep_rollbacker_thread
|
||||
name thread/sql/wsrep_rollbacker_thread
|
||||
use test;
|
||||
create table t1 (a int not null primary key) engine=innodb;
|
||||
insert into t1 values (1),(2);
|
||||
use performance_schema;
|
||||
select name from mutex_instances where name like 'wait/synch/mutex/sql/LOCK_wsrep%' order by name;
|
||||
name wait/synch/mutex/sql/LOCK_wsrep_cluster_config
|
||||
name wait/synch/mutex/sql/LOCK_wsrep_config_state
|
||||
name wait/synch/mutex/sql/LOCK_wsrep_desync
|
||||
name wait/synch/mutex/sql/LOCK_wsrep_group_commit
|
||||
name wait/synch/mutex/sql/LOCK_wsrep_ready
|
||||
name wait/synch/mutex/sql/LOCK_wsrep_replaying
|
||||
name wait/synch/mutex/sql/LOCK_wsrep_slave_threads
|
||||
name wait/synch/mutex/sql/LOCK_wsrep_SR_pool
|
||||
name wait/synch/mutex/sql/LOCK_wsrep_SR_store
|
||||
name wait/synch/mutex/sql/LOCK_wsrep_sst
|
||||
name wait/synch/mutex/sql/LOCK_wsrep_sst_init
|
||||
select name from cond_instances where name like 'wait/synch/cond/sql/COND_wsrep%' order by name;
|
||||
name wait/synch/cond/sql/COND_wsrep_ready
|
||||
name wait/synch/cond/sql/COND_wsrep_replaying
|
||||
name wait/synch/cond/sql/COND_wsrep_sst
|
||||
name wait/synch/cond/sql/COND_wsrep_sst_init
|
||||
name wait/synch/cond/sql/COND_wsrep_wsrep_slave_threads
|
||||
connection node_2;
|
||||
use test;
|
||||
SET SESSION wsrep_on=OFF;
|
||||
CREATE TABLE t2 (f1 INTEGER) engine=innodb;
|
||||
connection node_1;
|
||||
use test;
|
||||
CREATE TABLE t2 (f1 INTEGER) engine=innodb;
|
||||
connection node_2;
|
||||
SET SESSION wsrep_on=ON;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*) 2
|
||||
use performance_schema;
|
||||
select count(*)>=1 from file_instances where file_name like '%GRA_%.log';
|
||||
count(*)>=1 1
|
||||
CALL mtr.add_suppression("Slave SQL: Error 'Table 't2' already exists' on query");
|
||||
use test;
|
||||
drop table t1;
|
||||
drop table t2;
|
|
@ -15,4 +15,4 @@
|
|||
DROP PROCEDURE proc_update;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
CALL mtr.add_suppression("conflict state 3 after post commit");
|
||||
CALL mtr.add_suppression("conflict state ABORTED after post commit");
|
||||
|
|
|
@ -12,9 +12,8 @@
|
|||
# it all depends on timing.
|
||||
#
|
||||
|
||||
--source include/big_test.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/big_test.inc
|
||||
--source suite/galera/t/MW-328-header.inc
|
||||
|
||||
--connection node_2
|
||||
|
|
|
@ -7,9 +7,7 @@
|
|||
# gets the deadlock error
|
||||
#
|
||||
|
||||
--source include/big_test.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source suite/galera/t/MW-328-header.inc
|
||||
|
||||
--connection node_2
|
||||
|
|
|
@ -7,9 +7,8 @@
|
|||
# masks all deadlock errors
|
||||
#
|
||||
|
||||
--source include/big_test.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/big_test.inc
|
||||
--source suite/galera/t/MW-328-header.inc
|
||||
|
||||
--connection node_2
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
CREATE TABLE t1 (i INT) ENGINE = InnoDB;
|
||||
INSERT INTO t1 (i) VALUES(1);
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
create table t1 (i int primary key, j int) engine=innodb;
|
||||
create table t2 (i int primary key, j int) engine=innodb;
|
||||
|
|
58
mysql-test/suite/galera/t/galera_performance_schema.test
Normal file
58
mysql-test/suite/galera/t/galera_performance_schema.test
Normal file
|
@ -0,0 +1,58 @@
|
|||
#
|
||||
# Test that wsrep mutexes, condition variables, files and
|
||||
# threads are shown in performance schema
|
||||
#
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_perfschema.inc
|
||||
|
||||
use performance_schema;
|
||||
|
||||
--vertical_results
|
||||
--disable_ps_protocol
|
||||
SELECT name
|
||||
FROM threads
|
||||
WHERE name LIKE 'thread/sql/wsrep%'
|
||||
ORDER BY name;
|
||||
--enable_ps_protocol
|
||||
|
||||
use test;
|
||||
create table t1 (a int not null primary key) engine=innodb;
|
||||
insert into t1 values (1),(2);
|
||||
|
||||
use performance_schema;
|
||||
select name from mutex_instances where name like 'wait/synch/mutex/sql/LOCK_wsrep%' order by name;
|
||||
select name from cond_instances where name like 'wait/synch/cond/sql/COND_wsrep%' order by name;
|
||||
# Whenever a node fails to apply an event on a slave node, the database server creates a
|
||||
# special binary log file of the event in the data directory. The naming convention the
|
||||
# node uses for the filename is GRA_*.log.
|
||||
# Thus, we need to produce a applier failure
|
||||
|
||||
--connection node_2
|
||||
--exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log
|
||||
|
||||
# Create applier failure
|
||||
|
||||
use test;
|
||||
SET SESSION wsrep_on=OFF;
|
||||
CREATE TABLE t2 (f1 INTEGER) engine=innodb;
|
||||
|
||||
--connection node_1
|
||||
use test;
|
||||
CREATE TABLE t2 (f1 INTEGER) engine=innodb;
|
||||
|
||||
--connection node_2
|
||||
SET SESSION wsrep_on=ON;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
|
||||
use performance_schema;
|
||||
#
|
||||
# Below we can't just count number of files as if you run this test more
|
||||
# than once, test will create more files
|
||||
#
|
||||
select count(*)>=1 from file_instances where file_name like '%GRA_%.log';
|
||||
CALL mtr.add_suppression("Slave SQL: Error 'Table 't2' already exists' on query");
|
||||
|
||||
use test;
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
|
@ -26,6 +26,7 @@ INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
|
|||
connection node_1;
|
||||
connection node_1a;
|
||||
connection node_2;
|
||||
set session wsrep_sync_wait=15;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
30000
|
||||
|
|
|
@ -52,6 +52,7 @@ SET SESSION wsrep_trx_fragment_size = 1;
|
|||
--connection node_2
|
||||
--reap
|
||||
|
||||
set session wsrep_sync_wait=15;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
SELECT COUNT(DISTINCT f1) FROM t1;
|
||||
|
||||
|
|
|
@ -4,17 +4,8 @@
|
|||
|
||||
# Not supported in embedded
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# This test case needs to crash the server. Needs a debug server.
|
||||
-- source include/have_debug.inc
|
||||
|
||||
# Don't test this under valgrind, memory leaks will occur.
|
||||
-- source include/not_valgrind.inc
|
||||
|
||||
# Avoid CrashReporter popup on Mac
|
||||
-- source include/not_crashrep.inc
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_debug_sync.inc
|
||||
|
||||
# Create Insert Procedure
|
||||
DELIMITER |;
|
||||
|
@ -62,21 +53,11 @@ CALL populate_t1();
|
|||
|
||||
SELECT COUNT(*) FROM t1;
|
||||
|
||||
--enable_info
|
||||
CREATE INDEX idx_title ON t1(title);
|
||||
--disable_info
|
||||
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
CHECK TABLE t1;
|
||||
|
||||
SELECT * FROM t1 WHERE title = 'a10';
|
||||
|
||||
SELECT * FROM t1 WHERE title = 'a5000';
|
||||
|
||||
SELECT * FROM t1 WHERE title = 'a10000';
|
||||
|
||||
SELECT * FROM t1 WHERE title = 'a10010';
|
||||
|
||||
DROP TABLE t1;
|
||||
RENAME TABLE t1 TO t0;
|
||||
|
||||
-- echo # Test Blob
|
||||
|
||||
|
@ -104,16 +85,32 @@ INSERT INTO t1 VALUES
|
|||
|
||||
SELECT CHAR_LENGTH(b) FROM t1;
|
||||
|
||||
ALTER TABLE t1 DROP COLUMN c;
|
||||
--enable_info
|
||||
ALTER TABLE t1 DROP COLUMN c, FORCE;
|
||||
--disable_info
|
||||
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
CHECK TABLE t1;
|
||||
CHECK TABLE t0,t1;
|
||||
|
||||
SELECT CHAR_LENGTH(b) FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
RENAME TABLE t0 to t1;
|
||||
|
||||
CHECK TABLE t1;
|
||||
|
||||
SELECT * FROM t1 WHERE title = 'a10';
|
||||
|
||||
SELECT * FROM t1 WHERE title = 'a5000';
|
||||
|
||||
SELECT * FROM t1 WHERE title = 'a10000';
|
||||
|
||||
SELECT * FROM t1 WHERE title = 'a10010';
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
# Test Crash Recovery
|
||||
|
||||
if ($row_format != 'COMPRESSED')
|
||||
|
@ -140,17 +137,16 @@ if ($row_format == 'COMPRESSED')
|
|||
CALL populate_t1();
|
||||
-- enable_query_log
|
||||
|
||||
SET debug_dbug='+d,crash_commit_before';
|
||||
|
||||
# Write file to make mysql-test-run.pl start up the server again
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
|
||||
--error 2013
|
||||
connect (hang,localhost,root);
|
||||
SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
|
||||
send
|
||||
CREATE INDEX idx_title ON t1(title);
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
--disable_reconnect
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
let $shutdown_timeout=0;
|
||||
--source include/restart_mysqld.inc
|
||||
disconnect hang;
|
||||
|
||||
SELECT COUNT(*) FROM t1;
|
||||
|
||||
|
@ -194,17 +190,16 @@ INSERT INTO t1 VALUES
|
|||
|
||||
SELECT CHAR_LENGTH(b) FROM t1;
|
||||
|
||||
SET debug_dbug='+d,crash_commit_before';
|
||||
connect (hang,localhost,root);
|
||||
SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
|
||||
send
|
||||
ALTER TABLE t1 DROP COLUMN c, FORCE;
|
||||
|
||||
# Write file to make mysql-test-run.pl start up the server again
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
|
||||
--error 2013
|
||||
ALTER TABLE t1 DROP COLUMN c;
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
--disable_reconnect
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
--source include/restart_mysqld.inc
|
||||
disconnect hang;
|
||||
let $shutdown_timeout=60;
|
||||
|
||||
CHECK TABLE t1;
|
||||
|
||||
|
@ -212,10 +207,4 @@ SELECT CHAR_LENGTH(b) FROM t1;
|
|||
|
||||
DROP TABLE t1;
|
||||
|
||||
# Restore global variables
|
||||
if ($row_format == 'COMPRESSED')
|
||||
{
|
||||
SET GLOBAL innodb_file_per_table=default;
|
||||
}
|
||||
|
||||
DROP PROCEDURE populate_t1;
|
||||
|
|
|
@ -37,7 +37,9 @@ t1 CREATE TABLE `t1` (
|
|||
FULLTEXT KEY `b_2` (`b`,`c`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
ALTER TABLE t1 FORCE, ALGORITHM=COPY;
|
||||
SET DEBUG_DBUG='+d,crash_commit_before';
|
||||
connect hang,localhost,root;
|
||||
SET DEBUG_SYNC='alter_table_copy_trans_commit SIGNAL hung WAIT_FOR ever';
|
||||
# create 32 secondary indexes
|
||||
ALTER TABLE t ADD INDEX(b,c,d,a),ADD INDEX(b,c,a,d),ADD INDEX(b,a,c,d),ADD INDEX(b,a,d,c),
|
||||
ADD INDEX(b,d,a,c),ADD INDEX(b,d,c,a),ADD INDEX(a,b,c,d),ADD INDEX(a,b,d,c),
|
||||
ADD INDEX(a,c,b,d),ADD INDEX(a,c,d,b),ADD INDEX(a,d,b,c),ADD INDEX(a,d,c,b),
|
||||
|
@ -47,8 +49,10 @@ ADD INDEX(d,b,a,c),ADD INDEX(d,b,c,a),ADD INDEX(d,c,a,b),ADD INDEX(d,c,b,a),
|
|||
ADD INDEX(a,b,c), ADD INDEX(a,c,b), ADD INDEX(a,c,d), ADD INDEX(a,d,c),
|
||||
ADD INDEX(a,b,d), ADD INDEX(a,d,b), ADD INDEX(b,c,d), ADD INDEX(b,d,c),
|
||||
ALGORITHM=COPY;
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
# restart: --innodb-force-recovery=3
|
||||
disconnect hang;
|
||||
#sql-temporary.frm
|
||||
#sql-temporary.ibd
|
||||
FTS_INDEX_1.ibd
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
--- auto_increment_dup.result
|
||||
+++ auto_increment_dup,skip-log-bin.reject
|
||||
@@ -89,13 +89,14 @@
|
||||
SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue';
|
||||
affected rows: 0
|
||||
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
|
||||
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
+affected rows: 3
|
||||
+info: Records: 3 Duplicates: 0 Warnings: 0
|
||||
connection con1;
|
||||
#
|
||||
# 2 duplicates
|
||||
#
|
||||
-affected rows: 3
|
||||
-info: Records: 3 Duplicates: 0 Warnings: 0
|
||||
+affected rows: 4
|
||||
+info: Records: 3 Duplicates: 1 Warnings: 0
|
||||
connection default;
|
||||
#
|
||||
# 3 rows
|
||||
@@ -103,19 +104,21 @@
|
||||
SELECT * FROM t1 order by k;
|
||||
id k c
|
||||
1 1 NULL
|
||||
-2 2 NULL
|
||||
-3 3 NULL
|
||||
-affected rows: 3
|
||||
+4 2 1
|
||||
+2 3 NULL
|
||||
+5 4 NULL
|
||||
+6 5 NULL
|
||||
+affected rows: 5
|
||||
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
|
||||
-affected rows: 4
|
||||
-info: Records: 3 Duplicates: 1 Warnings: 0
|
||||
+affected rows: 6
|
||||
+info: Records: 3 Duplicates: 3 Warnings: 0
|
||||
SELECT * FROM t1 order by k;
|
||||
id k c
|
||||
1 1 NULL
|
||||
-2 2 2
|
||||
-3 3 NULL
|
||||
-7 4 NULL
|
||||
-8 5 NULL
|
||||
+4 2 2
|
||||
+2 3 NULL
|
||||
+5 4 2
|
||||
+6 5 2
|
||||
affected rows: 5
|
||||
disconnect con1;
|
||||
disconnect con2;
|
|
@ -89,13 +89,14 @@ affected rows: 0
|
|||
SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue';
|
||||
affected rows: 0
|
||||
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
affected rows: 3
|
||||
info: Records: 3 Duplicates: 0 Warnings: 0
|
||||
connection con1;
|
||||
#
|
||||
# 2 duplicates
|
||||
#
|
||||
affected rows: 3
|
||||
info: Records: 3 Duplicates: 0 Warnings: 0
|
||||
affected rows: 4
|
||||
info: Records: 3 Duplicates: 1 Warnings: 0
|
||||
connection default;
|
||||
#
|
||||
# 3 rows
|
||||
|
@ -103,19 +104,21 @@ connection default;
|
|||
SELECT * FROM t1 order by k;
|
||||
id k c
|
||||
1 1 NULL
|
||||
2 2 NULL
|
||||
3 3 NULL
|
||||
affected rows: 3
|
||||
4 2 1
|
||||
2 3 NULL
|
||||
5 4 NULL
|
||||
6 5 NULL
|
||||
affected rows: 5
|
||||
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
|
||||
affected rows: 4
|
||||
info: Records: 3 Duplicates: 1 Warnings: 0
|
||||
affected rows: 6
|
||||
info: Records: 3 Duplicates: 3 Warnings: 0
|
||||
SELECT * FROM t1 order by k;
|
||||
id k c
|
||||
1 1 NULL
|
||||
2 2 2
|
||||
3 3 NULL
|
||||
7 4 NULL
|
||||
8 5 NULL
|
||||
4 2 2
|
||||
2 3 NULL
|
||||
5 4 2
|
||||
6 5 2
|
||||
affected rows: 5
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
use test;
|
||||
drop table if exists t1;
|
||||
create table t1 (id int primary key, value int, value2 int,
|
||||
value3 int, index(value,value2)) engine=innodb;
|
||||
insert into t1 values
|
||||
(10,10,10,10),(11,11,11,11),(12,12,12,12),(13,13,13,13),(14,14,14,14),
|
||||
(15,15,15,15),(16,16,16,16),(17,17,17,17),(18,18,18,18),(19,19,19,19),
|
||||
(20,20,20,20);
|
||||
connect conn1, localhost, root,,;
|
||||
connect conn2, localhost, root,,;
|
||||
connect conn3, localhost, root,,;
|
||||
connection conn1;
|
||||
use test;
|
||||
start transaction with consistent snapshot;
|
||||
connection conn2;
|
||||
use test;
|
||||
CREATE PROCEDURE update_t1()
|
||||
BEGIN
|
||||
DECLARE i INT DEFAULT 1;
|
||||
while (i <= 5000) DO
|
||||
update test.t1 set value2=value2+1, value3=value3+1 where id=12;
|
||||
SET i = i + 1;
|
||||
END WHILE;
|
||||
END|
|
||||
set autocommit=0;
|
||||
CALL update_t1();
|
||||
select * from t1;
|
||||
id value value2 value3
|
||||
10 10 10 10
|
||||
11 11 11 11
|
||||
12 12 5012 5012
|
||||
13 13 13 13
|
||||
14 14 14 14
|
||||
15 15 15 15
|
||||
16 16 16 16
|
||||
17 17 17 17
|
||||
18 18 18 18
|
||||
19 19 19 19
|
||||
20 20 20 20
|
||||
set autocommit=1;
|
||||
select * from t1;
|
||||
id value value2 value3
|
||||
10 10 10 10
|
||||
11 11 11 11
|
||||
12 12 5012 5012
|
||||
13 13 13 13
|
||||
14 14 14 14
|
||||
15 15 15 15
|
||||
16 16 16 16
|
||||
17 17 17 17
|
||||
18 18 18 18
|
||||
19 19 19 19
|
||||
20 20 20 20
|
||||
connection conn1;
|
||||
select * from t1 force index(value) where value=12;
|
||||
connection conn3;
|
||||
kill query @id;
|
||||
connection conn1;
|
||||
ERROR 70100: Query execution was interrupted
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
disconnect conn2;
|
||||
disconnect conn3;
|
||||
drop procedure if exists update_t1;
|
||||
drop table if exists t1;
|
81
mysql-test/suite/innodb/r/innodb_bug84958.result
Normal file
81
mysql-test/suite/innodb/r/innodb_bug84958.result
Normal file
|
@ -0,0 +1,81 @@
|
|||
#
|
||||
# Bug #84958 InnoDB's MVCC has O(N^2) behaviors
|
||||
# https://bugs.mysql.com/bug.php?id=84958
|
||||
#
|
||||
# Set up the test with a procedure and a function.
|
||||
#
|
||||
CREATE PROCEDURE insert_n(start int, end int)
|
||||
BEGIN
|
||||
DECLARE i INT DEFAULT start;
|
||||
WHILE i <= end do
|
||||
INSERT INTO t1 VALUES (1, 2, 3) ON DUPLICATE KEY UPDATE c = i;
|
||||
SET i = i + 1;
|
||||
END WHILE;
|
||||
END~~
|
||||
CREATE FUNCTION num_pages_get()
|
||||
RETURNS INT
|
||||
BEGIN
|
||||
DECLARE ret INT;
|
||||
SELECT variable_value INTO ret
|
||||
FROM information_schema.global_status
|
||||
WHERE variable_name = 'innodb_buffer_pool_read_requests';
|
||||
RETURN ret;
|
||||
END~~
|
||||
#
|
||||
# Create a table with one record in it and start an RR transaction
|
||||
#
|
||||
CREATE TABLE t1 (a INT, b INT, c INT, PRIMARY KEY(a,b), KEY (b,c))
|
||||
ENGINE=InnoDB;
|
||||
BEGIN;
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
#
|
||||
# Create 100 newer record versions in con2 and con3
|
||||
#
|
||||
connect con2, localhost, root,,;
|
||||
connection con2;
|
||||
INSERT INTO t1 VALUES (1, 2, 3) ON DUPLICATE KEY UPDATE c = NULL;
|
||||
CALL insert_n(1, 50);;
|
||||
connect con3, localhost, root,,;
|
||||
connection con3;
|
||||
CALL insert_n(51, 100);;
|
||||
connection con2;
|
||||
connection con3;
|
||||
INSERT INTO t1 VALUES (1, 2, 1) ON DUPLICATE KEY UPDATE c = NULL;
|
||||
connection default;
|
||||
#
|
||||
# Connect to default and record how many pages were accessed
|
||||
# when selecting the record using the secondary key.
|
||||
#
|
||||
SET @num_pages_1 = num_pages_get();
|
||||
SELECT * FROM t1 force index (b);
|
||||
a b c
|
||||
SET @num_pages_2= num_pages_get();
|
||||
SELECT @num_pages_2 - @num_pages_1 < 500;
|
||||
@num_pages_2 - @num_pages_1 < 500
|
||||
1
|
||||
#
|
||||
# Commit and show the final record.
|
||||
#
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
SELECT * FROM t1 force index (b);
|
||||
a b c
|
||||
COMMIT;
|
||||
SELECT * FROM t1 force index (b);
|
||||
a b c
|
||||
1 2 NULL
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 2 NULL
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
disconnect con2;
|
||||
disconnect con3;
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE insert_n;
|
||||
DROP FUNCTION num_pages_get;
|
|
@ -17,21 +17,9 @@ SELECT COUNT(*) FROM t1;
|
|||
COUNT(*)
|
||||
10000
|
||||
CREATE INDEX idx_title ON t1(title);
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
SELECT * FROM t1 WHERE title = 'a10';
|
||||
class id title
|
||||
10 10 a10
|
||||
SELECT * FROM t1 WHERE title = 'a5000';
|
||||
class id title
|
||||
5000 5000 a5000
|
||||
SELECT * FROM t1 WHERE title = 'a10000';
|
||||
class id title
|
||||
10000 10000 a10000
|
||||
SELECT * FROM t1 WHERE title = 'a10010';
|
||||
class id title
|
||||
DROP TABLE t1;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
RENAME TABLE t1 TO t0;
|
||||
# Test Blob
|
||||
CREATE TABLE t1(
|
||||
a INT PRIMARY KEY,
|
||||
|
@ -48,9 +36,12 @@ CHAR_LENGTH(b)
|
|||
20000
|
||||
40000
|
||||
60000
|
||||
ALTER TABLE t1 DROP COLUMN c;
|
||||
CHECK TABLE t1;
|
||||
ALTER TABLE t1 DROP COLUMN c, FORCE;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
CHECK TABLE t0,t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t0 check status OK
|
||||
test.t1 check status OK
|
||||
SELECT CHAR_LENGTH(b) FROM t1;
|
||||
CHAR_LENGTH(b)
|
||||
|
@ -59,14 +50,33 @@ CHAR_LENGTH(b)
|
|||
40000
|
||||
60000
|
||||
DROP TABLE t1;
|
||||
RENAME TABLE t0 to t1;
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
SELECT * FROM t1 WHERE title = 'a10';
|
||||
class id title
|
||||
10 10 a10
|
||||
SELECT * FROM t1 WHERE title = 'a5000';
|
||||
class id title
|
||||
5000 5000 a5000
|
||||
SELECT * FROM t1 WHERE title = 'a10000';
|
||||
class id title
|
||||
10000 10000 a10000
|
||||
SELECT * FROM t1 WHERE title = 'a10010';
|
||||
class id title
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(
|
||||
class INT,
|
||||
id INT,
|
||||
title VARCHAR(100)
|
||||
) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
|
||||
SET debug_dbug='+d,crash_commit_before';
|
||||
connect hang,localhost,root;
|
||||
SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
|
||||
CREATE INDEX idx_title ON t1(title);
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
disconnect hang;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
10000
|
||||
|
@ -104,9 +114,12 @@ CHAR_LENGTH(b)
|
|||
20000
|
||||
40000
|
||||
60000
|
||||
SET debug_dbug='+d,crash_commit_before';
|
||||
ALTER TABLE t1 DROP COLUMN c;
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
connect hang,localhost,root;
|
||||
SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
|
||||
ALTER TABLE t1 DROP COLUMN c, FORCE;
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
disconnect hang;
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
|
@ -137,21 +150,9 @@ SELECT COUNT(*) FROM t1;
|
|||
COUNT(*)
|
||||
10000
|
||||
CREATE INDEX idx_title ON t1(title);
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
SELECT * FROM t1 WHERE title = 'a10';
|
||||
class id title
|
||||
10 10 a10
|
||||
SELECT * FROM t1 WHERE title = 'a5000';
|
||||
class id title
|
||||
5000 5000 a5000
|
||||
SELECT * FROM t1 WHERE title = 'a10000';
|
||||
class id title
|
||||
10000 10000 a10000
|
||||
SELECT * FROM t1 WHERE title = 'a10010';
|
||||
class id title
|
||||
DROP TABLE t1;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
RENAME TABLE t1 TO t0;
|
||||
# Test Blob
|
||||
CREATE TABLE t1(
|
||||
a INT PRIMARY KEY,
|
||||
|
@ -168,9 +169,12 @@ CHAR_LENGTH(b)
|
|||
20000
|
||||
40000
|
||||
60000
|
||||
ALTER TABLE t1 DROP COLUMN c;
|
||||
CHECK TABLE t1;
|
||||
ALTER TABLE t1 DROP COLUMN c, FORCE;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
CHECK TABLE t0,t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t0 check status OK
|
||||
test.t1 check status OK
|
||||
SELECT CHAR_LENGTH(b) FROM t1;
|
||||
CHAR_LENGTH(b)
|
||||
|
@ -179,14 +183,33 @@ CHAR_LENGTH(b)
|
|||
40000
|
||||
60000
|
||||
DROP TABLE t1;
|
||||
RENAME TABLE t0 to t1;
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
SELECT * FROM t1 WHERE title = 'a10';
|
||||
class id title
|
||||
10 10 a10
|
||||
SELECT * FROM t1 WHERE title = 'a5000';
|
||||
class id title
|
||||
5000 5000 a5000
|
||||
SELECT * FROM t1 WHERE title = 'a10000';
|
||||
class id title
|
||||
10000 10000 a10000
|
||||
SELECT * FROM t1 WHERE title = 'a10010';
|
||||
class id title
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(
|
||||
class INT,
|
||||
id INT,
|
||||
title VARCHAR(100)
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPACT;
|
||||
SET debug_dbug='+d,crash_commit_before';
|
||||
connect hang,localhost,root;
|
||||
SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
|
||||
CREATE INDEX idx_title ON t1(title);
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
disconnect hang;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
10000
|
||||
|
@ -224,9 +247,12 @@ CHAR_LENGTH(b)
|
|||
20000
|
||||
40000
|
||||
60000
|
||||
SET debug_dbug='+d,crash_commit_before';
|
||||
ALTER TABLE t1 DROP COLUMN c;
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
connect hang,localhost,root;
|
||||
SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
|
||||
ALTER TABLE t1 DROP COLUMN c, FORCE;
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
disconnect hang;
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
|
@ -257,21 +283,9 @@ SELECT COUNT(*) FROM t1;
|
|||
COUNT(*)
|
||||
10000
|
||||
CREATE INDEX idx_title ON t1(title);
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
SELECT * FROM t1 WHERE title = 'a10';
|
||||
class id title
|
||||
10 10 a10
|
||||
SELECT * FROM t1 WHERE title = 'a5000';
|
||||
class id title
|
||||
5000 5000 a5000
|
||||
SELECT * FROM t1 WHERE title = 'a10000';
|
||||
class id title
|
||||
10000 10000 a10000
|
||||
SELECT * FROM t1 WHERE title = 'a10010';
|
||||
class id title
|
||||
DROP TABLE t1;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
RENAME TABLE t1 TO t0;
|
||||
# Test Blob
|
||||
CREATE TABLE t1(
|
||||
a INT PRIMARY KEY,
|
||||
|
@ -288,9 +302,12 @@ CHAR_LENGTH(b)
|
|||
20000
|
||||
40000
|
||||
60000
|
||||
ALTER TABLE t1 DROP COLUMN c;
|
||||
CHECK TABLE t1;
|
||||
ALTER TABLE t1 DROP COLUMN c, FORCE;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
CHECK TABLE t0,t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t0 check status OK
|
||||
test.t1 check status OK
|
||||
SELECT CHAR_LENGTH(b) FROM t1;
|
||||
CHAR_LENGTH(b)
|
||||
|
@ -299,14 +316,33 @@ CHAR_LENGTH(b)
|
|||
40000
|
||||
60000
|
||||
DROP TABLE t1;
|
||||
RENAME TABLE t0 to t1;
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
SELECT * FROM t1 WHERE title = 'a10';
|
||||
class id title
|
||||
10 10 a10
|
||||
SELECT * FROM t1 WHERE title = 'a5000';
|
||||
class id title
|
||||
5000 5000 a5000
|
||||
SELECT * FROM t1 WHERE title = 'a10000';
|
||||
class id title
|
||||
10000 10000 a10000
|
||||
SELECT * FROM t1 WHERE title = 'a10010';
|
||||
class id title
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(
|
||||
class INT,
|
||||
id INT,
|
||||
title VARCHAR(100)
|
||||
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||
SET debug_dbug='+d,crash_commit_before';
|
||||
connect hang,localhost,root;
|
||||
SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
|
||||
CREATE INDEX idx_title ON t1(title);
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
disconnect hang;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
10000
|
||||
|
@ -344,9 +380,12 @@ CHAR_LENGTH(b)
|
|||
20000
|
||||
40000
|
||||
60000
|
||||
SET debug_dbug='+d,crash_commit_before';
|
||||
ALTER TABLE t1 DROP COLUMN c;
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
connect hang,localhost,root;
|
||||
SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
|
||||
ALTER TABLE t1 DROP COLUMN c, FORCE;
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
disconnect hang;
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
|
@ -378,21 +417,9 @@ SELECT COUNT(*) FROM t1;
|
|||
COUNT(*)
|
||||
10000
|
||||
CREATE INDEX idx_title ON t1(title);
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
SELECT * FROM t1 WHERE title = 'a10';
|
||||
class id title
|
||||
10 10 a10
|
||||
SELECT * FROM t1 WHERE title = 'a5000';
|
||||
class id title
|
||||
5000 5000 a5000
|
||||
SELECT * FROM t1 WHERE title = 'a10000';
|
||||
class id title
|
||||
10000 10000 a10000
|
||||
SELECT * FROM t1 WHERE title = 'a10010';
|
||||
class id title
|
||||
DROP TABLE t1;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
RENAME TABLE t1 TO t0;
|
||||
# Test Blob
|
||||
SET GLOBAL innodb_file_per_table=1;
|
||||
CREATE TABLE t1(
|
||||
|
@ -410,9 +437,12 @@ CHAR_LENGTH(b)
|
|||
20000
|
||||
40000
|
||||
60000
|
||||
ALTER TABLE t1 DROP COLUMN c;
|
||||
CHECK TABLE t1;
|
||||
ALTER TABLE t1 DROP COLUMN c, FORCE;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
CHECK TABLE t0,t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t0 check status OK
|
||||
test.t1 check status OK
|
||||
SELECT CHAR_LENGTH(b) FROM t1;
|
||||
CHAR_LENGTH(b)
|
||||
|
@ -421,15 +451,34 @@ CHAR_LENGTH(b)
|
|||
40000
|
||||
60000
|
||||
DROP TABLE t1;
|
||||
RENAME TABLE t0 to t1;
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
SELECT * FROM t1 WHERE title = 'a10';
|
||||
class id title
|
||||
10 10 a10
|
||||
SELECT * FROM t1 WHERE title = 'a5000';
|
||||
class id title
|
||||
5000 5000 a5000
|
||||
SELECT * FROM t1 WHERE title = 'a10000';
|
||||
class id title
|
||||
10000 10000 a10000
|
||||
SELECT * FROM t1 WHERE title = 'a10010';
|
||||
class id title
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL innodb_file_per_table=1;
|
||||
CREATE TABLE t1(
|
||||
class INT,
|
||||
id INT,
|
||||
title VARCHAR(100)
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
|
||||
SET debug_dbug='+d,crash_commit_before';
|
||||
connect hang,localhost,root;
|
||||
SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
|
||||
CREATE INDEX idx_title ON t1(title);
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
disconnect hang;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
10000
|
||||
|
@ -468,9 +517,12 @@ CHAR_LENGTH(b)
|
|||
20000
|
||||
40000
|
||||
60000
|
||||
SET debug_dbug='+d,crash_commit_before';
|
||||
ALTER TABLE t1 DROP COLUMN c;
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
connect hang,localhost,root;
|
||||
SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever';
|
||||
ALTER TABLE t1 DROP COLUMN c, FORCE;
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
disconnect hang;
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
|
@ -481,5 +533,4 @@ CHAR_LENGTH(b)
|
|||
40000
|
||||
60000
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL innodb_file_per_table=default;
|
||||
DROP PROCEDURE populate_t1;
|
||||
|
|
|
@ -2,8 +2,10 @@
|
|||
# Bug #20445525 ADD A CONSISTENCY CHECK AGAINST DB_TRX_ID BEING
|
||||
# IN THE FUTURE
|
||||
#
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
|
||||
CREATE TABLE t1(a INT) row_format=redundant engine=innoDB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
InnoDB 0 transactions not purged
|
||||
NOT FOUND /\[Warning\] InnoDB: A transaction id in a record of table `test`\.`t1` is newer than the system-wide maximum/ in mysqld.1.err
|
||||
call mtr.add_suppression("\\[Warning\\] InnoDB: A transaction id in a record of table `test`\\.`t1` is newer than the system-wide maximum");
|
||||
SELECT * FROM t1;
|
||||
|
|
|
@ -8,8 +8,8 @@ update t1 set c = 'MariaDB';
|
|||
update t1 set c = 'InnoDB';
|
||||
set global debug_dbug = '+d,ib_undo_trunc';
|
||||
commit;
|
||||
drop table t1;
|
||||
call mtr.add_suppression("InnoDB: innodb_undo_tablespaces=0 disables dedicated undo log tablespaces");
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
FOUND 1 /ib_undo_trunc/ in mysqld.1.err
|
||||
# restart: with restart_parameters
|
||||
drop table t1;
|
||||
|
|
|
@ -37,11 +37,11 @@ SELECT * FROM t1 WHERE MATCH(b,c) AGAINST ('column');
|
|||
SHOW CREATE TABLE t1;
|
||||
ALTER TABLE t1 FORCE, ALGORITHM=COPY;
|
||||
|
||||
# crash right after the last write_row(), before the first commit of ALTER TABLE
|
||||
--source include/expect_crash.inc
|
||||
# kill right after the last write_row(), before the first commit of ALTER TABLE
|
||||
connect (hang,localhost,root);
|
||||
|
||||
SET DEBUG_DBUG='+d,crash_commit_before';
|
||||
--error 2013
|
||||
SET DEBUG_SYNC='alter_table_copy_trans_commit SIGNAL hung WAIT_FOR ever';
|
||||
send
|
||||
# create 32 secondary indexes
|
||||
ALTER TABLE t ADD INDEX(b,c,d,a),ADD INDEX(b,c,a,d),ADD INDEX(b,a,c,d),ADD INDEX(b,a,d,c),
|
||||
ADD INDEX(b,d,a,c),ADD INDEX(b,d,c,a),ADD INDEX(a,b,c,d),ADD INDEX(a,b,d,c),
|
||||
|
@ -53,8 +53,13 @@ ALTER TABLE t ADD INDEX(b,c,d,a),ADD INDEX(b,c,a,d),ADD INDEX(b,a,c,d),ADD INDEX
|
|||
ADD INDEX(a,b,d), ADD INDEX(a,d,b), ADD INDEX(b,c,d), ADD INDEX(b,d,c),
|
||||
ALGORITHM=COPY;
|
||||
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
let $shutdown_timeout=0;
|
||||
--let $restart_parameters= --innodb-force-recovery=3
|
||||
--source include/start_mysqld.inc
|
||||
--source include/restart_mysqld.inc
|
||||
disconnect hang;
|
||||
let $shutdown_timeout=;
|
||||
let $datadir=`select @@datadir`;
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/ /FTS_[0-9a-f]*_[0-9a-f]*/FTS/
|
||||
--list_files $datadir/test
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
--source include/have_debug_sync.inc
|
||||
--source include/innodb_binlog.inc
|
||||
|
||||
let $stmt= `SELECT @@GLOBAL.log_bin`;
|
||||
|
||||
set global transaction isolation level repeatable read;
|
||||
|
||||
CREATE TABLE t1(
|
||||
|
@ -84,13 +82,7 @@ SET DEBUG_SYNC='ha_write_row_end SIGNAL write_row_done WAIT_FOR continue';
|
|||
--reap
|
||||
|
||||
SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue';
|
||||
if ($stmt) {
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
|
||||
}
|
||||
if (!$stmt) {
|
||||
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
|
||||
}
|
||||
|
||||
--connection con1
|
||||
--echo #
|
||||
|
|
|
@ -1,95 +0,0 @@
|
|||
--source include/have_innodb.inc
|
||||
|
||||
#
|
||||
# create test-bed to run test
|
||||
#
|
||||
use test;
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
create table t1 (id int primary key, value int, value2 int,
|
||||
value3 int, index(value,value2)) engine=innodb;
|
||||
|
||||
insert into t1 values
|
||||
(10,10,10,10),(11,11,11,11),(12,12,12,12),(13,13,13,13),(14,14,14,14),
|
||||
(15,15,15,15),(16,16,16,16),(17,17,17,17),(18,18,18,18),(19,19,19,19),
|
||||
(20,20,20,20);
|
||||
let $ID= `SELECT @id := CONNECTION_ID()`;
|
||||
|
||||
#
|
||||
# we need multiple connections as we need to keep one connection
|
||||
# active with trx requesting consistent read.
|
||||
#
|
||||
connect (conn1, localhost, root,,);
|
||||
connect (conn2, localhost, root,,);
|
||||
connect (conn3, localhost, root,,);
|
||||
|
||||
#
|
||||
# start trx with consistent read
|
||||
#
|
||||
connection conn1;
|
||||
use test;
|
||||
|
||||
start transaction with consistent snapshot;
|
||||
|
||||
#
|
||||
# update table such that secondary index is updated.
|
||||
#
|
||||
connection conn2;
|
||||
use test;
|
||||
delimiter |;
|
||||
CREATE PROCEDURE update_t1()
|
||||
BEGIN
|
||||
DECLARE i INT DEFAULT 1;
|
||||
while (i <= 5000) DO
|
||||
update test.t1 set value2=value2+1, value3=value3+1 where id=12;
|
||||
SET i = i + 1;
|
||||
END WHILE;
|
||||
END|
|
||||
|
||||
delimiter ;|
|
||||
set autocommit=0;
|
||||
CALL update_t1();
|
||||
select * from t1;
|
||||
set autocommit=1;
|
||||
select * from t1;
|
||||
|
||||
#
|
||||
# Now try to fire select query from connection-1 enforcing
|
||||
# use of secondary index.
|
||||
#
|
||||
connection conn1;
|
||||
let $ID= `SELECT @id := CONNECTION_ID()`;
|
||||
#--error ER_QUERY_INTERRUPTED
|
||||
--send
|
||||
select * from t1 force index(value) where value=12;
|
||||
|
||||
#
|
||||
# select is going to take good time so let's kill query.
|
||||
#
|
||||
connection conn3;
|
||||
let $wait_condition=
|
||||
select * from information_schema.processlist where state = 'Sending data' and
|
||||
info = 'select * from t1 force index(value) where value=12';
|
||||
--source include/wait_condition.inc
|
||||
let $ignore= `SELECT @id := $ID`;
|
||||
kill query @id;
|
||||
|
||||
#
|
||||
# reap the value of connection-1
|
||||
#
|
||||
connection conn1;
|
||||
--error ER_QUERY_INTERRUPTED
|
||||
reap;
|
||||
|
||||
#
|
||||
# clean test-bed.
|
||||
#
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
disconnect conn2;
|
||||
disconnect conn3;
|
||||
drop procedure if exists update_t1;
|
||||
drop table if exists t1;
|
||||
|
||||
|
86
mysql-test/suite/innodb/t/innodb_bug84958.test
Normal file
86
mysql-test/suite/innodb/t/innodb_bug84958.test
Normal file
|
@ -0,0 +1,86 @@
|
|||
--echo #
|
||||
--echo # Bug #84958 InnoDB's MVCC has O(N^2) behaviors
|
||||
--echo # https://bugs.mysql.com/bug.php?id=84958
|
||||
--echo #
|
||||
--echo # Set up the test with a procedure and a function.
|
||||
--echo #
|
||||
|
||||
--source include/have_innodb.inc
|
||||
|
||||
DELIMITER ~~;
|
||||
CREATE PROCEDURE insert_n(start int, end int)
|
||||
BEGIN
|
||||
DECLARE i INT DEFAULT start;
|
||||
WHILE i <= end do
|
||||
INSERT INTO t1 VALUES (1, 2, 3) ON DUPLICATE KEY UPDATE c = i;
|
||||
SET i = i + 1;
|
||||
END WHILE;
|
||||
END~~
|
||||
|
||||
CREATE FUNCTION num_pages_get()
|
||||
RETURNS INT
|
||||
BEGIN
|
||||
DECLARE ret INT;
|
||||
SELECT variable_value INTO ret
|
||||
FROM information_schema.global_status
|
||||
WHERE variable_name = 'innodb_buffer_pool_read_requests';
|
||||
RETURN ret;
|
||||
END~~
|
||||
DELIMITER ;~~
|
||||
|
||||
--echo #
|
||||
--echo # Create a table with one record in it and start an RR transaction
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT, b INT, c INT, PRIMARY KEY(a,b), KEY (b,c))
|
||||
ENGINE=InnoDB;
|
||||
BEGIN;
|
||||
SELECT * FROM t1;
|
||||
|
||||
--echo #
|
||||
--echo # Create 100 newer record versions in con2 and con3
|
||||
--echo #
|
||||
connect (con2, localhost, root,,);
|
||||
connection con2;
|
||||
INSERT INTO t1 VALUES (1, 2, 3) ON DUPLICATE KEY UPDATE c = NULL;
|
||||
--send CALL insert_n(1, 50);
|
||||
|
||||
connect (con3, localhost, root,,);
|
||||
connection con3;
|
||||
--send CALL insert_n(51, 100);
|
||||
|
||||
connection con2;
|
||||
reap;
|
||||
connection con3;
|
||||
reap;
|
||||
INSERT INTO t1 VALUES (1, 2, 1) ON DUPLICATE KEY UPDATE c = NULL;
|
||||
|
||||
connection default;
|
||||
|
||||
--echo #
|
||||
--echo # Connect to default and record how many pages were accessed
|
||||
--echo # when selecting the record using the secondary key.
|
||||
--echo #
|
||||
SET @num_pages_1 = num_pages_get();
|
||||
SELECT * FROM t1 force index (b);
|
||||
SET @num_pages_2= num_pages_get();
|
||||
|
||||
SELECT @num_pages_2 - @num_pages_1 < 500;
|
||||
|
||||
--echo #
|
||||
--echo # Commit and show the final record.
|
||||
--echo #
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t1 force index (b);
|
||||
COMMIT;
|
||||
SELECT * FROM t1 force index (b);
|
||||
SELECT * FROM t1;
|
||||
CHECK TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup
|
||||
--echo #
|
||||
disconnect con2;
|
||||
disconnect con3;
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE insert_n;
|
||||
DROP FUNCTION num_pages_get;
|
|
@ -7,14 +7,15 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
|
||||
let PAGE_SIZE=`select @@innodb_page_size`;
|
||||
|
||||
CREATE TABLE t1(a INT) row_format=redundant engine=innoDB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
|
||||
let MYSQLD_DATADIR=`select @@datadir`;
|
||||
--source include/wait_all_purged.inc
|
||||
let $restart_noprint=2;
|
||||
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
perl;
|
||||
|
|
1
mysql-test/suite/innodb/t/undo_truncate_recover.opt
Normal file
1
mysql-test/suite/innodb/t/undo_truncate_recover.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--innodb-purge-threads=1
|
|
@ -34,6 +34,7 @@ update t1 set c = 'MariaDB';
|
|||
update t1 set c = 'InnoDB';
|
||||
eval set global debug_dbug = '+d,$SEARCH_PATTERN';
|
||||
commit;
|
||||
drop table t1;
|
||||
call mtr.add_suppression("InnoDB: innodb_undo_tablespaces=0 disables dedicated undo log tablespaces");
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
@ -50,5 +51,3 @@ if ($checksum_algorithm == "strict_crc32")
|
|||
let $restart_parameters= $restart_parameters --innodb_checksum_algorithm=strict_full_crc32;
|
||||
}
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
drop table t1;
|
||||
|
|
32
mysql-test/suite/mariabackup/big_innodb_log.result
Normal file
32
mysql-test/suite/mariabackup/big_innodb_log.result
Normal file
|
@ -0,0 +1,32 @@
|
|||
# Kill the server
|
||||
# restart: --debug-dbug=+d,innodb_small_log_block_no_limit
|
||||
CREATE TABLE t(i INT) ENGINE InnoDB;
|
||||
INSERT INTO t VALUES
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
|
||||
# xtrabackup backup, execute the following query after test.t is copied:
|
||||
# BEGIN NOT ATOMIC INSERT INTO test.t SELECT * FROM test.t; UPDATE test.t SET i = 10 WHERE i = 0; DELETE FROM test.t WHERE i = 1; END
|
||||
SELECT count(*) FROM t WHERE i = 0;
|
||||
count(*)
|
||||
0
|
||||
# xtrabackup prepare
|
||||
# shutdown server
|
||||
# remove datadir
|
||||
# xtrabackup move back
|
||||
# restart: --debug-dbug=+d,innodb_small_log_block_no_limit
|
||||
SELECT count(*) FROM t WHERE i = 0;
|
||||
count(*)
|
||||
0
|
||||
Ok
|
||||
Ok
|
||||
DROP TABLE t;
|
||||
# Kill the server
|
||||
# restart
|
87
mysql-test/suite/mariabackup/big_innodb_log.test
Normal file
87
mysql-test/suite/mariabackup/big_innodb_log.test
Normal file
|
@ -0,0 +1,87 @@
|
|||
# The general reason why innodb redo log file is limited by 512G is that
|
||||
# log_block_convert_lsn_to_no() returns value limited by 1G. But there is no
|
||||
# need to have unique log block numbers in log group. This test forces innodb
|
||||
# to generate redo log files with non-unique log block numbers and tests
|
||||
# recovery process with such numbers.
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
|
||||
--let MYSQLD_DATADIR= `select @@datadir`
|
||||
let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --debug-dbug=+d,innodb_small_log_block_no_limit;
|
||||
|
||||
--source include/kill_mysqld.inc
|
||||
--rmdir $MYSQLD_DATADIR
|
||||
--mkdir $MYSQLD_DATADIR
|
||||
--mkdir $MYSQLD_DATADIR/mysql
|
||||
--mkdir $MYSQLD_DATADIR/test
|
||||
--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQL_BOOTSTRAP_SQL_FILE >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
|
||||
let $old_restart_parameters=$restart_parameters;
|
||||
let $restart_parameters= $old_restart_parameters --debug-dbug=+d,innodb_small_log_block_no_limit;
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
CREATE TABLE t(i INT) ENGINE InnoDB;
|
||||
INSERT INTO t VALUES
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
|
||||
|
||||
--let after_copy_test_t=BEGIN NOT ATOMIC INSERT INTO test.t SELECT * FROM test.t; UPDATE test.t SET i = 10 WHERE i = 0; DELETE FROM test.t WHERE i = 1; END
|
||||
|
||||
--echo # xtrabackup backup, execute the following query after test.t is copied:
|
||||
--echo # $after_copy_test_t
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events,innodb_small_log_block_no_limit;
|
||||
--enable_result_log
|
||||
|
||||
--let $total_before=`SELECT count(*) FROM t`
|
||||
SELECT count(*) FROM t WHERE i = 0;
|
||||
--let $updated_before=`SELECT count(*) FROM t WHERE i = 10`
|
||||
|
||||
echo # xtrabackup prepare;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --prepare --target-dir=$targetdir --dbug=+d,innodb_small_log_block_no_limit;
|
||||
--source include/restart_and_restore.inc
|
||||
--enable_result_log
|
||||
|
||||
--let $total_after=`SELECT count(*) FROM t`
|
||||
SELECT count(*) FROM t WHERE i = 0;
|
||||
--let $updated_after=`SELECT count(*) FROM t WHERE i = 10`
|
||||
|
||||
if ($total_before == $total_after) {
|
||||
--echo Ok
|
||||
}
|
||||
if ($total_before != $total_after) {
|
||||
--echo Failed
|
||||
}
|
||||
if ($updated_before == $updated_after) {
|
||||
--echo Ok
|
||||
}
|
||||
if ($updated_before != $updated_after) {
|
||||
--echo Failed
|
||||
}
|
||||
|
||||
DROP TABLE t;
|
||||
rmdir $targetdir;
|
||||
--source include/kill_mysqld.inc
|
||||
--rmdir $MYSQLD_DATADIR
|
||||
|
||||
perl;
|
||||
use lib "lib";
|
||||
use My::File::Path;
|
||||
my $install_db_dir = ($ENV{MTR_PARALLEL} == 1) ?
|
||||
"$ENV{'MYSQLTEST_VARDIR'}/install.db" :
|
||||
"$ENV{'MYSQLTEST_VARDIR'}/../install.db";
|
||||
copytree($install_db_dir, $ENV{'MYSQLD_DATADIR'});
|
||||
EOF
|
||||
|
||||
--let $restart_parameters= $old_restart_parameters
|
||||
--source include/start_mysqld.inc
|
20
mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result
Normal file
20
mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result
Normal file
|
@ -0,0 +1,20 @@
|
|||
include/master-slave.inc
|
||||
[connection master]
|
||||
CREATE TEMPORARY TABLE t1 (a INT NOT NULL);
|
||||
LOAD DATA INFILE 'x' INTO TABLE x;
|
||||
ERROR 42S02: Table 'test.x' doesn't exist
|
||||
CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x);
|
||||
ERROR HY000: Cannot create temporary table with partitions
|
||||
"************** DROP TEMPORARY TABLE Should be present in Binary log **************"
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t1 (a INT NOT NULL)
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x)
|
||||
CREATE TABLE t1 (b INT);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
connection slave;
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
include/rpl_end.inc
|
32
mysql-test/suite/rpl/r/rpl_failed_drop_tbl_binlog.result
Normal file
32
mysql-test/suite/rpl/r/rpl_failed_drop_tbl_binlog.result
Normal file
|
@ -0,0 +1,32 @@
|
|||
include/master-slave.inc
|
||||
[connection master]
|
||||
create table t1 (a int) engine=innodb;
|
||||
create table t2 (b longblob) engine=innodb;
|
||||
create table t3 (c int) engine=innodb;
|
||||
insert into t2 values (repeat('b',1024*1024));
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
set debug_sync='rm_table_no_locks_before_delete_table SIGNAL nogo WAIT_FOR go EXECUTE 2';
|
||||
drop table t1, t2, t3;
|
||||
connect foo,localhost,root;
|
||||
set debug_sync='now SIGNAL go';
|
||||
kill query CONNECTION_ID;
|
||||
connection master;
|
||||
ERROR 70100: Query execution was interrupted
|
||||
"Tables t2 and t3 should be listed"
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
t2
|
||||
t3
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
|
||||
connection slave;
|
||||
drop table t2, t3;
|
||||
connection master;
|
||||
set debug_sync='RESET';
|
||||
drop table t2, t3;
|
||||
include/rpl_end.inc
|
|
@ -41,7 +41,7 @@ START SLAVE;
|
|||
.. con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
|
||||
...==== BEGIN include/wait_for_slave_param.inc [Slave_IO_Running] ====
|
||||
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
|
||||
Waiting until 'Slave_IO_Running' = 'Yes' [timeout='300', $slave_error_param='Last_IO_Errno']
|
||||
Waiting until 'Slave_IO_Running' = 'Yes' [$slave_error_param='Last_IO_Errno']
|
||||
[connection slave]
|
||||
...==== END include/wait_for_slave_param.inc [Slave_IO_Running] ====
|
||||
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
|
||||
|
@ -52,7 +52,7 @@ Waiting until 'Slave_IO_Running' = 'Yes' [timeout='300', $slave_error_param='Las
|
|||
.. con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
|
||||
...==== BEGIN include/wait_for_slave_param.inc [Slave_SQL_Running] ====
|
||||
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
|
||||
Waiting until 'Slave_SQL_Running' = 'Yes' [timeout='300', $slave_error_param='1']
|
||||
Waiting until 'Slave_SQL_Running' = 'Yes' [$slave_error_param='1']
|
||||
[connection slave]
|
||||
...==== END include/wait_for_slave_param.inc [Slave_SQL_Running] ====
|
||||
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
|
||||
|
|
|
@ -1,31 +1,5 @@
|
|||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
|
||||
UNIQUE(b));
|
||||
connection slave;
|
||||
connection master;
|
||||
INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1 10
|
||||
2 2
|
||||
connection slave;
|
||||
call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432");
|
||||
include/wait_for_slave_sql_error.inc [errno=1105]
|
||||
Last_SQL_Error = 'Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10''
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
stop slave;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
reset slave;
|
||||
connection master;
|
||||
reset master;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
start slave;
|
||||
include/wait_for_slave_to_start.inc
|
||||
connection master;
|
||||
CREATE TABLE t1 (
|
||||
id bigint(20) unsigned NOT NULL auto_increment,
|
||||
|
|
129
mysql-test/suite/rpl/r/rpl_mdev_17614.result
Normal file
129
mysql-test/suite/rpl/r/rpl_mdev_17614.result
Normal file
|
@ -0,0 +1,129 @@
|
|||
include/master-slave.inc
|
||||
[connection master]
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY , b INT,
|
||||
UNIQUE(b), c int) engine=innodb;
|
||||
connection slave;
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES (1, 1, 1);
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES(2, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
|
||||
connection master;
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 2
|
||||
2 2 3
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1062]
|
||||
Last_SQL_Error = 'Error 'Duplicate entry '1' for key 'b'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c)''
|
||||
#Different value from server
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 1
|
||||
2 2 3
|
||||
stop slave;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
reset slave;
|
||||
connection master;
|
||||
reset master;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
start slave;
|
||||
include/wait_for_slave_to_start.inc
|
||||
connection master;
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY auto_increment, b INT,
|
||||
UNIQUE(b), c int) engine=innodb;
|
||||
connection slave;
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES (default, 1, 1);
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (default, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES(default, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
connection master;
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 2
|
||||
3 2 3
|
||||
connection slave;
|
||||
#same data as master
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 2
|
||||
3 2 3
|
||||
connection master;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
connection master;
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT,
|
||||
UNIQUE(b), c int, d int ) engine=innodb;
|
||||
connection slave;
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES (1, 1, 1, 1);
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (2, NULL, 2, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES(3, NULL, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
|
||||
connection master;
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
a b c d
|
||||
1 1 1 1
|
||||
2 NULL 2 2
|
||||
3 NULL 2 3
|
||||
connection slave;
|
||||
#same data as master
|
||||
SELECT * FROM t1;
|
||||
a b c d
|
||||
1 1 1 1
|
||||
2 NULL 2 2
|
||||
3 NULL 2 3
|
||||
connection master;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
connection master;
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY auto_increment, b INT,
|
||||
UNIQUE(b), c int) engine=innodb;
|
||||
connection slave;
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES (1, 1, 1);
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES(2, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
connection master;
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 2
|
||||
2 2 3
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1062]
|
||||
Last_SQL_Error = 'Error 'Duplicate entry '1' for key 'b'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c)''
|
||||
#Different value from server
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 1
|
||||
2 2 3
|
||||
stop slave;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
reset slave;
|
||||
connection master;
|
||||
reset master;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
start slave;
|
||||
include/wait_for_slave_to_start.inc
|
||||
include/rpl_end.inc
|
18
mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result
Normal file
18
mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result
Normal file
|
@ -0,0 +1,18 @@
|
|||
include/master-slave.inc
|
||||
[connection master]
|
||||
connection slave;
|
||||
SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency;
|
||||
SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay;
|
||||
SET GLOBAL innodb_thread_concurrency = 100;
|
||||
connection master;
|
||||
CREATE TABLE t(f INT) ENGINE=INNODB;
|
||||
INSERT INTO t VALUES (10);
|
||||
connection slave;
|
||||
include/diff_tables.inc [master:t, slave:t]
|
||||
"===== Clean up======="
|
||||
connection master;
|
||||
DROP TABLE t;
|
||||
connection slave;
|
||||
SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency;
|
||||
SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay;
|
||||
include/rpl_end.inc
|
|
@ -1,5 +1,6 @@
|
|||
include/master-slave.inc
|
||||
[connection master]
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
|
||||
CREATE TABLE t1(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
|
||||
CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
|
||||
CREATE TRIGGER trig1 AFTER INSERT ON t1
|
||||
|
@ -49,9 +50,13 @@ connection master;
|
|||
DROP TABLE t1;
|
||||
CREATE TABLE t1(i INT, j INT, UNIQUE KEY(i), UNIQUE KEY(j)) ENGINE=INNODB;
|
||||
INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
|
||||
START TRANSACTION;
|
||||
LOCK TABLES t1 WRITE;
|
||||
INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
|
||||
UNLOCK TABLES;
|
||||
COMMIT;
|
||||
connection slave;
|
||||
|
|
56
mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test
Normal file
56
mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test
Normal file
|
@ -0,0 +1,56 @@
|
|||
# ==== Purpose ====
|
||||
#
|
||||
# Test verifies that failed CREATE OR REPLACE TEMPORARY TABLE statement which
|
||||
# dropped the table but failed at a later stage of creation of temporary table
|
||||
# is written to binarylog in row based replication.
|
||||
#
|
||||
# ==== Implementation ====
|
||||
#
|
||||
# Steps:
|
||||
# 0 - Have mixed based replication mode.
|
||||
# 1 - Create a temporary table. It will be replicated as mixed replication
|
||||
# mode is in use.
|
||||
# 2 - Execute an unsafe statement which will switch current statement
|
||||
# binlog format to 'ROW'. i.e If binlog_format=MIXED, there are open
|
||||
# temporary tables, and an unsafe statement is executed, then subsequent
|
||||
# statements are logged in row format.
|
||||
# 3 - Execute a CREATE OR REPLACE TEMPORARY TABLE statement which tries to
|
||||
# create partitions on temporary table. Since it is not supported it will
|
||||
# fail.
|
||||
# 4 - Check the binary log output to ensure that the failed statement is
|
||||
# written to the binary log.
|
||||
# 5 - Slave should be up and running and in sync with master.
|
||||
#
|
||||
# ==== References ====
|
||||
#
|
||||
# MDEV-18930: Failed CREATE OR REPLACE TEMPORARY not written into binary log
|
||||
# makes data on master and slave diverge
|
||||
#
|
||||
|
||||
--source include/have_partition.inc
|
||||
--source include/have_binlog_format_mixed.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
CREATE TEMPORARY TABLE t1 (a INT NOT NULL);
|
||||
|
||||
# Execute an unsafe statement which switches replication mode internally from
|
||||
# "STATEMENT" to "ROW".
|
||||
--error ER_NO_SUCH_TABLE
|
||||
LOAD DATA INFILE 'x' INTO TABLE x;
|
||||
|
||||
--error ER_PARTITION_NO_TEMPORARY
|
||||
CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x);
|
||||
|
||||
--echo "************** DROP TEMPORARY TABLE Should be present in Binary log **************"
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
CREATE TABLE t1 (b INT);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
--sync_slave_with_master
|
||||
|
||||
# Cleanup
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
|
||||
--source include/rpl_end.inc
|
||||
|
64
mysql-test/suite/rpl/t/rpl_failed_drop_tbl_binlog.test
Normal file
64
mysql-test/suite/rpl/t/rpl_failed_drop_tbl_binlog.test
Normal file
|
@ -0,0 +1,64 @@
|
|||
# ==== Purpose ====
|
||||
#
|
||||
# Check that when the execution of a DROP TABLE command with single table
|
||||
# fails it should not be written to the binary log. Also test that when the
|
||||
# execution of DROP TABLE command with multiple tables fails the command
|
||||
# should be written into the binary log.
|
||||
#
|
||||
# ==== Implementation ====
|
||||
#
|
||||
# Steps:
|
||||
# 0 - Create tables named t1, t2, t3
|
||||
# 1 - Execute DROP TABLE t1,t2,t3 command.
|
||||
# 2 - Kill the DROP TABLE command while it is trying to drop table 't2'.
|
||||
# 3 - Verify that tables t2,t3 are present after the DROP command execution
|
||||
# was interrupted.
|
||||
# 4 - Check that table 't1' is present in binary log as part of DROP
|
||||
# command.
|
||||
#
|
||||
# ==== References ====
|
||||
#
|
||||
# MDEV-20348: DROP TABLE IF EXISTS killed on master but was replicated.
|
||||
#
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/have_binlog_format_statement.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
create table t1 (a int) engine=innodb;
|
||||
create table t2 (b longblob) engine=innodb;
|
||||
create table t3 (c int) engine=innodb;
|
||||
insert into t2 values (repeat('b',1024*1024));
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
|
||||
|
||||
let $id=`select connection_id()`;
|
||||
set debug_sync='rm_table_no_locks_before_delete_table SIGNAL nogo WAIT_FOR go EXECUTE 2';
|
||||
send drop table t1, t2, t3;
|
||||
|
||||
connect foo,localhost,root;
|
||||
set debug_sync='now SIGNAL go';
|
||||
let $wait_condition=select 1 from information_schema.processlist where state like 'debug sync point:%';
|
||||
source include/wait_condition.inc;
|
||||
--replace_result $id CONNECTION_ID
|
||||
eval kill query $id;
|
||||
|
||||
connection master;
|
||||
error ER_QUERY_INTERRUPTED;
|
||||
reap;
|
||||
|
||||
--echo "Tables t2 and t3 should be listed"
|
||||
SHOW TABLES;
|
||||
--source include/show_binlog_events.inc
|
||||
--sync_slave_with_master
|
||||
drop table t2, t3;
|
||||
|
||||
connection master;
|
||||
set debug_sync='RESET';
|
||||
drop table t2, t3;
|
||||
|
||||
source include/rpl_end.inc;
|
|
@ -14,45 +14,6 @@ source include/have_binlog_checksum_off.inc;
|
|||
|
||||
source include/master-slave.inc;
|
||||
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
|
||||
|
||||
#
|
||||
# This is to test that slave properly detects if
|
||||
# master may suffer from:
|
||||
# BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
|
||||
# (i.e. on master, INSERT ON DUPLICATE KEY UPDATE is used and manipulates
|
||||
# an auto_increment column, and is binlogged statement-based).
|
||||
#
|
||||
|
||||
# testcase with INSERT VALUES
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
|
||||
UNIQUE(b));
|
||||
sync_slave_with_master;
|
||||
connection master;
|
||||
INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
|
||||
SELECT * FROM t1;
|
||||
connection slave;
|
||||
|
||||
# show the error message
|
||||
#1105 = ER_UNKNOWN_ERROR
|
||||
--let $slave_sql_errno= 1105
|
||||
--let $show_slave_sql_error= 1
|
||||
call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432");
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
# show that it was not replicated
|
||||
SELECT * FROM t1;
|
||||
|
||||
# restart replication for the next testcase
|
||||
stop slave;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
reset slave;
|
||||
connection master;
|
||||
reset master;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
start slave;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
# testcase with INSERT SELECT
|
||||
connection master;
|
||||
CREATE TABLE t1 (
|
||||
|
|
121
mysql-test/suite/rpl/t/rpl_mdev_17614.test
Normal file
121
mysql-test/suite/rpl/t/rpl_mdev_17614.test
Normal file
|
@ -0,0 +1,121 @@
|
|||
source include/have_debug.inc;
|
||||
source include/have_innodb.inc;
|
||||
-- source include/have_binlog_format_statement.inc
|
||||
source include/master-slave.inc;
|
||||
# MDEV-17614
|
||||
# INSERT on dup key update is replication unsafe
|
||||
# There can be three case
|
||||
# 1. 2 unique key, Replication is unsafe.
|
||||
# 2. 2 unique key , with one auto increment key, Safe to replicate because Innodb will acquire gap lock
|
||||
# 3. n no of unique keys (n>1) but insert is only in 1 unique key
|
||||
# 4. 2 unique key , with one auto increment key(but user gives auto inc value), unsafe to replicate
|
||||
|
||||
# Case 1
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY , b INT,
|
||||
UNIQUE(b), c int) engine=innodb;
|
||||
sync_slave_with_master;
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES (1, 1, 1);
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
--connection master1
|
||||
INSERT INTO t1 VALUES(2, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
--connection master
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
--connection slave
|
||||
# show the error message
|
||||
--let $slave_sql_errno= 1062
|
||||
--let $show_slave_sql_error= 1
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
--echo #Different value from server
|
||||
SELECT * FROM t1;
|
||||
|
||||
# restart replication for the next testcase
|
||||
stop slave;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
reset slave;
|
||||
connection master;
|
||||
reset master;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
start slave;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
# Case 2
|
||||
--connection master
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY auto_increment, b INT,
|
||||
UNIQUE(b), c int) engine=innodb;
|
||||
sync_slave_with_master;
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES (default, 1, 1);
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (default, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
--connection master1
|
||||
INSERT INTO t1 VALUES(default, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
--connection master
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
--sync_slave_with_master
|
||||
--echo #same data as master
|
||||
SELECT * FROM t1;
|
||||
|
||||
connection master;
|
||||
drop table t1;
|
||||
--sync_slave_with_master
|
||||
|
||||
# Case 3
|
||||
--connection master
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT,
|
||||
UNIQUE(b), c int, d int ) engine=innodb;
|
||||
sync_slave_with_master;
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES (1, 1, 1, 1);
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (2, NULL, 2, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
--connection master1
|
||||
INSERT INTO t1 VALUES(3, NULL, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
--connection master
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
--sync_slave_with_master
|
||||
--echo #same data as master
|
||||
SELECT * FROM t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
--sync_slave_with_master
|
||||
|
||||
# Case 4
|
||||
--connection master
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY auto_increment, b INT,
|
||||
UNIQUE(b), c int) engine=innodb;
|
||||
sync_slave_with_master;
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES (1, 1, 1);
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
--connection master1
|
||||
INSERT INTO t1 VALUES(2, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c);
|
||||
--connection master
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
--connection slave
|
||||
# show the error message
|
||||
--let $slave_sql_errno= 1062
|
||||
--let $show_slave_sql_error= 1
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
--echo #Different value from server
|
||||
SELECT * FROM t1;
|
||||
|
||||
# restart replication for the next testcase
|
||||
stop slave;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
reset slave;
|
||||
connection master;
|
||||
reset master;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
start slave;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
--source include/rpl_end.inc
|
41
mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test
Normal file
41
mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test
Normal file
|
@ -0,0 +1,41 @@
|
|||
# ==== Purpose ====
|
||||
#
|
||||
# Test verifies that replication shouldn't hang when number of active threads
|
||||
# on the slave server are less than the allowed innodb_thread_concurrency value.
|
||||
#
|
||||
# ==== Implementation ====
|
||||
#
|
||||
# Steps:
|
||||
# 0 - Have master slave replication setup with engine being Innodb.
|
||||
# 1 - Configure innodb_thread_concurrency = 100.
|
||||
# 2 - Do some DML on master and sync the slave with master.
|
||||
# 3 - Ensure replication doesn't hang.
|
||||
#
|
||||
# ==== References ====
|
||||
#
|
||||
# MDEV-20247: Replication hangs with "preparing" and never starts
|
||||
#
|
||||
|
||||
--source include/master-slave.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--connection slave
|
||||
SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency;
|
||||
SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay;
|
||||
SET GLOBAL innodb_thread_concurrency = 100;
|
||||
|
||||
--connection master
|
||||
CREATE TABLE t(f INT) ENGINE=INNODB;
|
||||
INSERT INTO t VALUES (10);
|
||||
--sync_slave_with_master
|
||||
|
||||
--let $diff_tables=master:t, slave:t
|
||||
--source include/diff_tables.inc
|
||||
|
||||
--echo "===== Clean up======="
|
||||
--connection master
|
||||
DROP TABLE t;
|
||||
--sync_slave_with_master
|
||||
SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency;
|
||||
SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay;
|
||||
--source include/rpl_end.inc
|
|
@ -24,7 +24,7 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/have_binlog_format_mixed.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
|
||||
# Case-1: BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS
|
||||
# Statement is unsafe because it invokes a trigger or a
|
||||
# stored function that inserts into an AUTO_INCREMENT column.
|
||||
|
|
|
@ -1445,7 +1445,7 @@ VARIABLE_SCOPE GLOBAL
|
|||
VARIABLE_TYPE BIGINT UNSIGNED
|
||||
VARIABLE_COMMENT Size of each log file in a log group.
|
||||
NUMERIC_MIN_VALUE 1048576
|
||||
NUMERIC_MAX_VALUE 549755813888
|
||||
NUMERIC_MAX_VALUE 17592186044415
|
||||
NUMERIC_BLOCK_SIZE 65536
|
||||
ENUM_VALUE_LIST NULL
|
||||
READ_ONLY YES
|
||||
|
|
|
@ -1,18 +1,9 @@
|
|||
SET @start_value = @@global.table_open_cache ;
|
||||
SELECT @start_value;
|
||||
@start_value
|
||||
421
|
||||
'#--------------------FN_DYNVARS_001_01------------------------#'
|
||||
SET @@global.table_open_cache = 99;
|
||||
SET @@global.table_open_cache = DeFAULT;
|
||||
SELECT @@global.table_open_cache;
|
||||
@@global.table_open_cache
|
||||
2000
|
||||
'#---------------------FN_DYNVARS_001_02-------------------------#'
|
||||
SET @@global.table_open_cache = Default;
|
||||
SELECT @@global.table_open_cache = 400;
|
||||
@@global.table_open_cache = 400
|
||||
0
|
||||
SELECT @@global.table_open_cache > 0;
|
||||
@@global.table_open_cache > 0
|
||||
1
|
||||
'#--------------------FN_DYNVARS_001_03------------------------#'
|
||||
SET @@global.table_open_cache = 8;
|
||||
Warnings:
|
||||
|
@ -106,6 +97,3 @@ ERROR 42S02: Unknown table 'global' in field list
|
|||
SELECT table_open_cache = @@session.table_open_cache ;
|
||||
ERROR 42S22: Unknown column 'table_open_cache' in 'field list'
|
||||
SET @@global.table_open_cache = @start_value;
|
||||
SELECT @@global.table_open_cache ;
|
||||
@@global.table_open_cache
|
||||
421
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
# Scope: GLOBAL #
|
||||
# Access Type: Dynamic #
|
||||
# Data Type: numeric #
|
||||
# Default Value: 400 #
|
||||
# Range: 64-524288 #
|
||||
# Default Value: 400 #
|
||||
# Range: 64-524288 #
|
||||
# #
|
||||
# #
|
||||
# Creation Date: 2008-02-13 #
|
||||
|
@ -35,18 +35,6 @@
|
|||
##########################################################################
|
||||
|
||||
SET @start_value = @@global.table_open_cache ;
|
||||
SELECT @start_value;
|
||||
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_001_01------------------------#'
|
||||
########################################################################
|
||||
# Display the DEFAULT value of table_open_cache #
|
||||
########################################################################
|
||||
|
||||
SET @@global.table_open_cache = 99;
|
||||
SET @@global.table_open_cache = DeFAULT;
|
||||
SELECT @@global.table_open_cache;
|
||||
|
||||
|
||||
--echo '#---------------------FN_DYNVARS_001_02-------------------------#'
|
||||
###############################################
|
||||
|
@ -54,7 +42,7 @@ SELECT @@global.table_open_cache;
|
|||
###############################################
|
||||
|
||||
SET @@global.table_open_cache = Default;
|
||||
SELECT @@global.table_open_cache = 400;
|
||||
SELECT @@global.table_open_cache > 0;
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_001_03------------------------#'
|
||||
########################################################################
|
||||
|
@ -163,10 +151,7 @@ SELECT table_open_cache = @@session.table_open_cache ;
|
|||
##############################
|
||||
|
||||
SET @@global.table_open_cache = @start_value;
|
||||
SELECT @@global.table_open_cache ;
|
||||
|
||||
|
||||
##################################################################
|
||||
# END OF table_open_cache TESTS #
|
||||
##################################################################
|
||||
|
||||
|
|
|
@ -605,5 +605,40 @@ select * from t1;
|
|||
a b
|
||||
1 0
|
||||
affected rows: 1
|
||||
#
|
||||
# MDEV-19304 Segfault in ALTER TABLE after UPDATE for SIMULTANEOUS_ASSIGNMENT
|
||||
#
|
||||
create or replace table t1 (a int, s timestamp(6) as row start, e timestamp(6) as row end, period for system_time(s,e)) engine=myisam with system versioning;
|
||||
insert into t1 values (null, null, null);
|
||||
insert into t1 values (null, null, null);
|
||||
set sql_mode= 'simultaneous_assignment';
|
||||
update t1 set e= 1;
|
||||
Warnings:
|
||||
Warning 1906 The value specified for generated column 'e' in table 't1' has been ignored
|
||||
Warning 1906 The value specified for generated column 'e' in table 't1' has been ignored
|
||||
alter table t1 force;
|
||||
set sql_mode= default;
|
||||
#
|
||||
# MDEV-18862 Unfortunate error message upon attempt to drop system versioning
|
||||
#
|
||||
set system_versioning_alter_history= keep;
|
||||
create or replace table t1 (x int) with system versioning;
|
||||
alter table t1 drop column `row_start`, drop column `row_end`, drop period for system_time, drop system versioning;
|
||||
ERROR 42000: Can't DROP PERIOD FOR SYSTEM_TIME on `t1`; check that it exists
|
||||
alter table t1 drop period for system_time;
|
||||
ERROR 42000: Can't DROP PERIOD FOR SYSTEM_TIME on `t1`; check that it exists
|
||||
alter table t1 drop column `row_start`, drop column `row_end`, drop system versioning;
|
||||
ERROR 42000: Can't DROP COLUMN `row_start`; check that it exists
|
||||
alter table t1 drop column `row_end`;
|
||||
ERROR 42000: Can't DROP COLUMN `row_end`; check that it exists
|
||||
#
|
||||
# MDEV-19127 Assertion `row_start_field' failed in vers_prepare_keys upon ALTER TABLE
|
||||
#
|
||||
set system_versioning_alter_history=keep;
|
||||
create or replace table t1 (f1 int) with system versioning;
|
||||
alter table t1 add f2 int with system versioning, drop system versioning;
|
||||
create or replace table t1 (f1 int) with system versioning;
|
||||
alter table t1 drop system versioning, add f2 int with system versioning;
|
||||
ERROR HY000: Table `t1` is not system-versioned
|
||||
drop database test;
|
||||
create database test;
|
||||
|
|
|
@ -554,6 +554,36 @@ t1 CREATE TABLE `t1` (
|
|||
#
|
||||
create or replace table t1 (f int) with system versioning partition by hash(f);
|
||||
insert delayed into t1 values (1);
|
||||
#
|
||||
# MDEV-17613 MIN/MAX Optimization (Select tables optimized away) does not work
|
||||
#
|
||||
create or replace table t1 (pk int primary key) with system versioning
|
||||
partition by system_time (
|
||||
partition p1 history,
|
||||
partition pn current);
|
||||
insert into t1 values (1), (2);
|
||||
explain select max(pk) from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
#
|
||||
# MDEV-20068 History partition rotation is not done under LOCK TABLES
|
||||
#
|
||||
create or replace table t1 (x int) with system versioning partition by system_time limit 1
|
||||
(partition p1 history, partition pn current);
|
||||
lock tables t1 write;
|
||||
insert into t1 values (0), (1), (2), (3);
|
||||
delete from t1 where x < 3;
|
||||
delete from t1;
|
||||
Warnings:
|
||||
Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
|
||||
unlock tables;
|
||||
#
|
||||
# MDEV-20336 Assertion bitmap_is_set(read_partitions) upon SELECT FOR UPDATE from versioned table
|
||||
#
|
||||
create or replace table t1 (pk int primary key) with system versioning partition by system_time limit 100 (partition p1 history, partition pn current);
|
||||
execute immediate 'select * from t1 for update';
|
||||
pk
|
||||
drop table t1;
|
||||
# Test cleanup
|
||||
drop database test;
|
||||
create database test;
|
||||
|
|
|
@ -44,7 +44,7 @@ i
|
|||
6
|
||||
explain partitions select * from t1;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL 2 Using where
|
||||
1 SIMPLE t1 pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL 2
|
||||
explain partitions select * from t1 for system_time as of '2001-02-04 10:20:30';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1_p1sp0,p1_p1sp1,p0_p0sp0,p0_p0sp1,p2_p2sp0,p2_p2sp1,pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL # Using where
|
||||
|
|
|
@ -503,5 +503,40 @@ alter table t1 modify a int with system versioning;
|
|||
select * from t1;
|
||||
--disable_info
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-19304 Segfault in ALTER TABLE after UPDATE for SIMULTANEOUS_ASSIGNMENT
|
||||
--echo #
|
||||
create or replace table t1 (a int, s timestamp(6) as row start, e timestamp(6) as row end, period for system_time(s,e)) engine=myisam with system versioning;
|
||||
insert into t1 values (null, null, null);
|
||||
insert into t1 values (null, null, null);
|
||||
set sql_mode= 'simultaneous_assignment';
|
||||
update t1 set e= 1;
|
||||
alter table t1 force;
|
||||
set sql_mode= default;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18862 Unfortunate error message upon attempt to drop system versioning
|
||||
--echo #
|
||||
set system_versioning_alter_history= keep;
|
||||
create or replace table t1 (x int) with system versioning;
|
||||
--error ER_CANT_DROP_FIELD_OR_KEY
|
||||
alter table t1 drop column `row_start`, drop column `row_end`, drop period for system_time, drop system versioning;
|
||||
--error ER_CANT_DROP_FIELD_OR_KEY
|
||||
alter table t1 drop period for system_time;
|
||||
--error ER_CANT_DROP_FIELD_OR_KEY
|
||||
alter table t1 drop column `row_start`, drop column `row_end`, drop system versioning;
|
||||
--error ER_CANT_DROP_FIELD_OR_KEY
|
||||
alter table t1 drop column `row_end`;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-19127 Assertion `row_start_field' failed in vers_prepare_keys upon ALTER TABLE
|
||||
--echo #
|
||||
set system_versioning_alter_history=keep;
|
||||
create or replace table t1 (f1 int) with system versioning;
|
||||
alter table t1 add f2 int with system versioning, drop system versioning;
|
||||
create or replace table t1 (f1 int) with system versioning;
|
||||
--error ER_VERS_NOT_VERSIONED
|
||||
alter table t1 drop system versioning, add f2 int with system versioning;
|
||||
|
||||
drop database test;
|
||||
create database test;
|
||||
|
|
|
@ -488,6 +488,45 @@ create or replace table t1 (f int) with system versioning partition by hash(f);
|
|||
--error 0,ER_DELAYED_NOT_SUPPORTED
|
||||
insert delayed into t1 values (1);
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17613 MIN/MAX Optimization (Select tables optimized away) does not work
|
||||
--echo #
|
||||
--disable_query_log
|
||||
set @saved_storage_engine= @@default_storage_engine;
|
||||
if ($MTR_COMBINATION_HEAP)
|
||||
{
|
||||
# This case does not work with HEAP
|
||||
set default_storage_engine= myisam;
|
||||
}
|
||||
--enable_query_log
|
||||
create or replace table t1 (pk int primary key) with system versioning
|
||||
partition by system_time (
|
||||
partition p1 history,
|
||||
partition pn current);
|
||||
insert into t1 values (1), (2);
|
||||
explain select max(pk) from t1;
|
||||
--disable_query_log
|
||||
set default_storage_engine= @saved_storage_engine;
|
||||
--enable_query_log
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-20068 History partition rotation is not done under LOCK TABLES
|
||||
--echo #
|
||||
create or replace table t1 (x int) with system versioning partition by system_time limit 1
|
||||
(partition p1 history, partition pn current);
|
||||
lock tables t1 write;
|
||||
insert into t1 values (0), (1), (2), (3);
|
||||
delete from t1 where x < 3;
|
||||
delete from t1;
|
||||
unlock tables;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-20336 Assertion bitmap_is_set(read_partitions) upon SELECT FOR UPDATE from versioned table
|
||||
--echo #
|
||||
create or replace table t1 (pk int primary key) with system versioning partition by system_time limit 100 (partition p1 history, partition pn current);
|
||||
execute immediate 'select * from t1 for update';
|
||||
drop table t1;
|
||||
|
||||
--echo # Test cleanup
|
||||
drop database test;
|
||||
create database test;
|
||||
|
|
|
@ -2,9 +2,15 @@
|
|||
# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
|
||||
#
|
||||
# Verbose run
|
||||
set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
|
||||
prepare set_wsrep_myisam from @prep;
|
||||
set @toggle=1; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_name ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_transition ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=InnoDB;
|
||||
END IF|
|
||||
\d ;
|
||||
TRUNCATE TABLE time_zone;
|
||||
TRUNCATE TABLE time_zone_name;
|
||||
TRUNCATE TABLE time_zone_transition;
|
||||
|
@ -28,11 +34,25 @@ Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/ignored.tab' as time zo
|
|||
Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion.
|
||||
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
|
||||
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
|
||||
set @toggle=0; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=Aria;
|
||||
ALTER TABLE time_zone_name ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=Aria;
|
||||
END IF|
|
||||
\d ;
|
||||
# Silent run
|
||||
set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
|
||||
prepare set_wsrep_myisam from @prep;
|
||||
set @toggle=1; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_name ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_transition ENGINE=InnoDB;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=InnoDB;
|
||||
END IF|
|
||||
\d ;
|
||||
TRUNCATE TABLE time_zone;
|
||||
TRUNCATE TABLE time_zone_name;
|
||||
TRUNCATE TABLE time_zone_transition;
|
||||
|
@ -53,26 +73,56 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
|
|||
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it.
|
||||
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
|
||||
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
|
||||
set @toggle=0; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=Aria;
|
||||
ALTER TABLE time_zone_name ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=Aria;
|
||||
END IF|
|
||||
\d ;
|
||||
#
|
||||
# Testing with explicit timezonefile
|
||||
#
|
||||
set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
|
||||
prepare set_wsrep_myisam from @prep;
|
||||
set @toggle=1; execute set_wsrep_myisam using @toggle;
|
||||
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
|
||||
SET @time_zone_id= LAST_INSERT_ID();
|
||||
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
|
||||
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
|
||||
(@time_zone_id, 0, 0, 0, 'GMT')
|
||||
;
|
||||
set @toggle=0; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=Aria;
|
||||
ALTER TABLE time_zone_name ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=Aria;
|
||||
END IF|
|
||||
\d ;
|
||||
#
|
||||
# Testing --leap
|
||||
#
|
||||
set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');
|
||||
prepare set_wsrep_myisam from @prep;
|
||||
set @toggle=1; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone_leap_second ENGINE=InnoDB;
|
||||
END IF|
|
||||
\d ;
|
||||
TRUNCATE TABLE time_zone_leap_second;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone_leap_second ENGINE=Aria;
|
||||
END IF|
|
||||
\d ;
|
||||
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
|
||||
set @toggle=0; execute set_wsrep_myisam using @toggle;
|
||||
\d |
|
||||
IF (select count(*) from information_schema.global_variables where
|
||||
variable_name='wsrep_on') = 1 THEN
|
||||
ALTER TABLE time_zone ENGINE=Aria;
|
||||
ALTER TABLE time_zone_name ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition ENGINE=Aria;
|
||||
ALTER TABLE time_zone_transition_type ENGINE=Aria;
|
||||
END IF|
|
||||
\d ;
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
#
|
||||
# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
|
||||
#
|
||||
# Verbose run
|
||||
set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
|
||||
prepare set_wsrep_write_binlog from @prep1;
|
||||
set @toggle=0; execute set_wsrep_write_binlog using @toggle;
|
||||
TRUNCATE TABLE time_zone;
|
||||
TRUNCATE TABLE time_zone_name;
|
||||
TRUNCATE TABLE time_zone_transition;
|
||||
TRUNCATE TABLE time_zone_transition_type;
|
||||
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
|
||||
SET @time_zone_id= LAST_INSERT_ID();
|
||||
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
|
||||
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
|
||||
(@time_zone_id, 0, 0, 0, 'GMT')
|
||||
;
|
||||
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/garbage' as time zone. Skipping it.
|
||||
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/ignored.tab' as time zone. Skipping it.
|
||||
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
|
||||
SET @time_zone_id= LAST_INSERT_ID();
|
||||
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('posix/GMT', @time_zone_id);
|
||||
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
|
||||
(@time_zone_id, 0, 0, 0, 'GMT')
|
||||
;
|
||||
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it.
|
||||
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/ignored.tab' as time zone. Skipping it.
|
||||
Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion.
|
||||
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
|
||||
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
|
||||
# Silent run
|
||||
set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
|
||||
prepare set_wsrep_write_binlog from @prep1;
|
||||
set @toggle=0; execute set_wsrep_write_binlog using @toggle;
|
||||
TRUNCATE TABLE time_zone;
|
||||
TRUNCATE TABLE time_zone_name;
|
||||
TRUNCATE TABLE time_zone_transition;
|
||||
TRUNCATE TABLE time_zone_transition_type;
|
||||
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
|
||||
SET @time_zone_id= LAST_INSERT_ID();
|
||||
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
|
||||
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
|
||||
(@time_zone_id, 0, 0, 0, 'GMT')
|
||||
;
|
||||
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/garbage' as time zone. Skipping it.
|
||||
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
|
||||
SET @time_zone_id= LAST_INSERT_ID();
|
||||
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('posix/GMT', @time_zone_id);
|
||||
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
|
||||
(@time_zone_id, 0, 0, 0, 'GMT')
|
||||
;
|
||||
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it.
|
||||
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
|
||||
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
|
||||
#
|
||||
# Testing with explicit timezonefile
|
||||
#
|
||||
set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
|
||||
prepare set_wsrep_write_binlog from @prep1;
|
||||
set @toggle=0; execute set_wsrep_write_binlog using @toggle;
|
||||
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
|
||||
SET @time_zone_id= LAST_INSERT_ID();
|
||||
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
|
||||
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
|
||||
(@time_zone_id, 0, 0, 0, 'GMT')
|
||||
;
|
||||
#
|
||||
# Testing --leap
|
||||
#
|
||||
set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
|
||||
prepare set_wsrep_write_binlog from @prep1;
|
||||
set @toggle=0; execute set_wsrep_write_binlog using @toggle;
|
||||
TRUNCATE TABLE time_zone_leap_second;
|
||||
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
|
|
@ -0,0 +1,40 @@
|
|||
--source include/have_wsrep.inc
|
||||
--source include/have_symlink.inc
|
||||
--source include/not_windows.inc
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
|
||||
--echo #
|
||||
|
||||
--exec mkdir $MYSQLTEST_VARDIR/zoneinfo
|
||||
--exec ln -s $MYSQLTEST_VARDIR/zoneinfo $MYSQLTEST_VARDIR/zoneinfo/posix
|
||||
--copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/GMT
|
||||
--copy_file std_data/words.dat $MYSQLTEST_VARDIR/zoneinfo/garbage
|
||||
--copy_file std_data/words.dat $MYSQLTEST_VARDIR/zoneinfo/ignored.tab
|
||||
|
||||
--echo # Verbose run
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--exec $MYSQL_TZINFO_TO_SQL --verbose --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo 2>&1
|
||||
|
||||
--echo # Silent run
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo 2>&1
|
||||
|
||||
--echo #
|
||||
--echo # Testing with explicit timezonefile
|
||||
--echo #
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>&1
|
||||
|
||||
--echo #
|
||||
--echo # Testing --leap
|
||||
--echo #
|
||||
|
||||
--exec $MYSQL_TZINFO_TO_SQL --leap --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo/GMT 2>&1
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
|
||||
--exec rm -rf $MYSQLTEST_VARDIR/zoneinfo
|
|
@ -1,5 +1,5 @@
|
|||
# Copyright (c) 2005, 2015, Oracle and/or its affiliates.
|
||||
# Copyright (c) 2008, 2017, MariaDB
|
||||
# Copyright (c) 2008, 2019, MariaDB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
|
|
|
@ -2864,7 +2864,8 @@ strncmpic(pcre_uint8 *s, pcre_uint8 *t, int n)
|
|||
{
|
||||
while (n--)
|
||||
{
|
||||
int c = tolower(*s++) - tolower(*t++);
|
||||
int c = tolower(*s) - tolower(*t);
|
||||
s++; t++;
|
||||
if (c) return c;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -3953,7 +3953,12 @@ int ha_partition::external_lock(THD *thd, int lock_type)
|
|||
{
|
||||
if (m_part_info->part_expr)
|
||||
m_part_info->part_expr->walk(&Item::register_field_in_read_map, 1, 0);
|
||||
if (m_part_info->part_type == VERSIONING_PARTITION)
|
||||
if (m_part_info->part_type == VERSIONING_PARTITION &&
|
||||
/* TODO: MDEV-20345 exclude more inapproriate commands like INSERT
|
||||
These commands may be excluded because working history partition is needed
|
||||
only for versioned DML. */
|
||||
thd->lex->sql_command != SQLCOM_SELECT &&
|
||||
thd->lex->sql_command != SQLCOM_INSERT_SELECT)
|
||||
m_part_info->vers_set_hist_part(thd);
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
|
@ -4095,8 +4100,24 @@ int ha_partition::start_stmt(THD *thd, thr_lock_type lock_type)
|
|||
/* Add partition to be called in reset(). */
|
||||
bitmap_set_bit(&m_partitions_to_reset, i);
|
||||
}
|
||||
if (lock_type == F_WRLCK && m_part_info->part_expr)
|
||||
m_part_info->part_expr->walk(&Item::register_field_in_read_map, 1, 0);
|
||||
switch (lock_type)
|
||||
{
|
||||
case TL_WRITE_ALLOW_WRITE:
|
||||
case TL_WRITE_CONCURRENT_INSERT:
|
||||
case TL_WRITE_DELAYED:
|
||||
case TL_WRITE_DEFAULT:
|
||||
case TL_WRITE_LOW_PRIORITY:
|
||||
case TL_WRITE:
|
||||
case TL_WRITE_ONLY:
|
||||
if (m_part_info->part_expr)
|
||||
m_part_info->part_expr->walk(&Item::register_field_in_read_map, 1, 0);
|
||||
if (m_part_info->part_type == VERSIONING_PARTITION &&
|
||||
// TODO: MDEV-20345 (see above)
|
||||
thd->lex->sql_command != SQLCOM_SELECT &&
|
||||
thd->lex->sql_command != SQLCOM_INSERT_SELECT)
|
||||
m_part_info->vers_set_hist_part(thd);
|
||||
default:;
|
||||
}
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define SQL_ITEM_INCLUDED
|
||||
|
||||
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2018, MariaDB Corporation
|
||||
Copyright (c) 2009, 2019, 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
|
||||
|
@ -719,7 +719,6 @@ public:
|
|||
class Item: public Value_source,
|
||||
public Type_all_attributes
|
||||
{
|
||||
void operator=(Item &);
|
||||
/**
|
||||
The index in the JOIN::join_tab array of the JOIN_TAB this Item is attached
|
||||
to. Items are attached (or 'pushed') to JOIN_TABs during optimization by the
|
||||
|
|
|
@ -3176,7 +3176,7 @@ bool Item_func_pad::fix_length_and_dec()
|
|||
DBUG_ASSERT(collation.collation->mbmaxlen > 0);
|
||||
if (args[1]->const_item() && !args[1]->is_expensive())
|
||||
{
|
||||
fix_char_length(Repeat_count(args[1]).count());
|
||||
fix_char_length_ulonglong(Repeat_count(args[1]).count());
|
||||
return false;
|
||||
}
|
||||
max_length= MAX_BLOB_WIDTH;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
|
||||
Copyright (c) 2008, 2015, MariaDB
|
||||
Copyright (c) 2008, 2019, 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
|
||||
|
@ -2692,6 +2692,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
|
|||
KEY_PART *key_parts;
|
||||
KEY *key_info;
|
||||
PARAM param;
|
||||
bool force_group_by = false;
|
||||
|
||||
if (check_stack_overrun(thd, 2*STACK_MIN_SIZE + sizeof(PARAM), buff))
|
||||
DBUG_RETURN(0); // Fatal error flag is set
|
||||
|
@ -2856,6 +2857,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
|
|||
Try to construct a QUICK_GROUP_MIN_MAX_SELECT.
|
||||
Notice that it can be constructed no matter if there is a range tree.
|
||||
*/
|
||||
DBUG_EXECUTE_IF("force_group_by", force_group_by = true; );
|
||||
if (!only_single_index_range_scan)
|
||||
group_trp= get_best_group_min_max(¶m, tree, best_read_time);
|
||||
if (group_trp)
|
||||
|
@ -2867,11 +2869,15 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
|
|||
if (unlikely(thd->trace_started()))
|
||||
group_trp->trace_basic_info(¶m, &grp_summary);
|
||||
|
||||
if (group_trp->read_cost < best_read_time)
|
||||
if (group_trp->read_cost < best_read_time || force_group_by)
|
||||
{
|
||||
grp_summary.add("chosen", true);
|
||||
best_trp= group_trp;
|
||||
best_read_time= best_trp->read_cost;
|
||||
if (force_group_by)
|
||||
{
|
||||
goto force_plan;
|
||||
}
|
||||
}
|
||||
else
|
||||
grp_summary.add("chosen", false).add("cause", "cost");
|
||||
|
@ -2977,6 +2983,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
|
|||
}
|
||||
}
|
||||
|
||||
force_plan:
|
||||
thd->mem_root= param.old_root;
|
||||
|
||||
/* If we got a read plan, create a quick select from it. */
|
||||
|
@ -12173,13 +12180,28 @@ int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length,
|
|||
DBUG_ASSERT(cur_prefix != NULL);
|
||||
result= file->ha_index_read_map(record, cur_prefix, keypart_map,
|
||||
HA_READ_AFTER_KEY);
|
||||
if (result || last_range->max_keypart_map == 0)
|
||||
DBUG_RETURN(result);
|
||||
|
||||
key_range previous_endpoint;
|
||||
last_range->make_max_endpoint(&previous_endpoint, prefix_length, keypart_map);
|
||||
if (file->compare_key(&previous_endpoint) <= 0)
|
||||
DBUG_RETURN(0);
|
||||
if (result || last_range->max_keypart_map == 0) {
|
||||
/*
|
||||
Only return if actual failure occurred. For HA_ERR_KEY_NOT_FOUND
|
||||
or HA_ERR_END_OF_FILE, we just want to continue to reach the next
|
||||
set of ranges. It is possible for the storage engine to return
|
||||
HA_ERR_KEY_NOT_FOUND/HA_ERR_END_OF_FILE even when there are more
|
||||
keys if it respects the end range set by the read_range_first call
|
||||
below.
|
||||
*/
|
||||
if (result != HA_ERR_KEY_NOT_FOUND && result != HA_ERR_END_OF_FILE)
|
||||
DBUG_RETURN(result);
|
||||
} else {
|
||||
/*
|
||||
For storage engines that don't respect end range, check if we've
|
||||
moved past the current range.
|
||||
*/
|
||||
key_range previous_endpoint;
|
||||
last_range->make_max_endpoint(&previous_endpoint, prefix_length,
|
||||
keypart_map);
|
||||
if (file->compare_key(&previous_endpoint) <= 0)
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
}
|
||||
|
||||
uint count= ranges.elements - (uint)(cur_range - (QUICK_RANGE**) ranges.buffer);
|
||||
|
|
|
@ -2608,6 +2608,7 @@ unlink_all_closed_tables(THD *thd, MYSQL_LOCK *lock, size_t reopen_count)
|
|||
DBUG_ASSERT(thd->open_tables == m_reopen_array[reopen_count]);
|
||||
|
||||
thd->open_tables->pos_in_locked_tables->table= NULL;
|
||||
thd->open_tables->pos_in_locked_tables= NULL;
|
||||
|
||||
close_thread_table(thd, &thd->open_tables);
|
||||
}
|
||||
|
@ -8461,8 +8462,8 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values,
|
|||
rfield->field_index == table->next_number_field->field_index)
|
||||
table->auto_increment_field_not_null= TRUE;
|
||||
Item::Type type= value->type();
|
||||
bool vers_sys_field= table->versioned() && rfield->vers_sys_field();
|
||||
if ((rfield->vcol_info || vers_sys_field) &&
|
||||
const bool skip_sys_field= rfield->vers_sys_field(); // TODO: && !thd->vers_modify_history() [MDEV-16546]
|
||||
if ((rfield->vcol_info || skip_sys_field) &&
|
||||
type != Item::DEFAULT_VALUE_ITEM &&
|
||||
type != Item::NULL_ITEM &&
|
||||
table->s->table_category != TABLE_CATEGORY_TEMPORARY)
|
||||
|
@ -8471,15 +8472,14 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values,
|
|||
ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN,
|
||||
ER_THD(thd, ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN),
|
||||
rfield->field_name.str, table->s->table_name.str);
|
||||
if (vers_sys_field)
|
||||
continue;
|
||||
}
|
||||
if (only_unvers_fields && !rfield->vers_update_unversioned())
|
||||
only_unvers_fields= false;
|
||||
|
||||
if (rfield->stored_in_db())
|
||||
{
|
||||
if (unlikely(value->save_in_field(rfield, 0) < 0) && !ignore_errors)
|
||||
if (!skip_sys_field &&
|
||||
unlikely(value->save_in_field(rfield, 0) < 0) && !ignore_errors)
|
||||
{
|
||||
my_message(ER_UNKNOWN_ERROR, ER_THD(thd, ER_UNKNOWN_ERROR), MYF(0));
|
||||
goto err;
|
||||
|
|
|
@ -4906,12 +4906,6 @@ extern "C" int thd_slave_thread(const MYSQL_THD thd)
|
|||
}
|
||||
|
||||
|
||||
extern "C" int thd_rpl_stmt_based(const MYSQL_THD thd)
|
||||
{
|
||||
return thd &&
|
||||
!thd->is_current_stmt_binlog_format_row() &&
|
||||
!thd->is_current_stmt_binlog_disabled();
|
||||
}
|
||||
|
||||
|
||||
/* Returns high resolution timestamp for the start
|
||||
|
@ -6251,6 +6245,48 @@ int THD::decide_logging_format(TABLE_LIST *tables)
|
|||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
int THD::decide_logging_format_low(TABLE *table)
|
||||
{
|
||||
/*
|
||||
INSERT...ON DUPLICATE KEY UPDATE on a table with more than one unique keys
|
||||
can be unsafe.
|
||||
*/
|
||||
if(wsrep_binlog_format() <= BINLOG_FORMAT_STMT &&
|
||||
!is_current_stmt_binlog_format_row() &&
|
||||
!lex->is_stmt_unsafe() &&
|
||||
lex->sql_command == SQLCOM_INSERT &&
|
||||
lex->duplicates == DUP_UPDATE)
|
||||
{
|
||||
uint unique_keys= 0;
|
||||
uint keys= table->s->keys, i= 0;
|
||||
Field *field;
|
||||
for (KEY* keyinfo= table->s->key_info;
|
||||
i < keys && unique_keys <= 1; i++, keyinfo++)
|
||||
if (keyinfo->flags & HA_NOSAME &&
|
||||
!(keyinfo->key_part->field->flags & AUTO_INCREMENT_FLAG &&
|
||||
//User given auto inc can be unsafe
|
||||
!keyinfo->key_part->field->val_int()))
|
||||
{
|
||||
for (uint j= 0; j < keyinfo->user_defined_key_parts; j++)
|
||||
{
|
||||
field= keyinfo->key_part[j].field;
|
||||
if(!bitmap_is_set(table->write_set,field->field_index))
|
||||
goto exit;
|
||||
}
|
||||
unique_keys++;
|
||||
exit:;
|
||||
}
|
||||
|
||||
if (unique_keys > 1)
|
||||
{
|
||||
lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_INSERT_TWO_KEYS);
|
||||
binlog_unsafe_warning_flags|= lex->get_stmt_unsafe_flags();
|
||||
set_current_stmt_binlog_format_row_if_mixed();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Implementation of interface to write rows to the binary log through the
|
||||
|
|
|
@ -2448,6 +2448,20 @@ public:
|
|||
/* container for handler's private per-connection data */
|
||||
Ha_data ha_data[MAX_HA];
|
||||
|
||||
/**
|
||||
Bit field for the state of binlog warnings.
|
||||
|
||||
The first Lex::BINLOG_STMT_UNSAFE_COUNT bits list all types of
|
||||
unsafeness that the current statement has.
|
||||
|
||||
This must be a member of THD and not of LEX, because warnings are
|
||||
detected and issued in different places (@c
|
||||
decide_logging_format() and @c binlog_query(), respectively).
|
||||
Between these calls, the THD->lex object may change; e.g., if a
|
||||
stored routine is invoked. Only THD persists between the calls.
|
||||
*/
|
||||
uint32 binlog_unsafe_warning_flags;
|
||||
|
||||
#ifndef MYSQL_CLIENT
|
||||
binlog_cache_mngr * binlog_setup_trx_data();
|
||||
|
||||
|
@ -2557,20 +2571,6 @@ private:
|
|||
*/
|
||||
enum_binlog_format current_stmt_binlog_format;
|
||||
|
||||
/**
|
||||
Bit field for the state of binlog warnings.
|
||||
|
||||
The first Lex::BINLOG_STMT_UNSAFE_COUNT bits list all types of
|
||||
unsafeness that the current statement has.
|
||||
|
||||
This must be a member of THD and not of LEX, because warnings are
|
||||
detected and issued in different places (@c
|
||||
decide_logging_format() and @c binlog_query(), respectively).
|
||||
Between these calls, the THD->lex object may change; e.g., if a
|
||||
stored routine is invoked. Only THD persists between the calls.
|
||||
*/
|
||||
uint32 binlog_unsafe_warning_flags;
|
||||
|
||||
/*
|
||||
Number of outstanding table maps, i.e., table maps in the
|
||||
transaction cache.
|
||||
|
@ -4558,6 +4558,18 @@ public:
|
|||
}
|
||||
void leave_locked_tables_mode();
|
||||
int decide_logging_format(TABLE_LIST *tables);
|
||||
/*
|
||||
In Some cases when decide_logging_format is called it does not have all
|
||||
information to decide the logging format. So that cases we call decide_logging_format_2
|
||||
at later stages in execution.
|
||||
One example would be binlog format for IODKU but column with unique key is not inserted.
|
||||
We dont have inserted columns info when we call decide_logging_format so on later stage we call
|
||||
decide_logging_format_low
|
||||
|
||||
@returns 0 if no format is changed
|
||||
1 if there is change in binlog format
|
||||
*/
|
||||
int decide_logging_format_low(TABLE *table);
|
||||
|
||||
enum need_invoker { INVOKER_NONE=0, INVOKER_USER, INVOKER_ROLE};
|
||||
void binlog_invoker(bool role) { m_binlog_invoker= role ? INVOKER_ROLE : INVOKER_USER; }
|
||||
|
|
|
@ -1061,6 +1061,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
|
|||
break;
|
||||
}
|
||||
|
||||
thd->decide_logging_format_low(table);
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
if (lock_type == TL_WRITE_DELAYED)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef INCLUDES_MYSQL_SQL_LIST_H
|
||||
#define INCLUDES_MYSQL_SQL_LIST_H
|
||||
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
|
||||
Copyright (c) 2019, 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
|
||||
|
@ -48,6 +49,14 @@ public:
|
|||
next= elements ? tmp.next : &first;
|
||||
}
|
||||
|
||||
SQL_I_List& operator=(const SQL_I_List &tmp)
|
||||
{
|
||||
elements= tmp.elements;
|
||||
first= tmp.first;
|
||||
next= tmp.next;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline void empty()
|
||||
{
|
||||
elements= 0;
|
||||
|
@ -488,7 +497,6 @@ template <class T> class List :public base_list
|
|||
{
|
||||
public:
|
||||
inline List() :base_list() {}
|
||||
inline List(const List<T> &tmp) :base_list(tmp) {}
|
||||
inline List(const List<T> &tmp, MEM_ROOT *mem_root) :
|
||||
base_list(tmp, mem_root) {}
|
||||
inline bool push_back(T *a) { return base_list::push_back(a); }
|
||||
|
|
|
@ -868,7 +868,6 @@ Item* period_get_condition(THD *thd, TABLE_LIST *table, SELECT_LEX *select,
|
|||
cond1= and_items(thd, cond3, cond1);
|
||||
}
|
||||
return cond1;
|
||||
#undef newx
|
||||
}
|
||||
|
||||
static
|
||||
|
@ -917,6 +916,19 @@ Item* SELECT_LEX::period_setup_conds(THD *thd, TABLE_LIST *tables, Item *where)
|
|||
DBUG_RETURN(result);
|
||||
}
|
||||
|
||||
/**
|
||||
Setup System Versioning conditions
|
||||
|
||||
Add WHERE condition according to FOR SYSTEM_TIME clause.
|
||||
|
||||
If the table is partitioned by SYSTEM_TIME and there is no FOR SYSTEM_TIME
|
||||
clause, then select now-partition instead of modifying WHERE condition.
|
||||
|
||||
@retval
|
||||
-1 on error
|
||||
@retval
|
||||
0 on success
|
||||
*/
|
||||
int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
|
||||
{
|
||||
DBUG_ENTER("SELECT_LEX::vers_setup_conds");
|
||||
|
@ -974,12 +986,13 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
|
|||
vers_select_conds_t &vers_conditions= table->vers_conditions;
|
||||
|
||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||
/*
|
||||
if the history is stored in partitions, then partitions
|
||||
themselves are not versioned
|
||||
*/
|
||||
if (table->partition_names && table->table->part_info->vers_info)
|
||||
Vers_part_info *vers_info;
|
||||
if (table->table->part_info && (vers_info= table->table->part_info->vers_info))
|
||||
{
|
||||
if (table->partition_names)
|
||||
{
|
||||
/* If the history is stored in partitions, then partitions
|
||||
themselves are not versioned. */
|
||||
if (vers_conditions.is_set())
|
||||
{
|
||||
my_error(ER_VERS_QUERY_IN_PARTITION, MYF(0), table->alias.str);
|
||||
|
@ -988,6 +1001,19 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
|
|||
else
|
||||
vers_conditions.init(SYSTEM_TIME_ALL);
|
||||
}
|
||||
else if (!vers_conditions.is_set() &&
|
||||
/* We cannot optimize REPLACE .. SELECT because it may need
|
||||
to call vers_set_hist_part() to update history. */
|
||||
thd->lex->sql_command != SQLCOM_REPLACE_SELECT)
|
||||
{
|
||||
table->partition_names= newx List<String>;
|
||||
String *s= newx String(vers_info->now_part->partition_name,
|
||||
system_charset_info);
|
||||
table->partition_names->push_back(s);
|
||||
table->table->file->change_partitions_to_open(table->partition_names);
|
||||
vers_conditions.init(SYSTEM_TIME_ALL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (outer_table && !vers_conditions.is_set())
|
||||
|
@ -1042,6 +1068,7 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables)
|
|||
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
#undef newx
|
||||
|
||||
/*****************************************************************************
|
||||
Check fields, find best join, do the select and output fields.
|
||||
|
|
|
@ -2392,35 +2392,6 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
|
|||
/* remove .frm file and engine files */
|
||||
path_length= build_table_filename(path, sizeof(path) - 1, db.str, alias.str,
|
||||
reg_ext, 0);
|
||||
|
||||
/*
|
||||
This handles the case where a "DROP" was executed and a regular
|
||||
table "may be" dropped as drop_temporary is FALSE and error is
|
||||
TRUE. If the error was FALSE a temporary table was dropped and
|
||||
regardless of the status of drop_temporary a "DROP TEMPORARY"
|
||||
must be used.
|
||||
*/
|
||||
if (!dont_log_query)
|
||||
{
|
||||
/*
|
||||
Note that unless if_exists is TRUE or a temporary table was deleted,
|
||||
there is no means to know if the statement should be written to the
|
||||
binary log. See further information on this variable in what follows.
|
||||
*/
|
||||
non_tmp_table_deleted= (if_exists ? TRUE : non_tmp_table_deleted);
|
||||
/*
|
||||
Don't write the database name if it is the current one (or if
|
||||
thd->db is NULL).
|
||||
*/
|
||||
if (thd->db.str == NULL || cmp(&db, &thd->db) != 0)
|
||||
{
|
||||
append_identifier(thd, &built_query, &db);
|
||||
built_query.append(".");
|
||||
}
|
||||
|
||||
append_identifier(thd, &built_query, &table->table_name);
|
||||
built_query.append(",");
|
||||
}
|
||||
}
|
||||
DEBUG_SYNC(thd, "rm_table_no_locks_before_delete_table");
|
||||
error= 0;
|
||||
|
@ -2500,9 +2471,16 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
|
|||
// Remove extension for delete
|
||||
*(end= path + path_length - reg_ext_length)= '\0';
|
||||
|
||||
error= ha_delete_table(thd, table_type, path, &db, &table->table_name,
|
||||
!dont_log_query);
|
||||
if (!error)
|
||||
if ((error= ha_delete_table(thd, table_type, path, &db, &table->table_name,
|
||||
!dont_log_query)))
|
||||
{
|
||||
if (thd->is_killed())
|
||||
{
|
||||
error= -1;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Delete the table definition file */
|
||||
strmov(end,reg_ext);
|
||||
|
@ -2546,7 +2524,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
|
|||
if (error)
|
||||
{
|
||||
if (wrong_tables.length())
|
||||
wrong_tables.append(',');
|
||||
wrong_tables.append(',');
|
||||
wrong_tables.append(&db);
|
||||
wrong_tables.append('.');
|
||||
wrong_tables.append(&table->table_name);
|
||||
|
@ -2559,6 +2537,22 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
|
|||
mysql_audit_drop_table(thd, table);
|
||||
}
|
||||
|
||||
if (!dont_log_query && !drop_temporary)
|
||||
{
|
||||
non_tmp_table_deleted= (if_exists ? TRUE : non_tmp_table_deleted);
|
||||
/*
|
||||
Don't write the database name if it is the current one (or if
|
||||
thd->db is NULL).
|
||||
*/
|
||||
if (thd->db.str == NULL || cmp(&db, &thd->db) != 0)
|
||||
{
|
||||
append_identifier(thd, &built_query, &db);
|
||||
built_query.append(".");
|
||||
}
|
||||
|
||||
append_identifier(thd, &built_query, &table->table_name);
|
||||
built_query.append(",");
|
||||
}
|
||||
DBUG_PRINT("table", ("table: %p s: %p", table->table,
|
||||
table->table ? table->table->s : NULL));
|
||||
}
|
||||
|
@ -5293,7 +5287,7 @@ bool mysql_create_table(THD *thd, TABLE_LIST *create_table,
|
|||
|
||||
err:
|
||||
/* In RBR we don't need to log CREATE TEMPORARY TABLE */
|
||||
if (thd->is_current_stmt_binlog_format_row() && create_info->tmp_table())
|
||||
if (!result && thd->is_current_stmt_binlog_format_row() && create_info->tmp_table())
|
||||
DBUG_RETURN(result);
|
||||
|
||||
if (create_info->tmp_table())
|
||||
|
@ -7961,9 +7955,11 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
|||
KEY *key_info=table->key_info;
|
||||
bool rc= TRUE;
|
||||
bool modified_primary_key= FALSE;
|
||||
bool vers_system_invisible= false;
|
||||
Create_field *def;
|
||||
Field **f_ptr,*field;
|
||||
MY_BITMAP *dropped_fields= NULL; // if it's NULL - no dropped fields
|
||||
bool save_reopen= table->m_needs_reopen;
|
||||
bool drop_period= false;
|
||||
DBUG_ENTER("mysql_prepare_alter_table");
|
||||
|
||||
|
@ -8070,7 +8066,11 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
|||
bitmap_set_bit(dropped_fields, field->field_index);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (field->invisible == INVISIBLE_SYSTEM &&
|
||||
field->flags & VERS_SYSTEM_FIELD)
|
||||
{
|
||||
vers_system_invisible= true;
|
||||
}
|
||||
/* invisible versioning column is dropped automatically on DROP SYSTEM VERSIONING */
|
||||
if (!drop && field->invisible >= INVISIBLE_SYSTEM &&
|
||||
field->flags & VERS_SYSTEM_FIELD &&
|
||||
|
@ -8188,7 +8188,8 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
|||
dropped_sys_vers_fields &= VERS_SYSTEM_FIELD;
|
||||
if ((dropped_sys_vers_fields ||
|
||||
alter_info->flags & ALTER_DROP_PERIOD) &&
|
||||
dropped_sys_vers_fields != VERS_SYSTEM_FIELD)
|
||||
dropped_sys_vers_fields != VERS_SYSTEM_FIELD &&
|
||||
!vers_system_invisible)
|
||||
{
|
||||
StringBuffer<NAME_LEN*3> tmp;
|
||||
append_drop_column(thd, dropped_sys_vers_fields & VERS_SYS_START_FLAG,
|
||||
|
@ -8198,6 +8199,11 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
|||
my_error(ER_MISSING, MYF(0), table->s->table_name.str, tmp.c_ptr());
|
||||
goto err;
|
||||
}
|
||||
else if (alter_info->flags & ALTER_DROP_PERIOD && vers_system_invisible)
|
||||
{
|
||||
my_error(ER_CANT_DROP_FIELD_OR_KEY, MYF(0), "PERIOD FOR SYSTEM_TIME on", table->s->table_name.str);
|
||||
goto err;
|
||||
}
|
||||
alter_info->flags &= ~(ALTER_DROP_PERIOD | ALTER_ADD_PERIOD);
|
||||
def_it.rewind();
|
||||
while ((def=def_it++)) // Add new columns
|
||||
|
@ -8701,7 +8707,9 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
|||
alter_info->create_list.swap(new_create_list);
|
||||
alter_info->key_list.swap(new_key_list);
|
||||
alter_info->check_constraint_list.swap(new_constraint_list);
|
||||
DBUG_RETURN(rc);
|
||||
err:
|
||||
table->m_needs_reopen= save_reopen;
|
||||
DBUG_RETURN(rc);
|
||||
}
|
||||
|
||||
|
@ -10412,6 +10420,7 @@ end_temporary:
|
|||
(ulong) (copied + deleted), (ulong) deleted,
|
||||
(ulong) thd->get_stmt_da()->current_statement_warn_count());
|
||||
my_ok(thd, copied + deleted, 0L, alter_ctx.tmp_buff);
|
||||
DEBUG_SYNC(thd, "alter_table_inplace_trans_commit");
|
||||
DBUG_RETURN(false);
|
||||
|
||||
err_new_table_cleanup:
|
||||
|
@ -10462,7 +10471,8 @@ err_with_mdl:
|
|||
tables and release the exclusive metadata lock.
|
||||
*/
|
||||
thd->locked_tables_list.unlink_all_closed_tables(thd, NULL, 0);
|
||||
thd->mdl_context.release_all_locks_for_name(mdl_ticket);
|
||||
if (!table_list->table)
|
||||
thd->mdl_context.release_all_locks_for_name(mdl_ticket);
|
||||
DBUG_RETURN(true);
|
||||
}
|
||||
|
||||
|
@ -10495,12 +10505,14 @@ bool mysql_trans_commit_alter_copy_data(THD *thd)
|
|||
uint save_unsafe_rollback_flags;
|
||||
DBUG_ENTER("mysql_trans_commit_alter_copy_data");
|
||||
|
||||
/* Save flags as transcommit_implicit_are_deleting_them */
|
||||
/* Save flags as trans_commit_implicit are deleting them */
|
||||
save_unsafe_rollback_flags= thd->transaction.stmt.m_unsafe_rollback_flags;
|
||||
|
||||
DEBUG_SYNC(thd, "alter_table_copy_trans_commit");
|
||||
|
||||
if (ha_enable_transaction(thd, TRUE))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
|
||||
/*
|
||||
Ensure that the new table is saved properly to disk before installing
|
||||
the new .frm.
|
||||
|
|
|
@ -7274,6 +7274,11 @@ serial_attribute:
|
|||
{
|
||||
Lex->last_field->versioning= $1;
|
||||
Lex->create_info.options|= HA_VERSIONED_TABLE;
|
||||
if (Lex->alter_info.flags & ALTER_DROP_SYSTEM_VERSIONING)
|
||||
{
|
||||
my_yyabort_error((ER_VERS_NOT_VERSIONED, MYF(0),
|
||||
Lex->create_last_non_select_table->table_name.str));
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
|
@ -8485,6 +8490,7 @@ alter_list_item:
|
|||
| DROP SYSTEM VERSIONING_SYM
|
||||
{
|
||||
Lex->alter_info.flags|= ALTER_DROP_SYSTEM_VERSIONING;
|
||||
Lex->create_info.options&= ~HA_VERSIONED_TABLE;
|
||||
}
|
||||
| DROP PERIOD_SYM FOR_SYSTEM_TIME_SYM
|
||||
{
|
||||
|
|
|
@ -7352,6 +7352,11 @@ serial_attribute:
|
|||
{
|
||||
Lex->last_field->versioning= $1;
|
||||
Lex->create_info.options|= HA_VERSIONED_TABLE;
|
||||
if (Lex->alter_info.flags & ALTER_DROP_SYSTEM_VERSIONING)
|
||||
{
|
||||
my_yyabort_error((ER_VERS_NOT_VERSIONED, MYF(0),
|
||||
Lex->create_last_non_select_table->table_name.str));
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
|
@ -8576,6 +8581,7 @@ alter_list_item:
|
|||
| DROP SYSTEM VERSIONING_SYM
|
||||
{
|
||||
Lex->alter_info.flags|= ALTER_DROP_SYSTEM_VERSIONING;
|
||||
Lex->create_info.options&= ~HA_VERSIONED_TABLE;
|
||||
}
|
||||
| DROP PERIOD_SYM FOR_SYSTEM_TIME_SYM
|
||||
{
|
||||
|
|
|
@ -147,6 +147,7 @@ typedef struct st_time_zone_info
|
|||
|
||||
static my_bool prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage);
|
||||
|
||||
my_bool opt_leap, opt_verbose, opt_skip_write_binlog;
|
||||
|
||||
#if defined(TZINFO2SQL) || defined(TESTTIME)
|
||||
|
||||
|
@ -2428,6 +2429,14 @@ print_tz_leaps_as_sql(const TIME_ZONE_INFO *sp)
|
|||
We are assuming that there are only one list of leap seconds
|
||||
For all timezones.
|
||||
*/
|
||||
if (!opt_skip_write_binlog)
|
||||
printf("\\d |\n"
|
||||
"IF (select count(*) from information_schema.global_variables where\n"
|
||||
"variable_name='wsrep_on') = 1 THEN\n"
|
||||
"ALTER TABLE time_zone_leap_second ENGINE=InnoDB;\n"
|
||||
"END IF|\n"
|
||||
"\\d ;\n");
|
||||
|
||||
printf("TRUNCATE TABLE time_zone_leap_second;\n");
|
||||
|
||||
if (sp->leapcnt)
|
||||
|
@ -2440,6 +2449,14 @@ print_tz_leaps_as_sql(const TIME_ZONE_INFO *sp)
|
|||
printf(";\n");
|
||||
}
|
||||
|
||||
if (!opt_skip_write_binlog)
|
||||
printf("\\d |\n"
|
||||
"IF (select count(*) from information_schema.global_variables where\n"
|
||||
"variable_name='wsrep_on') = 1 THEN\n"
|
||||
"ALTER TABLE time_zone_leap_second ENGINE=Aria;\n"
|
||||
"END IF|\n"
|
||||
"\\d ;\n");
|
||||
|
||||
printf("ALTER TABLE time_zone_leap_second ORDER BY Transition_time;\n");
|
||||
}
|
||||
|
||||
|
@ -2597,8 +2614,6 @@ scan_tz_dir(char * name_end, uint symlink_recursion_level, uint verbose)
|
|||
}
|
||||
|
||||
|
||||
my_bool opt_leap, opt_verbose;
|
||||
|
||||
static const char *load_default_groups[]=
|
||||
{ "mysql_tzinfo_to_sql", 0};
|
||||
|
||||
|
@ -2619,6 +2634,8 @@ static struct my_option my_long_options[] =
|
|||
&opt_verbose, &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"version", 'V', "Output version information and exit.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"skip-write-binlog", 'S', "Do not replicate changes to time zone tables to other nodes in a Galera cluster",
|
||||
&opt_skip_write_binlog,&opt_skip_write_binlog, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
@ -2687,11 +2704,14 @@ main(int argc, char **argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// Replicate MyISAM DDL for this session, cf. lp:1161432
|
||||
// timezone info unfixable in XtraDB Cluster
|
||||
printf("set @prep=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET GLOBAL wsrep_replicate_myisam=?', 'do ?');\n"
|
||||
"prepare set_wsrep_myisam from @prep;\n"
|
||||
"set @toggle=1; execute set_wsrep_myisam using @toggle;\n");
|
||||
if (opt_skip_write_binlog)
|
||||
/* If skip_write_binlog is set and wsrep is compiled in we disable
|
||||
sql_log_bin and wsrep_on to avoid Galera replicating below
|
||||
truncate table clauses. This will allow user to set different
|
||||
time zones to nodes in Galera cluster. */
|
||||
printf("set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');\n"
|
||||
"prepare set_wsrep_write_binlog from @prep1;\n"
|
||||
"set @toggle=0; execute set_wsrep_write_binlog using @toggle;\n");
|
||||
|
||||
if (argc == 1 && !opt_leap)
|
||||
{
|
||||
|
@ -2699,6 +2719,21 @@ main(int argc, char **argv)
|
|||
|
||||
root_name_end= strmake_buf(fullname, argv[0]);
|
||||
|
||||
if(!opt_skip_write_binlog)
|
||||
{
|
||||
// Alter time zone tables to InnoDB if wsrep_on is enabled
|
||||
// to allow changes to them to replicate with Galera
|
||||
printf("\\d |\n"
|
||||
"IF (select count(*) from information_schema.global_variables where\n"
|
||||
"variable_name='wsrep_on') = 1 THEN\n"
|
||||
"ALTER TABLE time_zone ENGINE=InnoDB;\n"
|
||||
"ALTER TABLE time_zone_name ENGINE=InnoDB;\n"
|
||||
"ALTER TABLE time_zone_transition ENGINE=InnoDB;\n"
|
||||
"ALTER TABLE time_zone_transition_type ENGINE=InnoDB;\n"
|
||||
"END IF|\n"
|
||||
"\\d ;\n");
|
||||
}
|
||||
|
||||
printf("TRUNCATE TABLE time_zone;\n");
|
||||
printf("TRUNCATE TABLE time_zone_name;\n");
|
||||
printf("TRUNCATE TABLE time_zone_transition;\n");
|
||||
|
@ -2740,8 +2775,19 @@ main(int argc, char **argv)
|
|||
free_root(&tz_storage, MYF(0));
|
||||
}
|
||||
|
||||
// Reset wsrep_replicate_myisam. lp:1161432
|
||||
printf("set @toggle=0; execute set_wsrep_myisam using @toggle;\n");
|
||||
if(!opt_skip_write_binlog)
|
||||
{
|
||||
// Fall back to Aria
|
||||
printf("\\d |\n"
|
||||
"IF (select count(*) from information_schema.global_variables where\n"
|
||||
"variable_name='wsrep_on') = 1 THEN\n"
|
||||
"ALTER TABLE time_zone ENGINE=Aria;\n"
|
||||
"ALTER TABLE time_zone_name ENGINE=Aria;\n"
|
||||
"ALTER TABLE time_zone_transition ENGINE=Aria;\n"
|
||||
"ALTER TABLE time_zone_transition_type ENGINE=Aria;\n"
|
||||
"END IF|\n"
|
||||
"\\d ;\n");
|
||||
}
|
||||
|
||||
free_defaults(default_argv);
|
||||
my_end(0);
|
||||
|
|
|
@ -212,7 +212,19 @@ static PSI_file_info wsrep_files[]=
|
|||
{
|
||||
{ &key_file_wsrep_gra_log, "wsrep_gra_log", 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
PSI_thread_key key_wsrep_sst_joiner, key_wsrep_sst_donor,
|
||||
key_wsrep_rollbacker, key_wsrep_applier;
|
||||
|
||||
static PSI_thread_info wsrep_threads[]=
|
||||
{
|
||||
{&key_wsrep_sst_joiner, "wsrep_sst_joiner_thread", PSI_FLAG_GLOBAL},
|
||||
{&key_wsrep_sst_donor, "wsrep_sst_donor_thread", PSI_FLAG_GLOBAL},
|
||||
{&key_wsrep_rollbacker, "wsrep_rollbacker_thread", PSI_FLAG_GLOBAL},
|
||||
{&key_wsrep_applier, "wsrep_applier_thread", PSI_FLAG_GLOBAL}
|
||||
};
|
||||
|
||||
#endif /* HAVE_PSI_INTERFACE */
|
||||
|
||||
my_bool wsrep_inited= 0; // initialized ?
|
||||
|
||||
|
@ -759,6 +771,7 @@ void wsrep_thr_init()
|
|||
mysql_mutex_register("sql", wsrep_mutexes, array_elements(wsrep_mutexes));
|
||||
mysql_cond_register("sql", wsrep_conds, array_elements(wsrep_conds));
|
||||
mysql_file_register("sql", wsrep_files, array_elements(wsrep_files));
|
||||
mysql_thread_register("sql", wsrep_threads, array_elements(wsrep_threads));
|
||||
#endif
|
||||
|
||||
mysql_mutex_init(key_LOCK_wsrep_ready, &LOCK_wsrep_ready, MY_MUTEX_INIT_FAST);
|
||||
|
|
|
@ -341,7 +341,14 @@ extern PSI_mutex_key key_LOCK_wsrep_thd_queue;
|
|||
extern PSI_cond_key key_COND_wsrep_thd_queue;
|
||||
|
||||
extern PSI_file_key key_file_wsrep_gra_log;
|
||||
|
||||
extern PSI_thread_key key_wsrep_sst_joiner;
|
||||
extern PSI_thread_key key_wsrep_sst_donor;
|
||||
extern PSI_thread_key key_wsrep_rollbacker;
|
||||
extern PSI_thread_key key_wsrep_applier;
|
||||
#endif /* HAVE_PSI_INTERFACE */
|
||||
|
||||
|
||||
struct TABLE_LIST;
|
||||
class Alter_info;
|
||||
int wsrep_to_isolation_begin(THD *thd, const char *db_, const char *table_,
|
||||
|
|
|
@ -663,10 +663,10 @@ static ssize_t sst_prepare_other (const char* method,
|
|||
pthread_t tmp;
|
||||
sst_thread_arg arg(cmd_str(), env());
|
||||
mysql_mutex_lock (&arg.lock);
|
||||
ret= pthread_create (&tmp, NULL, sst_joiner_thread, &arg);
|
||||
ret = mysql_thread_create (key_wsrep_sst_joiner, &tmp, NULL, sst_joiner_thread, &arg);
|
||||
if (ret)
|
||||
{
|
||||
WSREP_ERROR("sst_prepare_other(): pthread_create() failed: %d (%s)",
|
||||
WSREP_ERROR("sst_prepare_other(): mysql_thread_create() failed: %d (%s)",
|
||||
ret, strerror(ret));
|
||||
return -ret;
|
||||
}
|
||||
|
@ -1350,10 +1350,10 @@ static int sst_donate_other (const char* method,
|
|||
pthread_t tmp;
|
||||
sst_thread_arg arg(cmd_str(), env);
|
||||
mysql_mutex_lock (&arg.lock);
|
||||
ret= pthread_create (&tmp, NULL, sst_donor_thread, &arg);
|
||||
ret = mysql_thread_create (key_wsrep_sst_donor, &tmp, NULL, sst_donor_thread, &arg);
|
||||
if (ret)
|
||||
{
|
||||
WSREP_ERROR("sst_donate_other(): pthread_create() failed: %d (%s)",
|
||||
WSREP_ERROR("sst_donate_other(): mysql_thread_create() failed: %d (%s)",
|
||||
ret, strerror(ret));
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -87,9 +87,24 @@ static bool create_wsrep_THD(Wsrep_thd_args* args)
|
|||
{
|
||||
ulong old_wsrep_running_threads= wsrep_running_threads;
|
||||
pthread_t unused;
|
||||
#ifdef HAVE_PSI_THREAD_INTERFACE
|
||||
PSI_thread_key key;
|
||||
|
||||
bool res= pthread_create(&unused, &connection_attrib, start_wsrep_THD,
|
||||
args);
|
||||
switch (args->thread_type())
|
||||
{
|
||||
case WSREP_APPLIER_THREAD:
|
||||
key= key_wsrep_applier;
|
||||
break;
|
||||
case WSREP_ROLLBACKER_THREAD:
|
||||
key= key_wsrep_rollbacker;
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
bool res= mysql_thread_create(key, &unused, &connection_attrib,
|
||||
start_wsrep_THD, (void*)args);
|
||||
/*
|
||||
if starting a thread on server startup, wait until the this thread's THD
|
||||
is fully initialized (otherwise a THD initialization code might
|
||||
|
|
|
@ -879,7 +879,7 @@ MYSQL_FIELD *MYSQLC::GetNextField(void)
|
|||
PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb)
|
||||
{
|
||||
PCSZ fmt;
|
||||
char *name, v;
|
||||
char *name, v= 0;
|
||||
int n;
|
||||
bool uns;
|
||||
PCOLRES *pcrp, crp;
|
||||
|
|
|
@ -1671,9 +1671,9 @@ innobase_srv_conc_enter_innodb(
|
|||
&& thd_is_replication_slave_thread(trx->mysql_thd)) {
|
||||
const ulonglong end = my_interval_timer()
|
||||
+ ulonglong(srv_replication_delay) * 1000000;
|
||||
while (srv_conc_get_active_threads()
|
||||
>= srv_thread_concurrency
|
||||
|| my_interval_timer() >= end) {
|
||||
while ((srv_conc_get_active_threads()
|
||||
>= srv_thread_concurrency)
|
||||
&& my_interval_timer() < end) {
|
||||
os_thread_sleep(2000 /* 2 ms */);
|
||||
}
|
||||
} else {
|
||||
|
@ -3786,14 +3786,12 @@ static int innodb_init_params()
|
|||
DBUG_RETURN(HA_ERR_INITIALIZATION);
|
||||
}
|
||||
|
||||
if (srv_n_log_files * srv_log_file_size
|
||||
>= 512ULL * 1024ULL * 1024ULL * 1024ULL) {
|
||||
/* log_block_convert_lsn_to_no() limits the returned block
|
||||
number to 1G and given that OS_FILE_LOG_BLOCK_SIZE is 512
|
||||
bytes, then we have a limit of 512 GB. If that limit is to
|
||||
be raised, then log_block_convert_lsn_to_no() must be
|
||||
modified. */
|
||||
ib::error() << "Combined size of log files must be < 512 GB";
|
||||
if (srv_n_log_files * srv_log_file_size >= log_group_max_size) {
|
||||
/* Log group size is limited by the size of page number.
|
||||
Remove this limitation when fil_io() is not used for
|
||||
recovery log io. */
|
||||
ib::error() << "Combined size of log files must be < "
|
||||
<< log_group_max_size;
|
||||
DBUG_RETURN(HA_ERR_INITIALIZATION);
|
||||
}
|
||||
|
||||
|
@ -19077,7 +19075,7 @@ static MYSQL_SYSVAR_ULONG(log_buffer_size, srv_log_buffer_size,
|
|||
static MYSQL_SYSVAR_ULONGLONG(log_file_size, srv_log_file_size,
|
||||
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
|
||||
"Size of each log file in a log group.",
|
||||
NULL, NULL, 48 << 20, 1 << 20, 512ULL << 30, UNIV_PAGE_SIZE_MAX);
|
||||
NULL, NULL, 48 << 20, 1 << 20, log_group_max_size, UNIV_PAGE_SIZE_MAX);
|
||||
/* OS_FILE_LOG_BLOCK_SIZE would be more appropriate than UNIV_PAGE_SIZE_MAX,
|
||||
but fil_space_t is being used for the redo log, and it uses data pages. */
|
||||
|
||||
|
|
|
@ -56,6 +56,9 @@ Smart ALTER TABLE
|
|||
#include "row0sel.h"
|
||||
#include "ha_innodb.h"
|
||||
#include "ut0stage.h"
|
||||
#include "span.h"
|
||||
|
||||
using st_::span;
|
||||
|
||||
static const char *MSG_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN=
|
||||
"INPLACE ADD or DROP of virtual columns cannot be "
|
||||
|
@ -2682,20 +2685,22 @@ innobase_set_foreign_key_option(
|
|||
/*******************************************************************//**
|
||||
Check if a foreign key constraint can make use of an index
|
||||
that is being created.
|
||||
@param[in] col_names column names
|
||||
@param[in] n_cols number of columns
|
||||
@param[in] keys index information
|
||||
@param[in] add indexes being created
|
||||
@return useable index, or NULL if none found */
|
||||
static MY_ATTRIBUTE((nonnull, warn_unused_result))
|
||||
const KEY*
|
||||
innobase_find_equiv_index(
|
||||
/*======================*/
|
||||
const char*const* col_names,
|
||||
/*!< in: column names */
|
||||
uint n_cols, /*!< in: number of columns */
|
||||
const KEY* keys, /*!< in: index information */
|
||||
const uint* add, /*!< in: indexes being created */
|
||||
uint n_add) /*!< in: number of indexes to create */
|
||||
uint n_cols,
|
||||
const KEY* keys,
|
||||
span<uint> add)
|
||||
{
|
||||
for (uint i = 0; i < n_add; i++) {
|
||||
const KEY* key = &keys[add[i]];
|
||||
for (span<uint>::iterator it = add.begin(), end = add.end(); it != end;
|
||||
++it) {
|
||||
const KEY* key = &keys[*it];
|
||||
|
||||
if (key->user_defined_key_parts < n_cols
|
||||
|| key->flags & HA_SPATIAL) {
|
||||
|
@ -2746,7 +2751,7 @@ no_match:
|
|||
Find an index whose first fields are the columns in the array
|
||||
in the same order and is not marked for deletion
|
||||
@return matching index, NULL if not found */
|
||||
static MY_ATTRIBUTE((nonnull(1,5), warn_unused_result))
|
||||
static MY_ATTRIBUTE((nonnull(1,4), warn_unused_result))
|
||||
dict_index_t*
|
||||
innobase_find_fk_index(
|
||||
/*===================*/
|
||||
|
@ -2754,10 +2759,8 @@ innobase_find_fk_index(
|
|||
const char** col_names,
|
||||
/*!< in: column names, or NULL
|
||||
to use table->col_names */
|
||||
dict_index_t** drop_index,
|
||||
span<dict_index_t*> drop_index,
|
||||
/*!< in: indexes to be dropped */
|
||||
ulint n_drop_index,
|
||||
/*!< in: size of drop_index[] */
|
||||
const char** columns,/*!< in: array of column names */
|
||||
ulint n_cols) /*!< in: number of columns */
|
||||
{
|
||||
|
@ -2766,21 +2769,14 @@ innobase_find_fk_index(
|
|||
index = dict_table_get_first_index(table);
|
||||
|
||||
while (index != NULL) {
|
||||
if (dict_foreign_qualify_index(
|
||||
table, col_names, columns, n_cols,
|
||||
index, NULL, true, 0,
|
||||
NULL, NULL, NULL)) {
|
||||
for (ulint i = 0; i < n_drop_index; i++) {
|
||||
if (index == drop_index[i]) {
|
||||
/* Skip to-be-dropped indexes. */
|
||||
goto next_rec;
|
||||
}
|
||||
}
|
||||
|
||||
return(index);
|
||||
if (dict_foreign_qualify_index(table, col_names, columns,
|
||||
n_cols, index, NULL, true, 0,
|
||||
NULL, NULL, NULL)
|
||||
&& std::find(drop_index.begin(), drop_index.end(), index)
|
||||
== drop_index.end()) {
|
||||
return index;
|
||||
}
|
||||
|
||||
next_rec:
|
||||
index = dict_table_get_next_index(index);
|
||||
}
|
||||
|
||||
|
@ -2926,7 +2922,7 @@ innobase_get_foreign_key_info(
|
|||
|
||||
index = innobase_find_fk_index(
|
||||
table, col_names,
|
||||
drop_index, n_drop_index,
|
||||
span<dict_index_t*>(drop_index, n_drop_index),
|
||||
column_names, i);
|
||||
|
||||
/* MySQL would add a index in the creation
|
||||
|
@ -2941,8 +2937,8 @@ innobase_get_foreign_key_info(
|
|||
if (!index && !innobase_find_equiv_index(
|
||||
column_names, static_cast<uint>(i),
|
||||
ha_alter_info->key_info_buffer,
|
||||
ha_alter_info->index_add_buffer,
|
||||
ha_alter_info->index_add_count)) {
|
||||
span<uint>(ha_alter_info->index_add_buffer,
|
||||
ha_alter_info->index_add_count))) {
|
||||
my_error(
|
||||
ER_FK_NO_INDEX_CHILD,
|
||||
MYF(0),
|
||||
|
@ -7184,8 +7180,8 @@ innobase_check_foreign_key_index(
|
|||
foreign->referenced_col_names,
|
||||
foreign->n_fields,
|
||||
ha_alter_info->key_info_buffer,
|
||||
ha_alter_info->index_add_buffer,
|
||||
ha_alter_info->index_add_count)) {
|
||||
span<uint>(ha_alter_info->index_add_buffer,
|
||||
ha_alter_info->index_add_count))) {
|
||||
|
||||
/* Index cannot be dropped. */
|
||||
trx->error_info = index;
|
||||
|
@ -7219,8 +7215,8 @@ innobase_check_foreign_key_index(
|
|||
foreign->foreign_col_names,
|
||||
foreign->n_fields,
|
||||
ha_alter_info->key_info_buffer,
|
||||
ha_alter_info->index_add_buffer,
|
||||
ha_alter_info->index_add_count)) {
|
||||
span<uint>(ha_alter_info->index_add_buffer,
|
||||
ha_alter_info->index_add_count))) {
|
||||
|
||||
/* Index cannot be dropped. */
|
||||
trx->error_info = index;
|
||||
|
|
|
@ -119,9 +119,6 @@ thd_is_replication_slave_thread(
|
|||
/*============================*/
|
||||
THD* thd); /*!< in: thread handle */
|
||||
|
||||
/** @return whether statement-based replication is active */
|
||||
extern "C" int thd_rpl_stmt_based(const THD* thd);
|
||||
|
||||
/******************************************************************//**
|
||||
Returns true if the transaction this thread is processing has edited
|
||||
non-transactional tables. Used by the deadlock detector when deciding
|
||||
|
|
|
@ -40,6 +40,10 @@ Created 12/9/1995 Heikki Tuuri
|
|||
#include "os0event.h"
|
||||
#include "os0file.h"
|
||||
|
||||
#ifndef UINT32_MAX
|
||||
#define UINT32_MAX (4294967295U)
|
||||
#endif
|
||||
|
||||
/** Maximum number of srv_n_log_files, or innodb_log_files_in_group */
|
||||
#define SRV_N_LOG_FILES_MAX 100
|
||||
|
||||
|
@ -464,6 +468,12 @@ MariaDB 10.2.18 and later will use the 10.3 format, but LOG_HEADER_SUBFORMAT
|
|||
header */
|
||||
#define LOG_FILE_HDR_SIZE (4 * OS_FILE_LOG_BLOCK_SIZE)
|
||||
|
||||
/* As long as fil_io() is used to handle log io, log group max size is limited
|
||||
by (maximum page number) * (minimum page size). Page number type is uint32_t.
|
||||
Remove this limitation if page number is no longer used for log file io. */
|
||||
static const ulonglong log_group_max_size =
|
||||
((ulonglong(UINT32_MAX) + 1) * UNIV_PAGE_SIZE_MIN - 1);
|
||||
|
||||
typedef ib_mutex_t LogSysMutex;
|
||||
typedef ib_mutex_t FlushOrderMutex;
|
||||
|
||||
|
|
|
@ -185,7 +185,9 @@ log_block_convert_lsn_to_no(
|
|||
/*========================*/
|
||||
lsn_t lsn) /*!< in: lsn of a byte within the block */
|
||||
{
|
||||
return(((ulint) (lsn / OS_FILE_LOG_BLOCK_SIZE) & 0x3FFFFFFFUL) + 1);
|
||||
return(((ulint) (lsn / OS_FILE_LOG_BLOCK_SIZE) &
|
||||
DBUG_EVALUATE_IF("innodb_small_log_block_no_limit",
|
||||
0xFUL, 0x3FFFFFFFUL)) + 1);
|
||||
}
|
||||
|
||||
/** Calculate the checksum for a log block using the pre-5.7.9 algorithm.
|
||||
|
|
|
@ -198,10 +198,6 @@ struct ins_node_t{
|
|||
entry_list and sys fields are stored here;
|
||||
if this is NULL, entry list should be created
|
||||
and buffers for sys fields in row allocated */
|
||||
dict_index_t* duplicate;
|
||||
/* This is the first index that reported
|
||||
DB_DUPLICATE_KEY. Used in the case of REPLACE
|
||||
or INSERT ... ON DUPLICATE UPDATE. */
|
||||
ulint magic_n;
|
||||
};
|
||||
|
||||
|
|
145
storage/innobase/include/span.h
Normal file
145
storage/innobase/include/span.h
Normal file
|
@ -0,0 +1,145 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 2019, 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
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <iterator>
|
||||
|
||||
namespace st_ {
|
||||
|
||||
template <class ElementType> class span {
|
||||
public:
|
||||
typedef ElementType element_type;
|
||||
typedef ElementType value_type;
|
||||
typedef size_t index_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef element_type* pointer;
|
||||
typedef const element_type* const_pointer;
|
||||
typedef element_type& reference;
|
||||
typedef const element_type& const_reference;
|
||||
typedef pointer iterator;
|
||||
typedef const pointer const_iterator;
|
||||
typedef std::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
span() : data_(NULL), size_(0) {}
|
||||
|
||||
span(pointer ptr, index_type count) : data_(ptr), size_(count) {}
|
||||
|
||||
span(pointer first, pointer last) : data_(first), size_(last - first) {}
|
||||
|
||||
template <size_t N> span(element_type (&arr)[N]) : data_(arr), size_(N)
|
||||
{
|
||||
}
|
||||
|
||||
template <class Container>
|
||||
span(Container& cont) : data_(cont.begin()), size_(cont.size())
|
||||
{
|
||||
}
|
||||
|
||||
template <class Container>
|
||||
span(const Container& cont) : data_(cont.begin()), size_(cont.size())
|
||||
{
|
||||
}
|
||||
|
||||
span(const span& other) : data_(other.data_), size_(other.size_) {}
|
||||
|
||||
~span(){};
|
||||
|
||||
span& operator=(const span& other)
|
||||
{
|
||||
data_ = other.data_;
|
||||
size_ = other.size_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <size_t Count> span<element_type> first() const
|
||||
{
|
||||
assert(!empty());
|
||||
return span(data_, 1);
|
||||
}
|
||||
template <size_t Count> span<element_type> last() const
|
||||
{
|
||||
assert(!empty());
|
||||
return span(data_ + size() - 1, 1);
|
||||
}
|
||||
|
||||
span<element_type> first(index_type count) const
|
||||
{
|
||||
assert(!empty());
|
||||
return span(data_, 1);
|
||||
}
|
||||
span<element_type> last(index_type count) const
|
||||
{
|
||||
assert(!empty());
|
||||
return span(data_ + size() - 1, 1);
|
||||
}
|
||||
span<element_type> subspan(index_type offset, index_type count) const
|
||||
{
|
||||
assert(!empty());
|
||||
assert(size() >= offset + count);
|
||||
return span(data_ + offset, count);
|
||||
}
|
||||
|
||||
index_type size() const { return size_; }
|
||||
index_type size_bytes() const { return size_ * sizeof(ElementType); }
|
||||
bool empty() const __attribute__((warn_unused_result))
|
||||
{
|
||||
return size_ == 0;
|
||||
}
|
||||
|
||||
reference operator[](index_type idx) const
|
||||
{
|
||||
assert(size() > idx);
|
||||
return data_[idx];
|
||||
}
|
||||
reference front() const
|
||||
{
|
||||
assert(!empty());
|
||||
return data_[0];
|
||||
}
|
||||
reference back() const
|
||||
{
|
||||
assert(!empty());
|
||||
return data_[size() - 1];
|
||||
}
|
||||
pointer data() const
|
||||
{
|
||||
assert(!empty());
|
||||
return data_;
|
||||
}
|
||||
|
||||
iterator begin() const { return data_; }
|
||||
iterator end() const { return data_ + size_; }
|
||||
reverse_iterator rbegin() const
|
||||
{
|
||||
return std::reverse_iterator<iterator>(std::advance(end(), -1));
|
||||
}
|
||||
reverse_iterator rend() const
|
||||
{
|
||||
return std::reverse_iterator<iterator>(
|
||||
std::advance(begin(), -1));
|
||||
}
|
||||
|
||||
private:
|
||||
pointer data_;
|
||||
index_type size_;
|
||||
};
|
||||
|
||||
} // namespace st_
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue