diff options
author | unknown <sanja@montyprogram.com> | 2014-01-23 12:05:10 +0200 |
---|---|---|
committer | unknown <sanja@montyprogram.com> | 2014-01-23 12:05:10 +0200 |
commit | d9cb1352c8256d9c19a3d29af6fe3d705578a413 (patch) | |
tree | 1a48e97d1682ea753c59bccff73d4815e19d7351 /sql/table.cc | |
parent | bea9f82653dfafca0b2abc4357a5bb7f5cff826a (diff) | |
parent | 5f5f7befe37e942d4fff0771ac79d143ca4500c6 (diff) | |
download | mariadb-git-d9cb1352c8256d9c19a3d29af6fe3d705578a413.tar.gz |
merge of MDEV-5356 5.1->5.3 (with more fixes and test suite).
THD::thd->activate_stmt_arena_if_needed() should be used to temporary activating statement arena instead of direct usage of THD::set_n_backup_active_arena() because possible such scenario:
1) func1 saves current arena and activates copy1 of statement arena
2) func2 saves copy1 of statement arena setup by func1 and activates copy2
3) some changes made for copy 2
4) func2 stores changed copy2 back to statenet arena and activates copy1
5) func1 store unchanged copy1 back to statemnt arena (rewrite changed copy 2 so changes become lost) and activates arena which was before.
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sql/table.cc b/sql/table.cc index 066eb506835..aa5f11bbe30 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3560,7 +3560,7 @@ bool TABLE_LIST::create_field_translation(THD *thd) SELECT_LEX *select= get_single_select(); List_iterator_fast<Item> it(select->item_list); uint field_count= 0; - Query_arena *arena= thd->stmt_arena, backup; + Query_arena *arena, backup; bool res= FALSE; if (thd->stmt_arena->is_conventional() || @@ -3598,10 +3598,7 @@ bool TABLE_LIST::create_field_translation(THD *thd) return FALSE; } - if (arena->is_conventional()) - arena= 0; // For easier test - else - thd->set_n_backup_active_arena(arena, &backup); + arena= thd->activate_stmt_arena_if_needed(&backup); /* Create view fields translation table */ |