Commit 6e56a2ce authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-35044 ALTER on a table with vector index attempts to bypass unsupported...

MDEV-35044 ALTER on a table with vector index attempts to bypass unsupported locking limitation, server crashes in THD::free_tmp_table_share

open secondary tables early enough for the cleanup on error to see
them and remove their underlying files
parent 39414dbc
......@@ -44,3 +44,10 @@ drop table t, t2;
#
create table t (v binary(255) not null, vector index(v)) engine=memory;
ERROR HY000: Table storage engine 'MEMORY' does not support the create option 'VECTOR'
#
# MDEV-35044 ALTER on a table with vector index attempts to bypass unsupported locking limitation, server crashes in THD::free_tmp_table_share
#
create table t (a int primary key, v blob not null, vector index(v));
alter table t modify a int auto_increment, lock=none;
ERROR 0A000: LOCK=NONE is not supported. Reason: CHANGE COLUMN ... AUTO_INCREMENT. Try LOCK=SHARED
drop table t;
......@@ -47,3 +47,12 @@ drop table t, t2;
--echo #
--error ER_ILLEGAL_HA_CREATE_OPTION
create table t (v binary(255) not null, vector index(v)) engine=memory;
--echo #
--echo # MDEV-35044 ALTER on a table with vector index attempts to bypass unsupported locking limitation, server crashes in THD::free_tmp_table_share
--echo #
create table t (a int primary key, v blob not null, vector index(v));
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table t modify a int auto_increment, lock=none;
drop table t;
......@@ -11487,7 +11487,7 @@ do_continue:;
new_table= thd->create_and_open_tmp_table(&frm, alter_ctx.get_tmp_path(),
alter_ctx.new_db,
alter_ctx.new_name, true);
if (!new_table)
if (!new_table || new_table->open_hlindexes_for_write())
goto err_new_table_cleanup;
if (table->s->tmp_table != NO_TMP_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