mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-14650 Assertion 0 failed in TABLE::vers_update_fields [fixes #402]
SQL: fixed selecion of handlerton by respecting partitioning
This commit is contained in:
@ -31,6 +31,16 @@ begin
|
||||
return e;
|
||||
end~~
|
||||
|
||||
create function if not exists non_default_engine()
|
||||
returns varchar(255)
|
||||
deterministic
|
||||
begin
|
||||
if default_engine() = 'InnoDB' then
|
||||
return 'MyISAM';
|
||||
end if;
|
||||
return 'InnoDB';
|
||||
end~~
|
||||
|
||||
create function if not exists sys_datatype(engine varchar(255))
|
||||
returns varchar(255)
|
||||
deterministic
|
||||
@ -99,6 +109,7 @@ end~~
|
||||
delimiter ;~~
|
||||
|
||||
let $default_engine= `select default_engine()`;
|
||||
let $non_default_engine= `select non_default_engine()`;
|
||||
let $sys_datatype= `select sys_datatype(default_engine())`;
|
||||
let $sys_datatype_uc= `select upper(sys_datatype(default_engine()))`;
|
||||
--enable_query_log
|
||||
|
@ -2,6 +2,7 @@
|
||||
drop procedure verify_vtq;
|
||||
drop procedure innodb_verify_vtq;
|
||||
drop function default_engine;
|
||||
drop function non_default_engine;
|
||||
drop function sys_commit_ts;
|
||||
drop function sys_datatype;
|
||||
drop function current_row;
|
||||
|
@ -1,13 +1,4 @@
|
||||
drop table if exists t1;
|
||||
create function if not exists non_default_engine()
|
||||
returns varchar(255)
|
||||
deterministic
|
||||
begin
|
||||
if default_engine() = 'InnoDB' then
|
||||
return 'MyISAM';
|
||||
end if;
|
||||
return 'InnoDB';
|
||||
end~~
|
||||
create table t1 (
|
||||
x1 int unsigned,
|
||||
Sys_start SYS_DATATYPE generated always as row start comment 'start',
|
||||
|
@ -1,3 +1,4 @@
|
||||
### check System Versioning and conventional partitioning
|
||||
create table t1 (x int)
|
||||
with system versioning
|
||||
partition by range columns (x) (
|
||||
@ -27,6 +28,11 @@ x
|
||||
select * from t1 partition (p1) for system_time all;
|
||||
x
|
||||
300
|
||||
### Engine change versioned/non-versioned prohibited
|
||||
create or replace table t1 (i int) engine=MyISAM with system versioning partition by hash(i);
|
||||
alter table t1 engine=InnoDB;
|
||||
ERROR HY000: Not allowed for versioned `test`.`t1`. Change to/from native versioning engine is prohibited.
|
||||
### check server-level partitioning
|
||||
create or replace table t1 (x int)
|
||||
partition by system_time (
|
||||
partition p0 versioning,
|
||||
|
@ -5,19 +5,6 @@
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
delimiter ~~;
|
||||
create function if not exists non_default_engine()
|
||||
returns varchar(255)
|
||||
deterministic
|
||||
begin
|
||||
if default_engine() = 'InnoDB' then
|
||||
return 'MyISAM';
|
||||
end if;
|
||||
return 'InnoDB';
|
||||
end~~
|
||||
delimiter ;~~
|
||||
|
||||
let $non_default_engine= `select non_default_engine()`;
|
||||
let $non_sys_datatype= `select sys_datatype(non_default_engine())`;
|
||||
let $non_sys_datatype_uc= `select upper(sys_datatype(non_default_engine()))`;
|
||||
let $sys_datatype_null= $sys_datatype NULL DEFAULT NULL;
|
||||
|
@ -1,6 +1,6 @@
|
||||
-- source suite/versioning/common.inc
|
||||
|
||||
### check System Versioning and conventional partitioning
|
||||
--echo ### check System Versioning and conventional partitioning
|
||||
|
||||
create table t1 (x int)
|
||||
with system versioning
|
||||
@ -19,7 +19,12 @@ select * from t1 for system_time all;
|
||||
select * from t1 partition (p0) for system_time all;
|
||||
select * from t1 partition (p1) for system_time all;
|
||||
|
||||
### check server-level partitioning
|
||||
--echo ### Engine change versioned/non-versioned prohibited
|
||||
eval create or replace table t1 (i int) engine=$default_engine with system versioning partition by hash(i);
|
||||
--error ER_VERS_ALTER_ENGINE_PROHIBITED
|
||||
eval alter table t1 engine=$non_default_engine;
|
||||
|
||||
--echo ### check server-level partitioning
|
||||
|
||||
# create errors
|
||||
--error ER_VERS_ENGINE_UNSUPPORTED
|
||||
|
@ -8856,7 +8856,7 @@ bool mysql_alter_table(THD *thd, const char *new_db, const char *new_name,
|
||||
{
|
||||
if (handlerton *hton1= create_info->db_type)
|
||||
{
|
||||
handlerton *hton2= table->file->ht;
|
||||
handlerton *hton2= table->file->partition_ht();
|
||||
if (hton1 != hton2 &&
|
||||
(ha_check_storage_engine_flag(hton1, HTON_NATIVE_SYS_VERSIONING) ||
|
||||
ha_check_storage_engine_flag(hton2, HTON_NATIVE_SYS_VERSIONING)))
|
||||
|
Reference in New Issue
Block a user