mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01: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:
parent
ffc69dbd05
commit
a138d061b5
3 changed files with 96 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -469,5 +469,39 @@ alter table t add check (a > 0);
|
|||
insert into t values (0);
|
||||
insert into t values (2);
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18869 Assertion `!((field)->vcol_info && (field)->stored_in_db())' failed in innodb_col_no upon altering table with system versioning
|
||||
--echo #
|
||||
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);
|
||||
--enable_info
|
||||
alter table t1 modify a int without system versioning, algorithm=copy;
|
||||
alter table t1 modify a int with system versioning, algorithm=copy;
|
||||
alter table t1 modify a int without system versioning;
|
||||
alter table t1 modify a int with system versioning;
|
||||
--disable_info
|
||||
show create table t1;
|
||||
select * from t1;
|
||||
--enable_info
|
||||
--error ER_PARSE_ERROR
|
||||
alter table t1 modify b int generated always as (0) stored without system versioning;
|
||||
--error ER_PARSE_ERROR
|
||||
alter table t1 modify b int generated always as (0) stored with system versioning;
|
||||
alter table t1 modify b int without system versioning;
|
||||
--disable_info
|
||||
show create table t1;
|
||||
select * from t1;
|
||||
|
||||
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);
|
||||
--enable_info
|
||||
alter table t1 modify a int without system versioning, algorithm=copy;
|
||||
alter table t1 modify a int with system versioning, algorithm=copy;
|
||||
alter table t1 modify a int without system versioning;
|
||||
alter table t1 modify a int with system versioning;
|
||||
select * from t1;
|
||||
--disable_info
|
||||
|
||||
drop database test;
|
||||
create database test;
|
||||
|
|
|
@ -8588,7 +8588,7 @@ vers_change_fields_cache(
|
|||
ha_alter_info->alter_info->create_list);
|
||||
|
||||
while (const Create_field* create_field = it++) {
|
||||
if (!create_field->field) {
|
||||
if (!create_field->field || create_field->field->vcol_info) {
|
||||
continue;
|
||||
}
|
||||
dict_col_t* col = dict_table_get_nth_col(
|
||||
|
|
Loading…
Reference in a new issue