Commit 7320c683 authored by Aleksey Midenkov's avatar Aleksey Midenkov

Parser: disable SV for tmp tables [closes #344]

parent 86e57eaa
......@@ -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;
}
}
;
......
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