summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-05-08 15:26:26 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2018-06-14 17:58:33 +0200
commit71c318372e919e21ccf73e54553fffecb1040f75 (patch)
tree468d23eec3c8975713c1fcfe32caccc02a6871a3 /sql/sql_table.cc
parenta79b033b359b882f2fe88051781c6e850bd71780 (diff)
downloadmariadb-git-bb-10.2-MDEV-11071.tar.gz
MDEV-11071: Assertion `thd->transaction.stmt.is_empty()' failed in Locked_tables_list::unlock_locked_tablebb-10.2-MDEV-11071
fix_length_and_dec now return result (error/OK)
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index dd21c8fb107..9a87b0e7461 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -4896,7 +4896,12 @@ int create_table_impl(THD *thd,
file= mysql_create_frm_image(thd, orig_db, orig_table_name, create_info,
alter_info, create_table_mode, key_info,
key_count, frm);
- if (!file)
+ /*
+ TODO: remove this check of thd->is_error() (now it intercept
+ errors in some val_*() methoids and bring some single place to
+ such error interception).
+ */
+ if (!file || thd->is_error())
goto err;
if (rea_create_table(thd, frm, path, db, table_name, create_info,
file, frm_only))
@@ -7398,10 +7403,15 @@ static bool mysql_inplace_alter_table(THD *thd,
/*
Replace the old .FRM with the new .FRM, but keep the old name for now.
Rename to the new name (if needed) will be handled separately below.
+
+ TODO: remove this check of thd->is_error() (now it intercept
+ errors in some val_*() methoids and bring some single place to
+ such error interception).
*/
if (mysql_rename_table(db_type, alter_ctx->new_db, alter_ctx->tmp_name,
alter_ctx->db, alter_ctx->alias,
- FN_FROM_IS_TMP | NO_HA_TABLE))
+ FN_FROM_IS_TMP | NO_HA_TABLE) ||
+ thd->is_error())
{
// Since changes were done in-place, we can't revert them.
(void) quick_rm_table(thd, db_type,