Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
1dff7838
Commit
1dff7838
authored
Aug 10, 2005
by
bell@52.0.168.192.in-addr.arpa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
block using QC in case of having tables locked by LOCK... (BUG#12385)
parent
518745ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
2 deletions
+56
-2
mysql-test/r/query_cache_noembeded.result
mysql-test/r/query_cache_noembeded.result
+18
-0
mysql-test/t/query_cache_noembeded.test
mysql-test/t/query_cache_noembeded.test
+33
-0
sql/sql_cache.cc
sql/sql_cache.cc
+5
-2
No files found.
mysql-test/r/query_cache_noembeded.result
0 → 100644
View file @
1dff7838
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;
mysql-test/t/query_cache_noembeded.test
0 → 100644
View file @
1dff7838
--
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
;
sql/sql_cache.cc
View file @
1dff7838
...
...
@@ -739,7 +739,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
;
if
((
local_tables
=
is_cacheable
(
thd
,
thd
->
query_length
,
...
...
@@ -750,7 +750,10 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
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 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment