diff options
author | unknown <bell@sanja.is.com.ua> | 2004-09-10 02:22:44 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-09-10 02:22:44 +0300 |
commit | b386f888da6eaf55c50d5ee9f8c2fa46c6b0cbf2 (patch) | |
tree | b045cc181c0717a5a6787cfc01d4a6744ac330c6 /sql/item_subselect.cc | |
parent | ed2c4854dd9d6b75f052d0f7e824b68cc68e35d0 (diff) | |
download | mariadb-git-b386f888da6eaf55c50d5ee9f8c2fa46c6b0cbf2.tar.gz |
post merge fixes
mysql-test/t/merge.test:
additional test
sql/item.h:
parameter to detect need of saving view field names
sql/item_subselect.cc:
arena fix
used nearest thd pointer
sql/item_sum.cc:
after merge fix
sql/mysql_priv.h:
after merge fix
sql/sql_base.cc:
fixed unique test
fixed postmerge arena mamgement
sql/sql_class.h:
mey method to detect conventional execution
sql/sql_handler.cc:
new parameter
sql/sql_lex.cc:
fixed postmerge arena mamgement
sql/sql_parse.cc:
fixed unique test
sql/sql_select.cc:
fixed postmerge arena mamgement
sql/sql_union.cc:
fixed postmerge arena mamgement
sql/sql_view.cc:
fixed postmerge arena mamgement
sql/table.cc:
fixed postmerge arena mamgement
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 23dbcf8af48..9cd01255d43 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -316,9 +316,9 @@ Item_singlerow_subselect::select_transformer(JOIN *join) SELECT_LEX *select_lex= join->select_lex; /* Juggle with current arena only if we're in prepared statement prepare */ - Item_arena *arena= join->thd->current_arena; + Item_arena *arena= thd->current_arena; Item_arena backup; - if (!arena->is_stmt_prepare()) + if (arena->is_conventional()) arena= 0; // For easier test if (!select_lex->master_unit()->first_select()->next_select() && @@ -337,11 +337,11 @@ Item_singlerow_subselect::select_transformer(JOIN *join) { have_to_be_excluded= 1; - if (join->thd->lex->describe) + if (thd->lex->describe) { char warn_buff[MYSQL_ERRMSG_SIZE]; sprintf(warn_buff, ER(ER_SELECT_REDUCED), select_lex->select_number); - push_warning(join->thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_SELECT_REDUCED, warn_buff); } substitution= select_lex->item_list.head(); @@ -367,9 +367,9 @@ Item_singlerow_subselect::select_transformer(JOIN *join) if (!(substitution= new Item_func_if(cond, substitution, new Item_null()))) goto err; + if (arena) + thd->restore_backup_item_arena(arena, &backup); } - if (arena) - thd->restore_backup_item_arena(arena, &backup); return RES_REDUCE; } return RES_OK; @@ -654,11 +654,11 @@ Item_in_subselect::single_value_transformer(JOIN *join, } SELECT_LEX *select_lex= join->select_lex; - Item_arena *arena= join->thd->current_arena, backup; + Item_arena *arena= thd->current_arena, backup; thd->where= "scalar IN/ALL/ANY subquery"; - if (!arena->is_stmt_prepare()) + if (arena->is_conventional()) arena= 0; // For easier test else thd->set_n_backup_item_arena(arena, &backup); @@ -900,7 +900,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) thd->where= "row IN/ALL/ANY subquery"; Item_arena *arena= join->thd->current_arena, backup; - if (!arena->is_stmt_prepare()) + if (arena->is_conventional()) arena= 0; else thd->set_n_backup_item_arena(arena, &backup); @@ -1192,17 +1192,17 @@ void subselect_uniquesubquery_engine::fix_length_and_dec(Item_cache **row) int subselect_single_select_engine::exec() { DBUG_ENTER("subselect_single_select_engine::exec"); - char const *save_where= join->thd->where; - SELECT_LEX *save_select= join->thd->lex->current_select; - join->thd->lex->current_select= select_lex; + char const *save_where= thd->where; + SELECT_LEX *save_select= thd->lex->current_select; + thd->lex->current_select= select_lex; if (!optimized) { optimized=1; if (join->optimize()) { - join->thd->where= save_where; + thd->where= save_where; executed= 1; - join->thd->lex->current_select= save_select; + thd->lex->current_select= save_select; DBUG_RETURN(join->error ? join->error : 1); } if (item->engine_changed) @@ -1214,8 +1214,8 @@ int subselect_single_select_engine::exec() { if (join->reinit()) { - join->thd->where= save_where; - join->thd->lex->current_select= save_select; + thd->where= save_where; + thd->lex->current_select= save_select; DBUG_RETURN(1); } item->reset(); @@ -1225,20 +1225,20 @@ int subselect_single_select_engine::exec() { join->exec(); executed= 1; - join->thd->where= save_where; - join->thd->lex->current_select= save_select; + thd->where= save_where; + thd->lex->current_select= save_select; DBUG_RETURN(join->error||thd->is_fatal_error); } - join->thd->where= save_where; - join->thd->lex->current_select= save_select; + thd->where= save_where; + thd->lex->current_select= save_select; DBUG_RETURN(0); } int subselect_union_engine::exec() { - char const *save_where= unit->thd->where; + char const *save_where= thd->where; int res= unit->exec(); - unit->thd->where= save_where; + thd->where= save_where; return res; } |