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
ab3152cf
Commit
ab3152cf
authored
Dec 09, 2003
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-qc-4.0
parents
6f1d63bf
03e04c02
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
8 deletions
+41
-8
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+9
-2
mysql-test/t/query_cache.test
mysql-test/t/query_cache.test
+4
-0
sql/sql_cache.cc
sql/sql_cache.cc
+28
-6
No files found.
mysql-test/r/query_cache.result
View file @
ab3152cf
...
...
@@ -365,16 +365,23 @@ insert into mysqltest.t1 (a) values (1);
select * from mysqltest.t1 where i is null;
i a
1 1
create table t1(a int);
select * from t1;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
select * from mysqltest.t1;
i a
1 1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache
1
Qcache_queries_in_cache
2
drop database mysqltest;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
Qcache_queries_in_cache 1
drop table t1;
create table t1 (a char(1) not null);
insert into t1 values("");
select * from t1;
...
...
mysql-test/t/query_cache.test
View file @
ab3152cf
...
...
@@ -251,10 +251,14 @@ select * from mysqltest.t1 where i is null;
#
# drop db
#
create
table
t1
(
a
int
);
select
*
from
t1
;
show
status
like
"Qcache_queries_in_cache"
;
select
*
from
mysqltest
.
t1
;
show
status
like
"Qcache_queries_in_cache"
;
drop
database
mysqltest
;
show
status
like
"Qcache_queries_in_cache"
;
drop
table
t1
;
#
# Charset convertion (cp1251_koi8 always present)
...
...
sql/sql_cache.cc
View file @
ab3152cf
...
...
@@ -1151,9 +1151,29 @@ void Query_cache::invalidate(char *db)
if
(
query_cache_size
>
0
)
{
DUMP
(
this
);
/* invalidate_table reduce list while only root of list remain */
while
(
tables_blocks
!=
0
)
invalidate_table
(
tables_blocks
);
restart_search:
if
(
tables_blocks
)
{
Query_cache_block
*
curr
=
tables_blocks
;
Query_cache_block
*
next
;
do
{
next
=
curr
->
next
;
if
(
strcmp
(
db
,
(
char
*
)(
curr
->
table
()
->
db
()))
==
0
)
invalidate_table
(
curr
);
/*
invalidate_table can freed block on which point 'next' (if
table of this block used only in queries which was deleted
by invalidate_table). As far as we do not allocate new blocks
and mark all headers of freed blocks as 'FREE' (even if they are
merged with other blocks) we can just test type of block
to be sure that block is not deleted
*/
if
(
next
->
type
==
Query_cache_block
::
FREE
)
goto
restart_search
;
curr
=
next
;
}
while
(
curr
!=
tables_blocks
);
}
}
STRUCT_UNLOCK
(
&
structure_guard_mutex
);
}
...
...
@@ -2158,9 +2178,11 @@ void Query_cache::free_memory_block(Query_cache_block *block)
{
DBUG_ENTER
(
"Query_cache::free_memory_block"
);
block
->
used
=
0
;
DBUG_PRINT
(
"qcache"
,(
"first_block 0x%lx, block 0x%lx, pnext 0x%lx pprev 0x%lx"
,
(
ulong
)
first_block
,
(
ulong
)
block
,
block
->
pnext
,
(
ulong
)
block
->
pprev
));
block
->
type
=
Query_cache_block
::
FREE
;
// mark block as free in any case
DBUG_PRINT
(
"qcache"
,
(
"first_block 0x%lx, block 0x%lx, pnext 0x%lx pprev 0x%lx"
,
(
ulong
)
first_block
,
(
ulong
)
block
,
block
->
pnext
,
(
ulong
)
block
->
pprev
));
if
(
block
->
pnext
!=
first_block
&&
block
->
pnext
->
is_free
())
block
=
join_free_blocks
(
block
,
block
->
pnext
);
...
...
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