Commit 1a690844 authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua
Browse files

Fixed query cache align data bug.

parent 1937feae
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -49343,6 +49343,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet
@item
Fixed query cache align data bug.
@item
Fixed mutex bug in replication when reading from master fails.
@item
Added missing mutex in @code{TRUNCATE TABLE};  This fixes some core
+7 −4
Original line number Diff line number Diff line
@@ -2680,6 +2680,7 @@ my_bool Query_cache::move_by_type(byte **border,
    *before = new_block;
    /* If result writing complete && we have free space in block */
    ulong free_space= new_block->length - new_block->used;
    free_space-= free_space % ALIGN_SIZE(1);
    if (query->result()->type == Query_cache_block::RESULT &&
	new_block->length > new_block->used &&
	*gap + free_space > min_allocation_unit &&
@@ -2687,6 +2688,8 @@ my_bool Query_cache::move_by_type(byte **border,
    {
      *border-= free_space;
      *gap+= free_space;
      DBUG_PRINT("qcache",
		 ("rest of result free space added to gap (%lu)", *gap));
      new_block->length -= free_space;
    }
    BLOCK_UNLOCK_WR(query_block);
@@ -2747,7 +2750,7 @@ my_bool Query_cache::join_results(ulong join_limit)
	  header->length() > join_limit)
      {
	Query_cache_block *new_result_block =
	  get_free_block(header->length() +
	  get_free_block(ALIGN_SIZE(header->length()) +
			 ALIGN_SIZE(sizeof(Query_cache_block)) +
			 ALIGN_SIZE(sizeof(Query_cache_result)), 1, 0);
	if (new_result_block != 0)