List:Internals« Previous MessageNext Message »
From:sanja Date:August 10 2005 3:59pm
Subject:bk commit into 4.0 tree (bell:1.2133) BUG#12385
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of bell. When bell does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2133 05/08/10 18:58:55 bell@stripped +3 -0
  block using QC in case of having tables locked by LOCK... (BUG#12385)

  mysql-test/t/query_cache_noembeded.test
    1.1 05/08/10 18:58:48 bell@stripped +33 -0
    New BitKeeper file ``mysql-test/t/query_cache_noembeded.test''

  mysql-test/r/query_cache_noembeded.result
    1.1 05/08/10 18:58:48 bell@stripped +18 -0
    New BitKeeper file ``mysql-test/r/query_cache_noembeded.result''

  mysql-test/t/query_cache_noembeded.test
    1.0 05/08/10 18:58:48 bell@stripped +0 -0
    BitKeeper file /Users/bell/mysql/bk/work-qc-4.0/mysql-test/t/query_cache_noembeded.test

  mysql-test/r/query_cache_noembeded.result
    1.0 05/08/10 18:58:48 bell@stripped +0 -0
    BitKeeper file /Users/bell/mysql/bk/work-qc-4.0/mysql-test/r/query_cache_noembeded.result

  sql/sql_cache.cc
    1.65 05/08/10 18:58:47 bell@stripped +5 -2
    block QC using if tables are locked with LOCK
    unlock QC

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	bell
# Host:	52.0.168.192.in-addr.arpa
# Root:	/Users/bell/mysql/bk/work-qc-4.0

--- 1.64/sql/sql_cache.cc	2005-02-11 21:57:28 +02:00
+++ 1.65/sql/sql_cache.cc	2005-08-10 18:58:47 +03:00
@@ -739,7 +739,7 @@
   TABLE_COUNTER_TYPE local_tables;
   ulong tot_length;
   DBUG_ENTER("Query_cache::store_query");
-  if (query_cache_size == 0)
+  if (query_cache_size == 0 || thd->locked_tables)
     DBUG_VOID_RETURN;
 
   if ((local_tables= is_cacheable(thd, thd->query_length,
@@ -750,7 +750,10 @@
     STRUCT_LOCK(&structure_guard_mutex);
 
     if (query_cache_size == 0)
+    {
+      STRUCT_UNLOCK(&structure_guard_mutex);
       DBUG_VOID_RETURN;
+    }
     DUMP(this);
 
     /* Key is query + database + flag */
@@ -874,7 +877,7 @@
   byte flags;
   DBUG_ENTER("Query_cache::send_result_to_client");
 
-  if (query_cache_size == 0 ||
+  if (query_cache_size == 0 || thd->locked_tables ||
       /*
 	it is not possible to check has_transactions() function of handler
 	because tables not opened yet
--- New file ---
+++ mysql-test/r/query_cache_noembeded.result	05/08/10 18:58:48
set GLOBAL query_cache_size=1355776;
reset query cache;
flush status;
CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY AUTO_INCREMENT ) ENGINE =
MyISAM;
LOCK TABLE t1 READ LOCAL;
INSERT INTO t1 VALUES (), (), ();
SELECT * FROM t1;
a
SELECT * FROM t1;
a
1
2
3
SELECT * FROM t1;
a
drop table t1;
set GLOBAL query_cache_size=default;

--- New file ---
+++ mysql-test/t/query_cache_noembeded.test	05/08/10 18:58:48
-- source include/have_query_cache.inc
-- source include/not_embedded.inc

#
# Tests with query cache
#
set GLOBAL query_cache_size=1355776;

# Reset query cache variables.

reset query cache;
flush status;

#
# do not use QC if tables locked (BUG#12385)
#
connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
connection root;
CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY AUTO_INCREMENT ) ENGINE =
MyISAM;
LOCK TABLE t1 READ LOCAL;
connect (root2,localhost,root,,test,$MASTER_MYPORT,master.sock);
connection root2;
INSERT INTO t1 VALUES (), (), ();
connection root;
SELECT * FROM t1;
connection root2;
SELECT * FROM t1;
connection root;
SELECT * FROM t1;
drop table t1;

set GLOBAL query_cache_size=default;

Thread
bk commit into 4.0 tree (bell:1.2133) BUG#12385sanja10 Aug