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
4352b995
Commit
4352b995
authored
Feb 27, 2003
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed SQL_SELECT option with UNIONs
parent
c37b62b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
7 deletions
+16
-7
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+8
-3
mysql-test/t/query_cache.test
mysql-test/t/query_cache.test
+3
-2
sql/sql_cache.cc
sql/sql_cache.cc
+1
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+4
-1
No files found.
mysql-test/r/query_cache.result
View file @
4352b995
...
@@ -237,13 +237,18 @@ a
...
@@ -237,13 +237,18 @@ a
show status like "Qcache_queries_in_cache";
show status like "Qcache_queries_in_cache";
Variable_name Value
Variable_name Value
Qcache_queries_in_cache 0
Qcache_queries_in_cache 0
select sql_cache * from t1;
select sql_cache * from t1
union select * from t1
;
a
a
1
1
2
2
3
3
set query_cache_type=2;
set query_cache_type=2;
select sql_cache * from t1;
select sql_cache * from t1 union select * from t1;
a
1
2
3
select * from t1 union select sql_cache * from t1;
a
a
1
1
2
2
...
@@ -253,7 +258,7 @@ Variable_name Value
...
@@ -253,7 +258,7 @@ Variable_name Value
Qcache_hits 4
Qcache_hits 4
show status like "Qcache_queries_in_cache";
show status like "Qcache_queries_in_cache";
Variable_name Value
Variable_name Value
Qcache_queries_in_cache
1
Qcache_queries_in_cache
2
set query_cache_type=on;
set query_cache_type=on;
reset query cache;
reset query cache;
show status like "Qcache_queries_in_cache";
show status like "Qcache_queries_in_cache";
...
...
mysql-test/t/query_cache.test
View file @
4352b995
...
@@ -144,9 +144,10 @@ create table t1 (a int not null);
...
@@ -144,9 +144,10 @@ create table t1 (a int not null);
insert
into
t1
values
(
1
),(
2
),(
3
);
insert
into
t1
values
(
1
),(
2
),(
3
);
select
*
from
t1
;
select
*
from
t1
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_queries_in_cache"
;
select
sql_cache
*
from
t1
;
select
sql_cache
*
from
t1
union
select
*
from
t1
;
set
query_cache_type
=
2
;
set
query_cache_type
=
2
;
select
sql_cache
*
from
t1
;
select
sql_cache
*
from
t1
union
select
*
from
t1
;
select
*
from
t1
union
select
sql_cache
*
from
t1
;
show
status
like
"Qcache_hits"
;
show
status
like
"Qcache_hits"
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_queries_in_cache"
;
set
query_cache_type
=
on
;
set
query_cache_type
=
on
;
...
...
sql/sql_cache.cc
View file @
4352b995
...
@@ -2439,7 +2439,7 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
...
@@ -2439,7 +2439,7 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
if
(
lex
->
sql_command
==
SQLCOM_SELECT
&&
if
(
lex
->
sql_command
==
SQLCOM_SELECT
&&
(
thd
->
variables
.
query_cache_type
==
1
||
(
thd
->
variables
.
query_cache_type
==
1
||
(
thd
->
variables
.
query_cache_type
==
2
&&
(
lex
->
select
->
options
&
(
thd
->
variables
.
query_cache_type
==
2
&&
(
lex
->
select
_lex
.
options
&
OPTION_TO_QUERY_CACHE
)))
&&
OPTION_TO_QUERY_CACHE
)))
&&
thd
->
safe_to_cache_query
)
thd
->
safe_to_cache_query
)
{
{
...
...
sql/sql_yacc.yy
View file @
4352b995
...
@@ -1530,7 +1530,10 @@ select_option:
...
@@ -1530,7 +1530,10 @@ select_option:
Select->options|= OPTION_FOUND_ROWS;
Select->options|= OPTION_FOUND_ROWS;
}
}
| SQL_NO_CACHE_SYM { current_thd->safe_to_cache_query=0; }
| SQL_NO_CACHE_SYM { current_thd->safe_to_cache_query=0; }
| SQL_CACHE_SYM { Select->options|= OPTION_TO_QUERY_CACHE; }
| SQL_CACHE_SYM
{
Lex->select_lex.options|= OPTION_TO_QUERY_CACHE;
}
| ALL {}
| ALL {}
;
;
...
...
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