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
19efafcc
Commit
19efafcc
authored
Jul 18, 2003
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow to look up queries with leading comments
parent
035a4629
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
4 deletions
+48
-4
.bzrignore
.bzrignore
+1
-0
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+24
-0
mysql-test/t/query_cache.test
mysql-test/t/query_cache.test
+14
-0
sql/sql_cache.cc
sql/sql_cache.cc
+9
-4
No files found.
.bzrignore
View file @
19efafcc
...
...
@@ -625,3 +625,4 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslserver
vio/viotest-ssl
libmysqld/sp_cache.cc
mysql-test/r/query_cache.result
View file @
19efafcc
...
...
@@ -699,3 +699,27 @@ Variable_name Value
Qcache_queries_in_cache 2
SET OPTION SQL_SELECT_LIMIT=DEFAULT;
drop table t1;
create table t1 (a int);
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 41
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 13
/**/ select * from t1;
a
/**/ select * from t1;
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 42
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 14
drop table t1;
mysql-test/t/query_cache.test
View file @
19efafcc
...
...
@@ -477,3 +477,17 @@ select * from t1;
show
status
like
"Qcache_queries_in_cache"
;
SET
OPTION
SQL_SELECT_LIMIT
=
DEFAULT
;
drop
table
t1
;
#
# comments before command
#
create
table
t1
(
a
int
);
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
/**/
select
*
from
t1
;
/**/
select
*
from
t1
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
drop
table
t1
;
sql/sql_cache.cc
View file @
19efafcc
...
...
@@ -905,11 +905,16 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
/*
Test if the query is a SELECT
(pre-space is removed in dispatch_command)
(pre-space is removed in dispatch_command).
First '/' looks like comment before command it is not
frequently appeared in real lihe, consequently we can
check all such queries, too.
*/
if
(
my_toupper
(
system_charset_info
,
sql
[
0
])
!=
'S'
||
my_toupper
(
system_charset_info
,
sql
[
1
])
!=
'E'
||
my_toupper
(
system_charset_info
,
sql
[
2
])
!=
'L'
)
if
((
my_toupper
(
system_charset_info
,
sql
[
0
])
!=
'S'
||
my_toupper
(
system_charset_info
,
sql
[
1
])
!=
'E'
||
my_toupper
(
system_charset_info
,
sql
[
2
])
!=
'L'
)
&&
sql
[
0
]
!=
'/'
)
{
DBUG_PRINT
(
"qcache"
,
(
"The statement is not a SELECT; Not cached"
));
goto
err
;
...
...
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