mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge with 4.0 to get lastest bug fixes
include/m_string.h: Auto merged myisam/mi_create.c: Auto merged mysql-test/r/bdb-crash.result: Auto merged sql/handler.h: Auto merged mysql-test/r/grant_cache.result: Auto merged mysql-test/t/grant_cache.test: Auto merged sql/sql_cache.cc: Auto merged sql/sql_table.cc: Auto merged innobase/mem/mem0dbg.c: Merge with 4.0 mysql-test/r/myisam.result: Merge with 4.0 mysql-test/r/order_by.result: Merge with 4.0 mysql-test/t/bdb-crash.test: Merge with 4.0 mysql-test/t/myisam.test: Merge with 4.0 mysql-test/t/order_by.test: Merge with 4.0 sql/ha_berkeley.cc: Merge with 4.0 (use local code) sql/sql_select.cc: Merge with 4.0 to get fix for FORCE INDEX ... ORDER BY
This commit is contained in:
@ -601,7 +601,6 @@ void query_cache_insert(NET *net, const char *packet, ulong length)
|
||||
if (!query_cache.append_result_data(&result, length, (gptr) packet,
|
||||
query_block))
|
||||
{
|
||||
query_cache.refused++;
|
||||
DBUG_PRINT("warning", ("Can't append data"));
|
||||
header->result(result);
|
||||
DBUG_PRINT("qcache", ("free query 0x%lx", (ulong) query_block));
|
||||
@ -885,7 +884,8 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
|
||||
}
|
||||
}
|
||||
else
|
||||
statistic_increment(refused, &structure_guard_mutex);
|
||||
if (thd->lex.sql_command == SQLCOM_SELECT)
|
||||
statistic_increment(refused, &structure_guard_mutex);
|
||||
|
||||
end:
|
||||
DBUG_VOID_RETURN;
|
||||
@ -1024,7 +1024,6 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
|
||||
DBUG_PRINT("qcache",
|
||||
("probably no SELECT access to %s.%s => return to normal processing",
|
||||
table_list.db, table_list.alias));
|
||||
refused++; // This is actually a hit
|
||||
STRUCT_UNLOCK(&structure_guard_mutex);
|
||||
thd->lex->safe_to_cache_query=0; // Don't try to cache this
|
||||
BLOCK_UNLOCK_RD(query_block);
|
||||
@ -1680,6 +1679,12 @@ void Query_cache::free_query(Query_cache_block *query_block)
|
||||
*/
|
||||
if (result_block != 0)
|
||||
{
|
||||
if (result_block->type != Query_cache_block::RESULT)
|
||||
{
|
||||
// removing unfinished query
|
||||
refused++;
|
||||
inserts--;
|
||||
}
|
||||
Query_cache_block *block = result_block;
|
||||
do
|
||||
{
|
||||
@ -1688,6 +1693,12 @@ void Query_cache::free_query(Query_cache_block *query_block)
|
||||
free_memory_block(current);
|
||||
} while (block != result_block);
|
||||
}
|
||||
else
|
||||
{
|
||||
// removing unfinished query
|
||||
refused++;
|
||||
inserts--;
|
||||
}
|
||||
|
||||
query->unlock_n_destroy();
|
||||
free_memory_block(query_block);
|
||||
|
Reference in New Issue
Block a user