1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-18869 Assertion `!((field)->vcol_info && (field)->stored_in_db())' failed in innodb_col_no upon altering table with system versioning

WITH/WITHOUT SYSTEM VERSIONING is not supported for generated columns
at parser level (see definition of field_def rule).
This commit is contained in:
Aleksey Midenkov
2019-03-20 21:10:09 +03:00
committed by Marko Mäkelä
parent ffc69dbd05
commit a138d061b5
3 changed files with 96 additions and 1 deletions

View File

@@ -542,5 +542,66 @@ alter table t add check (a > 0);
insert into t values (0);
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t`
insert into t values (2);
#
# MDEV-18869 Assertion `!((field)->vcol_info && (field)->stored_in_db())' failed in innodb_col_no upon altering table with system versioning
#
set system_versioning_alter_history= keep;
create or replace table t1 (a int, b int generated always as (0) stored) engine=innodb with system versioning;
insert into t1 (a) values (1);
alter table t1 modify a int without system versioning, algorithm=copy;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
alter table t1 modify a int with system versioning, algorithm=copy;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
alter table t1 modify a int without system versioning;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
alter table t1 modify a int with system versioning;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) GENERATED ALWAYS AS (0) STORED
) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
select * from t1;
a b
1 0
alter table t1 modify b int generated always as (0) stored without system versioning;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'without system versioning' at line 1
alter table t1 modify b int generated always as (0) stored with system versioning;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'system versioning' at line 1
alter table t1 modify b int without system versioning;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
select * from t1;
a b
1 0
create or replace table t1 (a int, b int generated always as (0) virtual) engine=innodb with system versioning;
insert into t1 (a) values (1);
alter table t1 modify a int without system versioning, algorithm=copy;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
alter table t1 modify a int with system versioning, algorithm=copy;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
alter table t1 modify a int without system versioning;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
alter table t1 modify a int with system versioning;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
select * from t1;
a b
1 0
affected rows: 1
drop database test;
create database test;