1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2020-08-20 12:52:44 +03:00
46 changed files with 519 additions and 224 deletions

View File

@@ -9088,10 +9088,6 @@ static void init_signal_handling(void)
struct sigaction sa; struct sigaction sa;
DBUG_ENTER("init_signal_handling"); DBUG_ENTER("init_signal_handling");
#ifdef HAVE_STACKTRACE
my_init_stacktrace(0);
#endif
sa.sa_flags = SA_RESETHAND | SA_NODEFER; sa.sa_flags = SA_RESETHAND | SA_NODEFER;
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sigprocmask(SIG_SETMASK, &sa.sa_mask, NULL); sigprocmask(SIG_SETMASK, &sa.sa_mask, NULL);

View File

@@ -1,5 +1,6 @@
/* /*
Copyright (c) 2001, 2011, Oracle and/or its affiliates. Copyright (c) 2001, 2011, Oracle and/or its affiliates.
Copyright (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@@ -41,7 +42,7 @@
C_MODE_START C_MODE_START
#if defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE) #if defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE)
void my_init_stacktrace(int setup_handlers); void my_setup_stacktrace(void);
void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack, void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack,
my_bool silent); my_bool silent);
int my_safe_print_str(const char* val, size_t max_len); int my_safe_print_str(const char* val, size_t max_len);
@@ -53,7 +54,7 @@ char *my_demangle(const char *mangled_name, int *status);
void my_set_exception_pointers(EXCEPTION_POINTERS *ep); void my_set_exception_pointers(EXCEPTION_POINTERS *ep);
#endif /* __WIN__ */ #endif /* __WIN__ */
#else #else
#define my_init_stacktrace(A) do { } while(0) #define my_setup_stacktrace()
#endif /* ! (defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE)) */ #endif /* ! (defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE)) */
#ifndef _WIN32 #ifndef _WIN32

View File

@@ -15,6 +15,7 @@ TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition;
TRUNCATE TABLE time_zone_transition_type; TRUNCATE TABLE time_zone_transition_type;
START TRANSACTION;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID(); 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_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
@@ -32,6 +33,7 @@ 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. 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: 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. Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion.
COMMIT;
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; 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; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
\d | \d |
@@ -57,6 +59,7 @@ TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition;
TRUNCATE TABLE time_zone_transition_type; TRUNCATE TABLE time_zone_transition_type;
START TRANSACTION;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID(); 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_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
@@ -71,6 +74,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
(@time_zone_id, 0, 0, 0, 'GMT') (@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/garbage' as time zone. Skipping it.
COMMIT;
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; 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; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
\d | \d |
@@ -160,6 +164,8 @@ TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition;
TRUNCATE TABLE time_zone_transition_type; TRUNCATE TABLE time_zone_transition_type;
START TRANSACTION;
COMMIT;
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; 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; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
\d | \d |

View File

@@ -5,6 +5,9 @@ SET wsrep_on=OFF;
DROP SCHEMA test; DROP SCHEMA test;
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_3; connection node_3;
connection node_1;
connection node_2;
connection node_3;
SET wsrep_on=OFF; SET wsrep_on=OFF;
CREATE TABLE test.t1 (f1 INTEGER); CREATE TABLE test.t1 (f1 INTEGER);
connection node_1; connection node_1;

View File

@@ -1,40 +1,81 @@
connection node_2;
connection node_1;
connection node_1;
CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb; CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb;
INSERT INTO t1 VALUES (1, 1); INSERT INTO t1 VALUES (1, 1);
connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
connection node_2;
connection node_3;
INSERT INTO t1 VALUES (2, 3); INSERT INTO t1 VALUES (2, 3);
connection node_2;
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
SET wsrep_sync_wait = 0; SET wsrep_sync_wait = 0;
SET wsrep_on = OFF; SET wsrep_on = OFF;
SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining'; SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining';
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
connection node_2;
INSERT INTO t1 VALUES (3, 2); INSERT INTO t1 VALUES (3, 2);
connection node_1a;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
connection node_3;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
connection node_2;
connection node_3;
INSERT INTO t1 VALUES (4, 3); INSERT INTO t1 VALUES (4, 3);
connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
connection node_2;
INSERT INTO t1 VALUES (5, 2); INSERT INTO t1 VALUES (5, 2);
connection node_3;
connection node_1a;
SET GLOBAL wsrep_provider_options = 'dbug=d,before_send_state_request'; SET GLOBAL wsrep_provider_options = 'dbug=d,before_send_state_request';
SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining'; SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining';
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
connection node_2;
connection node_3;
INSERT INTO t1 VALUES (6, 3); INSERT INTO t1 VALUES (6, 3);
connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
connection node_2;
INSERT INTO t1 VALUES (7, 2); INSERT INTO t1 VALUES (7, 2);
connection node_3;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
connection node_2;
connection node_3;
INSERT INTO t1 VALUES (8, 3); INSERT INTO t1 VALUES (8, 3);
connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
connection node_2;
connection node_1a;
SET GLOBAL wsrep_provider_options = 'dbug=d,process_primary_configuration'; SET GLOBAL wsrep_provider_options = 'dbug=d,process_primary_configuration';
SET GLOBAL wsrep_provider_options = 'signal=before_send_state_request'; SET GLOBAL wsrep_provider_options = 'signal=before_send_state_request';
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
connection node_2;
INSERT INTO t1 VALUES (9, 2); INSERT INTO t1 VALUES (9, 2);
connection node_3;
connection node_1a;
SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration'; SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration';
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration'; SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration';
SET GLOBAL wsrep_provider_options = 'dbug='; SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
DROP TABLE t1; DROP TABLE t1;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
connection node_2;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
connection node_3;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");

View File

@@ -1,18 +1,39 @@
connection node_2;
connection node_1;
connection node_1;
CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb; CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb;
INSERT INTO t1 VALUES (1, 1); INSERT INTO t1 VALUES (1, 1);
connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
connection node_2;
connection node_3;
INSERT INTO t1 VALUES (2, 3); INSERT INTO t1 VALUES (2, 3);
connection node_2;
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
SET wsrep_sync_wait = 0; SET wsrep_sync_wait = 0;
SET wsrep_on = OFF; SET wsrep_on = OFF;
SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining'; SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining';
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
connection node_2;
INSERT INTO t1 VALUES (3, 2); INSERT INTO t1 VALUES (3, 2);
connection node_1a;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
connection node_3;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
connection node_2;
connection node_3;
INSERT INTO t1 VALUES (4, 3); INSERT INTO t1 VALUES (4, 3);
connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
connection node_2;
INSERT INTO t1 VALUES (5, 2); INSERT INTO t1 VALUES (5, 2);
connection node_3;
connection node_1a;
SET GLOBAL wsrep_provider_options = 'dbug=d,before_send_state_request'; SET GLOBAL wsrep_provider_options = 'dbug=d,before_send_state_request';
SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining'; SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining';
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
@@ -24,18 +45,35 @@ SET SESSION wsrep_on = 0;
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'; SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters';
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
WSREP_DEBUG_SYNC_WAITERS after_shift_to_joining WSREP_DEBUG_SYNC_WAITERS after_shift_to_joining
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
connection node_2;
connection node_3;
INSERT INTO t1 VALUES (6, 3); INSERT INTO t1 VALUES (6, 3);
connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
connection node_2;
INSERT INTO t1 VALUES (7, 2); INSERT INTO t1 VALUES (7, 2);
connection node_3;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
connection node_2;
connection node_3;
INSERT INTO t1 VALUES (8, 3); INSERT INTO t1 VALUES (8, 3);
connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
connection node_2;
connection node_1a;
SET GLOBAL wsrep_provider_options = 'dbug=d,process_primary_configuration'; SET GLOBAL wsrep_provider_options = 'dbug=d,process_primary_configuration';
SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining'; SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining';
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
connection node_2;
INSERT INTO t1 VALUES (9, 2); INSERT INTO t1 VALUES (9, 2);
connection node_3;
connection node_1a;
SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration'; SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration';
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
@@ -44,7 +82,10 @@ VARIABLE_NAME VARIABLE_VALUE
WSREP_DEBUG_SYNC_WAITERS process_primary_configuration WSREP_DEBUG_SYNC_WAITERS process_primary_configuration
SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration'; SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration';
SET GLOBAL wsrep_provider_options = 'dbug='; SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
DROP TABLE t1; DROP TABLE t1;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
connection node_2;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
connection node_3;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");

View File

@@ -1,44 +1,85 @@
connection node_2;
connection node_1;
connection node_1;
CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb; CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb;
INSERT INTO t1 VALUES (1, 1); INSERT INTO t1 VALUES (1, 1);
connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
connection node_2;
connection node_3;
INSERT INTO t1 VALUES (2, 3); INSERT INTO t1 VALUES (2, 3);
connection node_2;
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
SET wsrep_sync_wait = 0; SET wsrep_sync_wait = 0;
SET wsrep_on = OFF; SET wsrep_on = OFF;
SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining'; SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining';
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
connection node_2;
INSERT INTO t1 VALUES (3, 2); INSERT INTO t1 VALUES (3, 2);
connection node_1a;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
connection node_3;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
connection node_2;
connection node_3;
INSERT INTO t1 VALUES (4, 3); INSERT INTO t1 VALUES (4, 3);
connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
connection node_2;
INSERT INTO t1 VALUES (5, 2); INSERT INTO t1 VALUES (5, 2);
connection node_3;
connection node_1a;
SET GLOBAL wsrep_provider_options = 'dbug=d,before_send_state_request'; SET GLOBAL wsrep_provider_options = 'dbug=d,before_send_state_request';
SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining'; SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining';
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET GLOBAL wsrep_provider_options = 'dbug='; SET GLOBAL wsrep_provider_options = 'dbug=';
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
connection node_2;
connection node_3;
connection node_1a;
SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining'; SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining';
SET GLOBAL wsrep_provider_options = 'signal=before_send_state_request'; SET GLOBAL wsrep_provider_options = 'signal=before_send_state_request';
4 4
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'; SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters';
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
WSREP_DEBUG_SYNC_WAITERS WSREP_DEBUG_SYNC_WAITERS
connection node_3;
INSERT INTO t1 VALUES (6, 3); INSERT INTO t1 VALUES (6, 3);
connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
connection node_2;
INSERT INTO t1 VALUES (7, 2); INSERT INTO t1 VALUES (7, 2);
connection node_3;
connection node_1a;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET GLOBAL wsrep_provider_options = 'dbug='; SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,process_primary_configuration'; SET GLOBAL wsrep_provider_options = 'dbug=d,process_primary_configuration';
SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining'; SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining';
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
connection node_2;
connection node_3;
INSERT INTO t1 VALUES (8, 3); INSERT INTO t1 VALUES (8, 3);
connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
connection node_2;
connection node_1a;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
connection node_2;
INSERT INTO t1 VALUES (9, 2); INSERT INTO t1 VALUES (9, 2);
connection node_3;
connection node_1a;
SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration'; SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration';
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
@@ -48,8 +89,11 @@ SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 0; SET SESSION wsrep_on = 0;
SET GLOBAL wsrep_provider_options = 'dbug='; SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining'; SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining';
connection node_1;
DROP TABLE t1; DROP TABLE t1;
call mtr.add_suppression("WSREP: Send action {\(.*\), STATE_REQUEST} returned -107 \\(Transport endpoint is not connected\\)"); call mtr.add_suppression("WSREP: Send action {\(.*\), STATE_REQUEST} returned -107 \\(Transport endpoint is not connected\\)");
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
connection node_2;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
connection node_3;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");

View File

@@ -655,6 +655,7 @@ SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
# MDEV-17187 table doesn't exist in engine after ALTER other tables # MDEV-17187 table doesn't exist in engine after ALTER other tables
# with CONSTRAINTs # with CONSTRAINTs
# #
call mtr.add_suppression("\\[Warning\\] InnoDB: In ALTER TABLE `test`\\.`t2` has or is referenced in foreign key constraints which are not compatible with the new table definition.");
set foreign_key_checks=on; set foreign_key_checks=on;
create table t1 (id int not null primary key) engine=innodb; create table t1 (id int not null primary key) engine=innodb;
create table t2 (id int not null primary key, fid int not null, create table t2 (id int not null primary key, fid int not null,
@@ -710,6 +711,32 @@ drop table t1,t2;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
drop table t1,t2; drop table t1,t2;
ERROR 42S02: Unknown table 'test.t2' ERROR 42S02: Unknown table 'test.t2'
#
# MDEV-22934 Table disappear after two alter table command
#
CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT,
f2 INT NOT NULL,
PRIMARY KEY (f1), INDEX (f2))ENGINE=InnoDB;
CREATE TABLE t2(f1 INT NOT NULL,
f2 INT NOT NULL, f3 INT NOT NULL,
PRIMARY KEY(f1, f2), UNIQUE KEY(f2),
CONSTRAINT `t2_ibfk_1` FOREIGN KEY (f2) REFERENCES t1(f2) ON DELETE CASCADE,
CONSTRAINT `t2_ibfk_2` FOREIGN KEY (f1) REFERENCES t1(f1) ON DELETE CASCADE
) ENGINE=InnoDB;
SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE t2 DROP PRIMARY KEY, ADD PRIMARY KEY(f3), ALGORITHM=INPLACE;
ALTER TABLE t2 DROP INDEX `f2`, ALGORITHM=COPY;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`f1` int(11) NOT NULL,
`f2` int(11) NOT NULL,
`f3` int(11) NOT NULL,
PRIMARY KEY (`f3`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
CREATE TABLE t2 (f1 INT NOT NULL)ENGINE=InnoDB;
ERROR 42S01: Table 't2' already exists
DROP TABLE t2, t1;
# End of 10.2 tests # End of 10.2 tests
CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)), CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)),
FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB; FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB;
@@ -761,11 +788,12 @@ set default_storage_engine= default;
# #
# MDEV-21690 LeakSanitizer: detected memory leaks in mem_heap_create_block_func # MDEV-21690 LeakSanitizer: detected memory leaks in mem_heap_create_block_func
# #
SET FOREIGN_KEY_CHECKS=1;
CREATE TABLE t1 (a TEXT, b TEXT) ENGINE=InnoDB; CREATE TABLE t1 (a TEXT, b TEXT) ENGINE=InnoDB;
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (b); ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (b);
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
SET FOREIGN_KEY_CHECKS=DEFAULT;
DROP TABLE t1; DROP TABLE t1;
# End of 10.5 tests
# #
# MDEV-22602 Disable UPDATE CASCADE for SQL constraints # MDEV-22602 Disable UPDATE CASCADE for SQL constraints
# #
@@ -784,3 +812,4 @@ create or replace table t1 (a varchar(4096) unique) engine=innodb;
create or replace table t2 (pk int primary key, a varchar(4096) unique, foreign key(a) references t1(a) on update cascade) engine=innodb; create or replace table t2 (pk int primary key, a varchar(4096) unique, foreign key(a) references t1(a) on update cascade) engine=innodb;
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
drop table t1; drop table t1;
# End of 10.5 tests

View File

@@ -2544,7 +2544,6 @@ set foreign_key_checks=0;
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb; create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb;
create table t1(a varchar(10) primary key) engine = innodb; create table t1(a varchar(10) primary key) engine = innodb;
alter table t1 modify column a int; alter table t1 modify column a int;
Got one of the listed errors
set foreign_key_checks=1; set foreign_key_checks=1;
drop table t2,t1; drop table t2,t1;
set foreign_key_checks=0; set foreign_key_checks=0;
@@ -2553,6 +2552,7 @@ create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin
alter table t1 convert to character set utf8; alter table t1 convert to character set utf8;
set foreign_key_checks=1; set foreign_key_checks=1;
drop table t2,t1; drop table t2,t1;
call mtr.add_suppression("\\[Warning\\] InnoDB: In ALTER TABLE `test`.`t1` has or is referenced in foreign key constraints which are not compatible with the new table definition.");
set foreign_key_checks=0; set foreign_key_checks=0;
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8; create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;

View File

@@ -410,4 +410,10 @@ CREATE TABLE t (i INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t SET i=1; INSERT INTO t SET i=1;
ALTER TABLE t ADD e CHAR(255) CHARACTER SET UTF32 FIRST, ALGORITHM=INSTANT; ALTER TABLE t ADD e CHAR(255) CHARACTER SET UTF32 FIRST, ALGORITHM=INSTANT;
DROP TABLE t; DROP TABLE t;
#
# MDEV-23499 Assertion c.same_type(*o) failed
#
CREATE TABLE t (pk SERIAL, b TEXT CHARACTER SET utf8) ENGINE=InnoDB;
ALTER TABLE t MODIFY b TEXT CHARACTER SET utf8mb4 FIRST;
DROP TABLE t;
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency; SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;

View File

@@ -657,6 +657,8 @@ SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
--echo # with CONSTRAINTs --echo # with CONSTRAINTs
--echo # --echo #
call mtr.add_suppression("\\[Warning\\] InnoDB: In ALTER TABLE `test`\\.`t2` has or is referenced in foreign key constraints which are not compatible with the new table definition.");
set foreign_key_checks=on; set foreign_key_checks=on;
create table t1 (id int not null primary key) engine=innodb; create table t1 (id int not null primary key) engine=innodb;
create table t2 (id int not null primary key, fid int not null, create table t2 (id int not null primary key, fid int not null,
@@ -698,6 +700,27 @@ drop table t1,t2;
--error ER_BAD_TABLE_ERROR --error ER_BAD_TABLE_ERROR
drop table t1,t2; drop table t1,t2;
--echo #
--echo # MDEV-22934 Table disappear after two alter table command
--echo #
CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT,
f2 INT NOT NULL,
PRIMARY KEY (f1), INDEX (f2))ENGINE=InnoDB;
CREATE TABLE t2(f1 INT NOT NULL,
f2 INT NOT NULL, f3 INT NOT NULL,
PRIMARY KEY(f1, f2), UNIQUE KEY(f2),
CONSTRAINT `t2_ibfk_1` FOREIGN KEY (f2) REFERENCES t1(f2) ON DELETE CASCADE,
CONSTRAINT `t2_ibfk_2` FOREIGN KEY (f1) REFERENCES t1(f1) ON DELETE CASCADE
) ENGINE=InnoDB;
SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE t2 DROP PRIMARY KEY, ADD PRIMARY KEY(f3), ALGORITHM=INPLACE;
ALTER TABLE t2 DROP INDEX `f2`, ALGORITHM=COPY;
SHOW CREATE TABLE t2;
--error ER_TABLE_EXISTS_ERROR
CREATE TABLE t2 (f1 INT NOT NULL)ENGINE=InnoDB;
DROP TABLE t2, t1;
--echo # End of 10.2 tests --echo # End of 10.2 tests
# MDEV-21792 Server aborts upon attempt to create foreign key on spatial field # MDEV-21792 Server aborts upon attempt to create foreign key on spatial field
@@ -732,15 +755,15 @@ set default_storage_engine= default;
--echo # --echo #
--echo # MDEV-21690 LeakSanitizer: detected memory leaks in mem_heap_create_block_func --echo # MDEV-21690 LeakSanitizer: detected memory leaks in mem_heap_create_block_func
--echo # --echo #
SET FOREIGN_KEY_CHECKS=1;
CREATE TABLE t1 (a TEXT, b TEXT) ENGINE=InnoDB; CREATE TABLE t1 (a TEXT, b TEXT) ENGINE=InnoDB;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (b); ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (b);
SET FOREIGN_KEY_CHECKS=DEFAULT;
# Cleanup # Cleanup
DROP TABLE t1; DROP TABLE t1;
--echo # End of 10.5 tests
--echo # --echo #
--echo # MDEV-22602 Disable UPDATE CASCADE for SQL constraints --echo # MDEV-22602 Disable UPDATE CASCADE for SQL constraints
--echo # --echo #
@@ -764,4 +787,6 @@ create or replace table t2 (pk int primary key, a varchar(4096) unique, foreign
drop table t1; drop table t1;
--echo # End of 10.5 tests
--source include/wait_until_count_sessions.inc --source include/wait_until_count_sessions.inc

View File

@@ -1622,7 +1622,6 @@ drop table t1;
set foreign_key_checks=0; set foreign_key_checks=0;
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb; create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb;
create table t1(a varchar(10) primary key) engine = innodb; create table t1(a varchar(10) primary key) engine = innodb;
-- error 1025,1025
alter table t1 modify column a int; alter table t1 modify column a int;
set foreign_key_checks=1; set foreign_key_checks=1;
drop table t2,t1; drop table t2,t1;
@@ -1638,6 +1637,7 @@ drop table t2,t1;
# test that RENAME does not allow invalid charsets when f_k_c is 0 # test that RENAME does not allow invalid charsets when f_k_c is 0
call mtr.add_suppression("\\[Warning\\] InnoDB: In ALTER TABLE `test`.`t1` has or is referenced in foreign key constraints which are not compatible with the new table definition.");
set foreign_key_checks=0; set foreign_key_checks=0;
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8; create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;

View File

@@ -430,4 +430,11 @@ INSERT INTO t SET i=1;
ALTER TABLE t ADD e CHAR(255) CHARACTER SET UTF32 FIRST, ALGORITHM=INSTANT; ALTER TABLE t ADD e CHAR(255) CHARACTER SET UTF32 FIRST, ALGORITHM=INSTANT;
DROP TABLE t; DROP TABLE t;
--echo #
--echo # MDEV-23499 Assertion c.same_type(*o) failed
--echo #
CREATE TABLE t (pk SERIAL, b TEXT CHARACTER SET utf8) ENGINE=InnoDB;
ALTER TABLE t MODIFY b TEXT CHARACTER SET utf8mb4 FIRST;
DROP TABLE t;
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency; SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;

View File

@@ -0,0 +1,3 @@
SET SESSION wsrep_sync_wait=15;
SET SESSION wsrep_on=1;
START TRANSACTION READ WRITE;

View File

@@ -0,0 +1,13 @@
SET COLLATION_CONNECTION='utf16le_bin';
SET GLOBAL wsrep_provider='/invalid/path/libgalera_smm.so';
ERROR 42000: Variable 'wsrep_provider' can't be set to the value of '/'
SET GLOBAL wsrep_cluster_address='OFF';
SET GLOBAL wsrep_slave_threads=10;
SELECT 1;
1
1
SET GLOBAL wsrep_cluster_address='gcomm://';
SET GLOBAL wsrep_slave_threads=DEFAULT;
CALL mtr.add_suppression("wsrep_load()");
CALL mtr.add_suppression("Failed to create a new provider");
CALL mtr.add_suppression("Failed to load provider");

View File

@@ -0,0 +1,3 @@
SELECT WSREP_LAST_SEEN_GTID();
WSREP_LAST_SEEN_GTID()
00000000-0000-0000-0000-000000000000:-1

View File

@@ -15,6 +15,7 @@ TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition;
TRUNCATE TABLE time_zone_transition_type; TRUNCATE TABLE time_zone_transition_type;
START TRANSACTION;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID(); 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_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
@@ -32,6 +33,7 @@ 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. 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: 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. Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion.
COMMIT;
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; 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; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
\d | \d |
@@ -57,6 +59,7 @@ TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition;
TRUNCATE TABLE time_zone_transition_type; TRUNCATE TABLE time_zone_transition_type;
START TRANSACTION;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID(); 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_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
@@ -71,6 +74,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
(@time_zone_id, 0, 0, 0, 'GMT') (@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/garbage' as time zone. Skipping it.
COMMIT;
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; 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; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
\d | \d |

View File

@@ -9,6 +9,7 @@ TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition;
TRUNCATE TABLE time_zone_transition_type; TRUNCATE TABLE time_zone_transition_type;
START TRANSACTION;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID(); 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_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
@@ -26,6 +27,7 @@ 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. 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: 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. Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion.
COMMIT;
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; 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; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
# Silent run # Silent run
@@ -36,6 +38,7 @@ TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition;
TRUNCATE TABLE time_zone_transition_type; TRUNCATE TABLE time_zone_transition_type;
START TRANSACTION;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID(); 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_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
@@ -50,6 +53,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
(@time_zone_id, 0, 0, 0, 'GMT') (@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/garbage' as time zone. Skipping it.
COMMIT;
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; 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; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
# #

View File

@@ -0,0 +1,8 @@
!include ../my.cnf
[mysqld.1]
wsrep-on=OFF
binlog-format=ROW
wsrep-provider=none
wsrep-cluster-address='gcomm://'
innodb_autoinc_lock_mode=2

View File

@@ -0,0 +1,12 @@
#
# MDEV-22443: terminate called after throwing an instance of
# 'wsrep::runtime_error' in std::terminate on START TRANSACTION
#
--source include/have_innodb.inc
--source include/have_wsrep.inc
--source include/have_binlog_format_row.inc
SET SESSION wsrep_sync_wait=15;
SET SESSION wsrep_on=1;
START TRANSACTION READ WRITE;

View File

@@ -0,0 +1,8 @@
!include ../my.cnf
[mysqld.1]
wsrep-on=OFF
binlog-format=ROW
wsrep-provider=none
wsrep-cluster-address='gcomm://'
innodb_autoinc_lock_mode=2

View File

@@ -0,0 +1,22 @@
#
# MDEV-23092: SIGABRT in wsrep::server_state::provider when setting
# invalid wsrep_provider (on optimized builds)
#
--source include/have_innodb.inc
--source include/have_wsrep.inc
--source include/have_binlog_format_row.inc
SET COLLATION_CONNECTION='utf16le_bin';
--error 1231
SET GLOBAL wsrep_provider='/invalid/path/libgalera_smm.so';
SET GLOBAL wsrep_cluster_address='OFF';
SET GLOBAL wsrep_slave_threads=10;
SELECT 1;
SET GLOBAL wsrep_cluster_address='gcomm://';
SET GLOBAL wsrep_slave_threads=DEFAULT;
CALL mtr.add_suppression("wsrep_load()");
CALL mtr.add_suppression("Failed to create a new provider");
CALL mtr.add_suppression("Failed to load provider");

View File

@@ -0,0 +1,8 @@
!include ../my.cnf
[mysqld.1]
wsrep-on=OFF
binlog-format=ROW
wsrep-provider=none
wsrep-cluster-address='gcomm://'
innodb_autoinc_lock_mode=2

View File

@@ -0,0 +1,10 @@
#
# MDEV-23466: SIGABRT in wsrep::server_state::provider on
# SELECT WSREP_LAST_SEEN_GTID() on optimized builds
#
--source include/have_innodb.inc
--source include/have_wsrep.inc
--source include/have_binlog_format_row.inc
SELECT WSREP_LAST_SEEN_GTID();

View File

@@ -1,5 +1,6 @@
/* /*
Copyright (c) 2001, 2011, Oracle and/or its affiliates Copyright (c) 2001, 2011, Oracle and/or its affiliates
Copyright (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@@ -33,15 +34,6 @@
#include <execinfo.h> #include <execinfo.h>
#endif #endif
#ifdef __linux__
#define PTR_SANE(p) ((p) && (char*)(p) >= heap_start && (char*)(p) <= heap_end)
static char *heap_start;
char *__bss_start;
#else
#define PTR_SANE(p) (p)
#endif /* __linux */
/** /**
Default handler for printing stacktrace Default handler for printing stacktrace
*/ */
@@ -61,111 +53,23 @@ static sig_handler default_handle_fatal_signal(int sig)
/** /**
Initialize priting off stacktrace at signal Initialize priting off stacktrace at signal
@param setup_handlers 0 only initialize variables
1 setup signal handlers for stacktrace printing
*/ */
void my_init_stacktrace(int setup_handlers) void my_setup_stacktrace(void)
{ {
#ifdef __linux__ struct sigaction sa;
heap_start = (char*) &__bss_start; sa.sa_flags = SA_RESETHAND | SA_NODEFER;
#endif /* __linux */ sigemptyset(&sa.sa_mask);
if (setup_handlers) sa.sa_handler= default_handle_fatal_signal;
{ sigaction(SIGSEGV, &sa, NULL);
struct sigaction sa; sigaction(SIGABRT, &sa, NULL);
sa.sa_flags = SA_RESETHAND | SA_NODEFER;
sigemptyset(&sa.sa_mask);
sa.sa_handler= default_handle_fatal_signal;
sigaction(SIGSEGV, &sa, NULL);
sigaction(SIGABRT, &sa, NULL);
#ifdef SIGBUS #ifdef SIGBUS
sigaction(SIGBUS, &sa, NULL); sigaction(SIGBUS, &sa, NULL);
#endif #endif
sigaction(SIGILL, &sa, NULL); sigaction(SIGILL, &sa, NULL);
sigaction(SIGFPE, &sa, NULL); sigaction(SIGFPE, &sa, NULL);
}
} }
#ifdef __linux__
static void print_buffer(char *buffer, size_t count)
{
const char s[]= " ";
for (; count && *buffer; --count)
{
my_write_stderr(isprint(*buffer) ? buffer : s, 1);
++buffer;
}
}
/**
Access the pages of this process through /proc/self/task/<tid>/mem
in order to safely print the contents of a memory address range.
@param addr The address at the start of the memory region.
@param max_len The length of the memory region.
@return Zero on success.
*/
static int safe_print_str(const char *addr, size_t max_len)
{
int fd;
pid_t tid;
off_t offset;
ssize_t nbytes= 0;
size_t total, count;
char buf[256];
tid= (pid_t) syscall(SYS_gettid);
sprintf(buf, "/proc/self/task/%d/mem", tid);
if ((fd= open(buf, O_RDONLY)) < 0)
return -1;
/* Ensure that off_t can hold a pointer. */
compile_time_assert(sizeof(off_t) >= sizeof(intptr));
total= max_len;
offset= (intptr) addr;
/* Read up to the maximum number of bytes. */
while (total)
{
count= MY_MIN(sizeof(buf), total);
if ((nbytes= pread(fd, buf, count, offset)) < 0)
{
/* Just in case... */
if (errno == EINTR)
continue;
else
break;
}
/* Advance offset into memory. */
total-= nbytes;
offset+= nbytes;
addr+= nbytes;
/* Output the printable characters. */
print_buffer(buf, nbytes);
/* Break if less than requested... */
if ((count - nbytes))
break;
}
if (nbytes == -1)
my_safe_printf_stderr("Can't read from address %p", addr);
close(fd);
return 0;
}
#endif
/* /*
Attempt to print a char * pointer as a string. Attempt to print a char * pointer as a string.
@@ -187,24 +91,25 @@ static int safe_print_str(const char *addr, size_t max_len)
int my_safe_print_str(const char* val, size_t max_len) int my_safe_print_str(const char* val, size_t max_len)
{ {
#ifdef __linux__ const char *orig_val= val;
char *heap_end; if (!val)
// Try and make use of /proc filesystem to safely print memory contents.
if (!safe_print_str(val, max_len))
return 0;
heap_end= (char*) sbrk(0);
#endif
if (!PTR_SANE(val))
{ {
my_safe_printf_stderr("%s", "is an invalid pointer"); my_safe_printf_stderr("%s", "(null)");
return 1; return 1;
} }
for (; max_len && PTR_SANE(val) && *val; --max_len) for (; max_len; --max_len)
my_write_stderr((val++), 1); {
if (my_write_stderr((val++), 1) != 1)
{
if ((errno == EFAULT) &&(val == orig_val + 1))
{
// We can not read the address from very beginning
my_safe_printf_stderr("Can't access address %p", orig_val);
}
break;
}
}
my_safe_printf_stderr("%s", "\n"); my_safe_printf_stderr("%s", "\n");
return 0; return 0;
@@ -548,11 +453,6 @@ static EXCEPTION_POINTERS *exception_ptrs;
#define MODULE64_SIZE_WINXP 576 #define MODULE64_SIZE_WINXP 576
#define STACKWALK_MAX_FRAMES 64 #define STACKWALK_MAX_FRAMES 64
void my_init_stacktrace(int setup_handlers __attribute__((unused)))
{
}
void my_set_exception_pointers(EXCEPTION_POINTERS *ep) void my_set_exception_pointers(EXCEPTION_POINTERS *ep)
{ {
exception_ptrs = ep; exception_ptrs = ep;

View File

@@ -23,6 +23,7 @@ numa_interleave=0
wsrep_on=0 wsrep_on=0
dry_run=0 dry_run=0
defaults_group_suffix= defaults_group_suffix=
ignore_unknown=1
# Initial logging status: error log is not open, and not using syslog # Initial logging status: error log is not open, and not using syslog
logging=init logging=init
@@ -370,11 +371,22 @@ parse_arguments() {
--help) usage ;; --help) usage ;;
--ignore-unknown) ignore_unknown=1 ;;
--no-ignore-unknown|--not-ignore-unknown) ignore_unknown=0 ;;
*) *)
case "$unrecognized_handling" in if test $ignore_unknown -eq 0
collect) append_arg_to_args "$arg" ;; then
complain) log_error "unknown option '$arg'" ;; case "$unrecognized_handling" in
esac collect) append_arg_to_args "$arg" ;;
complain) log_error "unknown option '$arg'"
esac
else
case "$arg" in
"--loose-"*) append_arg_to_args "$arg" ;;
*) append_arg_to_args "--loose-$arg"
esac
fi
esac esac
done done
} }

View File

@@ -1,5 +1,5 @@
# Copyright (c) 2006, 2014, Oracle and/or its affiliates. # Copyright (c) 2006, 2014, Oracle and/or its affiliates.
# Copyright (c) 2010, 2018, MariaDB Corporation # Copyright (c) 2010, 2020, MariaDB Corporation.
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by

View File

@@ -2830,7 +2830,6 @@ void init_signals(void)
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL); sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL);
my_init_stacktrace(0);
#if defined(__amiga__) #if defined(__amiga__)
sa.sa_handler=(void(*)())handle_fatal_signal; sa.sa_handler=(void(*)())handle_fatal_signal;
#else #else

View File

@@ -2753,9 +2753,11 @@ main(int argc, char **argv)
printf("TRUNCATE TABLE time_zone_name;\n"); printf("TRUNCATE TABLE time_zone_name;\n");
printf("TRUNCATE TABLE time_zone_transition;\n"); printf("TRUNCATE TABLE time_zone_transition;\n");
printf("TRUNCATE TABLE time_zone_transition_type;\n"); printf("TRUNCATE TABLE time_zone_transition_type;\n");
printf("START TRANSACTION;\n");
if (scan_tz_dir(root_name_end, 0, opt_verbose)) if (scan_tz_dir(root_name_end, 0, opt_verbose))
{ {
printf("ROLLBACK;\n");
fflush(stdout); fflush(stdout);
fprintf(stderr, fprintf(stderr,
"There were fatal errors during processing " "There were fatal errors during processing "
@@ -2763,6 +2765,7 @@ main(int argc, char **argv)
return 1; return 1;
} }
printf("COMMIT;\n");
printf("ALTER TABLE time_zone_transition " printf("ALTER TABLE time_zone_transition "
"ORDER BY Time_zone_id, Transition_time;\n"); "ORDER BY Time_zone_id, Transition_time;\n");
printf("ALTER TABLE time_zone_transition_type " printf("ALTER TABLE time_zone_transition_type "

View File

@@ -1171,7 +1171,7 @@ bool wsrep_must_sync_wait (THD* thd, uint mask)
mysql_mutex_lock(&thd->LOCK_thd_data); mysql_mutex_lock(&thd->LOCK_thd_data);
ret= (thd->variables.wsrep_sync_wait & mask) && ret= (thd->variables.wsrep_sync_wait & mask) &&
thd->wsrep_client_thread && thd->wsrep_client_thread &&
thd->variables.wsrep_on && WSREP_ON &&
!(thd->variables.wsrep_dirty_reads && !(thd->variables.wsrep_dirty_reads &&
!is_update_query(thd->lex->sql_command)) && !is_update_query(thd->lex->sql_command)) &&
!thd->in_active_multi_stmt_transaction() && !thd->in_active_multi_stmt_transaction() &&

View File

@@ -360,6 +360,12 @@ static int wsrep_provider_verify (const char* provider_str)
{ {
return 1; return 1;
} }
if (MY_S_ISDIR(f_stat.st_mode))
{
return 1;
}
return 0; return 0;
} }

View File

@@ -5072,7 +5072,6 @@ btr_validate_index(
if (!btr_validate_level(index, trx, n - i, lockout)) { if (!btr_validate_level(index, trx, n - i, lockout)) {
err = DB_CORRUPTION; err = DB_CORRUPTION;
break;
} }
} }

View File

@@ -3442,7 +3442,7 @@ fail:
/* prefetch siblings of the leaf for the pessimistic /* prefetch siblings of the leaf for the pessimistic
operation, if the page is leaf. */ operation, if the page is leaf. */
if (page_is_leaf(page)) { if (page_is_leaf(page) && !index->is_ibuf()) {
btr_cur_prefetch_siblings(block); btr_cur_prefetch_siblings(block);
} }
fail_err: fail_err:
@@ -4575,6 +4575,7 @@ btr_cur_optimistic_update(
if (rec_offs_any_extern(*offsets)) { if (rec_offs_any_extern(*offsets)) {
any_extern: any_extern:
ut_ad(!index->is_ibuf());
/* Externally stored fields are treated in pessimistic /* Externally stored fields are treated in pessimistic
update */ update */
@@ -4771,7 +4772,7 @@ func_exit:
} }
} }
if (err != DB_SUCCESS) { if (err != DB_SUCCESS && !index->is_ibuf()) {
/* prefetch siblings of the leaf for the pessimistic /* prefetch siblings of the leaf for the pessimistic
operation. */ operation. */
btr_cur_prefetch_siblings(block); btr_cur_prefetch_siblings(block);

View File

@@ -3840,7 +3840,7 @@ buf_page_create(fil_space_t *space, uint32_t offset,
const bool drop_hash_entry= block->page.state() == BUF_BLOCK_FILE_PAGE && const bool drop_hash_entry= block->page.state() == BUF_BLOCK_FILE_PAGE &&
UNIV_LIKELY_NULL(block->index); UNIV_LIKELY_NULL(block->index);
if (UNIV_UNLIKELY(drop_hash_entry)) if (UNIV_UNLIKELY(drop_hash_entry))
block->page.set_io_fix(BUF_IO_PIN); rw_lock_x_lock(&block->lock);
#endif /* BTR_CUR_HASH_ADAPT */ #endif /* BTR_CUR_HASH_ADAPT */
/* Page can be found in buf_pool */ /* Page can be found in buf_pool */
@@ -3851,7 +3851,7 @@ buf_page_create(fil_space_t *space, uint32_t offset,
if (UNIV_UNLIKELY(drop_hash_entry)) if (UNIV_UNLIKELY(drop_hash_entry))
{ {
btr_search_drop_page_hash_index(block); btr_search_drop_page_hash_index(block);
block->page.io_unfix(); rw_lock_x_unlock(&block->lock);
} }
#endif /* BTR_CUR_HASH_ADAPT */ #endif /* BTR_CUR_HASH_ADAPT */

View File

@@ -120,7 +120,7 @@ bool dict_col_t::same_encoding(uint16_t a, uint16_t b)
{ {
if (const CHARSET_INFO *acs= get_charset(a, MYF(MY_WME))) if (const CHARSET_INFO *acs= get_charset(a, MYF(MY_WME)))
if (const CHARSET_INFO *bcs= get_charset(b, MYF(MY_WME))) if (const CHARSET_INFO *bcs= get_charset(b, MYF(MY_WME)))
return Charset(acs).same_encoding(bcs); return Charset(bcs).encoding_allows_reinterpret_as(acs);
return false; return false;
} }

View File

@@ -10796,11 +10796,11 @@ ha_innobase::commit_inplace_alter_table(
/* Exclusively lock the table, to ensure that no other /* Exclusively lock the table, to ensure that no other
transaction is holding locks on the table while we transaction is holding locks on the table while we
change the table definition. The MySQL meta-data lock change the table definition. The meta-data lock (MDL)
should normally guarantee that no conflicting locks should normally guarantee that no conflicting locks
exist. However, FOREIGN KEY constraints checks and any exist. However, FOREIGN KEY constraints checks and any
transactions collected during crash recovery could be transactions collected during crash recovery could be
holding InnoDB locks only, not MySQL locks. */ holding InnoDB locks only, not MDL. */
dberr_t error = row_merge_lock_table( dberr_t error = row_merge_lock_table(
m_prebuilt->trx, ctx->old_table, LOCK_X); m_prebuilt->trx, ctx->old_table, LOCK_X);

View File

@@ -728,7 +728,7 @@ public:
bool same_format(const dict_col_t &other) const bool same_format(const dict_col_t &other) const
{ {
return same_type(other) && len >= other.len && return same_type(other) && len >= other.len &&
mbminlen == other.mbminlen && mbmaxlen == other.mbmaxlen && mbminlen == other.mbminlen && mbmaxlen >= other.mbmaxlen &&
!((prtype ^ other.prtype) & ~(DATA_NOT_NULL | DATA_VERSIONED | !((prtype ^ other.prtype) & ~(DATA_NOT_NULL | DATA_VERSIONED |
CHAR_COLL_MASK << 16 | CHAR_COLL_MASK << 16 |
DATA_LONG_TRUE_VARCHAR)); DATA_LONG_TRUE_VARCHAR));

View File

@@ -2098,6 +2098,7 @@ wrong_page_type:
/* Validate the record list in a loop checking also that /* Validate the record list in a loop checking also that
it is consistent with the directory. */ it is consistent with the directory. */
ulint count = 0, data_size = 0, own_count = 1, slot_no = 0; ulint count = 0, data_size = 0, own_count = 1, slot_no = 0;
ulint info_bits;
slot_no = 0; slot_no = 0;
slot = page_dir_get_nth_slot(page, slot_no); slot = page_dir_get_nth_slot(page, slot_no);
@@ -2121,9 +2122,16 @@ wrong_page_type:
goto next_rec; goto next_rec;
} }
info_bits = rec_get_info_bits(rec, page_is_comp(page));
if (info_bits
& ~(REC_INFO_MIN_REC_FLAG | REC_INFO_DELETED_FLAG)) {
ib::error() << "info_bits has an incorrect value "
<< info_bits;
ret = false;
}
if (rec == first_rec) { if (rec == first_rec) {
if ((rec_get_info_bits(rec, page_is_comp(page)) if (info_bits & REC_INFO_MIN_REC_FLAG) {
& REC_INFO_MIN_REC_FLAG)) {
if (page_has_prev(page)) { if (page_has_prev(page)) {
ib::error() << "REC_INFO_MIN_REC_FLAG " ib::error() << "REC_INFO_MIN_REC_FLAG "
"is set on non-left page"; "is set on non-left page";
@@ -2134,8 +2142,7 @@ wrong_page_type:
ib::error() << "REC_INFO_MIN_REC_FLAG " ib::error() << "REC_INFO_MIN_REC_FLAG "
"is set in a leaf-page record"; "is set in a leaf-page record";
ret = false; ret = false;
} else if (!rec_get_deleted_flag( } else if (!(info_bits & REC_INFO_DELETED_FLAG)
rec, page_is_comp(page))
!= !index->table->instant) { != !index->table->instant) {
ib::error() << (index->table->instant ib::error() << (index->table->instant
? "Metadata record " ? "Metadata record "
@@ -2149,13 +2156,51 @@ wrong_page_type:
ib::error() << "Metadata record is missing"; ib::error() << "Metadata record is missing";
ret = false; ret = false;
} }
} else if (rec_get_info_bits(rec, page_is_comp(page)) } else if (info_bits & REC_INFO_MIN_REC_FLAG) {
& REC_INFO_MIN_REC_FLAG) {
ib::error() << "REC_INFO_MIN_REC_FLAG record is not " ib::error() << "REC_INFO_MIN_REC_FLAG record is not "
"first in page"; "first in page";
ret = false; ret = false;
} }
if (page_is_comp(page)) {
const rec_comp_status_t status = rec_get_status(rec);
if (status != REC_STATUS_ORDINARY
&& status != REC_STATUS_NODE_PTR
&& status != REC_STATUS_INFIMUM
&& status != REC_STATUS_SUPREMUM
&& status != REC_STATUS_INSTANT) {
ib::error() << "impossible record status "
<< status;
ret = false;
} else if (page_rec_is_infimum(rec)) {
if (status != REC_STATUS_INFIMUM) {
ib::error()
<< "infimum record has status "
<< status;
ret = false;
}
} else if (page_rec_is_supremum(rec)) {
if (status != REC_STATUS_SUPREMUM) {
ib::error() << "supremum record has "
"status "
<< status;
ret = false;
}
} else if (!page_is_leaf(page)) {
if (status != REC_STATUS_NODE_PTR) {
ib::error() << "node ptr record has "
"status "
<< status;
ret = false;
}
} else if (!index->is_instant()
&& status == REC_STATUS_INSTANT) {
ib::error() << "instantly added record in a "
"non-instant index";
ret = false;
}
}
/* Check that the records are in the ascending order */ /* Check that the records are in the ascending order */
if (count >= PAGE_HEAP_NO_USER_LOW if (count >= PAGE_HEAP_NO_USER_LOW
&& !page_rec_is_supremum(rec)) { && !page_rec_is_supremum(rec)) {

View File

@@ -3807,8 +3807,6 @@ funct_exit_all_freed:
trx->op_info = ""; trx->op_info = "";
srv_inc_activity_count();
DBUG_RETURN(err); DBUG_RETURN(err);
} }
@@ -4521,12 +4519,20 @@ end:
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
if (old_is_tmp) { if (old_is_tmp) {
ib::error() << "In ALTER TABLE " /* In case of copy alter, ignore the
loading of foreign key constraint
when foreign_key_check is disabled */
ib::error_or_warn(trx->check_foreigns)
<< "In ALTER TABLE "
<< ut_get_name(trx, new_name) << ut_get_name(trx, new_name)
<< " has or is referenced in foreign" << " has or is referenced in foreign"
" key constraints which are not" " key constraints which are not"
" compatible with the new table" " compatible with the new table"
" definition."; " definition.";
if (!trx->check_foreigns) {
err = DB_SUCCESS;
goto funct_exit;
}
} else { } else {
ib::error() << "In RENAME TABLE table " ib::error() << "In RENAME TABLE table "
<< ut_get_name(trx, new_name) << ut_get_name(trx, new_name)

View File

@@ -84,11 +84,11 @@ row_undo_ins_remove_clust_rec(
online = false; online = false;
} else { } else {
index->set_modified(mtr); index->set_modified(mtr);
ut_ad(lock_table_has_locks(index->table));
online = dict_index_is_online_ddl(index); online = dict_index_is_online_ddl(index);
if (online) { if (online) {
ut_ad(node->rec_type == TRX_UNDO_INSERT_REC); ut_ad(node->rec_type == TRX_UNDO_INSERT_REC);
ut_ad(node->trx->dict_operation_lock_mode ut_ad(!node->trx->dict_operation_lock_mode);
!= RW_X_LATCH);
ut_ad(node->table->id != DICT_INDEXES_ID); ut_ad(node->table->id != DICT_INDEXES_ID);
ut_ad(node->table->id != DICT_COLUMNS_ID); ut_ad(node->table->id != DICT_COLUMNS_ID);
mtr_s_lock_index(index, &mtr); mtr_s_lock_index(index, &mtr);
@@ -529,6 +529,9 @@ row_undo_ins(
return DB_SUCCESS; return DB_SUCCESS;
} }
ut_ad(node->table->is_temporary()
|| lock_table_has_locks(node->table));
/* Iterate over all the indexes and undo the insert.*/ /* Iterate over all the indexes and undo the insert.*/
node->index = dict_table_get_first_index(node->table); node->index = dict_table_get_first_index(node->table);

View File

@@ -244,10 +244,7 @@ row_undo_mod_clust(
bool online; bool online;
ut_ad(thr_get_trx(thr) == node->trx); ut_ad(thr_get_trx(thr) == node->trx);
ut_ad(node->trx->dict_operation_lock_mode);
ut_ad(node->trx->in_rollback); ut_ad(node->trx->in_rollback);
ut_ad(rw_lock_own_flagged(&dict_sys.latch,
RW_LOCK_FLAG_X | RW_LOCK_FLAG_S));
log_free_check(); log_free_check();
pcur = &node->pcur; pcur = &node->pcur;
@@ -259,11 +256,12 @@ row_undo_mod_clust(
mtr.set_log_mode(MTR_LOG_NO_REDO); mtr.set_log_mode(MTR_LOG_NO_REDO);
} else { } else {
index->set_modified(mtr); index->set_modified(mtr);
ut_ad(lock_table_has_locks(index->table));
} }
online = dict_index_is_online_ddl(index); online = dict_index_is_online_ddl(index);
if (online) { if (online) {
ut_ad(node->trx->dict_operation_lock_mode != RW_X_LATCH); ut_ad(!node->trx->dict_operation_lock_mode);
mtr_s_lock_index(index, &mtr); mtr_s_lock_index(index, &mtr);
} }
@@ -302,17 +300,7 @@ row_undo_mod_clust(
ut_ad(err == DB_SUCCESS || err == DB_OUT_OF_FILE_SPACE); ut_ad(err == DB_SUCCESS || err == DB_OUT_OF_FILE_SPACE);
} }
/* Online rebuild cannot be initiated while we are holding if (err == DB_SUCCESS && online && dict_index_is_online_ddl(index)) {
dict_sys.latch and index->lock. (It can be aborted.) */
ut_ad(online || !dict_index_is_online_ddl(index));
if (err == DB_SUCCESS && online) {
ut_ad(rw_lock_own_flagged(
&index->lock,
RW_LOCK_FLAG_S | RW_LOCK_FLAG_X
| RW_LOCK_FLAG_SX));
switch (node->rec_type) { switch (node->rec_type) {
case TRX_UNDO_DEL_MARK_REC: case TRX_UNDO_DEL_MARK_REC:
row_log_table_insert( row_log_table_insert(
@@ -886,37 +874,6 @@ func_exit_no_pcur:
return(err); return(err);
} }
/***********************************************************//**
Flags a secondary index corrupted. */
static MY_ATTRIBUTE((nonnull))
void
row_undo_mod_sec_flag_corrupted(
/*============================*/
trx_t* trx, /*!< in/out: transaction */
dict_index_t* index) /*!< in: secondary index */
{
ut_ad(!dict_index_is_clust(index));
switch (trx->dict_operation_lock_mode) {
case RW_S_LATCH:
/* Because row_undo() is holding an S-latch
on the data dictionary during normal rollback,
we can only mark the index corrupted in the
data dictionary cache. TODO: fix this somehow.*/
mutex_enter(&dict_sys.mutex);
dict_set_corrupted_index_cache_only(index);
mutex_exit(&dict_sys.mutex);
break;
default:
ut_ad(0);
/* fall through */
case RW_X_LATCH:
/* This should be the rollback of a data dictionary
transaction. */
dict_set_corrupted(index, trx, "rollback");
}
}
/***********************************************************//** /***********************************************************//**
Undoes a modify in secondary indexes when undo record type is UPD_DEL. Undoes a modify in secondary indexes when undo record type is UPD_DEL.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */ @return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
@@ -1030,8 +987,7 @@ row_undo_mod_del_mark_sec(
} }
if (err == DB_DUPLICATE_KEY) { if (err == DB_DUPLICATE_KEY) {
row_undo_mod_sec_flag_corrupted( index->type |= DICT_CORRUPT;
thr_get_trx(thr), index);
err = DB_SUCCESS; err = DB_SUCCESS;
/* Do not return any error to the caller. The /* Do not return any error to the caller. The
duplicate will be reported by ALTER TABLE or duplicate will be reported by ALTER TABLE or
@@ -1176,8 +1132,7 @@ row_undo_mod_upd_exist_sec(
} }
if (err == DB_DUPLICATE_KEY) { if (err == DB_DUPLICATE_KEY) {
row_undo_mod_sec_flag_corrupted( index->type |= DICT_CORRUPT;
thr_get_trx(thr), index);
err = DB_SUCCESS; err = DB_SUCCESS;
} else if (err != DB_SUCCESS) { } else if (err != DB_SUCCESS) {
break; break;
@@ -1340,6 +1295,8 @@ row_undo_mod(
return DB_SUCCESS; return DB_SUCCESS;
} }
ut_ad(node->table->is_temporary()
|| lock_table_has_locks(node->table));
node->index = dict_table_get_first_index(node->table); node->index = dict_table_get_first_index(node->table);
ut_ad(dict_index_is_clust(node->index)); ut_ad(dict_index_is_clust(node->index));

View File

@@ -411,15 +411,17 @@ row_undo(
return DB_SUCCESS; return DB_SUCCESS;
} }
/* Prevent DROP TABLE etc. while we are rolling back this row. /* Prevent prepare_inplace_alter_table_dict() from adding
If we are doing a TABLE CREATE or some other dictionary operation, dict_table_t::indexes while we are processing the record.
then we already have dict_sys.latch locked in x-mode. Do not Recovered transactions are not protected by MDL, and the
try to lock again, because that would cause a hang. */ secondary index creation is not protected by table locks
for online operation. (A table lock would only be acquired
when committing the ALTER TABLE operation.) */
trx_t* trx = node->trx; trx_t* trx = node->trx;
const bool locked_data_dict = (trx->dict_operation_lock_mode == 0); const bool locked_data_dict = UNIV_UNLIKELY(trx->is_recovered)
&& !trx->dict_operation_lock_mode;
if (locked_data_dict) { if (UNIV_UNLIKELY(locked_data_dict)) {
row_mysql_freeze_data_dictionary(trx); row_mysql_freeze_data_dictionary(trx);
} }
@@ -439,7 +441,7 @@ row_undo(
err = DB_CORRUPTION; err = DB_CORRUPTION;
} }
if (locked_data_dict) { if (UNIV_UNLIKELY(locked_data_dict)) {
row_mysql_unfreeze_data_dictionary(trx); row_mysql_unfreeze_data_dictionary(trx);
} }

View File

@@ -1188,6 +1188,7 @@ trx_flush_log_if_needed_low(
case 1: case 1:
/* Write the log and optionally flush it to disk */ /* Write the log and optionally flush it to disk */
log_write_up_to(lsn, flush); log_write_up_to(lsn, flush);
srv_inc_activity_count();
return; return;
case 0: case 0:
/* Do nothing */ /* Do nothing */

View File

@@ -127,7 +127,7 @@ int main(int argc, char **argv)
int error; int error;
MY_INIT(argv[0]); MY_INIT(argv[0]);
my_init_stacktrace(1); my_setup_stacktrace();
default_log_dir= opt_log_dir= maria_data_root= (char *)"."; default_log_dir= opt_log_dir= maria_data_root= (char *)".";
maria_chk_init(&check_param); maria_chk_init(&check_param);
check_param.opt_lock_memory= 1; /* Lock memory if possible */ check_param.opt_lock_memory= 1; /* Lock memory if possible */

View File

@@ -15,7 +15,7 @@
MY_ADD_TESTS(bitmap base64 my_atomic my_rdtsc lf my_malloc my_getopt dynstring MY_ADD_TESTS(bitmap base64 my_atomic my_rdtsc lf my_malloc my_getopt dynstring
byte_order byte_order
queues LINK_LIBRARIES mysys) queues stacktrace LINK_LIBRARIES mysys)
MY_ADD_TESTS(my_vsnprintf LINK_LIBRARIES strings mysys) MY_ADD_TESTS(my_vsnprintf LINK_LIBRARIES strings mysys)
MY_ADD_TESTS(aes LINK_LIBRARIES mysys mysys_ssl) MY_ADD_TESTS(aes LINK_LIBRARIES mysys mysys_ssl)
ADD_DEFINITIONS(${SSL_DEFINES}) ADD_DEFINITIONS(${SSL_DEFINES})

View File

@@ -0,0 +1,67 @@
/* Copyright (c) 2020, 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 */
#include <my_global.h>
#include <my_sys.h>
#include <stdio.h>
#include <my_stacktrace.h>
#include <tap.h>
char b_bss[10];
void test_my_safe_print_str()
{
char b_stack[10];
char *b_heap= strdup("LEGAL");
memcpy(b_stack, "LEGAL", 6);
memcpy(b_bss, "LEGAL", 6);
#ifndef __SANITIZE_ADDRESS__
fprintf(stderr, "\n===== stack =====\n");
my_safe_print_str(b_stack, 65535);
fprintf(stderr, "\n===== heap =====\n");
my_safe_print_str(b_heap, 65535);
fprintf(stderr, "\n===== BSS =====\n");
my_safe_print_str(b_bss, 65535);
fprintf(stderr, "\n===== data =====\n");
my_safe_print_str("LEGAL", 65535);
fprintf(stderr, "\n===== Above is a junk, but it is expected. =====\n");
#endif /*__SANITIZE_ADDRESS__*/
fprintf(stderr, "\n===== Nornal length test =====\n");
my_safe_print_str("LEGAL", 5);
fprintf(stderr, "\n===== NULL =====\n");
my_safe_print_str(0, 5);
#ifndef __SANITIZE_ADDRESS__
fprintf(stderr, "\n===== (const char*) 1 =====\n");
my_safe_print_str((const char*)1, 5);
#endif /*__SANITIZE_ADDRESS__*/
free(b_heap);
ok(1, "test_my_safe_print_str");
}
int main(int argc __attribute__((unused)), char **argv)
{
MY_INIT(argv[0]);
plan(1);
test_my_safe_print_str();
my_end(0);
return exit_status();
}