Commit 9aae0be8 authored by Aleksey Midenkov's avatar Aleksey Midenkov

SQL: disabled SYSTEM_TIME partitioning for InnoDB [fixes #294]

parent 0ab99d2f
......@@ -147,7 +147,7 @@ ERROR HY000: Wrong partitions consistency for `t1`: must have at least one 'VERS
alter table t1 add partition (
partition p1 versioning);
Warnings:
Warning 4078 Maybe missing parameters: no rotation condition for multiple `VERSIONING` partitions.
Warning 4105 Maybe missing parameters: no rotation condition for multiple `VERSIONING` partitions.
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
......@@ -157,9 +157,9 @@ t1 CREATE TABLE `t1` (
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
) ENGINE=${INNODB_OR_MYISAM} DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
PARTITION BY SYSTEM_TIME
(PARTITION p0 VERSIONING ENGINE = ${INNODB_OR_MYISAM},
PARTITION p1 VERSIONING ENGINE = ${INNODB_OR_MYISAM},
PARTITION pn AS OF NOW ENGINE = ${INNODB_OR_MYISAM})
(PARTITION `p0` VERSIONING ENGINE = ${INNODB_OR_MYISAM},
PARTITION `p1` VERSIONING ENGINE = ${INNODB_OR_MYISAM},
PARTITION `pn` AS OF NOW ENGINE = ${INNODB_OR_MYISAM})
insert into t1 values (1), (2);
alter table t1 drop partition pn;
ERROR HY000: Wrong partitions consistency for `t1`: must have at least one 'VERSIONING' and exactly one last 'AS OF NOW'
......@@ -278,9 +278,9 @@ t1 CREATE TABLE `t1` (
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
) ENGINE=${INNODB_OR_MYISAM} DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
PARTITION BY SYSTEM_TIME LIMIT 1
(PARTITION p0 VERSIONING ENGINE = ${INNODB_OR_MYISAM},
PARTITION p1 VERSIONING ENGINE = ${INNODB_OR_MYISAM},
PARTITION pn AS OF NOW ENGINE = ${INNODB_OR_MYISAM})
(PARTITION `p0` VERSIONING ENGINE = ${INNODB_OR_MYISAM},
PARTITION `p1` VERSIONING ENGINE = ${INNODB_OR_MYISAM},
PARTITION `pn` AS OF NOW ENGINE = ${INNODB_OR_MYISAM})
alter table t1 drop partition non_existent;
ERROR HY000: Error in list of partitions to DROP
insert into t1 values (1), (2);
......@@ -290,7 +290,7 @@ x
2
delete from t1;
Warnings:
Note 4079 Switching from partition `p0` to `p1`
Note 4106 Switching from partition `p0` to `p1`
select * from t1 partition (p0) for system_time all;
x
1
......@@ -300,7 +300,7 @@ x
insert into t1 values (3);
delete from t1;
Warnings:
Warning 4077 Using full partition `p1`, need more VERSIONING partitions!
Warning 4104 Using full partition `p1`, need more VERSIONING partitions!
select * from t1 partition (p1) for system_time all;
x
2
......@@ -333,7 +333,7 @@ x
insert into t1 values (4);
delete from t1;
Warnings:
Note 4079 Switching from partition `p0` to `p1`
Note 4106 Switching from partition `p0` to `p1`
select * from t1 partition (p1) for system_time all;
x
4
......@@ -355,8 +355,8 @@ x
2
delete from t1;
Warnings:
Note 4079 Switching from partition `p0` to `p1`
Warning 4077 Using full partition `p1`, need more VERSIONING partitions!
Note 4106 Switching from partition `p0` to `p1`
Warning 4104 Using full partition `p1`, need more VERSIONING partitions!
select * from t1 partition (p0sp0) for system_time all;
x
1
......
[innodb]
partition
default-storage-engine=innodb
# [innodb]
# partition
# default-storage-engine=innodb
[myisam]
partition
......
......@@ -951,7 +951,7 @@ bool partition_info::vers_setup_expression(THD * thd, uint32 alter_add)
{
DBUG_ASSERT(part_type == VERSIONING_PARTITION);
if (!table->versioned())
if (!table->versioned_by_sql())
{
my_error(ER_VERSIONING_REQUIRED, MYF(0), table->s->table_name);
return true;
......
......@@ -2324,7 +2324,7 @@ char *generate_partition_syntax(THD *thd, partition_info *part_info,
err+= str.append(STRING_WITH_LEN("HASH "));
break;
case VERSIONING_PARTITION:
err+= str.append(STRING_WITH_LEN("SYSTEM_TIME"));
err+= str.append(STRING_WITH_LEN("SYSTEM_TIME "));
break;
default:
DBUG_ASSERT(0);
......
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