From 09cd817f5d922d475277a0bb20f1cb8b5552f773 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 2 Oct 2024 17:34:51 +0200 Subject: [PATCH] MDEV-35060 Assertion failure upon DML on table with vector under lock --- mysql-test/main/vector_innodb.result | 8 ++++++++ mysql-test/main/vector_innodb.test | 9 +++++++++ sql/vector_mhnsw.cc | 2 -- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/mysql-test/main/vector_innodb.result b/mysql-test/main/vector_innodb.result index a2cd18e08af..a1a2637a95f 100644 --- a/mysql-test/main/vector_innodb.result +++ b/mysql-test/main/vector_innodb.result @@ -163,3 +163,11 @@ disconnect con1; connection default; commit; drop table t; +# +# MDEV-35060 Assertion failure upon DML on table with vector under lock +# +create table t (a int, v blob not null, vector(v)) engine=innodb; +insert into t values (1,x'00000000'),(2,x'00000000'); +lock table t write; +delete from t; +drop table t; diff --git a/mysql-test/main/vector_innodb.test b/mysql-test/main/vector_innodb.test index 6dd4271992e..075d1331d4e 100644 --- a/mysql-test/main/vector_innodb.test +++ b/mysql-test/main/vector_innodb.test @@ -150,3 +150,12 @@ disconnect con1; connection default; commit; drop table t; + +--echo # +--echo # MDEV-35060 Assertion failure upon DML on table with vector under lock +--echo # +create table t (a int, v blob not null, vector(v)) engine=innodb; +insert into t values (1,x'00000000'),(2,x'00000000'); +lock table t write; +delete from t; +drop table t; diff --git a/sql/vector_mhnsw.cc b/sql/vector_mhnsw.cc index e880a7298b4..ae3d2eaf84e 100644 --- a/sql/vector_mhnsw.cc +++ b/sql/vector_mhnsw.cc @@ -616,8 +616,6 @@ MHNSW_Trx *MHNSW_Trx::get_from_thd(TABLE *table, bool for_update) if (!for_update && !trx) return NULL; - DBUG_ASSERT(!table->mdl_ticket || - table->mdl_ticket->m_duration == MDL_TRANSACTION); while (trx && trx->table_id != table->mdl_ticket) trx= trx->next; if (!trx) {