Commit 3f38e2a4 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-24503 Assertion m_prebuilt->trx == thd_to_trx(m_user_thd) failed in ha_innobase::is_read_only

ha_innobase::check_if_supported_inplace_alter(): Invoke is_read_only()
only after calling update_thd(). In this way, the assertion failure
should be avoided even if the client was reconnected right before an
ALTER TABLE statement.

This bug was introduced by MDEV-23497.
parent 9118fd36
/*****************************************************************************
Copyright (c) 2005, 2019, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2020, MariaDB Corporation.
Copyright (c) 2013, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -1975,13 +1975,6 @@ ha_innobase::check_if_supported_inplace_alter(
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
}
if (is_read_only()) {
ha_alter_info->unsupported_reason =
my_get_err_msg(ER_READ_ONLY_MODE);
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
}
if (altered_table->s->fields > REC_MAX_N_USER_FIELDS) {
/* Deny the inplace ALTER TABLE. MySQL will try to
re-create the table and ha_innobase::create() will
......@@ -1994,6 +1987,13 @@ ha_innobase::check_if_supported_inplace_alter(
update_thd();
if (is_read_only()) {
ha_alter_info->unsupported_reason =
my_get_err_msg(ER_READ_ONLY_MODE);
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
}
if (ha_alter_info->handler_flags
& ~(INNOBASE_INPLACE_IGNORE
| INNOBASE_ALTER_INSTANT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment