diff options
author | Gleb Shchepa <gshchepa@mysql.com> | 2008-10-08 02:52:49 +0500 |
---|---|---|
committer | Gleb Shchepa <gshchepa@mysql.com> | 2008-10-08 02:52:49 +0500 |
commit | 39996b44cce1cb40fe3ae0634c735626c3a103e0 (patch) | |
tree | 0410f91fd4242a83c6223b770ea87e32d5e28c00 /sql/item.cc | |
parent | 5898c53c549aa794b14a3769a21878b50729de1f (diff) | |
parent | f48b42e77657dd2e27380201631fd0f137863b85 (diff) | |
download | mariadb-git-39996b44cce1cb40fe3ae0634c735626c3a103e0.tar.gz |
manual merge 5.0-5.1.29-rc --> 5.1-5.1.29-rc
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/item.cc b/sql/item.cc index fc33f3d5cad..93d00c287ae 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1804,14 +1804,16 @@ Item_field::Item_field(THD *thd, Name_resolution_context *context_arg, We need to copy db_name, table_name and field_name because they must be allocated in the statement memory, not in table memory (the table structure can go away and pop up again between subsequent executions - of a prepared statement). + of a prepared statement or after the close_tables_for_reopen() call + in mysql_multi_update_prepare()). */ - if (thd->stmt_arena->is_stmt_prepare_or_first_sp_execute()) { if (db_name) orig_db_name= thd->strdup(db_name); - orig_table_name= thd->strdup(table_name); - orig_field_name= thd->strdup(field_name); + if (table_name) + orig_table_name= thd->strdup(table_name); + if (field_name) + orig_field_name= thd->strdup(field_name); /* We don't restore 'name' in cleanup because it's not changed during execution. Still we need it to point to persistent |