1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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
This commit is contained in:
Sergei Golubchik
2024-09-30 19:22:30 +02:00
parent 824a63852b
commit 0932c3a27e
3 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
#
# 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;

View File

@@ -0,0 +1,9 @@
--source include/not_embedded.inc
--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;

View File

@@ -11575,7 +11575,7 @@ alter_copy:
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)