Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä 2022-10-12 11:29:32 +03:00
commit 977c385df3
46 changed files with 2925 additions and 353 deletions

View File

@ -1722,7 +1722,7 @@ that may lead to an endless loop.",
&opt_binlog_rows_event_max_encoded_size, 0, &opt_binlog_rows_event_max_encoded_size, 0,
GET_ULONG, REQUIRED_ARG, UINT_MAX/4, 256, ULONG_MAX, 0, 256, 0}, GET_ULONG, REQUIRED_ARG, UINT_MAX/4, 256, ULONG_MAX, 0, 256, 0},
#endif #endif
{"verify-binlog-checksum", 'c', "Verify checksum binlog events.", {"verify-binlog-checksum", 'c', "Verify binlog event checksums.",
(uchar**) &opt_verify_binlog_checksum, (uchar**) &opt_verify_binlog_checksum, (uchar**) &opt_verify_binlog_checksum, (uchar**) &opt_verify_binlog_checksum,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"rewrite-db", OPT_REWRITE_DB, {"rewrite-db", OPT_REWRITE_DB,

View File

@ -255,9 +255,6 @@
#cmakedefine STRUCT_TIMESPEC_HAS_TV_SEC 1 #cmakedefine STRUCT_TIMESPEC_HAS_TV_SEC 1
#cmakedefine STRUCT_TIMESPEC_HAS_TV_NSEC 1 #cmakedefine STRUCT_TIMESPEC_HAS_TV_NSEC 1
#define USE_MB 1
#define USE_MB_IDENT 1
/* this means that valgrind headers and macros are available */ /* this means that valgrind headers and macros are available */
#cmakedefine HAVE_VALGRIND_MEMCHECK_H 1 #cmakedefine HAVE_VALGRIND_MEMCHECK_H 1
@ -453,8 +450,8 @@
#cmakedefine MYSQL_DEFAULT_CHARSET_NAME "@MYSQL_DEFAULT_CHARSET_NAME@" #cmakedefine MYSQL_DEFAULT_CHARSET_NAME "@MYSQL_DEFAULT_CHARSET_NAME@"
#cmakedefine MYSQL_DEFAULT_COLLATION_NAME "@MYSQL_DEFAULT_COLLATION_NAME@" #cmakedefine MYSQL_DEFAULT_COLLATION_NAME "@MYSQL_DEFAULT_COLLATION_NAME@"
#cmakedefine USE_MB 1 #cmakedefine USE_MB
#cmakedefine USE_MB_IDENT 1 #cmakedefine USE_MB_IDENT
/* This should mean case insensitive file system */ /* This should mean case insensitive file system */
#cmakedefine FN_NO_CASE_SENSE 1 #cmakedefine FN_NO_CASE_SENSE 1

View File

@ -195,4 +195,29 @@ connection default;
DROP USER 'user2'@'%'; DROP USER 'user2'@'%';
DROP DATABASE temp; DROP DATABASE temp;
set global sql_mode=default; set global sql_mode=default;
End of 5.0 tests #
# End of 5.0 tests
#
create database db1;
create user foo@localhost;
grant create on db1.* to foo@localhost;
connect foo,localhost,foo;
create temporary table t as values (1),(2),(3);
use db1;
create table t1 as select * from test.t;
ERROR 42000: INSERT command denied to user 'foo'@'localhost' for table `db1`.`t1`
create table t1 as values (1),(2),(3);
ERROR 42000: INSERT command denied to user 'foo'@'localhost' for table `db1`.`t1`
create table t1 (a int);
disconnect foo;
connection default;
revoke create on db1.* from foo@localhost;
grant insert on db1.* to foo@localhost;
connect foo,localhost,foo;
use db1;
create table t2 as values (1),(2),(3);
ERROR 42000: CREATE command denied to user 'foo'@'localhost' for table `db1`.`t2`
disconnect foo;
connection default;
drop user foo@localhost;
drop database db1;

View File

@ -207,7 +207,35 @@ DROP USER 'user2'@'%';
DROP DATABASE temp; DROP DATABASE temp;
set global sql_mode=default; set global sql_mode=default;
--echo End of 5.0 tests --echo #
--echo # End of 5.0 tests
--echo #
create database db1;
create user foo@localhost;
grant create on db1.* to foo@localhost;
connect foo,localhost,foo;
create temporary table t as values (1),(2),(3);
use db1;
--error ER_TABLEACCESS_DENIED_ERROR
create table t1 as select * from test.t;
--error ER_TABLEACCESS_DENIED_ERROR
create table t1 as values (1),(2),(3);
create table t1 (a int);
disconnect foo;
connection default;
revoke create on db1.* from foo@localhost;
grant insert on db1.* to foo@localhost;
connect foo,localhost,foo;
use db1;
--error ER_TABLEACCESS_DENIED_ERROR
create table t2 as values (1),(2),(3);
disconnect foo;
connection default;
drop user foo@localhost;
drop database db1;
# Wait till we reached the initial number of concurrent sessions # Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc --source include/wait_until_count_sessions.inc

File diff suppressed because it is too large Load Diff

View File

@ -53,6 +53,8 @@ BEGIN NOT ATOMIC
SELECT tabledef AS ``; SELECT tabledef AS ``;
EXECUTE IMMEDIATE tabledef; EXECUTE IMMEDIATE tabledef;
SHOW WARNINGS; SHOW WARNINGS;
SELECT * FROM t1;
SHOW WARNINGS;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
DROP TABLE t1; DROP TABLE t1;
END; END;

View File

@ -34,8 +34,10 @@ SCHEMA="mtr_wsrep_notify"
MEMB_TABLE="$SCHEMA.membership" MEMB_TABLE="$SCHEMA.membership"
STATUS_TABLE="$SCHEMA.status" STATUS_TABLE="$SCHEMA.status"
BEGIN=" WSREP_ON='SET wsrep_on=ON'
SET wsrep_on=0; WSREP_OFF='SET wsrep_on=OFF'
BEGIN="$WSREP_OFF;
CREATE SCHEMA IF NOT EXISTS $SCHEMA; CREATE SCHEMA IF NOT EXISTS $SCHEMA;
CREATE TABLE IF NOT EXISTS $MEMB_TABLE ( CREATE TABLE IF NOT EXISTS $MEMB_TABLE (
idx INT, idx INT,
@ -50,9 +52,8 @@ CREATE TABLE IF NOT EXISTS $STATUS_TABLE (
uuid CHAR(40), /* cluster UUID */ uuid CHAR(40), /* cluster UUID */
prim BOOLEAN /* if component is primary */ prim BOOLEAN /* if component is primary */
) ENGINE=MEMORY; ) ENGINE=MEMORY;
BEGIN; BEGIN"
" END="COMMIT; $WSREP_ON"
END="COMMIT;"
configuration_change() configuration_change()
{ {
@ -71,7 +72,7 @@ configuration_change()
echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);" echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
echo "$END" echo "$END;"
} }
status_update() status_update()
@ -186,13 +187,13 @@ then
fi fi
fi fi
case $STATUS in case "$STATUS" in
"joined" | "donor" | "synced") 'joined' | 'donor' | 'synced')
"$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\ "$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\
"-h'$HOST'" "-P$PORT"$SSL_PARAM "-h'$HOST'" "-P$PORT"$SSL_PARAM
;; ;;
*) *)
# The node might be shutting down # The node might be shutting down or not initialized
;; ;;
esac esac

View File

@ -34,8 +34,10 @@ SCHEMA="mtr_wsrep_notify"
MEMB_TABLE="$SCHEMA.membership" MEMB_TABLE="$SCHEMA.membership"
STATUS_TABLE="$SCHEMA.status" STATUS_TABLE="$SCHEMA.status"
BEGIN=" WSREP_ON='SET wsrep_on=ON'
SET wsrep_on=0; WSREP_OFF='SET wsrep_on=OFF'
BEGIN="$WSREP_OFF;
CREATE SCHEMA IF NOT EXISTS $SCHEMA; CREATE SCHEMA IF NOT EXISTS $SCHEMA;
CREATE TABLE IF NOT EXISTS $MEMB_TABLE ( CREATE TABLE IF NOT EXISTS $MEMB_TABLE (
idx INT, idx INT,
@ -50,9 +52,8 @@ CREATE TABLE IF NOT EXISTS $STATUS_TABLE (
uuid CHAR(40), /* cluster UUID */ uuid CHAR(40), /* cluster UUID */
prim BOOLEAN /* if component is primary */ prim BOOLEAN /* if component is primary */
) ENGINE=MEMORY; ) ENGINE=MEMORY;
BEGIN; BEGIN"
" END="COMMIT; $WSREP_ON"
END="COMMIT;"
configuration_change() configuration_change()
{ {
@ -71,12 +72,12 @@ configuration_change()
echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);" echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
echo "$END" echo "$END;"
} }
status_update() status_update()
{ {
echo "SET wsrep_on=0; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; COMMIT;" echo "$BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; $END;"
} }
trim_string() trim_string()
@ -186,10 +187,14 @@ then
fi fi
fi fi
# Undefined means node is shutting down case "$STATUS" in
if [ "$STATUS" != 'Undefined' ]; then 'joined' | 'donor' | 'synced')
"$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\ "$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\
"-h'$HOST'" "-P$PORT"$SSL_PARAM "-h'$HOST'" "-P$PORT"$SSL_PARAM
fi ;;
*)
# The node might be shutting down or not initialized
;;
esac
exit 0 exit 0

View File

@ -22,7 +22,6 @@ galera_gcache_recover_manytrx : MDEV-18834 Galera test failure
galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails
galera_pc_recovery : MDEV-25199 cluster fails to start up galera_pc_recovery : MDEV-25199 cluster fails to start up
galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim
galera_trigger : MDEV-24048 galera.galera_trigger MTR fails: Result content mismatch
galera_var_ignore_apply_errors : MDEV-26770 galera_var_ignore_apply_errors fails Server did not transition to READY state galera_var_ignore_apply_errors : MDEV-26770 galera_var_ignore_apply_errors fails Server did not transition to READY state
galera_var_node_address : MDEV-20485 Galera test failure galera_var_node_address : MDEV-20485 Galera test failure
galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang
@ -33,3 +32,8 @@ query_cache: MDEV-15805 Test failure on galera.query_cache
versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch
galera_bf_abort_at_after_statement : Unstable galera_bf_abort_at_after_statement : Unstable
# Recent trouble
MDEV-26597 : crashes on 10.5
MDEV-27615 : crashes on 10.5 after MDEV-26597 fix
MDEV-29142 : fails on 10.5 with WSREP: Inconsistency detected
galera_bf_abort_shutdown : MDEV-29368 shutdown hang

View File

@ -0,0 +1,19 @@
connection node_2;
connection node_1;
connection node_1;
connection node_2;
connection node_2;
CREATE TABLE t3 (c1 INTEGER NOT NULL PRIMARY KEY, c2 FLOAT(3,2));
SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512';
SET @@autocommit=0;
INSERT INTO t3 VALUES (1000,0.00),(1001,0.25),(1002,0.50),(1003,0.75),(1008,1.00),(1009,1.25),(1010,1.50),(1011,1.75);
CREATE TABLE t1 ( pk int primary key) ENGINE=INNODB;
ERROR HY000: Maximum writeset size exceeded
SHOW WARNINGS;
Level Code Message
Error 1105 Maximum writeset size exceeded
connection node_2;
SET SESSION wsrep_sync_wait = 0;
Killing server ...
connection node_1;
DROP TABLE t3;

View File

@ -0,0 +1,17 @@
connection node_2;
connection node_1;
show variables like 'auto_increment%';
Variable_name Value
auto_increment_increment 3
auto_increment_offset 3
create table t4 (c1 int primary key auto_increment) engine=innodb;
show variables like 'auto_increment%';
Variable_name Value
auto_increment_increment 3
auto_increment_offset 3
alter table t4 add (c2 varchar(50));
show variables like 'auto_increment%';
Variable_name Value
auto_increment_increment 3
auto_increment_offset 3
DROP TABLE t4;

View File

@ -0,0 +1,43 @@
connection node_2;
connection node_1;
connection node_1;
connection node_2;
connection node_1;
call mtr.add_suppression("WSREP: Event .* Write_rows_v1 apply failed:.*");
call mtr.add_suppression("WSREP: Failed to apply write set:.*");
connection node_2;
call mtr.add_suppression("WSREP: Failed to open table mysql.wsrep_streaming_log for writing");
call mtr.add_suppression("WSREP: Failed to open SR table for write");
call mtr.add_suppression("WSREP: Failed to recover SR transactions from schema: wsrep_on : 0");
SET @@global.tx_read_only = ON;
SET default_storage_engine = SEQUENCE;
create table t1 (c1 int);
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
CREATE TABLE t1(c1 VARCHAR(20)) engine=innodb;
INSERT INTO t1 VALUES(0xA9B8);
create TABLE t1 (c1 int) engine=innodb;
ERROR 42S01: Table 't1' already exists
create TABLE t1 (c1 int) engine=innodb;
ERROR 42S01: Table 't1' already exists
SET GLOBAL wsrep_on=OFF;
SET GLOBAL wsrep_cluster_address='gcomm://';
INSERT INTO t1 VALUES (1);
SELECT 1;
1
1
SELECT 1;
1
1
COMMIT;
# Killing cluster because we have messed with wsrep_cluster_address
connection node_2;
SET SESSION wsrep_sync_wait = 0;
Killing server ...
connection node_1;
SET SESSION wsrep_sync_wait = 0;
Killing server ...
connection node_2;
call mtr.add_suppression("WSREP: Failed to open table mysql.wsrep_streaming_log for writing");
call mtr.add_suppression("WSREP: Failed to open SR table for write");
call mtr.add_suppression("WSREP: Failed to recover SR transactions from schema: wsrep_on : 0");
DROP TABLE IF EXISTS t1;

View File

@ -4,7 +4,7 @@ connection node_1;
CREATE TABLE t1 (f1 VARCHAR(512)) ENGINE=InnoDB; CREATE TABLE t1 (f1 VARCHAR(512)) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512'; SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512';
INSERT INTO t1 VALUES (REPEAT('a', 512)); INSERT INTO t1 VALUES (REPEAT('a', 512));
ERROR HY000: Got error 5 "Input/output error" during COMMIT ERROR HY000: Maximum writeset size exceeded
SELECT COUNT(*) = 0 FROM t1; SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0 COUNT(*) = 0
1 1

View File

@ -4,7 +4,7 @@ connection node_1;
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(1024)) Engine=InnoDB; CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(1024)) Engine=InnoDB;
SET GLOBAL wsrep_max_ws_size = 1024; SET GLOBAL wsrep_max_ws_size = 1024;
INSERT INTO t1 VALUES (DEFAULT, REPEAT('X', 1024)); INSERT INTO t1 VALUES (DEFAULT, REPEAT('X', 1024));
ERROR HY000: Got error 5 "Input/output error" during COMMIT ERROR HY000: Maximum writeset size exceeded
SELECT COUNT(*) = 0 FROM t1; SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0 COUNT(*) = 0
1 1

View File

@ -1,3 +1,5 @@
connection node_2;
connection node_1;
connection node_1; connection node_1;
SELECT COUNT(DISTINCT uuid) AS EXPECT_2 FROM mtr_wsrep_notify.membership; SELECT COUNT(DISTINCT uuid) AS EXPECT_2 FROM mtr_wsrep_notify.membership;
EXPECT_2 EXPECT_2

View File

@ -0,0 +1,32 @@
--source include/galera_cluster.inc
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
--connection node_2
CREATE TABLE t3 (c1 INTEGER NOT NULL PRIMARY KEY, c2 FLOAT(3,2));
SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512';
SET @@autocommit=0;
INSERT INTO t3 VALUES (1000,0.00),(1001,0.25),(1002,0.50),(1003,0.75),(1008,1.00),(1009,1.25),(1010,1.50),(1011,1.75);
--error ER_UNKNOWN_ERROR
CREATE TABLE t1 ( pk int primary key) ENGINE=INNODB;
SHOW WARNINGS;
--connection node_2
SET SESSION wsrep_sync_wait = 0;
--source include/kill_galera.inc
--let $start_mysqld_params = ""
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--source include/start_mysqld.inc
#
# Cleanup
#
--source ../../galera/include/auto_increment_offset_restore.inc
--connection node_1
DROP TABLE t3;

View File

@ -0,0 +1,2 @@
--wsrep_auto_increment_control=OFF --auto_increment_increment=3 --auto_increment_offset=3

View File

@ -0,0 +1,8 @@
--source include/galera_cluster.inc
show variables like 'auto_increment%';
create table t4 (c1 int primary key auto_increment) engine=innodb;
show variables like 'auto_increment%';
alter table t4 add (c2 varchar(50));
show variables like 'auto_increment%';
DROP TABLE t4;

View File

@ -0,0 +1,71 @@
--source include/galera_cluster.inc
--source include/have_sequence.inc
--source include/force_restart.inc
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
--connection node_1
call mtr.add_suppression("WSREP: Event .* Write_rows_v1 apply failed:.*");
call mtr.add_suppression("WSREP: Failed to apply write set:.*");
--connection node_2
call mtr.add_suppression("WSREP: Failed to open table mysql.wsrep_streaming_log for writing");
call mtr.add_suppression("WSREP: Failed to open SR table for write");
call mtr.add_suppression("WSREP: Failed to recover SR transactions from schema: wsrep_on : 0");
SET @@global.tx_read_only = ON;
--error 0,1286
SET default_storage_engine = SEQUENCE;
--error 1005
create table t1 (c1 int);
CREATE TABLE t1(c1 VARCHAR(20)) engine=innodb;
INSERT INTO t1 VALUES(0xA9B8);
--error 1050
create TABLE t1 (c1 int) engine=innodb;
--error 1050
create TABLE t1 (c1 int) engine=innodb;
--let $wsrep_cluster_address_saved = `SELECT @@global.wsrep_cluster_address`
SET GLOBAL wsrep_on=OFF;
SET GLOBAL wsrep_cluster_address='gcomm://';
INSERT INTO t1 VALUES (1);
SELECT 1;
SELECT 1;
COMMIT;
#
# Kill the entire cluster and restart
#
--echo # Killing cluster because we have messed with wsrep_cluster_address
--connection node_2
SET SESSION wsrep_sync_wait = 0;
--source include/kill_galera.inc
--connection node_1
SET SESSION wsrep_sync_wait = 0;
--source include/kill_galera.inc
--remove_file $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
--let $start_mysqld_params = "--wsrep-new-cluster"
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/start_mysqld.inc
--connection node_2
--let $start_mysqld_params = ""
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--source include/start_mysqld.inc
call mtr.add_suppression("WSREP: Failed to open table mysql.wsrep_streaming_log for writing");
call mtr.add_suppression("WSREP: Failed to open SR table for write");
call mtr.add_suppression("WSREP: Failed to recover SR transactions from schema: wsrep_on : 0");
#
# Cleanup
#
--source ../../galera/include/auto_increment_offset_restore.inc
# We killed cluster, it might mean that table does not exists
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

View File

@ -12,7 +12,7 @@ CREATE TABLE t1 (f1 VARCHAR(512)) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512'; SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512';
--error ER_ERROR_DURING_COMMIT --error ER_UNKNOWN_ERROR
INSERT INTO t1 VALUES (REPEAT('a', 512)); INSERT INTO t1 VALUES (REPEAT('a', 512));
SELECT COUNT(*) = 0 FROM t1; SELECT COUNT(*) = 0 FROM t1;

View File

@ -12,7 +12,7 @@ CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(1024)) Engine
--let $wsrep_max_ws_size_orig = `SELECT @@wsrep_max_ws_size` --let $wsrep_max_ws_size_orig = `SELECT @@wsrep_max_ws_size`
SET GLOBAL wsrep_max_ws_size = 1024; SET GLOBAL wsrep_max_ws_size = 1024;
--error ER_ERROR_DURING_COMMIT --error ER_UNKNOWN_ERROR
INSERT INTO t1 VALUES (DEFAULT, REPEAT('X', 1024)); INSERT INTO t1 VALUES (DEFAULT, REPEAT('X', 1024));
SELECT COUNT(*) = 0 FROM t1; SELECT COUNT(*) = 0 FROM t1;

View File

@ -16,6 +16,7 @@ galera_gtid_2_cluster : MDEV-23775 Galera test failure on galera_3nodes.galera_g
galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0,t=1,ut=255,o=4,s=0,sr=0,as=1,f=6,src=50524cfe,srcvid=view_id(REG,50524cfe,4),insvid=view_id(UNKNOWN,00000000,0),ru=00000000,r=[-1,-1],fs=75,nl=(} galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0,t=1,ut=255,o=4,s=0,sr=0,as=1,f=6,src=50524cfe,srcvid=view_id(REG,50524cfe,4),insvid=view_id(UNKNOWN,00000000,0),ru=00000000,r=[-1,-1],fs=75,nl=(}
galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query
galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query
galera_parallel_apply_3nodes : MDEV-29368 DEBUG_SYNC timeout
galera_pc_bootstrap : MDEV-24097 MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed galera_pc_bootstrap : MDEV-24097 MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
galera_safe_to_bootstrap : MDEV-24097 galera_3nodes.galera_safe_to_bootstrap MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed galera_safe_to_bootstrap : MDEV-24097 galera_3nodes.galera_safe_to_bootstrap MTR sporadaically fails: Failed to start mysqld or mysql_shutdown failed
galera_slave_options_do : MDEV-8798 galera_slave_options_do : MDEV-8798

View File

@ -12,3 +12,6 @@
GCF-1060 : MDEV-26528 wrong usage of mutex LOCK_thd_kill and LOCK_thd_kill GCF-1060 : MDEV-26528 wrong usage of mutex LOCK_thd_kill and LOCK_thd_kill
galera_sr_ws_size2 : MDEV-29773 assertion failure
galera-features#56 : MDEV-29773 assertion failure
MDEV-27615 : MDEV-29773 assertion failure

View File

@ -1082,9 +1082,11 @@ COMMIT;
drop table t2; drop table t2;
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-19526 heap number overflow # MDEV-19526/MDEV-29742 heap number overflow
# #
CREATE TABLE t1(a SMALLINT NOT NULL UNIQUE AUTO_INCREMENT, KEY(a)) CREATE TABLE t1(a SMALLINT NOT NULL UNIQUE AUTO_INCREMENT, KEY(a))
ENGINE=InnoDB; ENGINE=InnoDB;
INSERT INTO t1 (a) SELECT seq FROM seq_1_to_8191; INSERT INTO t1 (a) SELECT seq FROM seq_1_to_8191;
ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
DROP TABLE t1; DROP TABLE t1;
# End of 10.3 tests

View File

@ -641,9 +641,12 @@ drop table t2;
DROP TABLE t1; DROP TABLE t1;
--echo # --echo #
--echo # MDEV-19526 heap number overflow --echo # MDEV-19526/MDEV-29742 heap number overflow
--echo # --echo #
CREATE TABLE t1(a SMALLINT NOT NULL UNIQUE AUTO_INCREMENT, KEY(a)) CREATE TABLE t1(a SMALLINT NOT NULL UNIQUE AUTO_INCREMENT, KEY(a))
ENGINE=InnoDB; ENGINE=InnoDB;
INSERT INTO t1 (a) SELECT seq FROM seq_1_to_8191; INSERT INTO t1 (a) SELECT seq FROM seq_1_to_8191;
ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
DROP TABLE t1; DROP TABLE t1;
--echo # End of 10.3 tests

View File

@ -56,9 +56,8 @@ DROP TABLE t1;
# MDEV-25663 Double free of transaction during TRUNCATE # MDEV-25663 Double free of transaction during TRUNCATE
# #
call mtr.add_suppression("InnoDB: \\(Too many concurrent transactions\\)"); call mtr.add_suppression("InnoDB: \\(Too many concurrent transactions\\)");
SET DEBUG_DBUG='-d,ib_create_table_fail_too_many_trx';
CREATE TABLE t1 (b CHAR(12), FULLTEXT KEY(b)) engine=InnoDB;
SET @save_dbug= @@debug_dbug; SET @save_dbug= @@debug_dbug;
CREATE TABLE t1 (b CHAR(12), FULLTEXT KEY(b)) engine=InnoDB;
SET debug_dbug='+d,ib_create_table_fail_too_many_trx'; SET debug_dbug='+d,ib_create_table_fail_too_many_trx';
TRUNCATE t1; TRUNCATE t1;
ERROR HY000: Got error -1 "Internal error < 0 (Not system error)" from storage engine InnoDB ERROR HY000: Got error -1 "Internal error < 0 (Not system error)" from storage engine InnoDB

View File

@ -11,12 +11,13 @@ DROP TABLE mdev21563;
# #
CREATE TABLE t1(f1 CHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB; CREATE TABLE t1(f1 CHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB;
INSERT INTO t1 VALUES('mysql'), ('innodb'); INSERT INTO t1 VALUES('mysql'), ('innodb');
SET @save_dbug=@@debug_dbug;
set debug_dbug="+d,fts_instrument_sync_debug"; set debug_dbug="+d,fts_instrument_sync_debug";
INSERT INTO t1 VALUES('test'); INSERT INTO t1 VALUES('test');
set debug_dbug="-d,fts_instrument_sync_debug"; set debug_dbug=@save_dbug;
INSERT INTO t1 VALUES('This is a fts issue'); INSERT INTO t1 VALUES('This is a fts issue');
# restart # restart
set debug_dbug="+d,fts_instrument_sync_debug"; set debug_dbug="+d,fts_instrument_sync_debug";
UPDATE t1 SET f1="mariadb"; UPDATE t1 SET f1="mariadb";
set debug_dbug="-d,fts_instrument_sync_debug"; set debug_dbug=@save_dbug;
DROP TABLE t1; DROP TABLE t1;

View File

@ -85,10 +85,9 @@ DROP TABLE t1;
--echo # MDEV-25663 Double free of transaction during TRUNCATE --echo # MDEV-25663 Double free of transaction during TRUNCATE
--echo # --echo #
call mtr.add_suppression("InnoDB: \\(Too many concurrent transactions\\)"); call mtr.add_suppression("InnoDB: \\(Too many concurrent transactions\\)");
SET DEBUG_DBUG='-d,ib_create_table_fail_too_many_trx'; SET @save_dbug= @@debug_dbug;
CREATE TABLE t1 (b CHAR(12), FULLTEXT KEY(b)) engine=InnoDB; CREATE TABLE t1 (b CHAR(12), FULLTEXT KEY(b)) engine=InnoDB;
SET @save_dbug= @@debug_dbug;
SET debug_dbug='+d,ib_create_table_fail_too_many_trx'; SET debug_dbug='+d,ib_create_table_fail_too_many_trx';
--error ER_GET_ERRNO --error ER_GET_ERRNO
TRUNCATE t1; TRUNCATE t1;

View File

@ -16,12 +16,13 @@ DROP TABLE mdev21563;
--echo # --echo #
CREATE TABLE t1(f1 CHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB; CREATE TABLE t1(f1 CHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB;
INSERT INTO t1 VALUES('mysql'), ('innodb'); INSERT INTO t1 VALUES('mysql'), ('innodb');
SET @save_dbug=@@debug_dbug;
set debug_dbug="+d,fts_instrument_sync_debug"; set debug_dbug="+d,fts_instrument_sync_debug";
INSERT INTO t1 VALUES('test'); INSERT INTO t1 VALUES('test');
set debug_dbug="-d,fts_instrument_sync_debug"; set debug_dbug=@save_dbug;
INSERT INTO t1 VALUES('This is a fts issue'); INSERT INTO t1 VALUES('This is a fts issue');
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
set debug_dbug="+d,fts_instrument_sync_debug"; set debug_dbug="+d,fts_instrument_sync_debug";
UPDATE t1 SET f1="mariadb"; UPDATE t1 SET f1="mariadb";
set debug_dbug="-d,fts_instrument_sync_debug"; set debug_dbug=@save_dbug;
DROP TABLE t1; DROP TABLE t1;

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, 2020, MariaDB Corporation. # Copyright (c) 2010, 2022, 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
@ -177,6 +177,13 @@ SET (SQL_SOURCE
${MYSYS_LIBWRAP_SOURCE} ${MYSYS_LIBWRAP_SOURCE}
) )
IF(CMAKE_C_COMPILER_ID MATCHES "Clang" AND
NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "13.0.0")
ADD_COMPILE_FLAGS(${CMAKE_CURRENT_BINARY_DIR}/yy_mariadb.cc
${CMAKE_CURRENT_BINARY_DIR}/yy_oracle.cc
COMPILE_FLAGS "-Wno-unused-but-set-variable")
ENDIF()
IF ((CMAKE_SYSTEM_NAME MATCHES "Linux" OR IF ((CMAKE_SYSTEM_NAME MATCHES "Linux" OR
CMAKE_SYSTEM_NAME MATCHES "SunOS" OR CMAKE_SYSTEM_NAME MATCHES "SunOS" OR
WIN32 OR WIN32 OR

View File

@ -509,9 +509,19 @@ bool Sql_cmd_alter_table::execute(THD *thd)
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
/*
It makes sense to set auto_increment_* to defaults in TOI operations.
Must be done before wsrep_TOI_begin() since Query_log_event encapsulating
TOI statement and auto inc variables for wsrep replication is constructed
there. Variables are reset back in THD::reset_for_next_command() before
processing of next command.
*/
if (wsrep_auto_increment_control)
{
thd->variables.auto_increment_offset = 1; thd->variables.auto_increment_offset = 1;
thd->variables.auto_increment_increment = 1; thd->variables.auto_increment_increment = 1;
} }
}
#endif #endif
if (lex->name.str && !test_all_bits(priv, INSERT_ACL | CREATE_ACL)) if (lex->name.str && !test_all_bits(priv, INSERT_ACL | CREATE_ACL))

View File

@ -63,23 +63,23 @@ public:
{ {
static const char *names[17]= static const char *names[17]=
{ {
"HA_NOSAME", "HA_NOSAME", // 1
"HA_PACK_KEY", "HA_PACK_KEY", // 2 - used in both HA_KEYSEG and KEY/MI_KEYDEF
"HA_SPACE_PACK_USED", "HA_SPACE_PACK_USED", // 4
"HA_VAR_LENGTH_KEY", "HA_VAR_LENGTH_KEY", // 8
"HA_AUTO_KEY", "HA_AUTO_KEY", // 16
"HA_BINARY_PACK_KEY", "HA_BINARY_PACK_KEY", // 32
"HA_NULL_PART_KEY", "HA_NULL_PART_KEY", // 64
"HA_FULLTEXT", "HA_FULLTEXT", // 128
"HA_UNIQUE_CHECK", "HA_UNIQUE_CHECK", // 256
"HA_SORT_ALLOWS_SAME", "HA_SORT_ALLOWS_SAME", // 512
"HA_SPATIAL", "HA_SPATIAL", // 1024
"HA_NULL_ARE_EQUAL", "HA_NULL_ARE_EQUAL", // 2048
"HA_GENERATED_KEY", "HA_USES_COMMENT", // 4096
"HA_USES_COMMENT", "HA_GENERATED_KEY", // 8192
"HA_USES_PARSER", "HA_USES_PARSER", // 16384
"HA_USES_BLOCK_SIZE", "HA_USES_BLOCK_SIZE", // 32768
"HA_KEY_HAS_PART_KEY_SEG" "HA_KEY_HAS_PART_KEY_SEG" // 65536
}; };
return append_flag32_names((uint) flags, names, array_elements(names)); return append_flag32_names((uint) flags, names, array_elements(names));
} }
@ -89,7 +89,7 @@ public:
static const char *names[]= static const char *names[]=
{ {
"HA_SPACE_PACK", // 1 "HA_SPACE_PACK", // 1
"??? 2 ???", // 2 "HA_PACK_KEY", // 2 - used in both HA_KEYSEG and KEY/MI_KEYDEF
"HA_PART_KEY_SEG", // 4 "HA_PART_KEY_SEG", // 4
"HA_VAR_LENGTH_PART", // 8 "HA_VAR_LENGTH_PART", // 8
"HA_NULL_PART", // 16 "HA_NULL_PART", // 16

View File

@ -9962,7 +9962,7 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
{ {
LEX *lex= thd->lex; LEX *lex= thd->lex;
SELECT_LEX *select_lex= lex->first_select_lex(); SELECT_LEX *select_lex= lex->first_select_lex();
privilege_t want_priv(NO_ACL); privilege_t want_priv{CREATE_ACL};
bool error= TRUE; // Error message is given bool error= TRUE; // Error message is given
DBUG_ENTER("create_table_precheck"); DBUG_ENTER("create_table_precheck");
@ -9971,8 +9971,10 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
CREATE TABLE ... SELECT, also require INSERT. CREATE TABLE ... SELECT, also require INSERT.
*/ */
want_priv= lex->tmp_table() ? CREATE_TMP_ACL : if (lex->tmp_table())
(CREATE_ACL | (select_lex->item_list.elements ? INSERT_ACL : NO_ACL)); want_priv= CREATE_TMP_ACL;
else if (select_lex->item_list.elements || select_lex->tvc)
want_priv|= INSERT_ACL;
/* CREATE OR REPLACE on not temporary tables require DROP_ACL */ /* CREATE OR REPLACE on not temporary tables require DROP_ACL */
if (lex->create_info.or_replace() && !lex->tmp_table()) if (lex->create_info.or_replace() && !lex->tmp_table())

View File

@ -2,7 +2,7 @@
#define SQL_TYPE_H_INCLUDED #define SQL_TYPE_H_INCLUDED
/* /*
Copyright (c) 2015 MariaDB Foundation. Copyright (c) 2015 MariaDB Foundation.
Copyright (c) 2015, 2021, MariaDB Corporation. Copyright (c) 2015, 2022, 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
@ -3807,8 +3807,8 @@ public:
{ {
return this; return this;
} }
virtual bool partition_field_check(const LEX_CSTRING &field_name, virtual bool partition_field_check(const LEX_CSTRING &field_name, Item *)
Item *item_expr) const const
{ {
partition_field_type_not_allowed(field_name); partition_field_type_not_allowed(field_name);
return true; return true;
@ -4177,8 +4177,8 @@ public:
CHARSET_INFO *cs, CHARSET_INFO *cs,
bool send_error) const bool send_error) const
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return NULL; return nullptr;
} }
Item_literal *create_literal_item(THD *thd, const String *str, Item_literal *create_literal_item(THD *thd, const String *str,
bool send_error) const bool send_error) const
@ -4189,12 +4189,13 @@ public:
virtual Item *create_typecast_item(THD *thd, Item *item, virtual Item *create_typecast_item(THD *thd, Item *item,
const Type_cast_attributes &attr) const const Type_cast_attributes &attr) const
{ {
return NULL; MY_ASSERT_UNREACHABLE();
return nullptr;
} }
virtual Item_copy *create_item_copy(THD *thd, Item *item) const; virtual Item_copy *create_item_copy(THD *thd, Item *item) const;
virtual int cmp_native(const Native &a, const Native &b) const virtual int cmp_native(const Native &a, const Native &b) const
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0; return 0;
} }
virtual bool set_comparator_func(Arg_comparator *cmp) const= 0; virtual bool set_comparator_func(Arg_comparator *cmp) const= 0;
@ -4348,11 +4349,10 @@ class Type_handler_row: public Type_handler
public: public:
virtual ~Type_handler_row() {} virtual ~Type_handler_row() {}
const Name &default_value() const override; const Name &default_value() const override;
bool validate_implicit_default_value(THD *thd, bool validate_implicit_default_value(THD *, const Column_definition &)
const Column_definition &def) const const override
override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
const Type_collection *type_collection() const override; const Type_collection *type_collection() const override;
@ -4366,12 +4366,12 @@ public:
bool can_return_time() const override { return false; } bool can_return_time() const override { return false; }
enum_field_types field_type() const override enum_field_types field_type() const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return MYSQL_TYPE_NULL; return MYSQL_TYPE_NULL;
}; };
protocol_send_type_t protocol_send_type() const override protocol_send_type_t protocol_send_type() const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return PROTOCOL_SEND_STRING; return PROTOCOL_SEND_STRING;
} }
Item_result result_type() const override Item_result result_type() const override
@ -4382,47 +4382,44 @@ public:
{ {
return ROW_RESULT; return ROW_RESULT;
} }
enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr) enum_dynamic_column_type dyncol_type(const Type_all_attributes *)
const override const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return DYN_COL_NULL; return DYN_COL_NULL;
} }
const Type_handler *type_handler_for_comparison() const override; const Type_handler *type_handler_for_comparison() const override;
int stored_field_cmp_to_item(THD *thd, Field *field, Item *item) const override int stored_field_cmp_to_item(THD *, Field *, Item *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0; return 0;
} }
bool subquery_type_allows_materialization(const Item *, const Item *, bool subquery_type_allows_materialization(const Item *, const Item *, bool)
bool) const override
{
DBUG_ASSERT(0);
return false;
}
Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const override
{
DBUG_ASSERT(0);
return NULL;
}
Field *make_conversion_table_field(MEM_ROOT *root,
TABLE *table,
uint metadata,
const Field *target) const override
{
DBUG_ASSERT(0);
return NULL;
}
bool Column_definition_fix_attributes(Column_definition *c) const override
{
return false;
}
void Column_definition_reuse_fix_attributes(THD *thd,
Column_definition *c,
const Field *field)
const override const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return false;
}
Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const
override
{
MY_ASSERT_UNREACHABLE();
return nullptr;
}
Field *make_conversion_table_field(MEM_ROOT *, TABLE *, uint, const Field *)
const override
{
MY_ASSERT_UNREACHABLE();
return nullptr;
}
bool Column_definition_fix_attributes(Column_definition *) const override
{
return false;
}
void Column_definition_reuse_fix_attributes(THD *, Column_definition *,
const Field *) const override
{
MY_ASSERT_UNREACHABLE();
} }
bool Column_definition_prepare_stage1(THD *thd, bool Column_definition_prepare_stage1(THD *thd,
MEM_ROOT *mem_root, MEM_ROOT *mem_root,
@ -4432,28 +4429,25 @@ public:
const Column_derived_attributes const Column_derived_attributes
*derived_attr) *derived_attr)
const override; const override;
bool Column_definition_redefine_stage1(Column_definition *def, bool Column_definition_redefine_stage1(Column_definition *,
const Column_definition *dup, const Column_definition *,
const handler *file) const handler *)
const override const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Column_definition_prepare_stage2(Column_definition *c, bool Column_definition_prepare_stage2(Column_definition *, handler *,
handler *file, ulonglong) const override
ulonglong table_flags) const override
{ {
return false; return false;
} }
Field *make_table_field(MEM_ROOT *root, Field *make_table_field(MEM_ROOT *, const LEX_CSTRING *, const Record_addr &,
const LEX_CSTRING *name, const Type_all_attributes &, TABLE_SHARE *)
const Record_addr &addr, const override
const Type_all_attributes &attr,
TABLE_SHARE *share) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return NULL; return nullptr;
} }
Field *make_table_field_from_def(TABLE_SHARE *share, Field *make_table_field_from_def(TABLE_SHARE *share,
MEM_ROOT *mem_root, MEM_ROOT *mem_root,
@ -4466,76 +4460,73 @@ public:
const SORT_FIELD_ATTR *sort_field, const SORT_FIELD_ATTR *sort_field,
Sort_param *param) const override Sort_param *param) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
} }
uint make_packed_sort_key_part(uchar *to, Item *item, uint make_packed_sort_key_part(uchar *, Item *, const SORT_FIELD_ATTR *,
const SORT_FIELD_ATTR *sort_field, Sort_param *) const override
Sort_param *param) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0; return 0;
} }
void sort_length(THD *thd, const Type_std_attributes *item, void sort_length(THD *, const Type_std_attributes *, SORT_FIELD_ATTR *)
SORT_FIELD_ATTR *attr) const override const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
} }
uint32 max_display_length(const Item *item) const override uint32 max_display_length(const Item *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0; return 0;
} }
uint32 max_display_length_for_field(const Conv_source &src) const override uint32 max_display_length_for_field(const Conv_source &) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0; return 0;
} }
uint32 calc_pack_length(uint32 length) const override uint32 calc_pack_length(uint32) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0; return 0;
} }
bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr, bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr,
Item *a, Item *b) const override; Item *a, Item *b) const override;
uint Item_decimal_precision(const Item *item) const override uint Item_decimal_precision(const Item *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return DECIMAL_MAX_PRECISION; return DECIMAL_MAX_PRECISION;
} }
bool Item_save_in_value(THD *thd, Item *item, st_value *value) const override; bool Item_save_in_value(THD *thd, Item *item, st_value *value) const
override;
bool Item_param_set_from_value(THD *thd, bool Item_param_set_from_value(THD *thd,
Item_param *param, Item_param *param,
const Type_all_attributes *attr, const Type_all_attributes *attr,
const st_value *value) const override; const st_value *value) const override;
bool Item_send(Item *item, Protocol *protocol, st_value *buf) const override bool Item_send(Item *, Protocol *, st_value *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
void Item_update_null_value(Item *item) const override; void Item_update_null_value(Item *item) const override;
int Item_save_in_field(Item *item, Field *field, bool no_conversions) int Item_save_in_field(Item *, Field *, bool) const override
const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 1; return 1;
} }
String *print_item_value(THD *thd, Item *item, String *str) const override; String *print_item_value(THD *thd, Item *item, String *str) const override;
bool can_change_cond_ref_to_const(Item_bool_func2 *target, bool can_change_cond_ref_to_const(Item_bool_func2 *, Item *, Item *,
Item *target_expr, Item *target_value, Item_bool_func2 *, Item *, Item *)
Item_bool_func2 *source,
Item *source_expr, Item *source_const)
const override const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return false; return false;
} }
Item *make_const_item_for_comparison(THD *, Item *src, const Item *cmp) Item *make_const_item_for_comparison(THD *, Item *src, const Item *cmp) const
const override; override;
Item_cache *Item_get_cache(THD *thd, const Item *item) const override; Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
Item_copy *create_item_copy(THD *thd, Item *item) const override Item_copy *create_item_copy(THD *, Item *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return NULL; return nullptr;
} }
bool set_comparator_func(Arg_comparator *cmp) const override; bool set_comparator_func(Arg_comparator *cmp) const override;
bool Item_hybrid_func_fix_attributes(THD *thd, bool Item_hybrid_func_fix_attributes(THD *thd,
@ -4545,188 +4536,187 @@ public:
Item **items, uint nitems) Item **items, uint nitems)
const override const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const override bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_sum_sum_fix_length_and_dec(Item_sum_sum *) const override bool Item_sum_sum_fix_length_and_dec(Item_sum_sum *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_sum_avg_fix_length_and_dec(Item_sum_avg *) const override bool Item_sum_avg_fix_length_and_dec(Item_sum_avg *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_sum_variance_fix_length_and_dec(Item_sum_variance *) const override bool Item_sum_variance_fix_length_and_dec(Item_sum_variance *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_val_bool(Item *item) const override bool Item_val_bool(Item *item) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return false; return false;
} }
void Item_get_date(THD *thd, Item *item, void Item_get_date(THD *, Item *, Temporal::Warn *, MYSQL_TIME *ltime,
Temporal::Warn *warn, MYSQL_TIME *ltime, date_mode_t) const override
date_mode_t fuzzydate) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
set_zero_time(ltime, MYSQL_TIMESTAMP_NONE); set_zero_time(ltime, MYSQL_TIMESTAMP_NONE);
} }
longlong Item_val_int_signed_typecast(Item *item) const override longlong Item_val_int_signed_typecast(Item *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0; return 0;
} }
longlong Item_val_int_unsigned_typecast(Item *item) const override longlong Item_val_int_unsigned_typecast(Item *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0; return 0;
} }
String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str) String *Item_func_hex_val_str_ascii(Item_func_hex *, String *) const override
const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return NULL; return nullptr;
} }
String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *, String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *,
String *) const override String *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return NULL; return nullptr;
} }
double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *) double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *)
const override const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0.0; return 0.0;
} }
longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *) longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *)
const override const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0; return 0;
} }
my_decimal *Item_func_hybrid_field_type_val_decimal( my_decimal *Item_func_hybrid_field_type_val_decimal(
Item_func_hybrid_field_type *, Item_func_hybrid_field_type *,
my_decimal *) const override my_decimal *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return NULL; return nullptr;
} }
void Item_func_hybrid_field_type_get_date(THD *, void Item_func_hybrid_field_type_get_date(THD *,
Item_func_hybrid_field_type *, Item_func_hybrid_field_type *,
Temporal::Warn *, Temporal::Warn *,
MYSQL_TIME *ltime, MYSQL_TIME *ltime,
date_mode_t fuzzydate) date_mode_t) const override
const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
set_zero_time(ltime, MYSQL_TIMESTAMP_NONE); set_zero_time(ltime, MYSQL_TIMESTAMP_NONE);
} }
String *Item_func_min_max_val_str(Item_func_min_max *, String *) const override String *Item_func_min_max_val_str(Item_func_min_max *, String *) const
override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return NULL; return nullptr;
} }
double Item_func_min_max_val_real(Item_func_min_max *) const override double Item_func_min_max_val_real(Item_func_min_max *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0; return 0;
} }
longlong Item_func_min_max_val_int(Item_func_min_max *) const override longlong Item_func_min_max_val_int(Item_func_min_max *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0; return 0;
} }
my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *, my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
my_decimal *) const override my_decimal *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return NULL; return nullptr;
} }
bool Item_func_min_max_get_date(THD *thd, Item_func_min_max*, bool Item_func_min_max_get_date(THD *, Item_func_min_max*, MYSQL_TIME *,
MYSQL_TIME *, date_mode_t fuzzydate) date_mode_t) const override
const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_func_between_fix_length_and_dec(Item_func_between *func) bool Item_func_between_fix_length_and_dec(Item_func_between *) const override
const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
longlong Item_func_between_val_int(Item_func_between *func) const override; longlong Item_func_between_val_int(Item_func_between *func) const override;
cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override; cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override;
in_vector *make_in_vector(THD *thd, const Item_func_in *f, uint nargs) in_vector *make_in_vector(THD *thd, const Item_func_in *f, uint nargs) const
const override; override;
bool Item_func_in_fix_comparator_compatible_types(THD *thd, Item_func_in *) bool Item_func_in_fix_comparator_compatible_types(THD *thd,
const override; Item_func_in *) const
override;
bool Item_func_round_fix_length_and_dec(Item_func_round *) const override; bool Item_func_round_fix_length_and_dec(Item_func_round *) const override;
bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *) const override; bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *) const
override;
bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const override; bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const override;
bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const override; bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const override;
bool Item_func_signed_fix_length_and_dec(Item_func_signed *) const override bool Item_func_signed_fix_length_and_dec(Item_func_signed *) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_func_unsigned_fix_length_and_dec(Item_func_unsigned *) const override bool Item_func_unsigned_fix_length_and_dec(Item_func_unsigned *) const
override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_double_typecast_fix_length_and_dec(Item_double_typecast *) bool Item_double_typecast_fix_length_and_dec(Item_double_typecast *) const
const override override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_float_typecast_fix_length_and_dec(Item_float_typecast *) bool Item_float_typecast_fix_length_and_dec(Item_float_typecast *) const
const override override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_decimal_typecast_fix_length_and_dec(Item_decimal_typecast *) bool Item_decimal_typecast_fix_length_and_dec(Item_decimal_typecast *) const
const override override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_char_typecast_fix_length_and_dec(Item_char_typecast *) bool Item_char_typecast_fix_length_and_dec(Item_char_typecast *) const
const override override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_time_typecast_fix_length_and_dec(Item_time_typecast *) bool Item_time_typecast_fix_length_and_dec(Item_time_typecast *) const
const override override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_date_typecast_fix_length_and_dec(Item_date_typecast *) bool Item_date_typecast_fix_length_and_dec(Item_date_typecast *) const
const override override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
bool Item_datetime_typecast_fix_length_and_dec(Item_datetime_typecast *) bool Item_datetime_typecast_fix_length_and_dec(Item_datetime_typecast *)
const override const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return true; return true;
} }
@ -4746,8 +4736,6 @@ class Type_handler_numeric: public Type_handler
public: public:
const Name &default_value() const override; const Name &default_value() const override;
String *print_item_value(THD *thd, Item *item, String *str) const override; String *print_item_value(THD *thd, Item *item, String *str) const override;
double Item_func_min_max_val_real(Item_func_min_max *) const override;
longlong Item_func_min_max_val_int(Item_func_min_max *) const override;
bool Column_definition_prepare_stage1(THD *thd, bool Column_definition_prepare_stage1(THD *thd,
MEM_ROOT *mem_root, MEM_ROOT *mem_root,
Column_definition *c, Column_definition *c,
@ -4756,19 +4744,23 @@ public:
const Column_derived_attributes const Column_derived_attributes
*derived_attr) *derived_attr)
const override; const override;
double Item_func_min_max_val_real(Item_func_min_max *) const override;
longlong Item_func_min_max_val_int(Item_func_min_max *) const override;
my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *, my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
my_decimal *) const override; my_decimal *) const override;
bool Item_func_min_max_get_date(THD *thd, Item_func_min_max*, bool Item_func_min_max_get_date(THD *thd, Item_func_min_max*,
MYSQL_TIME *, date_mode_t fuzzydate) MYSQL_TIME *, date_mode_t fuzzydate) const
const override; override;
virtual ~Type_handler_numeric() { } virtual ~Type_handler_numeric() { }
bool can_change_cond_ref_to_const(Item_bool_func2 *target, bool can_change_cond_ref_to_const(Item_bool_func2 *target,
Item *target_expr, Item *target_value, Item *target_expr, Item *target_value,
Item_bool_func2 *source, Item_bool_func2 *source,
Item *source_expr, Item *source_const) Item *source_expr, Item *source_const) const
const override; override;
bool Item_func_between_fix_length_and_dec(Item_func_between *func) const override; bool Item_func_between_fix_length_and_dec(Item_func_between *func) const
bool Item_char_typecast_fix_length_and_dec(Item_char_typecast *) const override; override;
bool Item_char_typecast_fix_length_and_dec(Item_char_typecast *) const
override;
}; };
@ -5263,8 +5255,8 @@ public:
return type_limits_int()->char_length(); return type_limits_int()->char_length();
} }
uint32 Item_decimal_notation_int_digits(const Item *item) const override; uint32 Item_decimal_notation_int_digits(const Item *item) const override;
bool partition_field_check(const LEX_CSTRING &field_name, bool partition_field_check(const LEX_CSTRING &, Item *item_expr)
Item *item_expr) const override const override
{ {
return partition_field_check_result_type(item_expr, INT_RESULT); return partition_field_check_result_type(item_expr, INT_RESULT);
} }
@ -6102,8 +6094,8 @@ public:
const override; const override;
bool Item_param_val_native(THD *thd, Item_param *item, Native *to) bool Item_param_val_native(THD *thd, Item_param *item, Native *to)
const override; const override;
bool partition_field_check(const LEX_CSTRING &field_name, bool partition_field_check(const LEX_CSTRING &, Item *item_expr)
Item *item_expr) const override const override
{ {
return partition_field_check_result_type(item_expr, STRING_RESULT); return partition_field_check_result_type(item_expr, STRING_RESULT);
} }
@ -6312,8 +6304,8 @@ public:
{ {
return true; return true;
} }
bool partition_field_check(const LEX_CSTRING &field_name, bool partition_field_check(const LEX_CSTRING &, Item *item_expr)
Item *item_expr) const override const override
{ {
return partition_field_check_result_type(item_expr, STRING_RESULT); return partition_field_check_result_type(item_expr, STRING_RESULT);
} }
@ -6442,8 +6434,8 @@ public:
{ {
return true; return true;
} }
bool partition_field_check(const LEX_CSTRING &field_name, bool partition_field_check(const LEX_CSTRING &, Item *item_expr)
Item *item_expr) const override const override
{ {
return partition_field_check_result_type(item_expr, STRING_RESULT); return partition_field_check_result_type(item_expr, STRING_RESULT);
} }
@ -6893,12 +6885,13 @@ public:
bool is_param_long_data_type() const override { return true; } bool is_param_long_data_type() const override { return true; }
uint32 max_display_length_for_field(const Conv_source &src) const override; uint32 max_display_length_for_field(const Conv_source &src) const override;
uint32 calc_pack_length(uint32 length) const override { return length; } uint32 calc_pack_length(uint32 length) const override { return length; }
const Type_handler *type_handler_for_tmp_table(const Item *item) const override const Type_handler *type_handler_for_tmp_table(const Item *item) const
override
{ {
return varstring_type_handler(item); return varstring_type_handler(item);
} }
bool partition_field_check(const LEX_CSTRING &field_name, bool partition_field_check(const LEX_CSTRING &, Item *item_expr)
Item *item_expr) const override const override
{ {
return partition_field_check_result_type(item_expr, STRING_RESULT); return partition_field_check_result_type(item_expr, STRING_RESULT);
} }
@ -6985,7 +6978,8 @@ public:
{ {
return (length + (length < 256 ? 1: 2)); return (length + (length < 256 ? 1: 2));
} }
const Type_handler *type_handler_for_tmp_table(const Item *item) const override const Type_handler *type_handler_for_tmp_table(const Item *item) const
override
{ {
return varstring_type_handler(item); return varstring_type_handler(item);
} }
@ -6994,8 +6988,8 @@ public:
return varstring_type_handler(item); return varstring_type_handler(item);
} }
bool is_param_long_data_type() const override { return true; } bool is_param_long_data_type() const override { return true; }
bool partition_field_check(const LEX_CSTRING &field_name, bool partition_field_check(const LEX_CSTRING &, Item *item_expr)
Item *item_expr) const override const override
{ {
return partition_field_check_result_type(item_expr, STRING_RESULT); return partition_field_check_result_type(item_expr, STRING_RESULT);
} }
@ -7055,12 +7049,12 @@ public:
} }
ulong KEY_pack_flags(uint column_nr) const override ulong KEY_pack_flags(uint column_nr) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0; return 0;
} }
uint32 max_display_length_for_field(const Conv_source &src) const override; uint32 max_display_length_for_field(const Conv_source &src) const override;
bool partition_field_check(const LEX_CSTRING &field_name, bool partition_field_check(const LEX_CSTRING &field_name, Item *)
Item *item_expr) const override const override
{ {
partition_field_type_not_allowed(field_name); partition_field_type_not_allowed(field_name);
return true; return true;
@ -7178,7 +7172,8 @@ class Type_handler_medium_blob: public Type_handler_blob_common
public: public:
virtual ~Type_handler_medium_blob() {} virtual ~Type_handler_medium_blob() {}
uint length_bytes() const override { return 3; } uint length_bytes() const override { return 3; }
enum_field_types field_type() const override { return MYSQL_TYPE_MEDIUM_BLOB; } enum_field_types field_type() const override
{ return MYSQL_TYPE_MEDIUM_BLOB; }
uint32 max_display_length_for_field(const Conv_source &src) const override; uint32 max_display_length_for_field(const Conv_source &src) const override;
uint32 calc_pack_length(uint32 length) const override; uint32 calc_pack_length(uint32 length) const override;
Field *make_table_field(MEM_ROOT *root, Field *make_table_field(MEM_ROOT *root,
@ -7235,7 +7230,7 @@ public:
} }
ulong KEY_pack_flags(uint) const override ulong KEY_pack_flags(uint) const override
{ {
DBUG_ASSERT(0); MY_ASSERT_UNREACHABLE();
return 0; return 0;
} }
uint32 max_display_length_for_field(const Conv_source &src) const override; uint32 max_display_length_for_field(const Conv_source &src) const override;

View File

@ -471,19 +471,20 @@ void wsrep_recover_sr_from_storage(THD *orig_thd)
if (!wsrep_schema) if (!wsrep_schema)
{ {
WSREP_ERROR("Wsrep schema not initialized when trying to recover " WSREP_ERROR("Wsrep schema not initialized when trying to recover "
"streaming transactions"); "streaming transactions: wsrep_on %d", WSREP_ON);
unireg_abort(1); trans_commit(orig_thd);
} }
if (wsrep_schema->recover_sr_transactions(orig_thd)) if (wsrep_schema->recover_sr_transactions(orig_thd))
{ {
WSREP_ERROR("Failed to recover SR transactions from schema"); WSREP_ERROR("Failed to recover SR transactions from schema: wsrep_on : %d", WSREP_ON);
unireg_abort(1); trans_commit(orig_thd);
} }
break; break;
default: default:
/* */ /* */
WSREP_ERROR("Unsupported wsrep SR store type: %lu", wsrep_SR_store_type); WSREP_ERROR("Unsupported wsrep SR store type: %lu wsrep_on: %d",
unireg_abort(1); wsrep_SR_store_type, WSREP_ON);
trans_commit(orig_thd);
break; break;
} }
} }
@ -2355,7 +2356,7 @@ static int wsrep_TOI_begin(THD *thd, const char *db, const char *table,
ret, ret,
(thd->db.str ? thd->db.str : "(null)"), (thd->db.str ? thd->db.str : "(null)"),
wsrep_thd_query(thd)); wsrep_thd_query(thd));
my_error(ER_ERROR_DURING_COMMIT, MYF(0), WSREP_SIZE_EXCEEDED); my_error(ER_UNKNOWN_ERROR, MYF(0), "Maximum writeset size exceeded");
break; break;
case wsrep::e_deadlock_error: case wsrep::e_deadlock_error:
WSREP_WARN("TO isolation failed for: %d, schema: %s, sql: %s. " WSREP_WARN("TO isolation failed for: %d, schema: %s, sql: %s. "

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2013-2021 Codership Oy <info@codership.com> /* Copyright (C) 2013-2022 Codership Oy <info@codership.com>
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

@ -1,4 +1,4 @@
/* Copyright (C) 2013-2021 Codership Oy <info@codership.com> /* Copyright (C) 2013-2022 Codership Oy <info@codership.com>
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
@ -182,7 +182,7 @@ void wsrep_reset_threadvars(THD *);
so don't override those by default so don't override those by default
*/ */
static inline void wsrep_override_error(THD *thd, uint error) static inline void wsrep_override_error(THD *thd, uint error, const char *format= 0, ...)
{ {
DBUG_ASSERT(error != ER_ERROR_DURING_COMMIT); DBUG_ASSERT(error != ER_ERROR_DURING_COMMIT);
Diagnostics_area *da= thd->get_stmt_da(); Diagnostics_area *da= thd->get_stmt_da();
@ -195,26 +195,11 @@ static inline void wsrep_override_error(THD *thd, uint error)
da->sql_errno() != ER_LOCK_DEADLOCK)) da->sql_errno() != ER_LOCK_DEADLOCK))
{ {
da->reset_diagnostics_area(); da->reset_diagnostics_area();
my_error(error, MYF(0)); va_list args;
} va_start(args, format);
} if (!format) format= ER_THD(thd, error);
my_printv_error(error, format, MYF(0), args);
/** va_end(args);
Override error with additional wsrep status.
*/
static inline void wsrep_override_error(THD *thd, uint error,
enum wsrep::provider::status status)
{
Diagnostics_area *da= thd->get_stmt_da();
if (da->is_ok() ||
!da->is_set() ||
(da->is_error() &&
da->sql_errno() != error &&
da->sql_errno() != ER_ERROR_DURING_COMMIT &&
da->sql_errno() != ER_LOCK_DEADLOCK))
{
da->reset_diagnostics_area();
my_error(error, MYF(0), status);
} }
} }
@ -226,7 +211,10 @@ static inline void wsrep_override_error(THD* thd,
switch (ce) switch (ce)
{ {
case wsrep::e_error_during_commit: case wsrep::e_error_during_commit:
wsrep_override_error(thd, ER_ERROR_DURING_COMMIT, status); if (status == wsrep::provider::error_size_exceeded)
wsrep_override_error(thd, ER_UNKNOWN_ERROR, "Maximum writeset size exceeded");
else
wsrep_override_error(thd, ER_ERROR_DURING_COMMIT, 0, status);
break; break;
case wsrep::e_deadlock_error: case wsrep::e_deadlock_error:
wsrep_override_error(thd, ER_LOCK_DEADLOCK); wsrep_override_error(thd, ER_LOCK_DEADLOCK);
@ -235,11 +223,11 @@ static inline void wsrep_override_error(THD* thd,
wsrep_override_error(thd, ER_QUERY_INTERRUPTED); wsrep_override_error(thd, ER_QUERY_INTERRUPTED);
break; break;
case wsrep::e_size_exceeded_error: case wsrep::e_size_exceeded_error:
wsrep_override_error(thd, ER_ERROR_DURING_COMMIT, status); wsrep_override_error(thd, ER_UNKNOWN_ERROR, "Maximum writeset size exceeded");
break; break;
case wsrep::e_append_fragment_error: case wsrep::e_append_fragment_error:
/* TODO: Figure out better error number */ /* TODO: Figure out better error number */
wsrep_override_error(thd, ER_ERROR_DURING_COMMIT, status); wsrep_override_error(thd, ER_ERROR_DURING_COMMIT, 0, status);
break; break;
case wsrep::e_not_supported_error: case wsrep::e_not_supported_error:
wsrep_override_error(thd, ER_NOT_SUPPORTED_YET); wsrep_override_error(thd, ER_NOT_SUPPORTED_YET);

View File

@ -1,4 +1,4 @@
/* Copyright 2016-2019 Codership Oy <http://www.codership.com> /* Copyright 2016-2022 Codership Oy <http://www.codership.com>
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

@ -1,4 +1,4 @@
/* Copyright 2008-2021 Codership Oy <http://www.codership.com> /* Copyright 2008-2022 Codership Oy <http://www.codership.com>
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
@ -123,8 +123,7 @@ bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type)
if (wsrep_init()) if (wsrep_init())
{ {
my_error(ER_CANT_OPEN_LIBRARY, MYF(0), tmp, my_error, "wsrep_init failed"); my_error(ER_CANT_OPEN_LIBRARY, MYF(0), tmp, errno, "wsrep_init failed");
//rcode= true;
saved_wsrep_on= false; saved_wsrep_on= false;
} }
@ -803,10 +802,21 @@ bool wsrep_slave_threads_update (sys_var *self, THD* thd, enum_var_type type)
{ {
WSREP_DEBUG("Creating %d applier threads, total %ld", wsrep_slave_count_change, wsrep_slave_threads); WSREP_DEBUG("Creating %d applier threads, total %ld", wsrep_slave_count_change, wsrep_slave_threads);
res= wsrep_create_appliers(wsrep_slave_count_change, true); res= wsrep_create_appliers(wsrep_slave_count_change, true);
mysql_mutex_unlock(&LOCK_global_system_variables);
mysql_mutex_unlock(&LOCK_wsrep_slave_threads);
// Thread creation and execution is asyncronous, therefore we need
// wait them to be started or error produced
while (wsrep_running_applier_threads != (ulong)wsrep_slave_threads)
{
my_sleep(1000);
}
mysql_mutex_lock(&LOCK_global_system_variables);
WSREP_DEBUG("Running %lu applier threads", wsrep_running_applier_threads); WSREP_DEBUG("Running %lu applier threads", wsrep_running_applier_threads);
wsrep_slave_count_change = 0; wsrep_slave_count_change = 0;
} }
else
mysql_mutex_unlock(&LOCK_wsrep_slave_threads); mysql_mutex_unlock(&LOCK_wsrep_slave_threads);
return res; return res;

View File

@ -539,6 +539,11 @@ IF(MSVC)
# on generated file. # on generated file.
TARGET_COMPILE_OPTIONS(innobase PRIVATE "/wd4065") TARGET_COMPILE_OPTIONS(innobase PRIVATE "/wd4065")
ENDIF() ENDIF()
IF(CMAKE_C_COMPILER_ID MATCHES "Clang" AND
NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "13.0.0")
ADD_COMPILE_FLAGS(pars/pars0grm.cc fts/fts0pars.cc
COMPILE_FLAGS "-Wno-unused-but-set-variable")
ENDIF()
IF(NOT (PLUGIN_INNOBASE STREQUAL DYNAMIC)) IF(NOT (PLUGIN_INNOBASE STREQUAL DYNAMIC))
TARGET_LINK_LIBRARIES(innobase tpool mysys) TARGET_LINK_LIBRARIES(innobase tpool mysys)

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 2014, 2019, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2014, 2019, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2021, MariaDB Corporation. Copyright (c) 2017, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -752,6 +752,11 @@ bool
PageBulk::isSpaceAvailable( PageBulk::isSpaceAvailable(
ulint rec_size) ulint rec_size)
{ {
if (m_rec_no >= 8190) {
ut_ad(srv_page_size == 65536);
return false;
}
ulint slot_size; ulint slot_size;
ulint required_space; ulint required_space;

View File

@ -335,7 +335,7 @@ static int mrn_change_encoding(grn_ctx *ctx, const CHARSET_INFO *charset)
return mrn::encoding::set(ctx, charset); return mrn::encoding::set(ctx, charset);
} }
#if !defined(DBUG_OFF) && !defined(_lint) #if defined DBUG_TRACE && !defined(_lint)
static const char *mrn_inspect_thr_lock_type(enum thr_lock_type lock_type) static const char *mrn_inspect_thr_lock_type(enum thr_lock_type lock_type)
{ {
const char *inspected = "<unknown>"; const char *inspected = "<unknown>";
@ -3372,7 +3372,6 @@ int ha_mroonga::wrapper_create_index(const char *name, TABLE *table,
index_tables, NULL, tmp_share); index_tables, NULL, tmp_share);
} }
} }
}
if (error) { if (error) {
for (uint j = 0; j < i; j++) { for (uint j = 0; j < i; j++) {
@ -3383,6 +3382,7 @@ int ha_mroonga::wrapper_create_index(const char *name, TABLE *table,
grn_obj_remove(ctx, grn_table); grn_obj_remove(ctx, grn_table);
grn_table = NULL; grn_table = NULL;
} }
}
MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables);
DBUG_RETURN(error); DBUG_RETURN(error);
} }

View File

@ -828,8 +828,8 @@ grn_free_default(grn_ctx *ctx, void *ptr,
if (ptr) { if (ptr) {
GRN_ADD_ALLOC_COUNT(-1); GRN_ADD_ALLOC_COUNT(-1);
} else { } else {
GRN_LOG(ctx, GRN_LOG_ALERT, "free fail (%p) (%s:%d) <%d>", GRN_LOG(ctx, GRN_LOG_ALERT, "free fail (%s:%d) <%d>",
ptr, file, line, alloc_count); file, line, alloc_count);
} }
} }
} }

View File

@ -3591,16 +3591,14 @@ grn_obj_search_column_index_by_key(grn_ctx *ctx, grn_obj *obj,
if (need_cast) { if (need_cast) {
GRN_OBJ_INIT(&casted_query, GRN_BULK, 0, key_type); GRN_OBJ_INIT(&casted_query, GRN_BULK, 0, key_type);
rc = grn_obj_cast(ctx, query, &casted_query, GRN_FALSE); rc = grn_obj_cast(ctx, query, &casted_query, GRN_FALSE);
if (rc == GRN_SUCCESS) { if (rc != GRN_SUCCESS)
key = GRN_BULK_HEAD(&casted_query); goto fail;
key_len = GRN_BULK_VSIZE(&casted_query); query = &casted_query;
} }
} else {
rc = GRN_SUCCESS;
key = GRN_BULK_HEAD(query); key = GRN_BULK_HEAD(query);
key_len = GRN_BULK_VSIZE(query); key_len = GRN_BULK_VSIZE(query);
}
if (rc == GRN_SUCCESS) {
if (grn_logger_pass(ctx, GRN_REPORT_INDEX_LOG_LEVEL)) { if (grn_logger_pass(ctx, GRN_REPORT_INDEX_LOG_LEVEL)) {
const char *tag; const char *tag;
if (optarg) { if (optarg) {
@ -3637,7 +3635,7 @@ grn_obj_search_column_index_by_key(grn_ctx *ctx, grn_obj *obj,
} }
rc = grn_ii_sel(ctx, (grn_ii *)obj, key, key_len, rc = grn_ii_sel(ctx, (grn_ii *)obj, key, key_len,
(grn_hash *)res, op, optarg); (grn_hash *)res, op, optarg);
} fail:
if (need_cast) { if (need_cast) {
GRN_OBJ_FIN(ctx, &casted_query); GRN_OBJ_FIN(ctx, &casted_query);
} }

View File

@ -861,6 +861,13 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked)
} }
} }
DBUG_EXECUTE_IF("key",
Debug_key_myisam::print_keys_myisam(table->in_use,
"ha_myisam::open: ",
table, file->s->keyinfo,
file->s->base.keys);
);
if (test_if_locked & (HA_OPEN_IGNORE_IF_LOCKED | HA_OPEN_TMP_TABLE)) if (test_if_locked & (HA_OPEN_IGNORE_IF_LOCKED | HA_OPEN_TMP_TABLE))
(void) mi_extra(file, HA_EXTRA_NO_WAIT_LOCK, 0); (void) mi_extra(file, HA_EXTRA_NO_WAIT_LOCK, 0);

View File

@ -34,8 +34,10 @@ SCHEMA="wsrep"
MEMB_TABLE="$SCHEMA.membership" MEMB_TABLE="$SCHEMA.membership"
STATUS_TABLE="$SCHEMA.status" STATUS_TABLE="$SCHEMA.status"
BEGIN=" WSREP_ON='SET wsrep_on=ON'
SET wsrep_on=0; WSREP_OFF='SET wsrep_on=OFF'
BEGIN="$WSREP_OFF;
DROP SCHEMA IF EXISTS $SCHEMA; CREATE SCHEMA $SCHEMA; DROP SCHEMA IF EXISTS $SCHEMA; CREATE SCHEMA $SCHEMA;
CREATE TABLE $MEMB_TABLE ( CREATE TABLE $MEMB_TABLE (
idx INT UNIQUE PRIMARY KEY, idx INT UNIQUE PRIMARY KEY,
@ -50,9 +52,8 @@ CREATE TABLE $STATUS_TABLE (
uuid CHAR(40), /* cluster UUID */ uuid CHAR(40), /* cluster UUID */
prim BOOLEAN /* if component is primary */ prim BOOLEAN /* if component is primary */
) ENGINE=MEMORY; ) ENGINE=MEMORY;
BEGIN; BEGIN"
" END="COMMIT; $WSREP_ON"
END="COMMIT;"
configuration_change() configuration_change()
{ {
@ -71,12 +72,12 @@ configuration_change()
echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);" echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
echo "$END" echo "$END;"
} }
status_update() status_update()
{ {
echo "SET wsrep_on=0; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; COMMIT;" echo "$WSREP_OFF; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; $END;"
} }
trim_string() trim_string()
@ -186,10 +187,14 @@ then
fi fi
fi fi
# Undefined means node is shutting down case "$STATUS" in
if [ "$STATUS" != 'Undefined' ]; then 'joined' | 'donor' | 'synced')
"$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\ "$COM" | eval "$CLIENT" -B "-u'$USER'"${PSWD:+" -p'$PSWD'"}\
"-h'$HOST'" "-P$PORT"$SSL_PARAM "-h'$HOST'" "-P$PORT"$SSL_PARAM
fi ;;
*)
# The node might be shutting down or not initialized
;;
esac
exit 0 exit 0