Commit ead38354 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.4 into 10.5

parents f3bd2780 097b7b8c
...@@ -10433,7 +10433,7 @@ SELECT VARIABLE_VALUE into @local_mem_used FROM INFORMATION_SCHEMA.SESSION_STATU ...@@ -10433,7 +10433,7 @@ SELECT VARIABLE_VALUE into @local_mem_used FROM INFORMATION_SCHEMA.SESSION_STATU
CREATE PROCEDURE sp1() SELECT 1; CREATE PROCEDURE sp1() SELECT 1;
SHOW CREATE PROCEDURE sp1; SHOW CREATE PROCEDURE sp1;
SELECT VARIABLE_VALUE-@local_mem_used FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='MEMORY_USED'; SELECT VARIABLE_VALUE-@local_mem_used FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='MEMORY_USED';
# 10.5 FIXME: This occasionally shows 56 or 64 bytes of difference! # FIXME: MDEV-26754 main.sp test fails for embedded server
#SELECT VARIABLE_VALUE-@global_mem_used FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='MEMORY_USED'; #SELECT VARIABLE_VALUE-@global_mem_used FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='MEMORY_USED';
DROP PROCEDURE sp1; DROP PROCEDURE sp1;
--echo # End of 10.3 tests --echo # End of 10.3 tests
......
connection node_2;
connection node_1;
SET @wsrep_forced_binlog_format_saved = @@GLOBAL.wsrep_forced_binlog_format;
SET @@GLOBAL.wsrep_forced_binlog_format = STATEMENT;
CREATE TABLE t1(c INT PRIMARY KEY) ENGINE = MyISAM;
INSERT DELAYED INTO t1 VALUES (1),(2),(3);
SELECT SLEEP(1);
SLEEP(1)
0
DROP TABLE t1;
SET @@GLOBAL.wsrep_forced_binlog_format = @wsrep_forced_binlog_format_saved;
...@@ -36,3 +36,59 @@ COUNT(f1) = 1000 ...@@ -36,3 +36,59 @@ COUNT(f1) = 1000
1 1
DROP TABLE t1; DROP TABLE t1;
DROP TABLE ten; DROP TABLE ten;
connection node_1;
SET @value=REPEAT (1,5001);
CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb;
INSERT IGNORE INTO t VALUES(@value);
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT COUNT(*) FROM t;
COUNT(*)
1
connection node_2;
SELECT COUNT(*) FROM t;
COUNT(*)
1
connection node_1;
DROP TABLE t;
CREATE TABLE t (a VARCHAR(5000)) engine=innodb;
INSERT IGNORE INTO t VALUES(@value);
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT COUNT(*) FROM t;
COUNT(*)
1
connection node_2;
SELECT COUNT(*) FROM t;
COUNT(*)
1
connection node_1;
DROP TABLE t;
connection node_1;
SET @value=REPEAT (1,5001);
CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb DEFAULT CHARSET=utf8;
INSERT IGNORE INTO t VALUES(@value);
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT COUNT(*) FROM t;
COUNT(*)
1
connection node_2;
SELECT COUNT(*) FROM t;
COUNT(*)
1
connection node_1;
DROP TABLE t;
CREATE TABLE t (a VARCHAR(5000)) engine=innodb DEFAULT CHARSET=utf8;
INSERT IGNORE INTO t VALUES(@value);
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT COUNT(*) FROM t;
COUNT(*)
1
connection node_2;
SELECT COUNT(*) FROM t;
COUNT(*)
1
connection node_1;
DROP TABLE t;
!include ../galera_2nodes.cnf
[mysqld]
log-bin
\ No newline at end of file
--source include/galera_cluster.inc
--source include/have_innodb.inc
SET @wsrep_forced_binlog_format_saved = @@GLOBAL.wsrep_forced_binlog_format;
SET @@GLOBAL.wsrep_forced_binlog_format = STATEMENT;
CREATE TABLE t1(c INT PRIMARY KEY) ENGINE = MyISAM;
INSERT DELAYED INTO t1 VALUES (1),(2),(3);
SELECT SLEEP(1);
DROP TABLE t1;
SET @@GLOBAL.wsrep_forced_binlog_format = @wsrep_forced_binlog_format_saved;
...@@ -58,28 +58,50 @@ SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk'); ...@@ -58,28 +58,50 @@ SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk');
DROP TABLE t1; DROP TABLE t1;
DROP TABLE ten; DROP TABLE ten;
#
# Case 2: UTF-8
# TODO: MDEV-24978
# #
#--connection node_1 # MDEV-24978 : SIGABRT in __libc_message
#SET @value=REPEAT (1,5001);
#CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb DEFAULT CHARSET=utf8;
#INSERT IGNORE INTO t VALUES(@value);
#SELECT COUNT(*) FROM t;
# #
#--connection node_2 --connection node_1
#SELECT COUNT(*) FROM t; SET @value=REPEAT (1,5001);
# CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb;
#--connection node_1 INSERT IGNORE INTO t VALUES(@value);
#DROP TABLE t; SELECT COUNT(*) FROM t;
#CREATE TABLE t (a VARCHAR(5000)) engine=innodb DEFAULT CHARSET=utf8;
#INSERT IGNORE INTO t VALUES(@value); --connection node_2
#SELECT COUNT(*) FROM t; SELECT COUNT(*) FROM t;
--connection node_1
DROP TABLE t;
CREATE TABLE t (a VARCHAR(5000)) engine=innodb;
INSERT IGNORE INTO t VALUES(@value);
SELECT COUNT(*) FROM t;
--connection node_2
SELECT COUNT(*) FROM t;
--connection node_1
DROP TABLE t;
# #
#--connection node_2 # Case 2: UTF-8
#SELECT COUNT(*) FROM t;
# #
#--connection node_1 --connection node_1
#DROP TABLE t; SET @value=REPEAT (1,5001);
CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb DEFAULT CHARSET=utf8;
INSERT IGNORE INTO t VALUES(@value);
SELECT COUNT(*) FROM t;
--connection node_2
SELECT COUNT(*) FROM t;
--connection node_1
DROP TABLE t;
CREATE TABLE t (a VARCHAR(5000)) engine=innodb DEFAULT CHARSET=utf8;
INSERT IGNORE INTO t VALUES(@value);
SELECT COUNT(*) FROM t;
--connection node_2
SELECT COUNT(*) FROM t;
--connection node_1
DROP TABLE t;
...@@ -268,12 +268,11 @@ extern "C" my_bool wsrep_thd_order_before(const THD *left, const THD *right) ...@@ -268,12 +268,11 @@ extern "C" my_bool wsrep_thd_order_before(const THD *left, const THD *right)
extern "C" my_bool wsrep_thd_is_aborting(const MYSQL_THD thd) extern "C" my_bool wsrep_thd_is_aborting(const MYSQL_THD thd)
{ {
mysql_mutex_assert_owner(&thd->LOCK_thd_data); mysql_mutex_assert_owner(&thd->LOCK_thd_data);
if (thd != 0)
const wsrep::client_state& cs(thd->wsrep_cs());
const enum wsrep::transaction::state tx_state(cs.transaction().state());
switch (tx_state)
{ {
const wsrep::client_state& cs(thd->wsrep_cs());
const enum wsrep::transaction::state tx_state(cs.transaction().state());
switch (tx_state)
{
case wsrep::transaction::s_must_abort: case wsrep::transaction::s_must_abort:
return (cs.state() == wsrep::client_state::s_exec || return (cs.state() == wsrep::client_state::s_exec ||
cs.state() == wsrep::client_state::s_result); cs.state() == wsrep::client_state::s_result);
...@@ -282,8 +281,8 @@ extern "C" my_bool wsrep_thd_is_aborting(const MYSQL_THD thd) ...@@ -282,8 +281,8 @@ extern "C" my_bool wsrep_thd_is_aborting(const MYSQL_THD thd)
return true; return true;
default: default:
return false; return false;
}
} }
return false; return false;
} }
......
...@@ -475,7 +475,7 @@ void upgrade_lock_type(THD *thd, thr_lock_type *lock_type, ...@@ -475,7 +475,7 @@ void upgrade_lock_type(THD *thd, thr_lock_type *lock_type,
} }
bool log_on= (thd->variables.option_bits & OPTION_BIN_LOG); bool log_on= (thd->variables.option_bits & OPTION_BIN_LOG);
if (global_system_variables.binlog_format == BINLOG_FORMAT_STMT && if (thd->wsrep_binlog_format() == BINLOG_FORMAT_STMT &&
log_on && mysql_bin_log.is_open()) log_on && mysql_bin_log.is_open())
{ {
/* /*
......
...@@ -72,7 +72,8 @@ ...@@ -72,7 +72,8 @@
/* this is to get the bison compilation windows warnings out */ /* this is to get the bison compilation windows warnings out */
#ifdef _MSC_VER #ifdef _MSC_VER
/* warning C4065: switch statement contains 'default' but no 'case' labels */ /* warning C4065: switch statement contains 'default' but no 'case' labels */
#pragma warning (disable : 4065) /* warning C4102: 'yyexhaustedlab': unreferenced label */
#pragma warning (disable : 4065 4102)
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wunused-label" /* yyexhaustedlab: */ #pragma GCC diagnostic ignored "-Wunused-label" /* yyexhaustedlab: */
......
...@@ -6654,10 +6654,14 @@ wsrep_store_key_val_for_row( ...@@ -6654,10 +6654,14 @@ wsrep_store_key_val_for_row(
/* In a column prefix index, we may need to truncate /* In a column prefix index, we may need to truncate
the stored value: */ the stored value: */
if (true_len > key_len) { if (true_len > key_len) {
true_len = key_len; true_len = key_len;
} }
/* cannot exceed max column lenght either, we may need to truncate
the stored value: */
if (true_len > sizeof(sorted)) {
true_len = sizeof(sorted);
}
memcpy(sorted, data, true_len); memcpy(sorted, data, true_len);
true_len = wsrep_innobase_mysql_sort( true_len = wsrep_innobase_mysql_sort(
...@@ -6670,8 +6674,8 @@ wsrep_store_key_val_for_row( ...@@ -6670,8 +6674,8 @@ wsrep_store_key_val_for_row(
actual data. The rest of the space was reset to zero actual data. The rest of the space was reset to zero
in the bzero() call above. */ in the bzero() call above. */
if (true_len > buff_space) { if (true_len > buff_space) {
fprintf (stderr, WSREP_DEBUG (
"WSREP: key truncated: %s\n", "write set key truncated for: %s\n",
wsrep_thd_query(thd)); wsrep_thd_query(thd));
true_len = buff_space; true_len = buff_space;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment