Skip to content

Commit

Permalink
Merge 10.5 into 10.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Dec 5, 2022
2 parents 0a7d85c + dd20a43 commit e55397a
Show file tree
Hide file tree
Showing 47 changed files with 656 additions and 22 deletions.
3 changes: 3 additions & 0 deletions client/mysqlcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,10 @@ static int dbConnect(char *host, char *user, char *passwd)
opt_ssl_capath, opt_ssl_cipher);
mysql_options(&mysql_connection, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(&mysql_connection, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
mysql_options(&mysql_connection, MARIADB_OPT_TLS_VERSION, opt_tls_version);
}
mysql_options(&mysql_connection, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert);
#endif
if (opt_protocol)
mysql_options(&mysql_connection,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
Expand Down
3 changes: 3 additions & 0 deletions client/mysqlslap.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,10 @@ void set_mysql_connect_options(MYSQL *mysql)
opt_ssl_capath, opt_ssl_cipher);
mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
mysql_options(mysql, MARIADB_OPT_TLS_VERSION, opt_tls_version);
}
mysql_options(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert);
#endif
if (opt_protocol)
mysql_options(mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
Expand Down
1 change: 1 addition & 0 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9824,6 +9824,7 @@ int main(int argc, char **argv)
opt_ssl_capath, opt_ssl_cipher);
mysql_options(con->mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(con->mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
mysql_options(con->mysql, MARIADB_OPT_TLS_VERSION, opt_tls_version);
#if MYSQL_VERSION_ID >= 50000
/* Turn on ssl_verify_server_cert only if host is "localhost" */
opt_ssl_verify_server_cert= opt_host && !strcmp(opt_host, "localhost");
Expand Down
19 changes: 19 additions & 0 deletions extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3880,6 +3880,21 @@ static dberr_t xb_assign_undo_space_start()
return error;
}

/** Close all undo tablespaces while applying incremental delta */
static void xb_close_undo_tablespaces()
{
if (srv_undo_space_id_start == 0)
return;
for (ulint space_id= srv_undo_space_id_start;
space_id < srv_undo_space_id_start + srv_undo_tablespaces_open;
space_id++)
{
fil_space_t *space= fil_space_get(space_id);
ut_ad(space);
space->close();
}
}

/****************************************************************************
Populates the tablespace memory cache by scanning for and opening data files.
@returns DB_SUCCESS or error code.*/
Expand Down Expand Up @@ -3943,6 +3958,10 @@ xb_load_tablespaces()
return(err);
}

if (srv_operation == SRV_OPERATION_RESTORE_DELTA) {
xb_close_undo_tablespaces();
}

DBUG_MARIABACKUP_EVENT("after_load_tablespaces", {});
return(DB_SUCCESS);
}
Expand Down
4 changes: 2 additions & 2 deletions include/sslopt-longopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
&opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-crl", OPT_SSL_KEY, "Certificate revocation list (implies --ssl).",
{"ssl-crl", OPT_SSL_CRL, "Certificate revocation list (implies --ssl).",
&opt_ssl_crl, &opt_ssl_crl, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-crlpath", OPT_SSL_KEY,
{"ssl-crlpath", OPT_SSL_CRLPATH,
"Certificate revocation list path (implies --ssl).",
&opt_ssl_crlpath, &opt_ssl_crlpath, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
Expand Down
25 changes: 25 additions & 0 deletions mysql-test/main/ctype_tis620.result
Original file line number Diff line number Diff line change
Expand Up @@ -4432,3 +4432,28 @@ HEX(WEIGHT_STRING(_tis620 'a\0b' COLLATE tis620_thai_nopad_ci))
#
# End of 10.2 tests
#
#
# Start of 10.4 tests
#
#
# MDEV-27670 Assertion `(cs->state & 0x20000) == 0' failed in my_strnncollsp_nchars_generic_8bit
#
CREATE OR REPLACE TABLE t1
(
a VARCHAR(250) COLLATE tis620_thai_nopad_ci,
UNIQUE KEY(a(100)) USING HASH
) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('a'),('A');
ERROR 23000: Duplicate entry 'A' for key 'a'
DROP TABLE t1;
CREATE OR REPLACE TABLE t1
(
a CHAR(250) COLLATE tis620_thai_nopad_ci,
UNIQUE KEY(a(100)) USING HASH
) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('a'),('A');
ERROR 23000: Duplicate entry 'A' for key 'a'
DROP TABLE t1;
#
# End of 10.4 tests
#
31 changes: 31 additions & 0 deletions mysql-test/main/ctype_tis620.test
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,34 @@ SELECT HEX(WEIGHT_STRING(_tis620 'a\0b' COLLATE tis620_thai_nopad_ci));
--echo #
--echo # End of 10.2 tests
--echo #

--echo #
--echo # Start of 10.4 tests
--echo #

--echo #
--echo # MDEV-27670 Assertion `(cs->state & 0x20000) == 0' failed in my_strnncollsp_nchars_generic_8bit
--echo #

CREATE OR REPLACE TABLE t1
(
a VARCHAR(250) COLLATE tis620_thai_nopad_ci,
UNIQUE KEY(a(100)) USING HASH
) ENGINE=MyISAM;
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES ('a'),('A');
DROP TABLE t1;

CREATE OR REPLACE TABLE t1

(
a CHAR(250) COLLATE tis620_thai_nopad_ci,
UNIQUE KEY(a(100)) USING HASH
) ENGINE=MyISAM;
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES ('a'),('A');
DROP TABLE t1;

--echo #
--echo # End of 10.4 tests
--echo #
17 changes: 17 additions & 0 deletions mysql-test/suite/galera/r/MDEV-25389.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
connection node_2;
connection node_1;
connection node_1;
connection node_2;
connection node_2;
call mtr.add_suppression("WSREP: Failed to create/initialize system thread");
SET GLOBAL debug_dbug='+d,wsrep_simulate_failed_connection_1';
SET GLOBAL wsrep_slave_threads=2;
ERROR HY000: Incorrect arguments to SET
SELECT @@wsrep_slave_threads;
@@wsrep_slave_threads
1
SET GLOBAL debug_dbug='';
SET GLOBAL wsrep_slave_threads=1;
SELECT @@wsrep_slave_threads;
@@wsrep_slave_threads
1
40 changes: 40 additions & 0 deletions mysql-test/suite/galera/r/MDEV-29512.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 int, f3 varchar(2000));
INSERT INTO t1 VALUES (1, 0, REPEAT('1234567890', 200));
INSERT INTO t1 VALUES (3, 3, REPEAT('1234567890', 200));
SET SESSION wsrep_sync_wait=0;
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb";
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
SET SESSION wsrep_sync_wait=0;
connection node_1;
begin;
select f1,f2 from t1;
f1 f2
1 0
3 3
connection node_2;
UPDATE t1 SET f2=2 WHERE f1=3;
connection node_1a;
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
connection node_1;
UPDATE t1 SET f2=1 WHERE f1=3;
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync';
COMMIT;
connection node_1a;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync';
SET GLOBAL DEBUG_DBUG = "";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
SET GLOBAL debug_dbug = NULL;
SET debug_sync='RESET';
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
select f1,f2 from t1;
f1 f2
1 0
3 2
DROP TABLE t1;
6 changes: 3 additions & 3 deletions mysql-test/suite/galera/r/galera_var_dirty_reads.result
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status Disconnected
SELECT * FROM t1;
Got one of the listed errors
ERROR 08S01: WSREP has not yet prepared node for application use
SELECT 1 FROM t1;
Got one of the listed errors
ERROR 08S01: WSREP has not yet prepared node for application use
SET @@session.wsrep_dirty_reads=ON;
SELECT * FROM t1;
i
Expand All @@ -34,7 +34,7 @@ i variable_name variable_value
1 WSREP_DIRTY_READS ON
SET @@session.wsrep_dirty_reads=OFF;
SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
Got one of the listed errors
ERROR 08S01: WSREP has not yet prepared node for application use
SELECT 1;
1
1
Expand Down
24 changes: 24 additions & 0 deletions mysql-test/suite/galera/t/MDEV-25389.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--source include/galera_cluster.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc

--let $node_1=node_1
--let $node_2=node_2
--source ../galera/include/auto_increment_offset_save.inc

--connection node_2
call mtr.add_suppression("WSREP: Failed to create/initialize system thread");
SET GLOBAL debug_dbug='+d,wsrep_simulate_failed_connection_1';
--error ER_WRONG_ARGUMENTS
SET GLOBAL wsrep_slave_threads=2;
SELECT @@wsrep_slave_threads;
SET GLOBAL debug_dbug='';
SET GLOBAL wsrep_slave_threads=1;
SELECT @@wsrep_slave_threads;

# MDEV-29878: this test caused a subsequent test to fail
# during shutdown. Do a restart here, to make sure the
# issue is fixed.
--source include/restart_mysqld.inc

--source ../galera/include/auto_increment_offset_restore.inc
15 changes: 15 additions & 0 deletions mysql-test/suite/galera/t/MDEV-29512.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
!include ../galera_2nodes.cnf

[mysqld]
log-bin
log-slave-updates

[mysqld.1]
log_bin
log_slave_updates
max-binlog-size=4096
expire-logs-days=1


[mysqld.2]

91 changes: 91 additions & 0 deletions mysql-test/suite/galera/t/MDEV-29512.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#
# This test is for reproducing the issue in:
# https://jira.mariadb.org/browse/MDEV-29512
#
# The hanging in MDEV-29512 happens when binlog purging is attempted, and there is
# one local BF aborted transaction waiting for commit monitor.
#
# The test will launch two node cluster and enable binlogging with expire log days,
# to force binlog purging to happen.
# A local transaction is executed so that will become BF abort victim, and has advanced
# to replication stage waiting for commit monitor for final cleanup (to mark position in innodb)
# after that, applier is released to complete the BF abort and due to binlog configuration,
# starting the binlog purging. This is where the hanging would occur, if code is buggy
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_debug_sync.inc
--source include/galera_have_debug_sync.inc

#
# binlog size is limited to 4096 bytes, we will create enough events to
# cause binlog rotation
#
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 int, f3 varchar(2000));
INSERT INTO t1 VALUES (1, 0, REPEAT('1234567890', 200));
INSERT INTO t1 VALUES (3, 3, REPEAT('1234567890', 200));

SET SESSION wsrep_sync_wait=0;

# set sync point for replication applier
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb";

# Control connection to manage sync points for appliers
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1a
SET SESSION wsrep_sync_wait=0;

# starting local transaction, only select so far,
# write will happen later and this will be ordered after the transaction in node_2
--connection node_1
begin;
select f1,f2 from t1;

# send from node 2 an UPDATE transaction, which will BF abort the transaction in node_1
--connection node_2
--let $wait_condition=select count(*)=2 from t1
--source include/wait_condition.inc

UPDATE t1 SET f2=2 WHERE f1=3;

--connection node_1a
# wait to see the UPDATE from node_2 in apply_cb sync point
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";

--connection node_1
# now issuing conflicting update
UPDATE t1 SET f2=1 WHERE f1=3;

# Block the local commit, send final COMMIT and wait until it gets blocked
--let $galera_sync_point = commit_monitor_master_enter_sync
--source include/galera_set_sync_point.inc
--send COMMIT

--connection node_1a
# wait for the local commit to enter in commit monitor wait state
--let $galera_sync_point = commit_monitor_master_enter_sync
--source include/galera_wait_sync_point.inc
--source include/galera_clear_sync_point.inc

# release the local transaction to continue with commit
--let $galera_sync_point = commit_monitor_master_enter_sync
--source include/galera_signal_sync_point.inc

# and now release the applier, it should force local trx to abort
SET GLOBAL DEBUG_DBUG = "";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
SET GLOBAL debug_dbug = NULL;
SET debug_sync='RESET';

--connection node_1
--error ER_LOCK_DEADLOCK
--reap

# wait until applying is complete
--let $wait_condition = SELECT COUNT(*)=1 FROM t1 WHERE f2=2
--source include/wait_condition.inc

# final read to verify what we got
select f1,f2 from t1;

DROP TABLE t1;
6 changes: 3 additions & 3 deletions mysql-test/suite/galera/t/galera_var_dirty_reads.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ SHOW STATUS LIKE 'wsrep_ready';
# Must return 'Disconnected'
SHOW STATUS LIKE 'wsrep_cluster_status';

--error ER_UNKNOWN_COM_ERROR,1047
--error ER_UNKNOWN_COM_ERROR
SELECT * FROM t1;

--error ER_UNKNOWN_COM_ERROR,1047
--error ER_UNKNOWN_COM_ERROR
SELECT 1 FROM t1;

SET @@session.wsrep_dirty_reads=ON;
Expand All @@ -46,7 +46,7 @@ SELECT i, variable_name, variable_value FROM t1, information_schema.session_vari

SET @@session.wsrep_dirty_reads=OFF;

--error ER_UNKNOWN_COM_ERROR,1047
--error ER_UNKNOWN_COM_ERROR
SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;


Expand Down
1 change: 0 additions & 1 deletion mysql-test/suite/galera_3nodes_sr/disabled.def
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
GCF-336 :
GCF-582 :
GCF-810A :
GCF-810B :
Expand Down

0 comments on commit e55397a

Please sign in to comment.