-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #595 from github/support-generated-columns
Support for GENERATED (aka virtual) columns
- Loading branch information
Showing
17 changed files
with
134 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
drop table if exists gh_ost_test; | ||
create table gh_ost_test ( | ||
id int auto_increment, | ||
a int not null, | ||
b int not null, | ||
primary key(id) | ||
) auto_increment=1; | ||
|
||
drop event if exists gh_ost_test; | ||
delimiter ;; | ||
create event gh_ost_test | ||
on schedule every 1 second | ||
starts current_timestamp | ||
ends current_timestamp + interval 60 second | ||
on completion not preserve | ||
enable | ||
do | ||
begin | ||
insert into gh_ost_test (id, a, b) values (null, 2,3); | ||
insert into gh_ost_test (id, a, b) values (null, 2,4); | ||
insert into gh_ost_test (id, a, b) values (null, 2,5); | ||
insert into gh_ost_test (id, a, b) values (null, 2,6); | ||
insert into gh_ost_test (id, a, b) values (null, 2,7); | ||
insert into gh_ost_test (id, a, b) values (null, 2,8); | ||
insert into gh_ost_test (id, a, b) values (null, 2,9); | ||
insert into gh_ost_test (id, a, b) values (null, 2,0); | ||
insert into gh_ost_test (id, a, b) values (null, 2,1); | ||
insert into gh_ost_test (id, a, b) values (null, 2,2); | ||
end ;; |
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 @@ | ||
--alter="add column sum_ab int as (a + b) virtual not null" |
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 @@ | ||
id, a, b |
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.5|5.6) |
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 @@ | ||
id |
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 @@ | ||
id, a, b |
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,30 @@ | ||
drop table if exists gh_ost_test; | ||
create table gh_ost_test ( | ||
id int auto_increment, | ||
a int not null, | ||
b int not null, | ||
sum_ab int as (a + b) virtual not null, | ||
primary key(id) | ||
) auto_increment=1; | ||
|
||
drop event if exists gh_ost_test; | ||
delimiter ;; | ||
create event gh_ost_test | ||
on schedule every 1 second | ||
starts current_timestamp | ||
ends current_timestamp + interval 60 second | ||
on completion not preserve | ||
enable | ||
do | ||
begin | ||
insert into gh_ost_test (id, a, b) values (null, 2,3); | ||
insert into gh_ost_test (id, a, b) values (null, 2,4); | ||
insert into gh_ost_test (id, a, b) values (null, 2,5); | ||
insert into gh_ost_test (id, a, b) values (null, 2,6); | ||
insert into gh_ost_test (id, a, b) values (null, 2,7); | ||
insert into gh_ost_test (id, a, b) values (null, 2,8); | ||
insert into gh_ost_test (id, a, b) values (null, 2,9); | ||
insert into gh_ost_test (id, a, b) values (null, 2,0); | ||
insert into gh_ost_test (id, a, b) values (null, 2,1); | ||
insert into gh_ost_test (id, a, b) values (null, 2,2); | ||
end ;; |
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 @@ | ||
--alter="change sum_ab total_ab int as (a + b) virtual not null" --approve-renamed-columns |
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.5|5.6) |
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,30 @@ | ||
drop table if exists gh_ost_test; | ||
create table gh_ost_test ( | ||
id int auto_increment, | ||
a int not null, | ||
b int not null, | ||
sum_ab int as (a + b) virtual not null, | ||
primary key(id) | ||
) auto_increment=1; | ||
|
||
drop event if exists gh_ost_test; | ||
delimiter ;; | ||
create event gh_ost_test | ||
on schedule every 1 second | ||
starts current_timestamp | ||
ends current_timestamp + interval 60 second | ||
on completion not preserve | ||
enable | ||
do | ||
begin | ||
insert into gh_ost_test (id, a, b) values (null, 2,3); | ||
insert into gh_ost_test (id, a, b) values (null, 2,4); | ||
insert into gh_ost_test (id, a, b) values (null, 2,5); | ||
insert into gh_ost_test (id, a, b) values (null, 2,6); | ||
insert into gh_ost_test (id, a, b) values (null, 2,7); | ||
insert into gh_ost_test (id, a, b) values (null, 2,8); | ||
insert into gh_ost_test (id, a, b) values (null, 2,9); | ||
insert into gh_ost_test (id, a, b) values (null, 2,0); | ||
insert into gh_ost_test (id, a, b) values (null, 2,1); | ||
insert into gh_ost_test (id, a, b) values (null, 2,2); | ||
end ;; |
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.5|5.6) |
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