Loading mysql-test/r/query_cache_notembedded.result +14 −0 Original line number Diff line number Diff line Loading @@ -80,4 +80,18 @@ show status like "Qcache_free_blocks"; Variable_name Value Qcache_free_blocks 1 drop table t1, t2, t3, t11, t21; 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=0; mysql-test/t/query_cache_notembedded.test +19 −0 Original line number Diff line number Diff line Loading @@ -78,4 +78,23 @@ show status like "Qcache_total_blocks"; show status like "Qcache_free_blocks"; drop table t1, t2, t3, t11, t21; # # 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=0; sql/item_strfunc.cc +1 −1 Original line number Diff line number Diff line Loading @@ -1187,7 +1187,7 @@ String *Item_func_substr_index::val_str(String *str) } } else { // Start counting at end { /* Negative index, start counting at the end */ Loading sql/sql_cache.cc +3 −3 Original line number Diff line number Diff line Loading @@ -762,7 +762,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) 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; uint8 tables_type= 0; Loading Loading @@ -921,8 +921,8 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) bool check_tables; DBUG_ENTER("Query_cache::send_result_to_client"); if (query_cache_size == 0 || thd->variables.query_cache_type == 0) if (query_cache_size == 0 || thd->locked_tables || thd->variables.query_cache_type == 0) goto err; /* Check that we haven't forgot to reset the query cache variables */ Loading Loading
mysql-test/r/query_cache_notembedded.result +14 −0 Original line number Diff line number Diff line Loading @@ -80,4 +80,18 @@ show status like "Qcache_free_blocks"; Variable_name Value Qcache_free_blocks 1 drop table t1, t2, t3, t11, t21; 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=0;
mysql-test/t/query_cache_notembedded.test +19 −0 Original line number Diff line number Diff line Loading @@ -78,4 +78,23 @@ show status like "Qcache_total_blocks"; show status like "Qcache_free_blocks"; drop table t1, t2, t3, t11, t21; # # 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=0;
sql/item_strfunc.cc +1 −1 Original line number Diff line number Diff line Loading @@ -1187,7 +1187,7 @@ String *Item_func_substr_index::val_str(String *str) } } else { // Start counting at end { /* Negative index, start counting at the end */ Loading
sql/sql_cache.cc +3 −3 Original line number Diff line number Diff line Loading @@ -762,7 +762,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) 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; uint8 tables_type= 0; Loading Loading @@ -921,8 +921,8 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) bool check_tables; DBUG_ENTER("Query_cache::send_result_to_client"); if (query_cache_size == 0 || thd->variables.query_cache_type == 0) if (query_cache_size == 0 || thd->locked_tables || thd->variables.query_cache_type == 0) goto err; /* Check that we haven't forgot to reset the query cache variables */ Loading