summaryrefslogtreecommitdiff
path: root/sql/sql_partition.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r--sql/sql_partition.cc83
1 files changed, 4 insertions, 79 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 9ab4e0c5226..2d15ca24733 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -951,86 +951,11 @@ int check_signed_flag(partition_info *part_info)
return error;
}
-/**
- Initialize lex object for use in fix_fields and parsing.
-
- SYNOPSIS
- init_lex_with_single_table()
- @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
- stack for use by fix_fields and for parsing. In order to
- work properly it also needs to initialize the
- Name_resolution_context object of the lexer.
- Finally it needs to set a couple of variables to ensure
- proper functioning of fix_fields.
-*/
-
-static int
-init_lex_with_single_table(THD *thd, TABLE *table, LEX *lex)
-{
- TABLE_LIST *table_list;
- Table_ident *table_ident;
- 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.
- We will use a local lex object for this purpose. However we also
- need to set the Name_resolution_object for this lex object. We
- do this by using add_table_to_list where we add the table that
- we're working with to the Name_resolution_context.
- */
- thd->lex= lex;
- lex_start(thd);
- context->init();
- if ((!(table_ident= new Table_ident(thd,
- table->s->table_name,
- table->s->db, TRUE))) ||
- (!(table_list= select_lex->add_table_to_list(thd,
- table_ident,
- NULL,
- 0))))
- return TRUE;
- context->resolve_in_table_list_only(table_list);
- lex->use_only_table_context= TRUE;
- 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()
- @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
- init_lex_with_single_table and also restores some table
- variables temporarily set.
+/*
+ init_lex_with_single_table and end_lex_with_single_table
+ are now in sql_lex.cc
*/
-static void
-end_lex_with_single_table(THD *thd, TABLE *table, LEX *old_lex)
-{
- LEX *lex= thd->lex;
- table->map= 0;
- table->get_fields_in_item_tree= FALSE;
- lex_end(lex);
- thd->lex= old_lex;
-}
-
/*
The function uses a new feature in fix_fields where the flag
GET_FIXED_FIELDS_FLAG is set for all fields in the item tree.
@@ -2033,7 +1958,7 @@ static int add_int(File fptr, longlong number)
static int add_uint(File fptr, ulonglong number)
{
char buff[32];
- longlong2str(number, buff, 10, 1);
+ longlong2str(number, buff, 10);
return add_string(fptr, buff);
}