mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Moved safe_to_cache_query from thd to lex.
This is required for prepared statements and stored procedures. BitKeeper/etc/ignore: Added bkpull.log bkpull.log.2 bkpull.log.3 build.log sql/safe_to_cache_query.txt to the ignore list sql/item_create.cc: Moved safe_to_cache_query from thd to lex. sql/item_func.cc: Moved safe_to_cache_query from thd to lex. sql/sql_cache.cc: Moved safe_to_cache_query from thd to lex. Note: Query_cache::is_cacheable() has both a thd and lex argument. We assumed that it's the lex->safe_to_cache_query we should test. sql/sql_class.cc: Moved safe_to_cache_query from thd to lex. sql/sql_class.h: Moved safe_to_cache_query from thd to lex. sql/sql_lex.cc: Moved safe_to_cache_query from thd to lex. We set it to 1 initially. It's then set to 0 in cases where it's know not to be safe. (Before this change, it was set to 0 in thd, and then set to 1 before parsing.) sql/sql_lex.h: Moved safe_to_cache_query from thd to lex. sql/sql_parse.cc: Moved safe_to_cache_query from thd to lex. No point in setting it here now, it's set in lex_start() later. sql/sql_prepare.cc: Moved safe_to_cache_query from thd to lex. Must set it after lex_start() has been called. sql/sql_yacc.yy: Moved safe_to_cache_query from thd to lex.
This commit is contained in:
@ -76,7 +76,7 @@ Item *create_func_ceiling(Item* a)
|
||||
Item *create_func_connection_id(void)
|
||||
{
|
||||
THD *thd=current_thd;
|
||||
thd->safe_to_cache_query=0;
|
||||
thd->lex.safe_to_cache_query=0;
|
||||
return new Item_int("CONNECTION_ID()",(longlong) thd->thread_id,10);
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ Item *create_func_floor(Item* a)
|
||||
Item *create_func_found_rows(void)
|
||||
{
|
||||
THD *thd=current_thd;
|
||||
thd->safe_to_cache_query=0;
|
||||
thd->lex.safe_to_cache_query=0;
|
||||
return new Item_int("FOUND_ROWS()",(longlong) thd->found_rows(),21);
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ Item *create_func_from_days(Item* a)
|
||||
|
||||
Item *create_func_get_lock(Item* a, Item *b)
|
||||
{
|
||||
current_thd->safe_to_cache_query=0;
|
||||
current_thd->lex.safe_to_cache_query=0;
|
||||
return new Item_func_get_lock(a, b);
|
||||
}
|
||||
|
||||
@ -308,7 +308,7 @@ Item *create_func_radians(Item *a)
|
||||
|
||||
Item *create_func_release_lock(Item* a)
|
||||
{
|
||||
current_thd->safe_to_cache_query=0;
|
||||
current_thd->lex.safe_to_cache_query=0;
|
||||
return new Item_func_release_lock(a);
|
||||
}
|
||||
|
||||
@ -416,13 +416,13 @@ Item *create_func_year(Item* a)
|
||||
|
||||
Item *create_load_file(Item* a)
|
||||
{
|
||||
current_thd->safe_to_cache_query=0;
|
||||
current_thd->lex.safe_to_cache_query=0;
|
||||
return new Item_load_file(a);
|
||||
}
|
||||
|
||||
Item *create_wait_for_master_pos(Item* a, Item* b)
|
||||
{
|
||||
current_thd->safe_to_cache_query=0;
|
||||
current_thd->lex.safe_to_cache_query=0;
|
||||
return new Item_master_pos_wait(a, b);
|
||||
}
|
||||
|
||||
@ -443,7 +443,7 @@ Item *create_func_cast(Item *a, Item_cast cast_type)
|
||||
|
||||
Item *create_func_is_free_lock(Item* a)
|
||||
{
|
||||
current_thd->safe_to_cache_query=0;
|
||||
current_thd->lex.safe_to_cache_query=0;
|
||||
return new Item_func_is_free_lock(a);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user