mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement
The problem was that we restored SQL_CACHE, SQL_NO_CACHE flags in SELECT statement from internal structures based on value set later at runtime, not the original value set by the user. The solution is to remember that original value.
This commit is contained in:
@@ -14277,10 +14277,19 @@ void st_select_lex::print(THD *thd, String *str)
|
||||
str->append(STRING_WITH_LEN("sql_buffer_result "));
|
||||
if (options & OPTION_FOUND_ROWS)
|
||||
str->append(STRING_WITH_LEN("sql_calc_found_rows "));
|
||||
if (!thd->lex->safe_to_cache_query)
|
||||
str->append(STRING_WITH_LEN("sql_no_cache "));
|
||||
if (options & OPTION_TO_QUERY_CACHE)
|
||||
str->append(STRING_WITH_LEN("sql_cache "));
|
||||
switch (sql_cache)
|
||||
{
|
||||
case SQL_NO_CACHE:
|
||||
str->append(STRING_WITH_LEN("sql_no_cache "));
|
||||
break;
|
||||
case SQL_CACHE:
|
||||
str->append(STRING_WITH_LEN("sql_cache "));
|
||||
break;
|
||||
case SQL_CACHE_UNSPECIFIED:
|
||||
break;
|
||||
default:
|
||||
DBUG_ASSERT(0);
|
||||
}
|
||||
|
||||
//Item List
|
||||
bool first= 1;
|
||||
|
||||
Reference in New Issue
Block a user