Skip to content

Commit

Permalink
Merge 10.2 into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Oct 4, 2021
2 parents d836f8a + d28b118 commit 1d57892
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 26 deletions.
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 @@ -34,3 +34,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;
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;
3 changes: 2 additions & 1 deletion sql/sql_yacc.yy
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,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
3 changes: 2 additions & 1 deletion sql/sql_yacc_ora.yy
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,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 @@ -7103,10 +7103,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 @@ -7119,8 +7123,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

0 comments on commit 1d57892

Please sign in to comment.