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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
0ace9cef
Commit
0ace9cef
authored
Jul 05, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
c6c905f7
a559967d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
147 additions
and
0 deletions
+147
-0
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+88
-0
mysql-test/t/query_cache.test
mysql-test/t/query_cache.test
+44
-0
sql/sql_cache.cc
sql/sql_cache.cc
+13
-0
sql/sql_error.cc
sql/sql_error.cc
+2
-0
No files found.
mysql-test/r/query_cache.result
View file @
0ace9cef
...
...
@@ -923,6 +923,94 @@ select group_concat(a) FROM t1 group by b;
group_concat(a)
12345678901234567890
set group_concat_max_len=default;
drop table t1;
flush status;
CREATE TABLE t1 (
`date` datetime NOT NULL default '0000-00-00 00:00:00',
KEY `date` (`date`)
) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('20050326');
INSERT INTO t1 VALUES ('20050325');
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 0:0:0';
COUNT(*)
0
Warnings:
Warning 1292 Truncated incorrect datetime value: '20050327 0:0:0'
Warning 1292 Truncated incorrect datetime value: '20050327 0:0:0'
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 0:0:0';
COUNT(*)
0
Warnings:
Warning 1292 Truncated incorrect datetime value: '20050328 0:0:0'
Warning 1292 Truncated incorrect datetime value: '20050328 0:0:0'
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 0:0:0';
COUNT(*)
0
Warnings:
Warning 1292 Truncated incorrect datetime value: '20050327 0:0:0'
Warning 1292 Truncated incorrect datetime value: '20050327 0:0:0'
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
drop table t1;
create table t1 (a int);
insert into t1 values (1);
reset query cache;
flush status;
select * from (select * from t1) a;
a
1
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 (select * from t1) a;
a
1
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
insert into t1 values (2);
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 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
select * from (select * from t1) a;
a
1
2
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 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
drop table t1;
create table t1 (a int);
show status like "Qcache_queries_in_cache";
...
...
mysql-test/t/query_cache.test
View file @
0ace9cef
...
...
@@ -756,6 +756,50 @@ flush query cache;
drop
table
t1
,
t2
;
#
# Query with warning prohibited to query cache (BUG#9414)
#
flush
status
;
CREATE
TABLE
t1
(
`date`
datetime
NOT
NULL
default
'0000-00-00 00:00:00'
,
KEY
`date`
(
`date`
)
)
ENGINE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
'20050326'
);
INSERT
INTO
t1
VALUES
(
'20050325'
);
SELECT
COUNT
(
*
)
FROM
t1
WHERE
date
BETWEEN
'20050326'
AND
'20050327 0:0:0'
;
SELECT
COUNT
(
*
)
FROM
t1
WHERE
date
BETWEEN
'20050326'
AND
'20050328 0:0:0'
;
SELECT
COUNT
(
*
)
FROM
t1
WHERE
date
BETWEEN
'20050326'
AND
'20050327 0:0:0'
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
drop
table
t1
;
#
# queries with subquery in the FROM clause (BUG#11522)
#
create
table
t1
(
a
int
);
insert
into
t1
values
(
1
);
reset
query
cache
;
flush
status
;
select
*
from
(
select
*
from
t1
)
a
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
select
*
from
(
select
*
from
t1
)
a
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
insert
into
t1
values
(
2
);
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
select
*
from
(
select
*
from
t1
)
a
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
drop
table
t1
;
#
# SP cursors and selects with query cache (BUG#9715)
#
...
...
sql/sql_cache.cc
View file @
0ace9cef
...
...
@@ -2135,6 +2135,13 @@ Query_cache::register_tables_from_list(TABLE_LIST *tables_used,
tables_used
;
tables_used
=
tables_used
->
next_global
,
n
++
,
block_table
++
)
{
if
(
tables_used
->
derived
)
{
DBUG_PRINT
(
"qcache"
,
(
"derived table skipped"
);
n
--
;
block_table
--
;
continue
;
}
block_table
->
n
=
n
;
if
(
tables_used
->
view
)
{
...
...
@@ -2778,6 +2785,12 @@ static TABLE_COUNTER_TYPE process_and_count_tables(TABLE_LIST *tables_used,
tables_used
->
table
->
s
->
table_name
,
tables_used
->
table
->
s
->
table_cache_key
,
tables_used
->
table
->
s
->
db_type
));
if
(
table_used
->
derived
)
{
table_count
--
;
DBUG_PRINT
(
"qcache"
,
(
"derived table skipped"
));
continue
;
}
*
tables_type
|=
tables_used
->
table
->
file
->
table_cache_type
();
/*
...
...
sql/sql_error.cc
View file @
0ace9cef
...
...
@@ -146,6 +146,8 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
{
DBUG_RETURN
(
NULL
);
}
query_cache_abort
(
&
thd
->
net
);
if
(
thd
->
warn_list
.
elements
<
thd
->
variables
.
max_error_count
)
{
...
...
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