mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 03:47:17 +02:00
after review fix
sql/item.h: typo fixed sql/item_func.h: clear refernce on deleted variable sql/item_subselect.cc: layout fixed sql/sql_base.cc: temporary memory pool allocation moved from open_and_lock_tables sql/sql_prepare.cc: temporary memory pool allocation moved changing in routine suggeted by Monty tests/client_test.c: uncomment accidently commented test
This commit is contained in:
parent
36d2d2061b
commit
7dd164f730
6 changed files with 36 additions and 21 deletions
|
|
@ -419,7 +419,7 @@ public:
|
||||||
int save_in_field(Field *field, bool no_conversions);
|
int save_in_field(Field *field, bool no_conversions);
|
||||||
bool basic_const_item() const { return 1; }
|
bool basic_const_item() const { return 1; }
|
||||||
Item *new_item() { return new Item_int(name,value,max_length); }
|
Item *new_item() { return new Item_int(name,value,max_length); }
|
||||||
void cleanup() { fixed= 1; } // to privent drop fixed flag
|
void cleanup() { fixed= 1; } // to prevent drop fixed flag
|
||||||
void print(String *str);
|
void print(String *str);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -908,7 +908,7 @@ public:
|
||||||
static Item_cache* get_cache(Item_result type);
|
static Item_cache* get_cache(Item_result type);
|
||||||
table_map used_tables() const { return used_table_map; }
|
table_map used_tables() const { return used_table_map; }
|
||||||
virtual void keep_array() {}
|
virtual void keep_array() {}
|
||||||
void cleanup() { fixed= 1; } // to privent drop fixed flag
|
void cleanup() { fixed= 1; } // to prevent drop fixed flag
|
||||||
void print(String *str);
|
void print(String *str);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1009,7 +1009,10 @@ public:
|
||||||
table->fulltext_searched=0;
|
table->fulltext_searched=0;
|
||||||
}
|
}
|
||||||
if (concat)
|
if (concat)
|
||||||
|
{
|
||||||
delete concat;
|
delete concat;
|
||||||
|
concat= 0;
|
||||||
|
}
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
enum Functype functype() const { return FT_FUNC; }
|
enum Functype functype() const { return FT_FUNC; }
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,7 @@ void Item_subselect::init(st_select_lex *select_lex,
|
||||||
unit= select_lex->master_unit();
|
unit= select_lex->master_unit();
|
||||||
|
|
||||||
if (select_lex->next_select())
|
if (select_lex->next_select())
|
||||||
engine= new subselect_union_engine(unit, result,
|
engine= new subselect_union_engine(unit, result, this);
|
||||||
this);
|
|
||||||
else
|
else
|
||||||
engine= new subselect_single_select_engine(select_lex, result, this);
|
engine= new subselect_single_select_engine(select_lex, result, this);
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
|
|
|
||||||
|
|
@ -1631,14 +1631,6 @@ int open_and_lock_tables(THD *thd, TABLE_LIST *tables)
|
||||||
if (open_tables(thd, tables, &counter) || lock_tables(thd, tables, counter))
|
if (open_tables(thd, tables, &counter) || lock_tables(thd, tables, counter))
|
||||||
DBUG_RETURN(-1); /* purecov: inspected */
|
DBUG_RETURN(-1); /* purecov: inspected */
|
||||||
fix_tables_pointers(thd->lex->all_selects_list);
|
fix_tables_pointers(thd->lex->all_selects_list);
|
||||||
|
|
||||||
/*
|
|
||||||
open temporary memory pool, which will be closed in
|
|
||||||
mysql_test_select_fields, mysql_test_upd_fields or
|
|
||||||
mysql_test_insert_fields
|
|
||||||
*/
|
|
||||||
if (thd->current_statement)
|
|
||||||
thd->ps_setup_prepare_memory();
|
|
||||||
DBUG_RETURN(mysql_handle_derived(thd->lex));
|
DBUG_RETURN(mysql_handle_derived(thd->lex));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2089,6 +2081,11 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
|
||||||
if (!wild_num)
|
if (!wild_num)
|
||||||
return 0;
|
return 0;
|
||||||
Statement *stmt= thd->current_statement, backup;
|
Statement *stmt= thd->current_statement, backup;
|
||||||
|
|
||||||
|
/*
|
||||||
|
If we are in preparing prepared statement phase then we have change
|
||||||
|
temporary mem_root to statement mem root to save changes of SELECT list
|
||||||
|
*/
|
||||||
if (stmt)
|
if (stmt)
|
||||||
thd->set_n_backup_item_arena(stmt, &backup);
|
thd->set_n_backup_item_arena(stmt, &backup);
|
||||||
reg2 Item *item;
|
reg2 Item *item;
|
||||||
|
|
|
||||||
|
|
@ -621,9 +621,14 @@ static bool mysql_test_insert_fields(Prepared_statement *stmt,
|
||||||
(grant_option && check_grant(thd,privilege,table_list,0,0)))
|
(grant_option && check_grant(thd,privilege,table_list,0,0)))
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
open temporary memory pool for temporary data allocated by derived
|
||||||
|
tables & preparation procedure
|
||||||
|
*/
|
||||||
|
thd->ps_setup_prepare_memory();
|
||||||
if (open_and_lock_tables(thd, table_list))
|
if (open_and_lock_tables(thd, table_list))
|
||||||
{
|
{
|
||||||
// this memory pool was opened in open_and_lock_tables
|
|
||||||
thd->ps_setup_free_memory();
|
thd->ps_setup_free_memory();
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
|
|
@ -692,6 +697,12 @@ static bool mysql_test_upd_fields(Prepared_statement *stmt,
|
||||||
(grant_option && check_grant(thd,UPDATE_ACL,table_list,0,0)))
|
(grant_option && check_grant(thd,UPDATE_ACL,table_list,0,0)))
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
open temporary memory pool for temporary data allocated by derived
|
||||||
|
tables & preparation procedure
|
||||||
|
*/
|
||||||
|
thd->ps_setup_prepare_memory();
|
||||||
if (open_and_lock_tables(thd, table_list))
|
if (open_and_lock_tables(thd, table_list))
|
||||||
{
|
{
|
||||||
// this memory pool was opened in open_and_lock_tables
|
// this memory pool was opened in open_and_lock_tables
|
||||||
|
|
@ -761,13 +772,14 @@ static bool mysql_test_select_fields(Prepared_statement *stmt,
|
||||||
if ((&lex->select_lex != lex->all_selects_list &&
|
if ((&lex->select_lex != lex->all_selects_list &&
|
||||||
lex->unit.create_total_list(thd, lex, &tables)))
|
lex->unit.create_total_list(thd, lex, &tables)))
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
open temporary memory pool for temporary data allocated by derived
|
||||||
|
tables & preparation procedure
|
||||||
|
*/
|
||||||
|
thd->ps_setup_prepare_memory();
|
||||||
if (open_and_lock_tables(thd, tables))
|
if (open_and_lock_tables(thd, tables))
|
||||||
{
|
goto err;
|
||||||
// this memory pool was opened in open_and_lock_tables
|
|
||||||
thd->ps_setup_free_memory();
|
|
||||||
DBUG_RETURN(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lex->describe)
|
if (lex->describe)
|
||||||
{
|
{
|
||||||
|
|
@ -985,6 +997,10 @@ alloc_query_err:
|
||||||
thd->current_statement= 0;
|
thd->current_statement= 0;
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
insert_stmt_err:
|
insert_stmt_err:
|
||||||
|
stmt->set_statement(thd);
|
||||||
|
thd->set_statement(&thd->stmt_backup);
|
||||||
|
/* Statement map deletes statement on erase */
|
||||||
|
thd->stmt_map.erase(stmt);
|
||||||
thd->current_statement= 0;
|
thd->current_statement= 0;
|
||||||
delete stmt;
|
delete stmt;
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
|
|
@ -1068,7 +1084,7 @@ void mysql_stmt_execute(THD *thd, char *packet)
|
||||||
SELECT_LEX_UNIT *unit= sl->master_unit();
|
SELECT_LEX_UNIT *unit= sl->master_unit();
|
||||||
unit->unclean();
|
unit->unclean();
|
||||||
unit->types.empty();
|
unit->types.empty();
|
||||||
// for derived tables & PS (which can't be reset bu Item_subquery)
|
// for derived tables & PS (which can't be reset by Item_subquery)
|
||||||
unit->reinit_exec_mechanism();
|
unit->reinit_exec_mechanism();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8538,7 +8538,7 @@ int main(int argc, char **argv)
|
||||||
test_stmt_close(); /* mysql_stmt_close() test -- hangs */
|
test_stmt_close(); /* mysql_stmt_close() test -- hangs */
|
||||||
test_prepare_field_result(); /* prepare meta info */
|
test_prepare_field_result(); /* prepare meta info */
|
||||||
test_multi_stmt(); /* multi stmt test */
|
test_multi_stmt(); /* multi stmt test */
|
||||||
/* test_multi_statements(); *//* test multi statement execution */
|
test_multi_statements();/* test multi statement execution */
|
||||||
test_store_result(); /* test the store_result */
|
test_store_result(); /* test the store_result */
|
||||||
test_store_result1(); /* test store result without buffers */
|
test_store_result1(); /* test store result without buffers */
|
||||||
test_store_result2(); /* test store result for misc case */
|
test_store_result2(); /* test store result for misc case */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue