mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Parser: disable SV for tmp tables [closes #344]
This commit is contained in:
@ -271,8 +271,6 @@ A8 int without system versioning
|
||||
) with system versioning;
|
||||
ERROR HY000: Wrong parameters for `t1`: no columns defined 'WITH SYSTEM VERSIONING'
|
||||
create or replace table t1 (a int) with system versioning;
|
||||
create temporary table tmp with system versioning select * from t1;
|
||||
create or replace table t1 (a int) with system versioning;
|
||||
create table tt1 like t1;
|
||||
show create table tt1;
|
||||
Table Create Table
|
||||
@ -368,5 +366,7 @@ ERROR 42S21: Duplicate column name 'sys_trx_start'
|
||||
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 (x int) with system versioning;
|
||||
ERROR HY000: Incorrect usage of TEMPORARY and WITH SYSTEM VERSIONING
|
||||
drop database test;
|
||||
create database test;
|
||||
|
@ -192,11 +192,6 @@ create or replace table t1 (
|
||||
A8 int without system versioning
|
||||
) with system versioning;
|
||||
|
||||
# table with/without system versioning
|
||||
|
||||
create or replace table t1 (a int) with system versioning;
|
||||
create temporary table tmp with system versioning select * from t1;
|
||||
|
||||
# CREATE TABLE ... LIKE
|
||||
create or replace table t1 (a int) with system versioning;
|
||||
create table tt1 like t1;
|
||||
@ -286,5 +281,8 @@ create or replace table t (sys_trx_end int);
|
||||
--error ER_DUP_FIELDNAME
|
||||
alter table t with system versioning;
|
||||
|
||||
--error ER_WRONG_USAGE
|
||||
create or replace temporary table t (x int) with system versioning;
|
||||
|
||||
drop database test;
|
||||
create database test;
|
||||
|
@ -6045,8 +6045,20 @@ opt_versioning_option:
|
||||
versioning_option:
|
||||
WITH_SYSTEM_SYM VERSIONING_SYM
|
||||
{
|
||||
Lex->vers_get_info().with_system_versioning= true;
|
||||
Lex->create_info.options|= HA_VERSIONED_TABLE;
|
||||
if (Lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)
|
||||
{
|
||||
if (!thd->variables.vers_force)
|
||||
{
|
||||
my_error(ER_WRONG_USAGE, MYF(0),
|
||||
"TEMPORARY", "WITH SYSTEM VERSIONING");
|
||||
MYSQL_YYABORT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Lex->vers_get_info().with_system_versioning= true;
|
||||
Lex->create_info.options|= HA_VERSIONED_TABLE;
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
|
Reference in New Issue
Block a user