Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä 2020-05-13 14:25:06 +03:00
commit b30a013142
53 changed files with 836 additions and 754 deletions

View file

@ -148,7 +148,7 @@ static struct my_option my_long_options[]=
&opt_systables_only, &opt_systables_only, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#define USER_OPT (array_elements(my_long_options) - 6)
{"user", 'u', "User for login if not current user.", &opt_user,
{"user", 'u', "User for login.", &opt_user,
&opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Display more output about the process; Using it twice will print connection argument; Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during the check phase.",
&opt_not_used, &opt_not_used, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},

View file

@ -466,17 +466,21 @@ sub mtr_report_stats ($$$$) {
}
$test_time = sprintf("%.3f", $test->{timer} / 1000);
$test->{'name'} =~ s/$current_suite\.//;
$xml_report .= qq(\t\t<testcase assertions="" classname="$current_suite" name="$test->{'name'}" status="$test->{'result'}" time="$test_time");
my $comment = $test->{'comment'};
$comment =~ s/[\"]//g;
if ($test->{'result'} eq "MTR_RES_FAILED") {
$xml_report .= qq(>\n\t\t\t<failure message="" type="$test->{'result'}">\n<![CDATA[$test->{'logfile'}]]>\n\t\t\t</failure>\n\t\t</testcase>\n);
# if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML
if ($test->{'result'} eq "MTR_RES_FAILED" || $test->{'retries'}) {
my $logcontents = $test->{'logfile-failed'} || $test->{'logfile'};
$xml_report .= qq(>\n\t\t\t<failure message="" type="MTR_RES_FAILED">\n<![CDATA[$logcontents]]>\n\t\t\t</failure>\n\t\t</testcase>\n);
} elsif ($test->{'result'} eq "MTR_RES_SKIPPED" && $test->{'disable'}) {
$xml_report .= qq(>\n\t\t\t<disabled message="$comment" type="$test->{'result'}"/>\n\t\t</testcase>\n);
$xml_report .= qq(>\n\t\t\t<disabled message="$comment" type="MTR_RES_SKIPPED"/>\n\t\t</testcase>\n);
} elsif ($test->{'result'} eq "MTR_RES_SKIPPED") {
$xml_report .= qq(>\n\t\t\t<skipped message="$comment" type="$test->{'result'}"/>\n\t\t</testcase>\n);
$xml_report .= qq(>\n\t\t\t<skipped message="$comment" type="MTR_RES_SKIPPED"/>\n\t\t</testcase>\n);
} else {
$xml_report .= " />\n";
}

View file

@ -0,0 +1,12 @@
# Toplevel section for openssl (including libssl)
openssl_conf = default_conf_section
[default_conf_section]
# We only specify configuration for the "ssl module"
ssl_conf = ssl_section
[ssl_section]
system_default = system_default_section
[system_default_section]
CipherString = ALL:@SECLEVEL=1

View file

@ -15073,6 +15073,7 @@ EXPLAIN
"rows": 2,
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
"outer_ref_condition": "t1.a is not null",
@ -15179,6 +15180,7 @@ EXPLAIN
"rows": 2,
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
"outer_ref_condition": "t1.a is not null",
@ -15378,6 +15380,7 @@ EXPLAIN
"rows": 2,
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
"outer_ref_condition": "t3.a is not null and t3.c is not null",
@ -15530,6 +15533,7 @@ EXPLAIN
"rows": 2,
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
"outer_ref_condition": "t3.a is not null and t3.c is not null",
@ -15705,6 +15709,7 @@ EXPLAIN
"rows": 2,
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
"outer_ref_condition": "t3.c is not null",
@ -15952,6 +15957,7 @@ EXPLAIN
"rows": 2,
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
"outer_ref_condition": "t3.c is not null",
@ -16440,6 +16446,7 @@ EXPLAIN
"filtered": 100,
"first_match": "t4",
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 3,
"const_condition": "1",
@ -16586,6 +16593,7 @@ EXPLAIN
"rows": 2,
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
"table": {

View file

@ -109,7 +109,7 @@ End of 5.0 tests
# Start of 10.0 tests
#
#
# MDEV-6950 Bad results with joins compating DATE and INT/ENUM/VARCHAR columns
# MDEV-6950 Bad results with joins comparing DATE and INT/ENUM/VARCHAR columns
#
CREATE TABLE t1 (c1 DATE PRIMARY KEY);
INSERT INTO t1 VALUES ('2001-01-01');

View file

@ -102,7 +102,7 @@ DROP TABLE t1;
--echo #
--echo #
--echo # MDEV-6950 Bad results with joins compating DATE and INT/ENUM/VARCHAR columns
--echo # MDEV-6950 Bad results with joins comparing DATE and INT/ENUM/VARCHAR columns
--echo #
CREATE TABLE t1 (c1 DATE PRIMARY KEY);

View file

@ -390,7 +390,7 @@ my $set_titlebar;
};
eval 'sub HAVE_WIN32_CONSOLE { $have_win32_console }';
} else {
sub HAVE_WIN32_CONSOLE { 0 };
eval 'sub HAVE_WIN32_CONSOLE { 0 }';
}
}
@ -398,7 +398,7 @@ if (-t STDOUT) {
if (IS_WINDOWS and HAVE_WIN32_CONSOLE) {
$set_titlebar = sub {Win32::Console::Title $_[0];};
} elsif (defined $ENV{TERM} and $ENV{TERM} =~ /xterm/) {
$set_titlebar = sub { print "\e];$_[0]\a"; };
$set_titlebar = sub { syswrite STDOUT, "\e];$_[0]\a"; };
}
}
@ -784,6 +784,7 @@ sub run_test_server ($$$) {
if ( $result->is_failed() ) {
my $worker_logdir= $result->{savedir};
my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log";
$result->{'logfile-failed'} = mtr_lastlinesfromfile($log_file_name, 20);
rename $log_file_name,$log_file_name.".failed";
}
delete($result->{result});
@ -2306,7 +2307,8 @@ sub environment_setup {
$ENV{'LC_CTYPE'}= "C";
$ENV{'LC_COLLATE'}= "C";
$ENV{'OPENSSL_CONF'}= "/dev/null";
$ENV{'OPENSSL_CONF'}= $mysqld_variables{'version-ssl-library'} gt 'OpenSSL 1.1.1'
? "$glob_mysql_test_dir/lib/openssl.cnf" : '/dev/null';
$ENV{'USE_RUNNING_SERVER'}= using_extern();
$ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir;

View file

@ -38,7 +38,6 @@ galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim
galera_split_brain : MDEV-18280 Galera test failure on galera_split_brain and galera_kill_nochanges
galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade
galera_sst_mariabackup_encrypt_with_key : MDEV-21484 galera_sst_mariabackup_encrypt_with_key
galera_sst_mariabackup_table_options: MDEV-19741 Galera test failure on galera.galera_sst_mariabackup_table_options
galera_toi_ddl_nonconflicting : MDEV-21518 galera.galera_toi_ddl_nonconflicting
galera_var_innodb_disallow_writes : MDEV-20928 galera.galera_var_innodb_disallow_writes
galera_var_node_address : MDEV-20485 Galera test failure
@ -46,7 +45,6 @@ galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang
galera_var_reject_queries : assertion in inline_mysql_socket_send
galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit
galera_wan : MDEV-17259 Test failure on galera.galera_wan
galera_wsrep_new_cluster : MDEV-21515 galera.galera_wsrep_new_cluster
mysql-wsrep#198 : MDEV-18935 Galera test mysql-wsrep#198 sporaric assertion transaction.cpp:362: int wsrep::transaction::before_commit(): Assertion `state() == s_executing || state() == s_committing || state() == s_must_abort || state() == s_replaying' failed.
lp1376747-4 : MDEV-21911 Galera test failure on lp1376747-4
partition : MDEV-19958 Galera test failure on galera.partition

View file

@ -1,25 +0,0 @@
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
INSERT INTO t1 (f1) VALUES (1);
CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
CREATE PROCEDURE proc_update ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
END WHILE;
END|
connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1X;
CALL proc_update();;
connection node_2;
SET SESSION wsrep_retry_autocommit = 10000;
connection node_1;
connection node_1X;
Got one of the listed errors
connection node_1;
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state ABORTED after post commit");

View file

@ -28,7 +28,11 @@ gtid_binlog_state_equal
#cleanup
connection node_3;
DROP TABLE t1;
reset master;
connection node_1;
connection node_2;
connection node_3;
connection node_3;
RESET MASTER;
connection node_1;
STOP SLAVE;
RESET SLAVE ALL;

View file

@ -0,0 +1,15 @@
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
connection node_1;
UPDATE t1 SET f1 = 2 WHERE f1 = 1;
connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
COUNT(*) = 1
1
DROP TABLE t1;

View file

@ -1,39 +1,40 @@
connection node_2;
connection node_1;
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
VARIABLE_VALUE = 'ON'
1
SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
VARIABLE_VALUE = 0
1
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
VARIABLE_VALUE = 'ON'
1
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
VARIABLE_VALUE = 4
1
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE = 'Synced'
connection node_1;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE
Primary
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
VARIABLE_VALUE
ON
SELECT (VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 ) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
(VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 )
1
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
VARIABLE_VALUE
ON
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
VARIABLE_VALUE
4
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE
Synced
connection node_2;
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
VARIABLE_VALUE = 'ON'
1
SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
VARIABLE_VALUE = 0
1
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
VARIABLE_VALUE = 'ON'
1
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
VARIABLE_VALUE = 4
1
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE = 'Synced'
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE
Primary
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
VARIABLE_VALUE
ON
SELECT (VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 ) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
(VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 )
1
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
VARIABLE_VALUE
ON
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
VARIABLE_VALUE
4
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE
Synced

View file

@ -62,6 +62,7 @@ push @::global_suppressions,
qr(WSREP: Ignoring error*),
qr(WSREP: Failed to remove page file .*),
qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*),
qr(WSREP: .*Transport endpoint is not connected.*),
);
sub skip_combinations {

View file

@ -0,0 +1,7 @@
!include ../galera_2nodes.cnf
[mysqld.1]
wsrep-debug=ON
[mysqld.2]
wsrep-debug=ON

View file

@ -13,7 +13,7 @@
#
--source include/galera_cluster.inc
--source include/big_test.inc
--source include/force_restart.inc
--source suite/galera/t/MW-328-header.inc
--connection node_2

View file

@ -0,0 +1,7 @@
!include ../galera_2nodes.cnf
[mysqld.1]
wsrep-debug=ON
[mysqld.2]
wsrep-debug=ON

View file

@ -8,7 +8,7 @@
#
--source include/galera_cluster.inc
--source include/big_test.inc
--source include/force_restart.inc
--source suite/galera/t/MW-328-header.inc
--connection node_2

View file

@ -58,7 +58,21 @@ SELECT COUNT(*) AS EXPECT_0 FROM t1;
--echo #cleanup
--connection node_3
DROP TABLE t1;
reset master;
--connection node_1
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--connection node_3
RESET MASTER;
--connection node_1
STOP SLAVE;

View file

@ -4,7 +4,9 @@
#
--source include/galera_cluster.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/galera_have_debug_sync.inc
--let $node_1=node_1
--let $node_2=node_2

View file

@ -6,44 +6,34 @@
--source include/galera_cluster.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'on' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT (VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 ) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
--connection node_2
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'on' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
SELECT (VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 ) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';

View file

@ -0,0 +1,27 @@
#
# Test that Galera SR continues to run even with --log-bin-use-v1-row-events=1
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
--connection node_2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT COUNT(*) = 1 FROM t1;
--connection node_1
COMMIT;
SET AUTOCOMMIT=ON;
UPDATE t1 SET f1 = 2 WHERE f1 = 1;
--connection node_2
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
DROP TABLE t1;

View file

@ -484,7 +484,7 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT InnoDB system tablespace size to be set in recovery.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
NUMERIC_MAX_VALUE 268435456
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES

File diff suppressed because it is too large Load diff

View file

@ -14,7 +14,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
/*
Code for handling dubble-linked lists in C
Code for handling doubly linked lists in C
*/
#include "mysys_priv.h"
@ -22,7 +22,7 @@
/* Add a element to start of list */
/* Add an element to start of list */
LIST *list_add(LIST *root, LIST *element)
{

View file

@ -90,6 +90,8 @@ static int pam_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
PAM_DEBUG((stderr, "PAM: execute pam sandbox [%s].\n", toolpath));
(void) execl(toolpath, toolpath, NULL);
PAM_DEBUG((stderr, "PAM: exec() failed.\n"));
my_printf_error(1, "PAM: Cannot execute %s (errno: %M)", ME_ERROR_LOG_ONLY,
toolpath, errno);
exit(-1);
}

View file

@ -3492,8 +3492,20 @@ bool Item_basic_value::eq(const Item *item, bool binary_cmp) const
(h0= type_handler())->type_handler_for_comparison() ==
(h1= item->type_handler())->type_handler_for_comparison() &&
h0->cast_to_int_type_handler()->type_handler_for_comparison() ==
h1->cast_to_int_type_handler()->type_handler_for_comparison() &&
h0->Item_const_eq(c0, c1, binary_cmp);
h1->cast_to_int_type_handler()->type_handler_for_comparison();
if (res)
{
switch (c0->const_is_null() + c1->const_is_null()) {
case 2: // Two NULLs
res= true;
break;
case 1: // NULL and non-NULL
res= false;
break;
case 0: // Two non-NULLs
res= h0->Item_const_eq(c0, c1, binary_cmp);
}
}
DBUG_EXECUTE_IF("Item_basic_value",
push_warning_printf(current_thd,
Sql_condition::WARN_LEVEL_NOTE,

View file

@ -4425,7 +4425,11 @@ static void init_ssl()
{
ulong err;
while ((err= ERR_get_error()))
sql_print_warning("SSL error: %s", ERR_error_string(err, NULL));
{
char buf[256];
ERR_error_string_n(err, buf, sizeof(buf));
sql_print_warning("SSL error: %s",buf);
}
}
else
ERR_remove_state(0);

View file

@ -772,31 +772,6 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
(table->table->s->table_category == TABLE_CATEGORY_USER &&
(check_eits_collection_allowed(thd) ||
lex->with_persistent_for_clause));
if (!lex->index_list)
{
tab->keys_in_use_for_query.init(tab->s->keys);
}
else
{
int pos;
LEX_STRING *index_name;
List_iterator_fast<LEX_STRING> it(*lex->index_list);
tab->keys_in_use_for_query.clear_all();
while ((index_name= it++))
{
if (tab->s->keynames.type_names == 0 ||
(pos= find_type(&tab->s->keynames, index_name->str,
index_name->length, 1)) <= 0)
{
compl_result_code= result_code= HA_ADMIN_INVALID;
break;
}
tab->keys_in_use_for_query.set_bit(--pos);
}
}
}
if (result_code == HA_ADMIN_OK)
@ -882,6 +857,27 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
}
tab->file->column_bitmaps_signal();
}
if (!lex->index_list)
tab->keys_in_use_for_query.init(tab->s->keys);
else
{
int pos;
LEX_STRING *index_name;
List_iterator_fast<LEX_STRING> it(*lex->index_list);
tab->keys_in_use_for_query.clear_all();
while ((index_name= it++))
{
if (tab->s->keynames.type_names == 0 ||
(pos= find_type(&tab->s->keynames, index_name->str,
index_name->length, 1)) <= 0)
{
compl_result_code= result_code= HA_ADMIN_INVALID;
break;
}
tab->keys_in_use_for_query.set_bit(--pos);
}
}
if (!(compl_result_code=
alloc_statistics_for_table(thd, table->table)) &&
!(compl_result_code=

View file

@ -4936,6 +4936,7 @@ extern "C" LEX_STRING * thd_query_string (MYSQL_THD thd)
@param buflen Length of the buffer
@return Length of the query
@retval 0 if LOCK_thd_data cannot be acquired without waiting
@note This function is thread safe as the query string is
accessed under mutex protection and the string is copied
@ -4944,10 +4945,19 @@ extern "C" LEX_STRING * thd_query_string (MYSQL_THD thd)
extern "C" size_t thd_query_safe(MYSQL_THD thd, char *buf, size_t buflen)
{
mysql_mutex_lock(&thd->LOCK_thd_data);
size_t len= MY_MIN(buflen - 1, thd->query_length());
memcpy(buf, thd->query(), len);
mysql_mutex_unlock(&thd->LOCK_thd_data);
size_t len= 0;
/* InnoDB invokes this function while holding internal mutexes.
THD::awake() will hold LOCK_thd_data while invoking an InnoDB
function that would acquire the internal mutex. Because this
function is a non-essential part of information_schema view output,
we will break the deadlock by avoiding a mutex wait here
and returning the empty string if a wait would be needed. */
if (!mysql_mutex_trylock(&thd->LOCK_thd_data))
{
len= MY_MIN(buflen - 1, thd->query_length());
memcpy(buf, thd->query(), len);
mysql_mutex_unlock(&thd->LOCK_thd_data);
}
buf[len]= '\0';
return len;
}

View file

@ -1884,6 +1884,11 @@ void Explain_table_access::print_explain_json(Explain_query *query,
/* This is a derived table. Print its contents here */
writer->add_member("materialized").start_object();
Explain_node *node= query->get_node(derived_select_number);
if (node->get_type() == Explain_node::EXPLAIN_SELECT &&
((Explain_select*)node)->is_lateral)
{
writer->add_member("lateral").add_ll(1);
}
node->print_explain_json(query, writer, is_analyze);
writer->end_object();
}

View file

@ -211,6 +211,7 @@ public:
select_lex(NULL),
#endif
linkage(UNSPECIFIED_TYPE),
is_lateral(false),
message(NULL),
having(NULL), having_value(Item::COND_UNDEF),
using_temporary(false), using_filesort(false),
@ -226,6 +227,7 @@ public:
#endif
const char *select_type;
enum sub_select_type linkage;
bool is_lateral;
/*
If message != NULL, this is a degenerate join plan, and all subsequent

View file

@ -27013,6 +27013,8 @@ int JOIN::save_explain_data_intern(Explain_query *output,
xpl_sel->select_id= join->select_lex->select_number;
xpl_sel->select_type= join->select_lex->type;
xpl_sel->linkage= select_lex->get_linkage();
xpl_sel->is_lateral= ((select_lex->get_linkage() == DERIVED_TABLE_TYPE) &&
(select_lex->uncacheable & UNCACHEABLE_DEPENDENT));
if (select_lex->master_unit()->derived)
xpl_sel->connection_type= Explain_node::EXPLAIN_NODE_DERIVED;

View file

@ -1815,18 +1815,11 @@ retry_page_get:
if (dict_index_is_spatial(index)) {
ut_ad(cursor->rtr_info);
node_seq_t seq_no = rtr_get_current_ssn_id(index);
/* If SSN in memory is not initialized, fetch
it from root page */
if (seq_no < 1) {
node_seq_t root_seq_no;
root_seq_no = page_get_ssn_id(page);
mutex_enter(&(index->rtr_ssn.mutex));
index->rtr_ssn.seq_no = root_seq_no + 1;
mutex_exit(&(index->rtr_ssn.mutex));
if (!rtr_get_current_ssn_id(index)) {
/* FIXME: do this in dict_load_table_one() */
index->set_ssn(page_get_ssn_id(page) + 1);
}
/* Save the MBR */

View file

@ -431,16 +431,13 @@ decompress:
decompress_with_slot:
ut_d(fil_page_type_validate(space, dst_frame));
bpage->write_size = fil_page_decompress(
ulint write_size = fil_page_decompress(
slot->crypt_buf, dst_frame, space->flags);
slot->release();
ut_ad(!bpage->write_size
|| fil_page_type_validate(space, dst_frame));
ut_ad(!write_size || fil_page_type_validate(space, dst_frame));
ut_ad(space->pending_io());
return bpage->write_size != 0;
return write_size != 0;
}
if (key_version && space->crypt_data) {
@ -1295,7 +1292,6 @@ buf_block_init(buf_block_t* block, byte* frame)
block->page.buf_fix_count = 0;
block->page.io_fix = BUF_IO_NONE;
block->page.real_size = 0;
block->page.write_size = 0;
block->modify_clock = 0;
block->page.slot = NULL;
block->page.status = buf_page_t::NORMAL;
@ -4197,7 +4193,6 @@ buf_page_init_low(
bpage->freed_page_clock = 0;
bpage->access_time = 0;
bpage->oldest_modification = 0;
bpage->write_size = 0;
bpage->real_size = 0;
bpage->slot = NULL;
bpage->ibuf_exist = false;

View file

@ -3560,7 +3560,7 @@ dict_foreign_parse_drop_constraints(
ut_a(trx->mysql_thd);
cs = innobase_get_charset(trx->mysql_thd);
cs = thd_charset(trx->mysql_thd);
*n = 0;

View file

@ -789,7 +789,6 @@ dict_mem_index_create(
mutex_create(LATCH_ID_ZIP_PAD_MUTEX, &index->zip_pad.mutex);
if (type & DICT_SPATIAL) {
mutex_create(LATCH_ID_RTR_SSN_MUTEX, &index->rtr_ssn.mutex);
index->rtr_track = new
(mem_heap_alloc(heap, sizeof *index->rtr_track))
rtr_info_track_t();
@ -1102,7 +1101,7 @@ dict_mem_index_free(
for (auto& rtr_info : index->rtr_track->rtr_active) {
rtr_info->index = NULL;
}
mutex_destroy(&index->rtr_ssn.mutex);
mutex_destroy(&index->rtr_track->rtr_active_mutex);
index->rtr_track->~rtr_info_track_t();
}

View file

@ -570,7 +570,6 @@ static PSI_mutex_info all_innodb_mutexes[] = {
PSI_KEY(rtr_active_mutex),
PSI_KEY(rtr_match_mutex),
PSI_KEY(rtr_path_mutex),
PSI_KEY(rtr_ssn_mutex),
PSI_KEY(trx_sys_mutex),
PSI_KEY(zip_pad_mutex)
};
@ -2126,17 +2125,6 @@ innobase_casedn_str(
my_casedn_str(system_charset_info, a);
}
/**********************************************************************//**
Determines the connection character set.
@return connection character set */
CHARSET_INFO*
innobase_get_charset(
/*=================*/
THD* mysql_thd) /*!< in: MySQL thread handle */
{
return(thd_charset(mysql_thd));
}
/** Determines the current SQL statement.
Thread unsafe, can only be called from the thread owning the THD.
@param[in] thd MySQL thread handle
@ -2156,22 +2144,6 @@ innobase_get_stmt_unsafe(
return NULL;
}
/** Determines the current SQL statement.
Thread safe, can be called from any thread as the string is copied
into the provided buffer.
@param[in] thd MySQL thread handle
@param[out] buf Buffer containing SQL statement
@param[in] buflen Length of provided buffer
@return Length of the SQL statement */
size_t
innobase_get_stmt_safe(
THD* thd,
char* buf,
size_t buflen)
{
return thd_query_safe(thd, buf, buflen);
}
/**********************************************************************//**
Get the current setting of the tdc_size global parameter. We do
a dirty read because for one there is no synchronization object and
@ -12177,7 +12149,7 @@ create_table_info_t::create_foreign_keys()
dict_index_t* err_index = NULL;
ulint err_col;
const bool tmp_table = m_flags2 & DICT_TF2_TEMPORARY;
const CHARSET_INFO* cs = innobase_get_charset(m_thd);
const CHARSET_INFO* cs = thd_charset(m_thd);
const char* operation = "Create ";
const char* name = m_table_name;
@ -20031,7 +20003,7 @@ static MYSQL_SYSVAR_UINT(data_file_size_debug,
srv_sys_space_size_debug,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"InnoDB system tablespace size to be set in recovery.",
NULL, NULL, 0, 0, UINT_MAX32, 0);
NULL, NULL, 0, 0, 256U << 20, 0);
static MYSQL_SYSVAR_ULONG(fil_make_page_dirty_debug,
srv_fil_make_page_dirty_debug, PLUGIN_VAR_OPCMDARG,

View file

@ -528,13 +528,8 @@ the definitions are bracketed with #ifdef INNODB_COMPATIBILITY_HOOKS */
#error InnoDB needs MySQL to be built with #define INNODB_COMPATIBILITY_HOOKS
#endif
LEX_STRING* thd_query_string(MYSQL_THD thd);
size_t thd_query_safe(MYSQL_THD thd, char *buf, size_t buflen);
extern "C" {
struct charset_info_st *thd_charset(MYSQL_THD thd);
/** Check if a user thread is a replication slave thread
@param thd user thread
@retval 0 the user thread is not a replication slave thread

View file

@ -2929,7 +2929,7 @@ innobase_get_foreign_key_info(
char* referenced_table_name = NULL;
ulint num_fk = 0;
Alter_info* alter_info = ha_alter_info->alter_info;
const CHARSET_INFO* cs = innobase_get_charset(trx->mysql_thd);
const CHARSET_INFO* cs = thd_charset(trx->mysql_thd);
DBUG_ENTER("innobase_get_foreign_key_info");

View file

@ -2607,42 +2607,28 @@ ibuf_contract_after_insert(
} while (size > 0 && sum_sizes < entry_size);
}
/*********************************************************************//**
Determine if an insert buffer record has been encountered already.
@return TRUE if a new record, FALSE if possible duplicate */
static
ibool
ibuf_get_volume_buffered_hash(
/*==========================*/
const rec_t* rec, /*!< in: ibuf record in post-4.1 format */
const byte* types, /*!< in: fields */
const byte* data, /*!< in: start of user record data */
ulint comp, /*!< in: 0=ROW_FORMAT=REDUNDANT,
nonzero=ROW_FORMAT=COMPACT */
ulint* hash, /*!< in/out: hash array */
ulint size) /*!< in: number of elements in hash array */
/** Determine if a change buffer record has been encountered already.
@param rec change buffer record in the MySQL 5.5 format
@param hash hash table of encountered records
@param size number of elements in hash
@retval true if a distinct record
@retval false if this may be duplicating an earlier record */
static bool ibuf_get_volume_buffered_hash(const rec_t *rec, ulint *hash,
ulint size)
{
ulint len;
ulint fold;
ulint bitmask;
ut_ad(rec_get_n_fields_old(rec) > IBUF_REC_FIELD_USER);
const ulint start= rec_get_field_start_offs(rec, IBUF_REC_FIELD_USER);
const ulint len= rec_get_data_size_old(rec) - start;
const uint32_t fold= ut_crc32(rec + start, len);
hash+= (fold / (CHAR_BIT * sizeof *hash)) % size;
ulint bitmask= static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
len = ibuf_rec_get_size(
rec, types,
rec_get_n_fields_old(rec) - IBUF_REC_FIELD_USER, comp);
fold = ut_fold_binary(data, len);
if (*hash & bitmask)
return false;
hash += (fold / (CHAR_BIT * sizeof *hash)) % size;
bitmask = static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
if (*hash & bitmask) {
return(FALSE);
}
/* We have not seen this record yet. Insert it. */
*hash |= bitmask;
return(TRUE);
/* We have not seen this record yet. Remember it. */
*hash|= bitmask;
return true;
}
#ifdef UNIV_DEBUG
@ -2735,11 +2721,7 @@ ibuf_get_volume_buffered_count_func(
case IBUF_OP_DELETE_MARK:
/* There must be a record to delete-mark.
See if this record has been already buffered. */
if (n_recs && ibuf_get_volume_buffered_hash(
rec, types + IBUF_REC_INFO_SIZE,
types + len,
types[IBUF_REC_OFFSET_FLAGS] & IBUF_REC_COMPACT,
hash, size)) {
if (n_recs && ibuf_get_volume_buffered_hash(rec, hash, size)) {
(*n_recs)++;
}

View file

@ -1169,11 +1169,6 @@ public:
zip.data == NULL means an active
buf_pool.watch */
ulint write_size; /* Write size is set when this
page is first time written and then
if written again we check is TRIM
operation needed. */
ulint real_size; /*!< Real size of the page
Normal pages == srv_page_size
page compressed pages, payload

View file

@ -1103,7 +1103,22 @@ struct dict_index_t {
/* in which slot the next sample should be
saved. */
/* @} */
rtr_ssn_t rtr_ssn;/*!< Node sequence number for RTree */
private:
/** R-tree split sequence number */
std::atomic<node_seq_t> rtr_ssn;
public:
void set_ssn(node_seq_t ssn)
{
rtr_ssn.store(ssn, std::memory_order_relaxed);
}
node_seq_t assign_ssn()
{
node_seq_t ssn= rtr_ssn.fetch_add(1, std::memory_order_relaxed);
return ssn + 1;
}
node_seq_t ssn() const { return rtr_ssn.load(std::memory_order_relaxed); }
rtr_info_track_t*
rtr_track;/*!< tracking all R-Tree search cursors */
trx_id_t trx_id; /*!< id of the transaction that created this

View file

@ -190,23 +190,8 @@ rtr_non_leaf_insert_stack_push(
double mbr_inc); /*!< in: MBR needs to be
enlarged */
/*****************************************************************//**
Allocates a new Split Sequence Number.
@return new SSN id */
UNIV_INLINE
node_seq_t
rtr_get_new_ssn_id(
/*===============*/
dict_index_t* index); /*!< in: the index struct */
/*****************************************************************//**
Get the current Split Sequence Number.
@return current SSN id */
UNIV_INLINE
node_seq_t
rtr_get_current_ssn_id(
/*===================*/
dict_index_t* index); /*!< in/out: the index struct */
#define rtr_get_new_ssn_id(index) (index)->assign_ssn()
#define rtr_get_current_ssn_id(index) (index)->ssn()
/********************************************************************//**
Create a RTree search info structure */

View file

@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
Copyright (c) 2017, 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
@ -123,41 +123,6 @@ rtr_non_leaf_stack_push(
#endif /* RTR_SEARCH_DIAGNOSTIC */
}
/*****************************************************************//**
Allocates a new Split Sequence Number.
@return new SSN id */
UNIV_INLINE
node_seq_t
rtr_get_new_ssn_id(
/*===============*/
dict_index_t* index) /*!< in/out: the index struct */
{
node_seq_t ssn;
mutex_enter(&(index->rtr_ssn.mutex));
ssn = ++index->rtr_ssn.seq_no;
mutex_exit(&(index->rtr_ssn.mutex));
return(ssn);
}
/*****************************************************************//**
Get the current Split Sequence Number.
@return current SSN id */
UNIV_INLINE
node_seq_t
rtr_get_current_ssn_id(
/*===================*/
dict_index_t* index) /*!< in: index struct */
{
node_seq_t ssn;
mutex_enter(&(index->rtr_ssn.mutex));
ssn = index->rtr_ssn.seq_no;
mutex_exit(&(index->rtr_ssn.mutex));
return(ssn);
}
/*********************************************************************//**
Sets pointer to the data and length in a field. */
UNIV_INLINE

View file

@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, 2019, MariaDB Corporation.
Copyright (c) 2018, 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
@ -142,12 +142,6 @@ struct rtr_info_track_t {
rtr_active */
};
/* Node Sequence Number and mutex protects it. */
typedef struct rtree_ssn {
ib_mutex_t mutex; /*!< mutex protect the seq num */
node_seq_t seq_no; /*!< the SSN (node sequence number) */
} rtr_ssn_t;
/* This is to record the record movement between pages. Used for corresponding
lock movement */
typedef struct rtr_rec_move {

View file

@ -237,13 +237,7 @@ ulint wsrep_innobase_mysql_sort(int mysql_type, uint charset_number,
unsigned int buf_length);
#endif /* WITH_WSREP */
/**********************************************************************//**
Determines the connection character set.
@return connection character set */
CHARSET_INFO*
innobase_get_charset(
/*=================*/
THD* thd); /*!< in: MySQL thread handle */
extern "C" struct charset_info_st *thd_charset(THD *thd);
/** Determines the current SQL statement.
Thread unsafe, can only be called from the thread owning the THD.
@ -255,19 +249,6 @@ innobase_get_stmt_unsafe(
THD* thd,
size_t* length);
/** Determines the current SQL statement.
Thread safe, can be called from any thread as the string is copied
into the provided buffer.
@param[in] thd MySQL thread handle
@param[out] buf Buffer containing SQL statement
@param[in] buflen Length of provided buffer
@return Length of the SQL statement */
size_t
innobase_get_stmt_safe(
THD* thd,
char* buf,
size_t buflen);
/******************************************************************//**
This function is used to find the storage length in bytes of the first n
characters for prefix indexes using a multibyte character set. The function

View file

@ -3,6 +3,7 @@
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2020, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@ -80,7 +81,6 @@ extern mysql_pfs_key_t recv_writer_mutex_key;
extern mysql_pfs_key_t rtr_active_mutex_key;
extern mysql_pfs_key_t rtr_match_mutex_key;
extern mysql_pfs_key_t rtr_path_mutex_key;
extern mysql_pfs_key_t rtr_ssn_mutex_key;
extern mysql_pfs_key_t redo_rseg_mutex_key;
extern mysql_pfs_key_t noredo_rseg_mutex_key;
extern mysql_pfs_key_t page_zip_stat_per_index_mutex_key;

View file

@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation.
Copyright (c) 2017, 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
@ -314,7 +314,6 @@ enum latch_id_t {
LATCH_ID_REDO_RSEG,
LATCH_ID_NOREDO_RSEG,
LATCH_ID_RW_LOCK_DEBUG,
LATCH_ID_RTR_SSN_MUTEX,
LATCH_ID_RTR_ACTIVE_MUTEX,
LATCH_ID_RTR_MATCH_MUTEX,
LATCH_ID_RTR_PATH_MUTEX,

View file

@ -1620,7 +1620,7 @@ wait_suspend_loop:
"Waiting for %s to exit", thread_name);
if (srv_print_verbose_log && count > COUNT_INTERVAL) {
ib::info() << "Waiting for " << thread_name
<< "to exit";
<< " to exit";
count = 0;
}
goto loop;

View file

@ -384,8 +384,7 @@ private:
{
return(latch->get_id() == LATCH_ID_RTR_ACTIVE_MUTEX
|| latch->get_id() == LATCH_ID_RTR_PATH_MUTEX
|| latch->get_id() == LATCH_ID_RTR_MATCH_MUTEX
|| latch->get_id() == LATCH_ID_RTR_SSN_MUTEX);
|| latch->get_id() == LATCH_ID_RTR_MATCH_MUTEX);
}
private:
@ -1361,8 +1360,6 @@ sync_latch_meta_init()
rw_lock_debug_mutex_key);
#endif /* UNIV_DEBUG */
LATCH_ADD_MUTEX(RTR_SSN_MUTEX, SYNC_ANY_LATCH, rtr_ssn_mutex_key);
LATCH_ADD_MUTEX(RTR_ACTIVE_MUTEX, SYNC_ANY_LATCH,
rtr_active_mutex_key);

View file

@ -3,6 +3,7 @@
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2020, MariaDB Corporation.
Copyright (c) 2008, Google Inc.
Copyright (c) 2020, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@ -73,7 +74,6 @@ mysql_pfs_key_t rw_lock_debug_mutex_key;
mysql_pfs_key_t rtr_active_mutex_key;
mysql_pfs_key_t rtr_match_mutex_key;
mysql_pfs_key_t rtr_path_mutex_key;
mysql_pfs_key_t rtr_ssn_mutex_key;
mysql_pfs_key_t rw_lock_list_mutex_key;
mysql_pfs_key_t rw_lock_mutex_key;
mysql_pfs_key_t srv_innodb_monitor_mutex_key;

View file

@ -46,6 +46,7 @@ Created July 17, 2007 Vasil Dimov
#include "trx0sys.h"
#include "que0que.h"
#include "trx0purge.h"
#include "sql_class.h"
/** Initial number of rows in the table cache */
#define TABLE_CACHE_INITIAL_ROWSNUM 1024
@ -427,7 +428,6 @@ fill_trx_row(
which to copy volatile
strings */
{
size_t stmt_len;
const char* s;
ut_ad(lock_mutex_own());
@ -462,16 +462,14 @@ fill_trx_row(
row->trx_mysql_thread_id = thd_get_thread_id(trx->mysql_thd);
char query[TRX_I_S_TRX_QUERY_MAX_LEN + 1];
stmt_len = innobase_get_stmt_safe(trx->mysql_thd, query, sizeof(query));
if (stmt_len > 0) {
if (size_t stmt_len = thd_query_safe(trx->mysql_thd, query,
sizeof query)) {
row->trx_query = static_cast<const char*>(
ha_storage_put_memlim(
cache->storage, query, stmt_len + 1,
MAX_ALLOWED_FOR_STORAGE(cache)));
row->trx_query_cs = innobase_get_charset(trx->mysql_thd);
row->trx_query_cs = thd_charset(trx->mysql_thd);
if (row->trx_query == NULL) {

View file

@ -20886,6 +20886,53 @@ static void test_explain_meta()
mct_close_log();
}
/*
MDEV-20261 NULL passed to String::eq, SEGV, server crash, regression in 10.4
*/
static void test_mdev20261()
{
int rc;
MYSQL_STMT *stmt;
MYSQL_BIND param[1];
const char *query= "SELECT * FROM t1 WHERE f = ? OR f = 'foo'";
char val[]= "";
my_bool is_null= TRUE;
myheader("test_mdev20261");
rc= mysql_query(mysql, "CREATE OR REPLACE TABLE t1 (f varchar(64)) ENGINE=MyISAM");
myquery(rc);
stmt= mysql_stmt_init(mysql);
check_stmt(stmt);
rc= mysql_stmt_prepare(stmt, query, strlen(query));
check_execute(stmt, rc);
verify_param_count(stmt, 1);
bzero((char*) param, sizeof(param));
param[0].buffer= &val;
param[0].buffer_type= MYSQL_TYPE_STRING;
param[0].is_null= &is_null;
rc= mysql_stmt_bind_param(stmt, param);
check_execute(stmt, rc);
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
rc= mysql_stmt_store_result(stmt);
check_execute(stmt, rc);
mysql_stmt_close(stmt);
rc= mysql_query(mysql, "DROP TABLE t1");
myquery(rc);
}
static struct my_tests_st my_tests[]= {
{ "disable_query_logs", disable_query_logs },
{ "test_view_sp_list_fields", test_view_sp_list_fields },
@ -21179,6 +21226,7 @@ static struct my_tests_st my_tests[]= {
#endif
{ "test_explain_meta", test_explain_meta },
{ "test_mdev18408", test_mdev18408 },
{ "test_mdev20261", test_mdev20261 },
{ 0, 0 }
};