-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
MDEV-40168 wip #5620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mariadb-YuchenPei
wants to merge
1
commit into
main
Choose a base branch
from
bb-main-mdev-40168
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+626
−34
Draft
MDEV-40168 wip #5620
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 @@ | ||
| --innodb_ft_index_cache |
This file contains hidden or 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,51 @@ | ||
| # basic test | ||
| SET SESSION debug_dbug = '+d,test_invisible_index,test_completely_invisible'; | ||
| create table t1 (c int, j json, key idx ((CAST(j->'$.tags' AS CHAR(6) ARRAY))))engine=innodb; | ||
| SHOW CREATE TABLE t1; | ||
| Table Create Table | ||
| t1 CREATE TABLE `t1` ( | ||
| `c` int(11) DEFAULT NULL, | ||
| `j` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`j`)) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci | ||
| show index from t1; | ||
| Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored | ||
| t1 1 invisible1 1 invisible1 A 0 NULL NULL YES BTREE NO | ||
| t1 1 idx 1 DB_MVI_1 NULL NULL NULL NULL YES FULLTEXT NO | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do I miss something or the table has TWO indexes? one BTREE and one FULLTEXT?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a side effect of the debug_dbug: |
||
| set @old_innodb_ft_aux_table=@@global.innodb_ft_aux_table; | ||
| set global innodb_ft_aux_table='test/t1'; | ||
| insert into t1 values (1, '{"tags": [1, "abcde", "34567", "", 34567]}'); | ||
| SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE; | ||
| WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION | ||
| 31xx 1 1 1 1 0 | ||
| 3334353637 1 1 1 1 16 | ||
| 3334353637 1 1 1 1 16 | ||
| 6162636465 1 1 1 1 5 | ||
| xxxx 1 1 1 1 27 | ||
| select json_contains(j->'$.tags', '"abcde"') from t1; | ||
| json_contains(j->'$.tags', '"abcde"') | ||
| 1 | ||
| explain | ||
| select * from t1 where json_contains(j->'$.tags', '"abcde"'); | ||
| id select_type table type possible_keys key key_len ref rows Extra | ||
| 1 SIMPLE t1 fulltext idx idx 0 1 Using where | ||
| select * from t1 where json_contains(j->'$.tags', '"abcde"'); | ||
| c j | ||
| 1 {"tags": [1, "abcde", "34567", "", 34567]} | ||
| DROP TABLE t1; | ||
| set global innodb_ft_aux_table=@old_innodb_ft_aux_table; | ||
| # direct call of mvi_encode | ||
| select mvi_encode('[1, 42, "3"]', int); | ||
| mvi_encode('[1, 42, "3"]', int) | ||
| 8000000000000001 800000000000002a 8000000000000003 | ||
| select mvi_encode('[1, 42, "3"]', unsigned); | ||
| mvi_encode('[1, 42, "3"]', unsigned) | ||
| 0000000000000001 000000000000002a 0000000000000003 | ||
| select mvi_encode('[1, 42, "3 "]', char(6)); | ||
| mvi_encode('[1, 42, "3 "]', char(6)) | ||
| 31xx 3432 33xx | ||
| select mvi_encode('[1, 42, " "]', char(6)); | ||
| mvi_encode('[1, 42, " "]', char(6)) | ||
| 31xx 3432 xxxx | ||
| select mvi_encode('[1, 42, "3 "]', binary(6)); | ||
| mvi_encode('[1, 42, "3 "]', binary(6)) | ||
| 31xx 3432 33xx | ||
This file contains hidden or 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,32 @@ | ||
| --source include/have_debug.inc | ||
| --source include/have_innodb.inc | ||
|
|
||
| --echo # basic test | ||
| SET SESSION debug_dbug = '+d,test_invisible_index,test_completely_invisible'; | ||
|
|
||
| create table t1 (c int, j json, key idx ((CAST(j->'$.tags' AS CHAR(6) ARRAY))))engine=innodb; | ||
| SHOW CREATE TABLE t1; | ||
| show index from t1; | ||
|
|
||
| set @old_innodb_ft_aux_table=@@global.innodb_ft_aux_table; | ||
| set global innodb_ft_aux_table='test/t1'; | ||
|
|
||
| insert into t1 values (1, '{"tags": [1, "abcde", "34567", "", 34567]}'); | ||
|
|
||
| SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE; | ||
|
|
||
| select json_contains(j->'$.tags', '"abcde"') from t1; | ||
| explain | ||
| select * from t1 where json_contains(j->'$.tags', '"abcde"'); | ||
| select * from t1 where json_contains(j->'$.tags', '"abcde"'); | ||
|
|
||
| DROP TABLE t1; | ||
|
|
||
| set global innodb_ft_aux_table=@old_innodb_ft_aux_table; | ||
|
|
||
| --echo # direct call of mvi_encode | ||
| select mvi_encode('[1, 42, "3"]', int); | ||
| select mvi_encode('[1, 42, "3"]', unsigned); | ||
| select mvi_encode('[1, 42, "3 "]', char(6)); | ||
| select mvi_encode('[1, 42, " "]', char(6)); | ||
| select mvi_encode('[1, 42, "3 "]', binary(6)); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the index is now shown in SHOW CREATE TABLE ?