case1: drop database test; create database test; use test; CREATE TABLE t1 (f VARCHAR(256)) ENGINE=InnoDB; SET SESSION FOREIGN_KEY_CHECKS= OFF ; ALTER TABLE t1 ADD FOREIGN KEY (f) REFERENCES non_existing_table (x); ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f); mysql [localhost] {msandbox} (test) > ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f); ERROR 2013 (HY000): Lost connection to MySQL server during query mysql [localhost] {msandbox} (test) > 2020-08-23 17:26:57 19482 [Note] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld: ready for connections. Version: '5.6.47-87.0-debug' socket: '/tmp/mysql_sandbox5648.sock' port: 5648 Source distribution 2020-08-23 17:34:13 19482 [ERROR] InnoDB: dict_load_foreigns() returned 38 for ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f) 2020-08-23 17:34:13 7f8c32ea3700 InnoDB: Assertion failure in thread 140240126359296 in file handler0alter.cc line 5973 InnoDB: Failing assertion: 0 InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed bug report to http://bugs.mysql.com. InnoDB: If you get repeated assertion failures or crashes, even InnoDB: immediately after the mysqld startup, there may be InnoDB: corruption in the InnoDB tablespace. Please refer to InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html InnoDB: about forcing recovery. 12:04:13 UTC - mysqld got signal 6 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail. Please help us make Percona Server better by reporting any bugs at https://bugs.percona.com/ key_buffer_size=8388608 read_buffer_size=131072 max_used_connections=1 max_threads=153 thread_count=1 connection_count=1 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 69107 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x7f8c03ad0000 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 7f8c32ea2de8 thread_stack 0x40000 /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(my_print_stacktrace+0x47)[0x561fd81559f6] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(handle_fatal_signal+0x416)[0x561fd7d88ad5] /lib/x86_64-linux-gnu/libpthread.so.0(+0x128a0)[0x7f8c314ce8a0] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f8c307caf47] /lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f8c307cc8b1] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(+0x9f3291)[0x561fd8202291] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_ZN7handler29ha_commit_inplace_alter_tableEP5TABLEP18Alter_inplace_infob+0xdf)[0x561fd7c9882d] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(+0x6b8710)[0x561fd7ec7710] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_Z17mysql_alter_tableP3THDPcS1_P24st_ha_create_informationP10TABLE_LISTP10Alter_infojP8st_orderb+0x1828)[0x561fd7ecca47] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_ZN19Sql_cmd_alter_table7executeEP3THD+0x610)[0x561fd8024176] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_Z21mysql_execute_commandP3THD+0x8301)[0x561fd7e500c1] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_stateb+0x580)[0x561fd7e53cdf] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xdb0)[0x561fd7e44f55] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_Z10do_commandP3THD+0x3cb)[0x561fd7e43ccb] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x273)[0x561fd7e08dc2] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(handle_one_connection+0x33)[0x561fd7e08aa2] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(pfs_spawn_thread+0x158)[0x561fd819cd43] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76db)[0x7f8c314c36db] /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7f8c308ada3f] Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (7f8bfb420010): ALTER TABLE t1 ADD FULLTEXT INDEX ft1 (f) Connection ID (thread ID): 4 Status: NOT_KILLED case2: drop database test; create database test; use test; CREATE TABLE t1 (a INT, KEY(a), UNIQUE(a), FOREIGN KEY (a) REFERENCES t1 (a)) ENGINE=InnoDB; ALTER TABLE t1 DROP INDEX a; ALTER TABLE t1 ADD COLUMN v INT; mysql [localhost] {msandbox} (test) > ALTER TABLE t1 ADD COLUMN v INT; ERROR 2013 (HY000): Lost connection to MySQL server during query 2020-08-23 17:49:10 5572 [Note] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld: ready for connections. Version: '5.6.47-87.0-debug' socket: '/tmp/mysql_sandbox5648.sock' port: 5648 Source distribution 2020-08-23 17:50:50 5572 [ERROR] InnoDB: dict_load_foreigns() returned 38 for ALTER TABLE t1 ADD COLUMN v INT 2020-08-23 17:50:50 7f07cee84700 InnoDB: Assertion failure in thread 139671512827648 in file handler0alter.cc line 5973 InnoDB: Failing assertion: 0 InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed bug report to http://bugs.mysql.com. InnoDB: If you get repeated assertion failures or crashes, even InnoDB: immediately after the mysqld startup, there may be InnoDB: corruption in the InnoDB tablespace. Please refer to InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html InnoDB: about forcing recovery. 12:20:50 UTC - mysqld got signal 6 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail. Please help us make Percona Server better by reporting any bugs at https://bugs.percona.com/ key_buffer_size=8388608 read_buffer_size=131072 max_used_connections=1 max_threads=153 thread_count=1 connection_count=1 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 69107 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x7f079fac7000 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 7f07cee83de8 thread_stack 0x40000 /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(my_print_stacktrace+0x47)[0x55d4635b39f6] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(handle_fatal_signal+0x416)[0x55d4631e6ad5] /lib/x86_64-linux-gnu/libpthread.so.0(+0x128a0)[0x7f07cd4af8a0] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f07cc7abf47] /lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f07cc7ad8b1] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(+0x9f3291)[0x55d463660291] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_ZN7handler29ha_commit_inplace_alter_tableEP5TABLEP18Alter_inplace_infob+0xdf)[0x55d4630f682d] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(+0x6b8710)[0x55d463325710] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_Z17mysql_alter_tableP3THDPcS1_P24st_ha_create_informationP10TABLE_LISTP10Alter_infojP8st_orderb+0x1828)[0x55d46332aa47] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_ZN19Sql_cmd_alter_table7executeEP3THD+0x610)[0x55d463482176] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_Z21mysql_execute_commandP3THD+0x8301)[0x55d4632ae0c1] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_stateb+0x580)[0x55d4632b1cdf] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xdb0)[0x55d4632a2f55] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_Z10do_commandP3THD+0x3cb)[0x55d4632a1ccb] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x273)[0x55d463266dc2] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(handle_one_connection+0x33)[0x55d463266aa2] /home/lalit/mysql_tar/percona/5.6.48/bin/mysqld(pfs_spawn_thread+0x158)[0x55d4635fad43] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76db)[0x7f07cd4a46db] /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7f07cc88ea3f] Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (7f0796c20010): ALTER TABLE t1 ADD COLUMN v INT Connection ID (thread ID): 3 Status: NOT_KILLED Reproduciable test case: drop database test; create database test; use test; CREATE TABLE t1 (a INT, KEY(a), UNIQUE(a), FOREIGN KEY (a) REFERENCES t1 (a)) ENGINE=InnoDB; SET SESSION FOREIGN_KEY_CHECKS= OFF ; ALTER TABLE t1 DROP INDEX a; ALTER TABLE t1 ADD COLUMN v INT; mysql [localhost] {msandbox} ((none)) > use test; Database changed mysql [localhost] {msandbox} (test) > CREATE TABLE t1 (a INT, KEY(a), UNIQUE(a), FOREIGN KEY (a) REFERENCES t1 (a)) ENGINE=InnoDB; Query OK, 0 rows affected (0.08 sec) mysql [localhost] {msandbox} (test) > SET SESSION FOREIGN_KEY_CHECKS= OFF ; Query OK, 0 rows affected (0.00 sec) mysql [localhost] {msandbox} (test) > ALTER TABLE t1 DROP INDEX a; Query OK, 0 rows affected (0.04 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql [localhost] {msandbox} (test) > ALTER TABLE t1 ADD COLUMN v INT; ERROR 1215 (HY000): Cannot add foreign key constraint Version: '5.6.47-87.0' socket: '/tmp/mysql_sandbox5647.sock' port: 5647 Percona Server (GPL), Release 87.0, Revision 9ad342b 2020-08-23 18:13:28 22340 [ERROR] InnoDB: dict_load_foreigns() returned 38 for ALTER TABLE t1 ADD COLUMN v INT