summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-02-03 18:40:27 +0100
committerSergei Golubchik <serg@mariadb.org>2019-02-05 01:34:17 +0100
commitef4ccb6ce2fd36014a7d065c3c4cf7611d113211 (patch)
tree5d121fe0657f3dfa20e72c145c2fbe2cef97c263 /sql/sql_table.cc
parent3b7694b7f89412e869ac63804d424a3f29f7e2af (diff)
downloadmariadb-git-ef4ccb6ce2fd36014a7d065c3c4cf7611d113211.tar.gz
MDEV-18083 ASAN heap-use-after-free in Field::set_warning_truncated_wrong_value upon inserting into temporary table
remove TABLE_SHARE::error_table_name() and TABLE_SHARE::orig_table_name (that was allocated in a wrong memroot in this bug). instead, simply set TABLE_SHARE::table_name correctly.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 58698936476..4f9adc3338c 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -9440,7 +9440,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
goto err_new_table_cleanup;
if (ha_create_table(thd, alter_ctx.get_tmp_path(),
- alter_ctx.new_db, alter_ctx.tmp_name,
+ alter_ctx.new_db, alter_ctx.new_name,
create_info, &frm))
goto err_new_table_cleanup;
@@ -9449,7 +9449,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
new_table=
thd->create_and_open_tmp_table(new_db_type, &frm, alter_ctx.get_tmp_path(),
- alter_ctx.new_db, alter_ctx.tmp_name, true);
+ alter_ctx.new_db, alter_ctx.new_name, true);
if (!new_table)
goto err_new_table_cleanup;
@@ -9511,7 +9511,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
goto err_new_table_cleanup;
}
}
- new_table->s->orig_table_name= table->s->table_name.str;
/*
Note: In case of MERGE table, we do not attach children. We do not