[MDEV-22811] DDL fails to drop and re-create FTS index Created: 2020-06-05  Updated: 2020-07-02  Resolved: 2020-06-18

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.2.33, 10.3.24, 10.4.14, 10.5.5

Type: Bug Priority: Critical
Reporter: Roel Van de Paar Assignee: Thirunarayanan Balathandayuthapani
Resolution: Fixed Votes: 0
Labels: not-10.1

Issue Links:
Blocks

 Description   

USE test;
CREATE TABLE t (FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY,c2 VARCHAR(200),FULLTEXT(c2));
ALTER TABLE t PACK_KEYS=0;

Leads to:

10.5.4 701efbb25b738f0c971798c5234d4d66b9235e47

Core was generated by `/test/MD030620-mariadb-10.5.4-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x14c7cb892700 (LWP 1761235))]
(gdb) bt
(gdb) (gdb) #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x0000564309c9f647 in my_write_core (sig=sig@entry=11) at /test/10.5_opt/mysys/stacktrace.c:518
#2  0x0000564309661f4a in handle_fatal_signal (sig=11) at /test/10.5_opt/sql/signal_handler.cc:330
#3  <signal handler called>
#4  fts_add_index (index=0x14c7aac35a80, table=0x14c7aac9a300) at /test/10.5_opt/storage/innobase/fts/fts0fts.cc:671
#5  0x000056430999fb47 in ha_innobase::commit_inplace_alter_table (this=<optimized out>, altered_table=<optimized out>, ha_alter_info=<optimized out>, commit=<optimized out>) at /test/10.5_opt/storage/innobase/handler/handler0alter.cc:11187
#6  0x0000564309504f5b in mysql_inplace_alter_table (target_mdl_request=0x14c7cb88e4f0, alter_ctx=0x14c7cb88fa20, inplace_supported=<optimized out>, ha_alter_info=0x14c7cb88d690, altered_table=0x14c7cb88d730, table=<optimized out>, table_list=0x14c7aac47110, thd=0x14c7aac12018) at /test/10.5_opt/sql/sql_table.cc:7936
#7  mysql_alter_table (thd=thd@entry=0x14c7aac12018, new_db=new_db@entry=0x14c7aac16718, new_name=new_name@entry=0x14c7aac16b20, create_info=create_info@entry=0x14c7cb890600, table_list=<optimized out>, table_list@entry=0x14c7aac47110, alter_info=alter_info@entry=0x14c7cb890530, order_num=0, order=0x0, ignore=false, if_exists=false) at /test/10.5_opt/sql/sql_table.cc:10457
#8  0x0000564309560371 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x14c7aac12018) at /test/10.5_opt/sql/sql_alter.cc:532
#9  0x000056430946c45f in mysql_execute_command (thd=thd@entry=0x14c7aac12018) at /test/10.5_opt/sql/sql_parse.cc:5950
#10 0x0000564309472f1c in mysql_parse (thd=0x14c7aac12018, rawbuf=<optimized out>, length=25, parser_state=0x14c7cb8914b0, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /test/10.5_opt/sql/sql_parse.cc:7992
#11 0x0000564309468235 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14c7aac12018, packet=packet@entry=0x14c7aac3a019 "ALTER TABLE t PACK_KEYS=0", packet_length=packet_length@entry=25, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_opt/sql/sql_parse.cc:1874
#12 0x0000564309466644 in do_command (thd=0x14c7aac12018) at /test/10.5_opt/sql/sql_parse.cc:1355
#13 0x000056430955b7c1 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14c7cb0329b8, put_in_cache=put_in_cache@entry=true) at /test/10.5_opt/sql/sql_connect.cc:1411
#14 0x000056430955bb24 in handle_one_connection (arg=arg@entry=0x14c7cb0329b8) at /test/10.5_opt/sql/sql_connect.cc:1313
#15 0x00005643098c817a in pfs_spawn_thread (arg=0x14c7cb04b018) at /test/10.5_opt/storage/perfschema/pfs.cc:2201
#16 0x000014c7cc8896db in start_thread (arg=0x14c7cb892700) at pthread_create.c:463
#17 0x000014c7cbc8788f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.3.24 (dbg), 10.3.24 (opt), 10.4.14 (dbg), 10.4.14 (opt), 10.5.4 (dbg), 10.5.4 (opt)

Bug confirmed not present in:
MariaDB: 10.1.46 (dbg), 10.1.46 (opt), 10.2.33 (dbg), 10.2.33 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)



 Comments   
Comment by Thirunarayanan Balathandayuthapani [ 2020-06-11 ]

--source include/have_innodb.inc
CREATE TABLE t (FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY,c2 VARCHAR(200),FULLTEXT fidx(c2))engine=innodb;
ALTER TABLE t drop index fidx, add fulltext index(c2);
DROP TABLE t;

Alternative test case to ignore PACK_KEYS. It fails in 10.2 as well

Comment by Thirunarayanan Balathandayuthapani [ 2020-06-15 ]

Patch is in bb-10.2-MDEV-22811

Comment by Marko Mäkelä [ 2020-06-15 ]

Thanks, the logic looks OK to me. I only had some suggestions about formatting and comments.

I think that it is best for mleich to test this, just in case.

Comment by Matthias Leich [ 2020-06-17 ]

The RQG testing with the battery for broad range coverage on
origin/bb-10.2-MDEV-22811 be5a2ef34358e6f8f0780eb45539ce991b6e2056 2020-06-15T15:49:47+05:30
did not show new unknown crashes.
Also the fraction of failing tests was ok.

Generated at Thu Feb 08 09:17:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.