From a76b9d7ff847010db9dc86565db456ed2cd129f8 Mon Sep 17 00:00:00 2001 From: Andreas Schnederle-Wagner Date: Fri, 23 Oct 2026 13:01:54 +0200 Subject: [PATCH] MDEV-41747 Aria: DROP TABLE warns "uses an extension that doesn't exist" for a table with a fulltext parser plugin maria_delete_table() opens the table to find out whether it is transactional. A table whose fulltext index uses a parser plugin has HA_OPTION_RELIES_ON_SQL_LAYER, so maria_open() refused it with HA_ERR_UNSUPPORTED. DROP TABLE then warned "Table uses an extension that doesn't exist in this MariaDB version" and skipped the REDO_DROP_TABLE log record of a transactional table. Opening for drop only reads the share, so allow it. Co-Authored-By: Claude Opus 5.5 --- .../suite/maria/fulltext_parser_drop.result | 12 ++++++++++++ mysql-test/suite/maria/fulltext_parser_drop.test | 15 +++++++++++++++ storage/maria/ma_open.c | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/maria/fulltext_parser_drop.result create mode 100644 mysql-test/suite/maria/fulltext_parser_drop.test diff --git a/mysql-test/suite/maria/fulltext_parser_drop.result b/mysql-test/suite/maria/fulltext_parser_drop.result new file mode 100644 index 0000000000000..41a7164ef48cb --- /dev/null +++ b/mysql-test/suite/maria/fulltext_parser_drop.result @@ -0,0 +1,12 @@ +# +# DROP TABLE of an Aria table with a fulltext parser plugin +# must not warn about an unsupported extension +# +INSTALL PLUGIN simple_parser SONAME 'mypluglib'; +CREATE TABLE t1 (a TEXT, FULLTEXT(a) WITH PARSER simple_parser) ENGINE=Aria; +INSERT INTO t1 VALUES ('hello world'); +DROP TABLE t1; +CREATE TABLE t1 (a TEXT, FULLTEXT(a) WITH PARSER simple_parser) +ENGINE=Aria TRANSACTIONAL=0; +DROP TABLE t1; +UNINSTALL PLUGIN simple_parser; diff --git a/mysql-test/suite/maria/fulltext_parser_drop.test b/mysql-test/suite/maria/fulltext_parser_drop.test new file mode 100644 index 0000000000000..726cd39e57510 --- /dev/null +++ b/mysql-test/suite/maria/fulltext_parser_drop.test @@ -0,0 +1,15 @@ +--source include/have_simple_parser.inc + +--echo # +--echo # DROP TABLE of an Aria table with a fulltext parser plugin +--echo # must not warn about an unsupported extension +--echo # + +INSTALL PLUGIN simple_parser SONAME 'mypluglib'; +CREATE TABLE t1 (a TEXT, FULLTEXT(a) WITH PARSER simple_parser) ENGINE=Aria; +INSERT INTO t1 VALUES ('hello world'); +DROP TABLE t1; +CREATE TABLE t1 (a TEXT, FULLTEXT(a) WITH PARSER simple_parser) + ENGINE=Aria TRANSACTIONAL=0; +DROP TABLE t1; +UNINSTALL PLUGIN simple_parser; diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index 3a31663942d62..4952ee316dd6e 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -435,7 +435,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags, goto err; } if ((share->options & HA_OPTION_RELIES_ON_SQL_LAYER) && - ! (open_flags & HA_OPEN_FROM_SQL_LAYER)) + ! (open_flags & (HA_OPEN_FROM_SQL_LAYER | HA_OPEN_FOR_DROP))) { DBUG_PRINT("error", ("table cannot be opened from non-sql layer")); my_errno= HA_ERR_UNSUPPORTED;