Commit fca44b7c authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-17909 Problem by MariaDB Update 10.1.32 -> 10.2.19 (Incorrect information in file: .frm)

use frm_version, not mysql_version when parsing frm

In particular, virtual columns are stored according to
frm_version. And CHECK TABLE will overwrite mysql_version
to the current server version, so it cannot correctly
describe frm format.
parent e765b47e
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -16,3 +16,19 @@ select * from vcol_autoinc;
pk v3
1 1
drop table vcol_autoinc;
check table t1 for upgrade;
Table Op Msg_type Msg_text
test.t1 check status OK
flush tables;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`Date` datetime(6) NOT NULL,
`Data` varbinary(2000) NOT NULL,
`a` varchar(100) GENERATED ALWAYS AS (column_get(`Data`,1 as char(100) charset latin1)) VIRTUAL,
PRIMARY KEY (`Date`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE (to_days(`Date`))
(PARTITION `p20181029` VALUES LESS THAN (737361) ENGINE = MyISAM,
PARTITION `p20181128` VALUES LESS THAN (737391) ENGINE = MyISAM)
drop table t1;
......@@ -11,3 +11,18 @@ select * from vcol_autoinc;
insert vcol_autoinc (pk) values (1);
select * from vcol_autoinc;
drop table vcol_autoinc;
#
# MDEV-17909 Problem by MariaDB Update 10.1.32 -> 10.2.19 (Incorrect information in file: .frm)
#
source include/have_partition.inc;
copy_file std_data/mdev17909#P#p20181029.MYD $datadir/test/t1#P#p20181029.MYD;
copy_file std_data/mdev17909#P#p20181029.MYI $datadir/test/t1#P#p20181029.MYI;
copy_file std_data/mdev17909#P#p20181128.MYD $datadir/test/t1#P#p20181128.MYD;
copy_file std_data/mdev17909#P#p20181128.MYI $datadir/test/t1#P#p20181128.MYI;
copy_file std_data/mdev17909.frm $datadir/test/t1.frm;
copy_file std_data/mdev17909.par $datadir/test/t1.par;
check table t1 for upgrade;
flush tables;
show create table t1;
drop table t1;
......@@ -1027,7 +1027,7 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
while (pos < end)
{
uint type, expr_length;
if (table->s->mysql_version >= 100202)
if (table->s->frm_version >= FRM_VER_EXPRESSSIONS)
{
uint field_nr, name_length;
/* see pack_expression() for how data is stored */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment