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
93191c73
Commit
93191c73
authored
20 years ago
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new NDB test with QC
sql/sql_cache.cc: if we removed old values in cache, then we can cache new one
parent
92882749
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
51 deletions
+27
-51
mysql-test/r/ndb_cache.result
mysql-test/r/ndb_cache.result
+0
-43
mysql-test/t/ndb_cache.test
mysql-test/t/ndb_cache.test
+25
-7
sql/sql_cache.cc
sql/sql_cache.cc
+2
-1
No files found.
mysql-test/r/ndb_cache.result
View file @
93191c73
set GLOBAL query_cache_size=1355776;
reset query cache;
flush status;
drop table if exists t1,t2;
CREATE TABLE t1 (a int) ENGINE=ndbcluster;
CREATE TABLE t2 (a int);
select * from t1;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
select * from t2;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
select * from t1;
a
select * from t2;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
drop table t1, t2;
SET GLOBAL query_cache_size=0;
This diff is collapsed.
Click to expand it.
mysql-test/t/ndb_cache.test
View file @
93191c73
--
source
include
/
have_query_cache
.
inc
--
source
include
/
have_query_cache
.
inc
--
source
include
/
have_ndb
.
inc
--
source
include
/
have_ndb
.
inc
set
GLOBAL
ndb_query_cache_type
=
on
;
# following line have to be removed when ndb_query_cache_type will made
# global only
set
ndb_query_cache_type
=
on
;
set
GLOBAL
query_cache_size
=
1355776
;
set
GLOBAL
query_cache_size
=
1355776
;
reset
query
cache
;
reset
query
cache
;
flush
status
;
flush
status
;
--
disable_warnings
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
drop
table
if
exists
t1
;
--
enable_warnings
--
enable_warnings
CREATE
TABLE
t1
(
a
int
)
ENGINE
=
ndbcluster
;
CREATE
TABLE
t1
(
a
int
)
ENGINE
=
ndbcluster
;
CREATE
TABLE
t2
(
a
int
);
insert
into
t1
value
(
2
);
select
*
from
t1
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
connect
(
con1
,
localhost
,
root
,,);
connection
con1
;
use
test
;
set
autocommit
=
0
;
update
t1
set
a
=
3
;
connect
(
con2
,
localhost
,
root
,,);
connection
con2
;
select
*
from
t1
;
select
*
from
t1
;
select
*
from
t1
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
show
status
like
"Qcache_hits"
;
select
*
from
t2
;
connection
con1
;
select
*
from
t1
;
select
*
from
t1
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
show
status
like
"Qcache_hits"
;
commit
;
connection
con2
;
select
*
from
t1
;
select
*
from
t1
;
select
*
from
t1
;
select
*
from
t2
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
show
status
like
"Qcache_hits"
;
drop
table
t1
;
drop
table
t1
,
t2
;
SET
GLOBAL
query_cache_size
=
0
;
SET
GLOBAL
query_cache_size
=
0
;
This diff is collapsed.
Click to expand it.
sql/sql_cache.cc
View file @
93191c73
...
@@ -1093,7 +1093,6 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
...
@@ -1093,7 +1093,6 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
DBUG_PRINT
(
"qcache"
,
(
"Handler does not allow caching for %s.%s"
,
DBUG_PRINT
(
"qcache"
,
(
"Handler does not allow caching for %s.%s"
,
table_list
.
db
,
table_list
.
alias
));
table_list
.
db
,
table_list
.
alias
));
BLOCK_UNLOCK_RD
(
query_block
);
BLOCK_UNLOCK_RD
(
query_block
);
thd
->
lex
->
safe_to_cache_query
=
0
;
// Don't try to cache this
if
(
engine_data
!=
table
->
engine_data
())
if
(
engine_data
!=
table
->
engine_data
())
{
{
DBUG_PRINT
(
"qcache"
,
DBUG_PRINT
(
"qcache"
,
...
@@ -1102,6 +1101,8 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
...
@@ -1102,6 +1101,8 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
engine_data
,
table
->
engine_data
()));
engine_data
,
table
->
engine_data
()));
invalidate_table
(
table
->
db
(),
table
->
key_length
());
invalidate_table
(
table
->
db
(),
table
->
key_length
());
}
}
else
thd
->
lex
->
safe_to_cache_query
=
0
;
// Don't try to cache this
goto
err_unlock
;
// Parse query
goto
err_unlock
;
// Parse query
}
}
else
else
...
...
This diff is collapsed.
Click to expand it.
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