Skip to content

Commit 47ba552

Browse files
author
Jan Lindström
committed
Revert "MDEV-24978 : SIGABRT in __libc_message"
This reverts commit 30dea45.
1 parent 88a4be7 commit 47ba552

File tree

3 files changed

+21
-94
lines changed

3 files changed

+21
-94
lines changed

mysql-test/suite/galera/r/galera_fulltext.result

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,6 @@ DROP TABLE t1;
3636
DROP TABLE ten;
3737
connection node_1;
3838
SET @value=REPEAT (1,5001);
39-
CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb;
40-
INSERT IGNORE INTO t VALUES(@value);
41-
Warnings:
42-
Warning 1265 Data truncated for column 'a' at row 1
43-
SELECT COUNT(*) FROM t;
44-
COUNT(*)
45-
1
46-
connection node_2;
47-
SELECT COUNT(*) FROM t;
48-
COUNT(*)
49-
1
50-
connection node_1;
51-
DROP TABLE t;
52-
CREATE TABLE t (a VARCHAR(5000)) engine=innodb;
53-
INSERT IGNORE INTO t VALUES(@value);
54-
Warnings:
55-
Warning 1265 Data truncated for column 'a' at row 1
56-
SELECT COUNT(*) FROM t;
57-
COUNT(*)
58-
1
59-
connection node_2;
60-
SELECT COUNT(*) FROM t;
61-
COUNT(*)
62-
1
63-
connection node_1;
64-
DROP TABLE t;
65-
connection node_1;
66-
SET @value=REPEAT (1,5001);
6739
CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb DEFAULT CHARSET=utf8;
6840
INSERT IGNORE INTO t VALUES(@value);
6941
Warnings:

mysql-test/suite/galera/t/galera_fulltext.test

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,29 +60,6 @@ SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk');
6060

6161
DROP TABLE t1;
6262
DROP TABLE ten;
63-
#
64-
# MDEV-24978 : SIGABRT in __libc_message
65-
#
66-
--connection node_1
67-
SET @value=REPEAT (1,5001);
68-
CREATE TABLE t (a VARCHAR(5000),FULLTEXT (a)) engine=innodb;
69-
INSERT IGNORE INTO t VALUES(@value);
70-
SELECT COUNT(*) FROM t;
71-
72-
--connection node_2
73-
SELECT COUNT(*) FROM t;
74-
75-
--connection node_1
76-
DROP TABLE t;
77-
CREATE TABLE t (a VARCHAR(5000)) engine=innodb;
78-
INSERT IGNORE INTO t VALUES(@value);
79-
SELECT COUNT(*) FROM t;
80-
81-
--connection node_2
82-
SELECT COUNT(*) FROM t;
83-
84-
--connection node_1
85-
DROP TABLE t;
8663

8764
#
8865
# Case 2: UTF-8

storage/innobase/handler/ha_innodb.cc

Lines changed: 21 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6727,8 +6727,8 @@ wsrep_innobase_mysql_sort(
67276727
case MYSQL_TYPE_LONG_BLOB:
67286728
case MYSQL_TYPE_VARCHAR:
67296729
{
6730-
uchar *tmp_str;
6731-
uint tmp_length;
6730+
uchar tmp_str[REC_VERSION_56_MAX_INDEX_COL_LEN] = {'\0'};
6731+
uint tmp_length = REC_VERSION_56_MAX_INDEX_COL_LEN;
67326732

67336733
/* Use the charset number to pick the right charset struct for
67346734
the comparison. Since the MySQL function get_charset may be
@@ -6751,12 +6751,7 @@ wsrep_innobase_mysql_sort(
67516751
}
67526752
}
67536753

6754-
// Note that strnxfrm may change length of string
6755-
tmp_length= charset->coll->strnxfrmlen(charset, str_length);
6756-
tmp_length= tmp_length * charset->mbmaxlen;
6757-
tmp_length= ut_max(str_length, tmp_length) + charset->mbmaxlen;
6758-
tmp_str= static_cast<uchar *>(ut_malloc_nokey(tmp_length));
6759-
ut_ad(str_length <= tmp_length);
6754+
ut_a(str_length <= tmp_length);
67606755
memcpy(tmp_str, str, str_length);
67616756

67626757
tmp_length = charset->coll->strnxfrm(charset, str, str_length,
@@ -6780,7 +6775,6 @@ wsrep_innobase_mysql_sort(
67806775
ret_length = tmp_length;
67816776
}
67826777

6783-
ut_free(tmp_str);
67846778
break;
67856779
}
67866780
case MYSQL_TYPE_DECIMAL :
@@ -7132,7 +7126,7 @@ wsrep_store_key_val_for_row(
71327126
THD* thd,
71337127
TABLE* table,
71347128
uint keynr, /*!< in: key number */
7135-
uchar* buff, /*!< in/out: buffer for the key value (in MySQL
7129+
char* buff, /*!< in/out: buffer for the key value (in MySQL
71367130
format) */
71377131
uint buff_len,/*!< in: buffer length */
71387132
const uchar* record,
@@ -7141,7 +7135,7 @@ wsrep_store_key_val_for_row(
71417135
KEY* key_info = table->key_info + keynr;
71427136
KEY_PART_INFO* key_part = key_info->key_part;
71437137
KEY_PART_INFO* end = key_part + key_info->user_defined_key_parts;
7144-
uchar* buff_start = buff;
7138+
char* buff_start = buff;
71457139
enum_field_types mysql_type;
71467140
Field* field;
71477141
uint buff_space = buff_len;
@@ -7153,8 +7147,7 @@ wsrep_store_key_val_for_row(
71537147

71547148
for (; key_part != end; key_part++) {
71557149

7156-
uchar *sorted=NULL;
7157-
uint max_len=0;
7150+
uchar sorted[REC_VERSION_56_MAX_INDEX_COL_LEN] = {'\0'};
71587151
ibool part_is_null = FALSE;
71597152

71607153
if (key_part->null_bit) {
@@ -7233,14 +7226,10 @@ wsrep_store_key_val_for_row(
72337226
true_len = key_len;
72347227
}
72357228

7236-
max_len= true_len;
7237-
sorted= static_cast<uchar *>(ut_malloc_nokey(max_len+1));
72387229
memcpy(sorted, data, true_len);
72397230
true_len = wsrep_innobase_mysql_sort(
72407231
mysql_type, cs->number, sorted, true_len,
7241-
max_len);
7242-
ut_ad(true_len <= max_len);
7243-
7232+
REC_VERSION_56_MAX_INDEX_COL_LEN);
72447233
if (wsrep_protocol_version > 1) {
72457234
/* Note that we always reserve the maximum possible
72467235
length of the true VARCHAR in the key value, though
@@ -7325,13 +7314,11 @@ wsrep_store_key_val_for_row(
73257314
true_len = key_len;
73267315
}
73277316

7328-
max_len= true_len;
7329-
sorted= static_cast<uchar *>(ut_malloc_nokey(max_len+1));
73307317
memcpy(sorted, blob_data, true_len);
73317318
true_len = wsrep_innobase_mysql_sort(
73327319
mysql_type, cs->number, sorted, true_len,
7333-
max_len);
7334-
ut_ad(true_len <= max_len);
7320+
REC_VERSION_56_MAX_INDEX_COL_LEN);
7321+
73357322

73367323
/* Note that we always reserve the maximum possible
73377324
length of the BLOB prefix in the key value. */
@@ -7407,14 +7394,10 @@ wsrep_store_key_val_for_row(
74077394
cs->mbmaxlen),
74087395
&error);
74097396
}
7410-
7411-
max_len= true_len;
7412-
sorted= static_cast<uchar *>(ut_malloc_nokey(max_len+1));
74137397
memcpy(sorted, src_start, true_len);
74147398
true_len = wsrep_innobase_mysql_sort(
74157399
mysql_type, cs->number, sorted, true_len,
7416-
max_len);
7417-
ut_ad(true_len <= max_len);
7400+
REC_VERSION_56_MAX_INDEX_COL_LEN);
74187401

74197402
if (true_len > buff_space) {
74207403
fprintf (stderr,
@@ -7429,11 +7412,6 @@ wsrep_store_key_val_for_row(
74297412
buff += true_len;
74307413
buff_space -= true_len;
74317414
}
7432-
7433-
if (sorted) {
7434-
ut_free(sorted);
7435-
sorted= NULL;
7436-
}
74377415
}
74387416

74397417
ut_a(buff <= buff_start + buff_len);
@@ -10510,7 +10488,7 @@ wsrep_append_key(
1051010488
trx_t *trx,
1051110489
TABLE_SHARE *table_share,
1051210490
TABLE *table,
10513-
const uchar* key,
10491+
const char* key,
1051410492
uint16_t key_len,
1051510493
wsrep_key_type key_type /*!< in: access type of this key
1051610494
(shared, exclusive, semi...) */
@@ -10614,8 +10592,8 @@ ha_innobase::wsrep_append_keys(
1061410592

1061510593
if (wsrep_protocol_version == 0) {
1061610594
uint len;
10617-
uchar keyval[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
10618-
uchar *key = &keyval[0];
10595+
char keyval[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
10596+
char *key = &keyval[0];
1061910597
ibool is_null;
1062010598

1062110599
len = wsrep_store_key_val_for_row(
@@ -10647,18 +10625,18 @@ ha_innobase::wsrep_append_keys(
1064710625

1064810626
for (i=0; i<table->s->keys; ++i) {
1064910627
uint len;
10650-
uchar keyval0[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
10651-
uchar keyval1[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
10652-
uchar* key0 = &keyval0[1];
10653-
uchar* key1 = &keyval1[1];
10628+
char keyval0[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
10629+
char keyval1[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'};
10630+
char* key0 = &keyval0[1];
10631+
char* key1 = &keyval1[1];
1065410632
KEY* key_info = table->key_info + i;
1065510633
ibool is_null;
1065610634

1065710635
dict_index_t* idx = innobase_get_index(i);
1065810636
dict_table_t* tab = (idx) ? idx->table : NULL;
1065910637

10660-
keyval0[0] = (uchar)i;
10661-
keyval1[0] = (uchar)i;
10638+
keyval0[0] = (char)i;
10639+
keyval1[0] = (char)i;
1066210640

1066310641
if (!tab) {
1066410642
WSREP_WARN("MariaDB-InnoDB key mismatch %s %s",
@@ -10716,7 +10694,7 @@ ha_innobase::wsrep_append_keys(
1071610694

1071710695
wsrep_calc_row_hash(digest, record0, table, m_prebuilt, thd);
1071810696
if ((rcode = wsrep_append_key(thd, trx, table_share, table,
10719-
(const uchar*) digest, 16,
10697+
(const char*) digest, 16,
1072010698
key_type))) {
1072110699
DBUG_RETURN(rcode);
1072210700
}
@@ -10726,7 +10704,7 @@ ha_innobase::wsrep_append_keys(
1072610704
digest, record1, table, m_prebuilt, thd);
1072710705
if ((rcode = wsrep_append_key(thd, trx, table_share,
1072810706
table,
10729-
(const uchar*) digest,
10707+
(const char*) digest,
1073010708
16, key_type))) {
1073110709
DBUG_RETURN(rcode);
1073210710
}

0 commit comments

Comments
 (0)