Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
MDEV-16768: fix blob key length
The blob key length could be shorter than the length of the entire blob,
for example,
CREATE TABLE t1 (b BLOB, i INT, KEY(b(8)));
INSERT INTO t1 VALUES (REPEAT('a',9),1);
The key length is 8, while the blob length is 9.
So we need to set the correct key length in Field_blob::sort_string().- Loading branch information
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| include/master-slave.inc | ||
| [connection master] | ||
| CREATE TABLE t1 (b BLOB, i INT, KEY(b(8))) ENGINE=RocksDB; | ||
| INSERT INTO t1 VALUES (REPEAT('a',9),1); | ||
| UPDATE t1 SET i = 2; | ||
| connection slave; | ||
| connection master; | ||
| DROP TABLE t1; | ||
| include/rpl_end.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --source include/have_rocksdb.inc | ||
| --source include/have_binlog_format_row.inc | ||
| --source include/master-slave.inc | ||
|
|
||
| CREATE TABLE t1 (b BLOB, i INT, KEY(b(8))) ENGINE=RocksDB; | ||
| INSERT INTO t1 VALUES (REPEAT('a',9),1); | ||
|
|
||
| UPDATE t1 SET i = 2; | ||
|
|
||
| --sync_slave_with_master | ||
|
|
||
| # Cleanup | ||
| --connection master | ||
| DROP TABLE t1; | ||
| --source include/rpl_end.inc |