diff --git a/mysql-test/main/alter_table_online_debug.result b/mysql-test/main/alter_table_online_debug.result index b76abdaf679..e7c875814b8 100644 --- a/mysql-test/main/alter_table_online_debug.result +++ b/mysql-test/main/alter_table_online_debug.result @@ -1176,5 +1176,19 @@ drop table t1; drop procedure p; set debug_sync=reset; # +# MDEV-30902 Server crash in LEX::first_lists_tables_same +# +create table t (id int, s date, e date, period for p(s,e), +unique(id, p without overlaps)) engine=aria; +insert into t values (1,'1971-01-01','1971-01-02'); +set debug_sync= 'alter_table_online_before_lock signal lock wait_for goon'; +alter table t force; +connection con1; +set debug_sync= 'now wait_for lock'; +delete from t; +set debug_sync= 'now signal goon'; +connection default; +drop table t; +# # End of 11.2 tests # diff --git a/mysql-test/main/alter_table_online_debug.test b/mysql-test/main/alter_table_online_debug.test index a2f0f9ca0ef..febdb388a75 100644 --- a/mysql-test/main/alter_table_online_debug.test +++ b/mysql-test/main/alter_table_online_debug.test @@ -1351,6 +1351,25 @@ drop table t1; drop procedure p; set debug_sync=reset; +--echo # +--echo # MDEV-30902 Server crash in LEX::first_lists_tables_same +--echo # +create table t (id int, s date, e date, period for p(s,e), + unique(id, p without overlaps)) engine=aria; +insert into t values (1,'1971-01-01','1971-01-02'); + +set debug_sync= 'alter_table_online_before_lock signal lock wait_for goon'; +send alter table t force; + +--connection con1 +set debug_sync= 'now wait_for lock'; +delete from t; +set debug_sync= 'now signal goon'; + +--connection default +--reap +drop table t; + --echo # --echo # End of 11.2 tests --echo # diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 2f58110cb91..258f8fc8c6d 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -2959,8 +2959,11 @@ int ha_maria::external_lock(THD *thd, int lock_type) tons of archived logs to roll-forward, we could then not disable REDOs/UNDOs in this case. */ - DBUG_PRINT("info", ("Disabling logging for table")); - _ma_tmp_disable_logging_for_table(file, TRUE); + if (likely(file->s->now_transactional)) + { + DBUG_PRINT("info", ("Disabling logging for table")); + _ma_tmp_disable_logging_for_table(file, TRUE); + } file->autocommit= 0; } else