1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-14692 Server crash in MDL_ticket::has_stronger_or_equal_type

SQL: disable system-versioning stuff on TEMPORARY tables
This commit is contained in:
Eugene Kosov
2017-12-21 10:14:25 +03:00
committed by GitHub
parent acdfacee75
commit a04a283469
7 changed files with 27 additions and 6 deletions

View File

@ -426,5 +426,11 @@ create or replace table t1 (pk int auto_increment unique) with system versioning
insert into t1 values (1);
delete from t1;
alter table t1 engine=myisam;
# MDEV-14692 crash in MDL_context::upgrade_shared_lock()
create or replace temporary table t (a int);
alter table t change column if exists b c bigint unsigned generated always as row start;
ERROR HY000: GENERATED AS ROW START prohibited for TEMPORARY tables
alter table t change column if exists b c bigint unsigned generated always as row end;
ERROR HY000: GENERATED AS ROW END prohibited for TEMPORARY tables
drop database test;
create database test;

View File

@ -344,7 +344,7 @@ create or replace table t (sys_trx_end int);
alter table t with system versioning;
ERROR 42S21: Duplicate column name 'sys_trx_end'
create or replace temporary table t (x28 int) with system versioning;
ERROR HY000: Incorrect usage of TEMPORARY and WITH SYSTEM VERSIONING
ERROR HY000: WITH SYSTEM VERSIONING prohibited for TEMPORARY tables
create or replace table t1 (
x29 int unsigned,
Sys_start0 timestamp(6) as row start invisible,

View File

@ -362,5 +362,13 @@ insert into t1 values (1);
delete from t1;
alter table t1 engine=myisam;
--echo # MDEV-14692 crash in MDL_context::upgrade_shared_lock()
create or replace temporary table t (a int);
--error ER_VERS_TEMPORARY
alter table t change column if exists b c bigint unsigned generated always as row start;
--error ER_VERS_TEMPORARY
alter table t change column if exists b c bigint unsigned generated always as row end;
drop database test;
create database test;

View File

@ -313,7 +313,7 @@ create or replace table t (sys_trx_end int);
--error ER_DUP_FIELDNAME
alter table t with system versioning;
--error ER_WRONG_USAGE
--error ER_VERS_TEMPORARY
create or replace temporary table t (x28 int) with system versioning;
--error ER_VERS_DUPLICATE_ROW_START_END

View File

@ -7188,9 +7188,14 @@ bool Vers_parse_info::fix_alter_info(THD *thd, Alter_info *alter_info,
List_iterator_fast<Create_field> it(alter_info->create_list);
while (Create_field *f= it++)
{
if (f->change.length &&
f->flags & (VERS_SYS_START_FLAG | VERS_SYS_END_FLAG))
if (f->change.length && f->flags & VERS_SYSTEM_FIELD)
{
if (share->table_category == TABLE_CATEGORY_TEMPORARY) {
my_error(ER_VERS_TEMPORARY, MYF(0),
f->flags & VERS_SYS_START_FLAG ? "GENERATED AS ROW START"
: "GENERATED AS ROW END");
return true;
}
if (thd->mdl_context.upgrade_shared_lock(
table->mdl_ticket, MDL_EXCLUSIVE,
thd->variables.lock_wait_timeout))

View File

@ -7932,3 +7932,6 @@ WARN_VERS_TRT_EXPERIMENTAL
ER_VERS_TRUNCATE_VIEW
eng "DELETE HISTORY from VIEW is prohibited"
ER_VERS_TEMPORARY
eng "%s prohibited for TEMPORARY tables"

View File

@ -6235,8 +6235,7 @@ versioning_option:
{
if (!thd->variables.vers_force)
{
my_error(ER_WRONG_USAGE, MYF(0),
"TEMPORARY", "WITH SYSTEM VERSIONING");
my_error(ER_VERS_TEMPORARY, MYF(0), "WITH SYSTEM VERSIONING");
MYSQL_YYABORT;
}
}