diff options
author | unknown <pappa@c-4a09e253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2005-08-26 20:56:19 -0400 |
---|---|---|
committer | unknown <pappa@c-4a09e253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2005-08-26 20:56:19 -0400 |
commit | 67e1194aaea300aa4bebe3ad5df8e872ae1f1cc7 (patch) | |
tree | 2b4021797a35f78a0b617dea1e43131baa125c56 /sql/sql_partition.cc | |
parent | 056ee93a060d1c2cc7fbfa92ba5ed0928b35f3e2 (diff) | |
download | mariadb-git-67e1194aaea300aa4bebe3ad5df8e872ae1f1cc7.tar.gz |
Merge 5.0 -> 5.1
Fixes +
Adapted to new name resolution context after WL #2486
sql/sql_base.cc:
Merge error fix + bug fix
sql/sql_partition.cc:
Adapted to new name resolution context after WL #2486
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r-- | sql/sql_partition.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 14466dfeaa0..a285eb53560 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -1213,18 +1213,26 @@ static bool fix_fields_part_func(THD *thd, TABLE_LIST *tables, bool result= TRUE; TABLE *table= tables->table; - TABLE_LIST *save_list; + TABLE_LIST *save_table_list, *save_first_table, *save_last_table; int error; - Name_resolution_context *context= &thd->lex->current_select->context; + Name_resolution_context *context; DBUG_ENTER("fix_fields_part_func"); + context= thd->lex->current_context(); table->map= 1; //To ensure correct calculation of const item table->get_fields_in_item_tree= TRUE; - save_list= context->table_list; + save_table_list= context->table_list; + save_first_table= context->first_name_resolution_table; + save_last_table= context->last_name_resolution_table; context->table_list= tables; + context->first_name_resolution_table= tables; + context->last_name_resolution_table= NULL; + func_expr->walk(&Item::change_context_processor, (byte*) context); thd->where= "partition function"; error= func_expr->fix_fields(thd, (Item**)0); - context->table_list= save_list; + context->table_list= save_table_list; + context->first_name_resolution_table= save_first_table; + context->last_name_resolution_table= save_last_table; if (unlikely(error)) { DBUG_PRINT("info", ("Field in partition function not part of table")); @@ -1630,6 +1638,8 @@ bool fix_partition_func(THD *thd, const char* name, TABLE *table) bzero((void*)&tables, sizeof(TABLE_LIST)); tables.alias= tables.table_name= (char*)share->table_name; tables.table= table; + tables.next_local= 0; + tables.next_name_resolution_table= 0; strmov(db_name_string, name); dir_length= dirname_length(db_name_string); db_name_string[dir_length - 1]= 0; |