#At file:///home/mikael/mysql_clones/mysql-6.0-bugteam-bug32115/
3480 Mikael Ronstrom 2009-08-05
Bug#32115, fixed review comments
modified:
sql/sql_partition.cc
=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc 2009-07-29 14:57:47 +0000
+++ b/sql/sql_partition.cc 2009-08-05 12:57:04 +0000
@@ -859,16 +859,16 @@ int check_signed_flag(partition_info *pa
return error;
}
-/*
+/**
Initialize lex object for use in fix_fields and parsing.
SYNOPSIS
init_lex_with_single_table()
- thd The thread object
- table The table object
- RETURN VALUE
- TRUE An error occurred, memory allocation error
- FALSE Ok
+ @param thd The thread object
+ @param table The table object
+ @return Operation status
+ @retval TRUE An error occurred, memory allocation error
+ @retval FALSE Ok
DESCRIPTION
This function is used to initialize a lex object on the
@@ -885,6 +885,8 @@ init_lex_with_single_table(THD *thd, TAB
TABLE_LIST *table_list;
Table_ident *table_ident;
LEX *lex= thd->lex;
+ SELECT_LEX *select_lex= &lex->select_lex;
+ Name_resolution_context *context= &select_lex->context;
/*
We will call the parser to create a part_info struct based on the
partition string stored in the frm file.
@@ -894,33 +896,32 @@ init_lex_with_single_table(THD *thd, TAB
we're working with to the Name_resolution_context.
*/
lex_start(thd);
- lex->select_lex.context.init();
+ context->init();
if ((!(table_ident= new Table_ident(thd,
table->s->table_name,
table->s->db, TRUE))) ||
- (!(table_list= lex->select_lex.add_table_to_list(thd,
- table_ident,
- NULL,
- 0))))
+ (!(table_list= select_lex->add_table_to_list(thd,
+ table_ident,
+ NULL,
+ 0))))
return TRUE;
- lex->select_lex.context.table_list=
- lex->select_lex.context.first_name_resolution_table= table_list;
+ context->resolve_in_table_list_only(table_list);
lex->use_only_table_context= TRUE;
- lex->select_lex.cur_pos_in_select_list= UNDEF_POS;
+ select_lex->cur_pos_in_select_list= UNDEF_POS;
table->map= 1; //To ensure correct calculation of const item
table->get_fields_in_item_tree= TRUE;
table_list->table= table;
return FALSE;
}
-/*
+/**
End use of local lex with single table
SYNOPSIS
end_lex_with_single_table()
- thd The thread object
- table The table object
- old_lex The real lex object connected to THD
+ @param thd The thread object
+ @param table The table object
+ @param old_lex The real lex object connected to THD
DESCRIPTION
This function restores the real lex object after calling
@@ -928,7 +929,7 @@ init_lex_with_single_table(THD *thd, TAB
variables temporarily set.
*/
-static int
+static void
end_lex_with_single_table(THD *thd, TABLE *table, LEX *old_lex)
{
LEX *lex= thd->lex;
| Thread |
|---|
| • bzr commit into mysql-5.4 branch (mikael:3480) Bug#32115 | Mikael Ronstrom | 5 Aug 2009 |