summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-02-01 00:54:03 +0100
committerSergei Golubchik <sergii@pisem.net>2014-02-01 00:54:03 +0100
commit59d9d08e2b6f6f35e781d24c47d33d26fb4ba2a5 (patch)
tree3e4a302ccf3912d4d8a40aa271414003bfe7c9b6 /sql/table.cc
parentce02738d7f2f2688eeec7004dd6a30293d36044f (diff)
parent6b6d40fa6ca1fe36f2a51c2723c58dfb3fc025bb (diff)
downloadmariadb-git-59d9d08e2b6f6f35e781d24c47d33d26fb4ba2a5.tar.gz
5.5 merge
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/sql/table.cc b/sql/table.cc
index f6bea7221ce..b9f2731e46e 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -807,7 +807,6 @@ static bool create_key_infos(const uchar *strpos, const uchar *frm_image_end,
keyinfo->ext_key_part_map= 0;
if (share->use_ext_keys && i)
{
- keyinfo->ext_key_part_map= 0;
for (j= 0;
j < first_key_parts && keyinfo->ext_key_parts < MAX_REF_PARTS;
j++)
@@ -4084,8 +4083,9 @@ 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;
+ DBUG_ENTER("TABLE_LIST::create_field_translation");
if (thd->stmt_arena->is_conventional() ||
thd->stmt_arena->is_stmt_prepare_or_first_sp_execute())
@@ -4106,7 +4106,7 @@ bool TABLE_LIST::create_field_translation(THD *thd)
if (field_translation)
{
/*
- Update items in the field translation aftet view have been prepared.
+ Update items in the field translation after view have been prepared.
It's needed because some items in the select list, like IN subselects,
might be substituted for optimized ones.
*/
@@ -4119,13 +4119,10 @@ bool TABLE_LIST::create_field_translation(THD *thd)
field_translation_updated= TRUE;
}
- return FALSE;
+ DBUG_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 */
@@ -4145,12 +4142,14 @@ bool TABLE_LIST::create_field_translation(THD *thd)
}
field_translation= transl;
field_translation_end= transl + field_count;
+ /* It's safe to cache this table for prepared statements */
+ cacheable_table= 1;
exit:
if (arena)
thd->restore_active_arena(arena, &backup);
- return res;
+ DBUG_RETURN(res);
}