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
MDEV-12936 upgrade to 10.2.6 failed upon tables with virtual columns
when opening 10.1- table that has virtual columns: 1. don't error out if it has vcols over autoinc columns. just issue a warning. 2. set vcol type properly 3. in innodb: use table->s->stored_fields instead of table->s->fields, because that's what was stored in innodb data dictionary
- Loading branch information
Showing
7 changed files
with
56 additions
and
12 deletions.
There are no files selected for viewing
Empty file.
Binary file not shown.
BIN
+951 Bytes
mysql-test/std_data/vcol_autoinc.frm
Binary file not shown.
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 @@ | ||
| check table vcol_autoinc for upgrade; | ||
| Table Op Msg_type Msg_text | ||
| test.vcol_autoinc check Warning Function or expression 'AUTO_INCREMENT' cannot be used in the GENERATED ALWAYS AS clause of `pk` | ||
| test.vcol_autoinc check status OK | ||
| show create table vcol_autoinc; | ||
| Table Create Table | ||
| vcol_autoinc CREATE TABLE `vcol_autoinc` ( | ||
| `pk` int(11) NOT NULL AUTO_INCREMENT, | ||
| `v3` int(11) GENERATED ALWAYS AS (`pk`) VIRTUAL, | ||
| PRIMARY KEY (`pk`) | ||
| ) ENGINE=MyISAM DEFAULT CHARSET=latin1 | ||
| select * from vcol_autoinc; | ||
| pk v3 | ||
| insert vcol_autoinc (pk) values (1); | ||
| select * from vcol_autoinc; | ||
| pk v3 | ||
| 1 1 | ||
| drop table vcol_autoinc; |
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,13 @@ | ||
| # | ||
| # MDEV-12936 upgrade to 10.2.6 failed upon tables with virtual columns | ||
| # | ||
| let $datadir=`select @@datadir`; | ||
| copy_file std_data/vcol_autoinc.frm $datadir/test/vcol_autoinc.frm; | ||
| copy_file std_data/vcol_autoinc.MYD $datadir/test/vcol_autoinc.MYD; | ||
| copy_file std_data/vcol_autoinc.MYI $datadir/test/vcol_autoinc.MYI; | ||
| check table vcol_autoinc for upgrade; | ||
| show create table vcol_autoinc; | ||
| select * from vcol_autoinc; | ||
| insert vcol_autoinc (pk) values (1); | ||
| select * from vcol_autoinc; | ||
| drop table vcol_autoinc; |
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