Skip to content

Commit a285e68

Browse files
committed
Merge 10.2 into bb-10.2-ext
2 parents 8695c81 + e12f77a commit a285e68

File tree

6 files changed

+57
-11
lines changed

6 files changed

+57
-11
lines changed

mysql-test/suite/sql_sequence/alter.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ ERROR 42S02: 'test.t1' is not a SEQUENCE
212212
drop table t1;
213213
alter sequence if exists t1 minvalue=100;
214214
Warnings:
215-
Note 4090 Unknown SEQUENCE: 'test.t1'
215+
Note 4091 Unknown SEQUENCE: 'test.t1'
216216
alter sequence t1 minvalue=100;
217217
ERROR 42S02: Table 'test.t1' doesn't exist
218218
create sequence t1;

mysql-test/suite/sql_sequence/create.result

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ drop sequence t1;
165165
ERROR 42S02: 'test.t1' is not a SEQUENCE
166166
drop sequence if exists t1;
167167
Warnings:
168-
Note 4090 Unknown SEQUENCE: 'test.t1'
168+
Note 4091 Unknown SEQUENCE: 'test.t1'
169169
create sequence t1 start with 10 maxvalue=9;
170170
ERROR HY000: Sequence 'test.t1' values are conflicting
171171
create sequence t1 minvalue= 100 maxvalue=10;
@@ -377,7 +377,7 @@ key key1 (next_not_cached_value)
377377
ERROR HY000: Sequence 'test.t1' table structure is invalid (Sequence tables cannot have any keys)
378378
drop sequence if exists t1;
379379
Warnings:
380-
Note 4090 Unknown SEQUENCE: 'test.t1'
380+
Note 4091 Unknown SEQUENCE: 'test.t1'
381381
create sequence t1;
382382
create sequence t2;
383383
create table t3 (a int) engine=myisam;
@@ -387,8 +387,8 @@ CREATE SEQUENCE s1;
387387
drop sequence s1;
388388
drop sequence if exists t1,t2,t3,t4;
389389
Warnings:
390-
Note 4090 Unknown SEQUENCE: 'test.t3'
391-
Note 4090 Unknown SEQUENCE: 'test.t4'
390+
Note 4091 Unknown SEQUENCE: 'test.t3'
391+
Note 4091 Unknown SEQUENCE: 'test.t4'
392392
drop table if exists t1,t2,t3;
393393
Warnings:
394394
Note 1051 Unknown table 'test.t1'
@@ -414,9 +414,9 @@ CREATE TABLE t2 (a int);
414414
CREATE SEQUENCE s1;
415415
drop sequence if exists t1,t2,s1,s2;
416416
Warnings:
417-
Note 4090 Unknown SEQUENCE: 'test.t1'
418-
Note 4090 Unknown SEQUENCE: 'test.t2'
419-
Note 4090 Unknown SEQUENCE: 'test.s2'
417+
Note 4091 Unknown SEQUENCE: 'test.t1'
418+
Note 4091 Unknown SEQUENCE: 'test.t2'
419+
Note 4091 Unknown SEQUENCE: 'test.s2'
420420
drop table if exists t1,t2;
421421
CREATE TEMPORARY SEQUENCE s1;
422422
DROP SEQUENCE s1;

sql/share/errmsg-utf8.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7750,6 +7750,9 @@ ER_NET_OK_PACKET_TOO_LARGE
77507750
ER_GEOJSON_EMPTY_COORDINATES
77517751
eng "Incorrect GeoJSON format - empty 'coordinates' array."
77527752

7753+
ER_MYROCKS_CANT_NOPAD_COLLATION
7754+
eng "MyRocks doesn't currently support collations with \"No pad\" attribute."
7755+
77537756
ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
77547757
eng "Illegal parameter data types %s and %s for operation '%s'"
77557758
ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION

storage/rocksdb/ha_rocksdb.cc

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5964,6 +5964,19 @@ rdb_is_index_collation_supported(const my_core::Field *const field) {
59645964
return true;
59655965
}
59665966

5967+
5968+
static bool
5969+
rdb_field_uses_nopad_collation(const my_core::Field *const field) {
5970+
const my_core::enum_field_types type = field->real_type();
5971+
/* Handle [VAR](CHAR|BINARY) or TEXT|BLOB */
5972+
if (type == MYSQL_TYPE_VARCHAR || type == MYSQL_TYPE_STRING ||
5973+
type == MYSQL_TYPE_BLOB) {
5974+
return (field->charset()->state & MY_CS_NOPAD);
5975+
}
5976+
return false;
5977+
}
5978+
5979+
59675980
/*
59685981
Create structures needed for storing data in rocksdb. This is called when the
59695982
table is created. The structures will be shared by all TABLE* objects.
@@ -6072,8 +6085,7 @@ int ha_rocksdb::create_cfs(
60726085
for (uint i = 0; i < tbl_def_arg->m_key_count; i++) {
60736086
rocksdb::ColumnFamilyHandle *cf_handle;
60746087

6075-
if (rocksdb_strict_collation_check &&
6076-
!is_hidden_pk(i, table_arg, tbl_def_arg) &&
6088+
if (!is_hidden_pk(i, table_arg, tbl_def_arg) &&
60776089
tbl_def_arg->base_tablename().find(tmp_file_prefix) != 0) {
60786090
if (!tsys_set)
60796091
{
@@ -6085,7 +6097,16 @@ int ha_rocksdb::create_cfs(
60856097
for (uint part = 0; part < table_arg->key_info[i].ext_key_parts;
60866098
part++)
60876099
{
6088-
if (!rdb_is_index_collation_supported(
6100+
/* MariaDB: disallow NOPAD collations */
6101+
if (rdb_field_uses_nopad_collation(
6102+
table_arg->key_info[i].key_part[part].field))
6103+
{
6104+
my_error(ER_MYROCKS_CANT_NOPAD_COLLATION, MYF(0));
6105+
DBUG_RETURN(HA_EXIT_FAILURE);
6106+
}
6107+
6108+
if (rocksdb_strict_collation_check &&
6109+
!rdb_is_index_collation_supported(
60896110
table_arg->key_info[i].key_part[part].field) &&
60906111
!rdb_collation_exceptions->matches(tablename_sys)) {
60916112
std::string collation_err;

storage/rocksdb/mysql-test/rocksdb/r/mariadb_port_fixes.result

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,12 @@ id select_type table type possible_keys key key_len ref rows Extra
5555
1 SIMPLE t2 range a a 32 NULL # Using where
5656
drop table t1,t2;
5757
set global rocksdb_strict_collation_check=@tmp_rscc;
58+
#
59+
# MDEV-14389: MyRocks and NOPAD collations
60+
#
61+
create table t1 (pk varchar(10) collate latin1_nopad_bin, primary key(pk)) engine=rocksdb;
62+
ERROR HY000: MyRocks doesn't currently support collations with "No pad" attribute.
63+
set global rocksdb_strict_collation_check=off;
64+
create table t1 (pk varchar(10) collate latin1_nopad_bin, primary key(pk)) engine=rocksdb;
65+
ERROR HY000: MyRocks doesn't currently support collations with "No pad" attribute.
66+
set global rocksdb_strict_collation_check=@tmp_rscc;

storage/rocksdb/mysql-test/rocksdb/t/mariadb_port_fixes.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,16 @@ explain select a from t2 where a <'zzz';
5454
drop table t1,t2;
5555

5656
set global rocksdb_strict_collation_check=@tmp_rscc;
57+
58+
--echo #
59+
--echo # MDEV-14389: MyRocks and NOPAD collations
60+
--echo #
61+
62+
--error ER_MYROCKS_CANT_NOPAD_COLLATION
63+
create table t1 (pk varchar(10) collate latin1_nopad_bin, primary key(pk)) engine=rocksdb;
64+
65+
set global rocksdb_strict_collation_check=off;
66+
--error ER_MYROCKS_CANT_NOPAD_COLLATION
67+
create table t1 (pk varchar(10) collate latin1_nopad_bin, primary key(pk)) engine=rocksdb;
68+
69+
set global rocksdb_strict_collation_check=@tmp_rscc;

0 commit comments

Comments
 (0)