1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge with 4.0 to get lastest bug fixes

This commit is contained in:
monty@mysql.com
2004-03-29 19:21:53 +03:00
14 changed files with 165 additions and 116 deletions

View File

@ -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);