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
Add PART_INDIRECT_KEY_FLAG
This is to mark that a field is indirectly part of a key, which simplifes
checking if we need to have this field up to date to evaluate a key.
For example:
CREATE TABLE t1 (a int, b int as (a) virtual,
c int as (b) virtual, index(c))
would mark a and b with PART_INDIRECT_KEY_FLAG.
c is marked with PART_KEY_FLAG as before.- Loading branch information
Showing
6 changed files
with
126 additions
and
21 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=myisam; | ||
| insert into t1 (a) values (1),(2),(3); | ||
| update t1 set a=5 where a=3; | ||
| delete from t1 where a=1; | ||
| select * from t1; | ||
| a b c | ||
| 2 3 4 | ||
| 5 6 7 | ||
| select * from t1 where c=7; | ||
| a b c | ||
| 5 6 7 | ||
| check table t1; | ||
| Table Op Msg_type Msg_text | ||
| test.t1 check status OK | ||
| select * from t1; | ||
| a b c | ||
| 2 3 4 | ||
| 5 6 7 | ||
| drop table t1; | ||
| CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=innodb; | ||
| insert into t1 (a) values (1),(2),(3); | ||
| update t1 set a=5 where a=3; | ||
| delete from t1 where a=1; | ||
| select * from t1; | ||
| a b c | ||
| 2 3 4 | ||
| 5 6 7 | ||
| select * from t1 where c=7; | ||
| a b c | ||
| 5 6 7 | ||
| check table t1; | ||
| Table Op Msg_type Msg_text | ||
| test.t1 check status OK | ||
| select * from t1; | ||
| a b c | ||
| 2 3 4 | ||
| 5 6 7 | ||
| drop table t1; |
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,25 @@ | ||
| --source include/have_innodb.inc | ||
|
|
||
| # | ||
| # Test creating table with a key that consists of indirect virtual fields | ||
| # | ||
|
|
||
| CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=myisam; | ||
| insert into t1 (a) values (1),(2),(3); | ||
| update t1 set a=5 where a=3; | ||
| delete from t1 where a=1; | ||
| select * from t1; | ||
| select * from t1 where c=7; | ||
| check table t1; | ||
| select * from t1; | ||
| drop table t1; | ||
|
|
||
| CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=innodb; | ||
| insert into t1 (a) values (1),(2),(3); | ||
| update t1 set a=5 where a=3; | ||
| delete from t1 where a=1; | ||
| select * from t1; | ||
| select * from t1 where c=7; | ||
| check table t1; | ||
| select * from t1; | ||
| drop table t1; |
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