summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-06-03 00:02:47 +0400
committerunknown <konstantin@mysql.com>2005-06-03 00:02:47 +0400
commit892032a2c2db6ecbe983578132f34ce8dc596048 (patch)
treefc14b1c1768a454bb3c2e61001bce454073be9ae
parent198550e39b8741cccca0e936f608ca6b1c8dd70a (diff)
downloadmariadb-git-892032a2c2db6ecbe983578132f34ce8dc596048.tar.gz
Give Item_arena::is_stmt_prepare a more descriptive name (it marks
the code that is active for SP as well in 5.0) sql/item.cc: Rename of an Item_arena method. sql/item_subselect.cc: Rename of an Item_arena method. sql/sql_class.h: Rename of an Item_arena method. sql/sql_parse.cc: Rename of an Item_arena method. sql/sql_union.cc: Rename of an Item_arena method.
-rw-r--r--sql/item.cc2
-rw-r--r--sql/item_subselect.cc2
-rw-r--r--sql/sql_class.h3
-rw-r--r--sql/sql_parse.cc4
-rw-r--r--sql/sql_union.cc2
5 files changed, 7 insertions, 6 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 0db9a56055f..a9c1ef7198e 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1027,7 +1027,7 @@ Item_field::Item_field(THD *thd, Field *f)
structure can go away and pop up again between subsequent executions
of a prepared statement).
*/
- if (thd->current_arena->is_stmt_prepare())
+ if (thd->current_arena->is_stmt_prepare_or_first_sp_execute())
{
if (db_name)
orig_db_name= thd->strdup(db_name);
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index b7aefdd6f2e..4f1e5b9a290 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -362,7 +362,7 @@ Item_singlerow_subselect::select_transformer(JOIN *join)
because we do not rollback this changes
TODO: make rollback for it, or special name resolving mode in 5.0.
*/
- !arena->is_stmt_prepare()
+ !arena->is_stmt_prepare_or_first_sp_execute()
)
{
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 47987f3a0c6..7c8ead7558e 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -695,7 +695,8 @@ public:
virtual Type type() const;
virtual ~Item_arena() {};
- inline bool is_stmt_prepare() const { return (int)state < (int)PREPARED; }
+ inline bool is_stmt_prepare_or_first_sp_execute() const
+ { return (int)state < (int)PREPARED; }
inline bool is_first_stmt_execute() const { return state == PREPARED; }
inline bool is_stmt_execute() const
{ return state == PREPARED || state == EXECUTED; }
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 2af9191110c..a9e68de3705 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -5894,7 +5894,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ptr->db= empty_c_string;
ptr->db_length= 0;
}
- if (thd->current_arena->is_stmt_prepare())
+ if (thd->current_arena->is_stmt_prepare_or_first_sp_execute())
ptr->db= thd->strdup(ptr->db);
ptr->alias= alias_str;
@@ -6972,7 +6972,7 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
against the opened tables to ensure we don't use a table that is part
of the view (which can only be done after the table has been opened).
*/
- if (thd->current_arena->is_stmt_prepare())
+ if (thd->current_arena->is_stmt_prepare_or_first_sp_execute())
{
/*
For temporary tables we don't have to check if the created table exists
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 8d36889df76..56401ced67c 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -323,7 +323,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
}
if (tmp_arena)
thd->restore_backup_item_arena(tmp_arena, &backup);
- if (arena->is_stmt_prepare())
+ if (arena->is_stmt_prepare_or_first_sp_execute())
{
/* prepare fake select to initialize it correctly */
init_prepare_fake_select_lex(thd);