This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lightning: evaluate all generated columns even if they are virtual (#…
- Loading branch information
1 parent
0ef10e6
commit 3ac0ac1
Showing
8 changed files
with
53 additions
and
8 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
11 changes: 11 additions & 0 deletions
11
tests/lightning_generated_columns/data/gencol.expr_index-schema.sql
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,11 @@ | ||
-- https://github.com/pingcap/br/issues/1404 | ||
-- expression indices just use a hidden virtual generated column behind the scene. | ||
|
||
CREATE TABLE `expr_index` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`a` varchar(20) DEFAULT NULL, | ||
`b` varchar(20) DEFAULT NULL, | ||
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */, | ||
KEY `idx_a` (`a`), | ||
KEY `idx_lower_b` ((lower(`b`))) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=90003; |
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 @@ | ||
insert into expr_index (id, a, b) values (1, 'aaa', 'bbb'), (2, 'ABC', 'CDSFDS'); |
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
5 changes: 5 additions & 0 deletions
5
tests/lightning_generated_columns/data/gencol.virtual_only-schema.sql
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,5 @@ | ||
create table virtual_only ( | ||
id int primary key, | ||
id_plus_1 int as (id + 1) virtual, | ||
id_plus_2 int as (id + 2) virtual | ||
); |
1 change: 1 addition & 0 deletions
1
tests/lightning_generated_columns/data/gencol.virtual_only.0.sql
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 @@ | ||
insert into virtual_only (id) values (30), (40); |
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