forked from facebook/mysql-5.6
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add index length limit (facebook#673) (facebook#673)
Summary: Address facebook#665. Changes: * Adds a variable `rocksdb_large_prefix` to mirror `innodb_large_prefix`. If on, the index length limit is 3072 bytes. If off, it is 767. * Modifies `ha_rocksdb::max_supported_key_part_length` to return the new limits. The values for `large_prefix` should be the same between master and slave. In 5.6 `innodb_large_prefix` defaults to off. In 5.7.7 it is deprecated and defaults to on. https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix Closes facebook#673 Differential Revision: D5554460 Pulled By: pbjc
- Loading branch information
Paul Choi
authored and
Herman Lee
committed
Jul 13, 2022
1 parent
f8d7093
commit 749f1dc
Showing
14 changed files
with
288 additions
and
6 deletions.
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
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
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
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
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
64 changes: 64 additions & 0 deletions
64
mysql-test/suite/rocksdb_sys_vars/r/rocksdb_large_prefix_basic.result
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,64 @@ | ||
CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; | ||
INSERT INTO valid_values VALUES(1); | ||
INSERT INTO valid_values VALUES(0); | ||
INSERT INTO valid_values VALUES('on'); | ||
CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; | ||
INSERT INTO invalid_values VALUES('\'aaa\''); | ||
INSERT INTO invalid_values VALUES('\'bbb\''); | ||
SET @start_global_value = @@global.ROCKSDB_LARGE_PREFIX; | ||
SELECT @start_global_value; | ||
@start_global_value | ||
0 | ||
'# Setting to valid values in global scope#' | ||
"Trying to set variable @@global.ROCKSDB_LARGE_PREFIX to 1" | ||
SET @@global.ROCKSDB_LARGE_PREFIX = 1; | ||
SELECT @@global.ROCKSDB_LARGE_PREFIX; | ||
@@global.ROCKSDB_LARGE_PREFIX | ||
1 | ||
"Setting the global scope variable back to default" | ||
SET @@global.ROCKSDB_LARGE_PREFIX = DEFAULT; | ||
SELECT @@global.ROCKSDB_LARGE_PREFIX; | ||
@@global.ROCKSDB_LARGE_PREFIX | ||
0 | ||
"Trying to set variable @@global.ROCKSDB_LARGE_PREFIX to 0" | ||
SET @@global.ROCKSDB_LARGE_PREFIX = 0; | ||
SELECT @@global.ROCKSDB_LARGE_PREFIX; | ||
@@global.ROCKSDB_LARGE_PREFIX | ||
0 | ||
"Setting the global scope variable back to default" | ||
SET @@global.ROCKSDB_LARGE_PREFIX = DEFAULT; | ||
SELECT @@global.ROCKSDB_LARGE_PREFIX; | ||
@@global.ROCKSDB_LARGE_PREFIX | ||
0 | ||
"Trying to set variable @@global.ROCKSDB_LARGE_PREFIX to on" | ||
SET @@global.ROCKSDB_LARGE_PREFIX = on; | ||
SELECT @@global.ROCKSDB_LARGE_PREFIX; | ||
@@global.ROCKSDB_LARGE_PREFIX | ||
1 | ||
"Setting the global scope variable back to default" | ||
SET @@global.ROCKSDB_LARGE_PREFIX = DEFAULT; | ||
SELECT @@global.ROCKSDB_LARGE_PREFIX; | ||
@@global.ROCKSDB_LARGE_PREFIX | ||
0 | ||
"Trying to set variable @@session.ROCKSDB_LARGE_PREFIX to 444. It should fail because it is not session." | ||
SET @@session.ROCKSDB_LARGE_PREFIX = 444; | ||
ERROR HY000: Variable 'rocksdb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL | ||
'# Testing with invalid values in global scope #' | ||
"Trying to set variable @@global.ROCKSDB_LARGE_PREFIX to 'aaa'" | ||
SET @@global.ROCKSDB_LARGE_PREFIX = 'aaa'; | ||
Got one of the listed errors | ||
SELECT @@global.ROCKSDB_LARGE_PREFIX; | ||
@@global.ROCKSDB_LARGE_PREFIX | ||
0 | ||
"Trying to set variable @@global.ROCKSDB_LARGE_PREFIX to 'bbb'" | ||
SET @@global.ROCKSDB_LARGE_PREFIX = 'bbb'; | ||
Got one of the listed errors | ||
SELECT @@global.ROCKSDB_LARGE_PREFIX; | ||
@@global.ROCKSDB_LARGE_PREFIX | ||
0 | ||
SET @@global.ROCKSDB_LARGE_PREFIX = @start_global_value; | ||
SELECT @@global.ROCKSDB_LARGE_PREFIX; | ||
@@global.ROCKSDB_LARGE_PREFIX | ||
0 | ||
DROP TABLE valid_values; | ||
DROP TABLE invalid_values; |
18 changes: 18 additions & 0 deletions
18
mysql-test/suite/rocksdb_sys_vars/t/rocksdb_large_prefix_basic.test
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,18 @@ | ||
--source include/have_rocksdb.inc | ||
|
||
CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam; | ||
INSERT INTO valid_values VALUES(1); | ||
INSERT INTO valid_values VALUES(0); | ||
INSERT INTO valid_values VALUES('on'); | ||
|
||
CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam; | ||
INSERT INTO invalid_values VALUES('\'aaa\''); | ||
INSERT INTO invalid_values VALUES('\'bbb\''); | ||
|
||
--let $sys_var=ROCKSDB_LARGE_PREFIX | ||
--let $read_only=0 | ||
--let $session=0 | ||
--source ../include/rocksdb_sys_var.inc | ||
|
||
DROP TABLE valid_values; | ||
DROP TABLE invalid_values; |
Oops, something went wrong.