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 Oct 5, 2021
2 parents 668a5f3 + df94aa3 commit 4ca56e8
Show file tree
Hide file tree
Showing 14 changed files with 178 additions and 39 deletions.
2 changes: 1 addition & 1 deletion client/mysqldump.c
Original file line number Diff line number Diff line change
Expand Up @@ -4474,7 +4474,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
if (!opt_xml && opt_copy_s3_tables && (ignore_flag & IGNORE_S3_TABLE))
{
DYNAMIC_STRING alter_string;
init_dynamic_string_checked(&alter_string, "ATER TABLE ", 1024, 1024);
init_dynamic_string_checked(&alter_string, "ALTER TABLE ", 1024, 1024);
dynstr_append_checked(&alter_string, opt_quoted_table);
dynstr_append_checked(&alter_string, " ENGINE=S3;\n");
fputs(alter_string.str, md_result_file);
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/sp.test
Original file line number Diff line number Diff line change
Expand Up @@ -10432,7 +10432,7 @@ SELECT VARIABLE_VALUE into @local_mem_used FROM INFORMATION_SCHEMA.SESSION_STATU
CREATE PROCEDURE sp1() SELECT 1;
SHOW CREATE PROCEDURE sp1;
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';
DROP PROCEDURE sp1;
--echo # End of 10.3 tests
Expand Down
11 changes: 11 additions & 0 deletions mysql-test/suite/galera/r/MDEV-22708.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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;
56 changes: 56 additions & 0 deletions mysql-test/suite/galera/r/galera_fulltext.result
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,59 @@ COUNT(f1) = 1000
1
DROP TABLE t1;
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;
4 changes: 4 additions & 0 deletions mysql-test/suite/galera/t/MDEV-22708.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
!include ../galera_2nodes.cnf

[mysqld]
log-bin
14 changes: 14 additions & 0 deletions mysql-test/suite/galera/t/MDEV-22708.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--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;
64 changes: 43 additions & 21 deletions mysql-test/suite/galera/t/galera_fulltext.test
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,50 @@ SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk');

DROP TABLE t1;
DROP TABLE ten;

#
# Case 2: UTF-8
# TODO: MDEV-24978
#
#--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);
#SELECT COUNT(*) FROM t;
# MDEV-24978 : SIGABRT in __libc_message
#
#--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_1
SET @value=REPEAT (1,5001);
CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) 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;
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
#SELECT COUNT(*) FROM t;
# Case 2: UTF-8
#
#--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);
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;
2 changes: 1 addition & 1 deletion mysql-test/suite/s3/mysqldump.result
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CREATE TABLE `t1` (
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1;
/*!40101 SET character_set_client = @saved_cs_client */;
INSERT INTO `t1` VALUES (1,1),(2,2),(3,3),(4,4);
ATER TABLE `t1` ENGINE=S3;
ALTER TABLE `t1` ENGINE=S3;
#####
# mysqldump with --copy-s3-tables=1 XML
###
Expand Down
11 changes: 5 additions & 6 deletions sql/service_wsrep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
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:
return (cs.state() == wsrep::client_state::s_exec ||
cs.state() == wsrep::client_state::s_result);
Expand All @@ -282,8 +281,8 @@ extern "C" my_bool wsrep_thd_is_aborting(const MYSQL_THD thd)
return true;
default:
return false;
}
}

return false;
}

Expand Down
2 changes: 1 addition & 1 deletion sql/sql_insert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if (global_system_variables.binlog_format == BINLOG_FORMAT_STMT &&
if (thd->wsrep_binlog_format() == BINLOG_FORMAT_STMT &&
log_on && mysql_bin_log.is_open())
{
/*
Expand Down
3 changes: 2 additions & 1 deletion sql/sql_yacc.yy
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
/* this is to get the bison compilation windows warnings out */
#ifdef _MSC_VER
/* 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
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wunused-label" /* yyexhaustedlab: */
Expand Down
10 changes: 7 additions & 3 deletions storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6794,10 +6794,14 @@ wsrep_store_key_val_for_row(

/* In a column prefix index, we may need to truncate
the stored value: */

if (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);
true_len = wsrep_innobase_mysql_sort(
Expand All @@ -6810,8 +6814,8 @@ wsrep_store_key_val_for_row(
actual data. The rest of the space was reset to zero
in the bzero() call above. */
if (true_len > buff_space) {
fprintf (stderr,
"WSREP: key truncated: %s\n",
WSREP_DEBUG (
"write set key truncated for: %s\n",
wsrep_thd_query(thd));
true_len = buff_space;
}
Expand Down
6 changes: 6 additions & 0 deletions storage/innobase/trx/trx0purge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,12 @@ static void trx_purge_cleanse_purge_queue(const fil_space_t& space)
mysql_mutex_unlock(&purge_sys.pq_mutex);
}

#if defined __GNUC__ && __GNUC__ == 4 && !defined __clang__
# if defined __arm__ || defined __aarch64__
/* Work around an internal compiler error in GCC 4.8.5 */
__attribute__((optimize(0)))
# endif
#endif
/**
Removes unnecessary history data from rollback segments. NOTE that when this
function is called, the caller must not have any latches on undo log pages!
Expand Down
Loading

0 comments on commit 4ca56e8

Please sign in to comment.