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
857dd49a
Commit
857dd49a
authored
Mar 14, 2008
by
istruewing@stella.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge stella.local:/home2/mydev/mysql-5.0-axmrg
into stella.local:/home2/mydev/mysql-5.1-axmrg
parents
ed89b81b
d0b86d23
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
27 deletions
+82
-27
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+26
-0
mysql-test/t/query_cache.test
mysql-test/t/query_cache.test
+19
-0
storage/myisam/ha_myisam.cc
storage/myisam/ha_myisam.cc
+37
-27
No files found.
mysql-test/r/query_cache.result
View file @
857dd49a
...
@@ -1654,6 +1654,32 @@ set GLOBAL query_cache_type=default;
...
@@ -1654,6 +1654,32 @@ set GLOBAL query_cache_type=default;
set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_min_res_unit=default;
set GLOBAL query_cache_min_res_unit=default;
set GLOBAL query_cache_size=default;
set GLOBAL query_cache_size=default;
FLUSH STATUS;
SET GLOBAL query_cache_size=10*1024*1024;
SET @save_concurrent_insert= @@concurrent_insert;
SET GLOBAL concurrent_insert= 0;
CREATE TABLE t1 (c1 INT NOT NULL) ENGINE=MyISAM;
INSERT INTO t1 (c1) VALUES (1), (2);
SHOW GLOBAL VARIABLES LIKE 'concurrent_insert';
Variable_name Value
concurrent_insert 0
SHOW STATUS LIKE 'Qcache_hits';
Variable_name Value
Qcache_hits 0
SELECT * FROM t1;
c1
1
2
SELECT * FROM t1;
c1
1
2
SHOW STATUS LIKE 'Qcache_hits';
Variable_name Value
Qcache_hits 1
DROP TABLE t1;
SET GLOBAL concurrent_insert= @save_concurrent_insert;
SET GLOBAL query_cache_size= default;
End of 5.0 tests
End of 5.0 tests
CREATE TABLE t1 (a ENUM('rainbow'));
CREATE TABLE t1 (a ENUM('rainbow'));
INSERT INTO t1 VALUES (),(),(),(),();
INSERT INTO t1 VALUES (),(),(),(),();
...
...
mysql-test/t/query_cache.test
View file @
857dd49a
...
@@ -1298,6 +1298,25 @@ set GLOBAL query_cache_limit=default;
...
@@ -1298,6 +1298,25 @@ set GLOBAL query_cache_limit=default;
set
GLOBAL
query_cache_min_res_unit
=
default
;
set
GLOBAL
query_cache_min_res_unit
=
default
;
set
GLOBAL
query_cache_size
=
default
;
set
GLOBAL
query_cache_size
=
default
;
#
# Bug#33756 - query cache with concurrent_insert=0 appears broken
#
FLUSH
STATUS
;
SET
GLOBAL
query_cache_size
=
10
*
1024
*
1024
;
SET
@
save_concurrent_insert
=
@@
concurrent_insert
;
SET
GLOBAL
concurrent_insert
=
0
;
CREATE
TABLE
t1
(
c1
INT
NOT
NULL
)
ENGINE
=
MyISAM
;
INSERT
INTO
t1
(
c1
)
VALUES
(
1
),
(
2
);
#
SHOW
GLOBAL
VARIABLES
LIKE
'concurrent_insert'
;
SHOW
STATUS
LIKE
'Qcache_hits'
;
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
;
SHOW
STATUS
LIKE
'Qcache_hits'
;
DROP
TABLE
t1
;
SET
GLOBAL
concurrent_insert
=
@
save_concurrent_insert
;
SET
GLOBAL
query_cache_size
=
default
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
#
#
...
...
storage/myisam/ha_myisam.cc
View file @
857dd49a
...
@@ -2098,6 +2098,7 @@ my_bool ha_myisam::register_query_cache_table(THD *thd, char *table_name,
...
@@ -2098,6 +2098,7 @@ my_bool ha_myisam::register_query_cache_table(THD *thd, char *table_name,
*
engine_callback
,
*
engine_callback
,
ulonglong
*
engine_data
)
ulonglong
*
engine_data
)
{
{
DBUG_ENTER
(
"ha_myisam::register_query_cache_table"
);
/*
/*
No call back function is needed to determine if a cached statement
No call back function is needed to determine if a cached statement
is valid or not.
is valid or not.
...
@@ -2109,14 +2110,22 @@ my_bool ha_myisam::register_query_cache_table(THD *thd, char *table_name,
...
@@ -2109,14 +2110,22 @@ my_bool ha_myisam::register_query_cache_table(THD *thd, char *table_name,
*/
*/
*
engine_data
=
0
;
*
engine_data
=
0
;
if
(
file
->
s
->
concurrent_insert
)
{
/*
/*
If a concurrent INSERT has happened just before the currently processed
If a concurrent INSERT has happened just before the currently
SELECT statement, the total size of the table is unknown.
processed SELECT statement, the total size of the table is
unknown.
To determine if the table size is known, the current thread's snap shot of
To determine if the table size is known, the current thread's snap
the table size with the actual table size are compared.
shot of
the table size with the actual table size are compared.
If the table size is unknown the SELECT statement can't be cached.
If the table size is unknown the SELECT statement can't be cached.
When concurrent inserts are disabled at table open, mi_open()
does not assign a get_status() function. In this case the local
("current") status is never updated. We would wrongly think that
we cannot cache the statement.
*/
*/
ulonglong
actual_data_file_length
;
ulonglong
actual_data_file_length
;
ulonglong
current_data_file_length
;
ulonglong
current_data_file_length
;
...
@@ -2138,10 +2147,11 @@ my_bool ha_myisam::register_query_cache_table(THD *thd, char *table_name,
...
@@ -2138,10 +2147,11 @@ my_bool ha_myisam::register_query_cache_table(THD *thd, char *table_name,
if
(
current_data_file_length
!=
actual_data_file_length
)
if
(
current_data_file_length
!=
actual_data_file_length
)
{
{
/* Don't cache current statement. */
/* Don't cache current statement. */
return
FALSE
;
DBUG_RETURN
(
FALSE
);
}
}
}
/* It is ok to try to cache current statement. */
/* It is ok to try to cache current statement. */
return
TRUE
;
DBUG_RETURN
(
TRUE
)
;
}
}
#endif
#endif
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