summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-01-01 16:04:00 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2021-01-01 16:04:00 +0200
commit3f38e2a452575e22813c363a8f7900f727f6b16b (patch)
tree8e34972e32ea6a5c5619c6470d0e2940dad6cec3
parent9118fd360a3da0bba521caf2a35c424968235ac4 (diff)
downloadmariadb-git-3f38e2a452575e22813c363a8f7900f727f6b16b.tar.gz
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.
-rw-r--r--storage/innobase/handler/handler0alter.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 8dceb3a21f5..459be7e22a2 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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