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
61be9477
Commit
61be9477
authored
Dec 14, 2001
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed not used functions from sql_cache
Added new tests to testsuite.
parent
0a2835a0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
199 additions
and
23 deletions
+199
-23
extra/resolveip.c
extra/resolveip.c
+6
-2
mysql-test/create-test-result
mysql-test/create-test-result
+2
-2
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+98
-2
mysql-test/t/query_cache-master.opt
mysql-test/t/query_cache-master.opt
+1
-1
mysql-test/t/query_cache.test
mysql-test/t/query_cache.test
+92
-2
sql/sql_cache.cc
sql/sql_cache.cc
+0
-12
sql/sql_cache.h
sql/sql_cache.h
+0
-2
No files found.
extra/resolveip.c
View file @
61be9477
...
...
@@ -22,9 +22,7 @@
#include <m_ctype.h>
#include <my_net.h>
#include <my_sys.h>
#ifndef SCO
#include <m_string.h>
#endif
#include <sys/types.h>
#include <sys/socket.h>
#ifndef HAVE_BROKEN_NETINET_INCLUDES
...
...
@@ -34,10 +32,16 @@
#include <netdb.h>
#include <getopt.h>
#ifdef SCO
#undef h_errno
#define h_errno errno
#endif
#if !defined(_AIX) && !defined(HAVE_UNIXWARE7_THREADS) && !defined(HAVE_UNIXWARE7_POSIX) && !defined(h_errno)
extern
int
h_errno
;
#endif
static
int
silent
=
0
;
static
struct
option
long_options
[]
=
...
...
mysql-test/create-test-result
View file @
61be9477
...
...
@@ -5,7 +5,7 @@
# If you have a spare moment feel free to improve it - the right way is
# to start mysqld yourself and run mysqltest -r
RESULT_DIR
=
r
/3.23
RESULT_DIR
=
r
if
[
-z
$EDITOR
]
;
then
EDITOR
=
vi
fi
...
...
@@ -32,7 +32,7 @@ result_file=$RESULT_DIR/$test_name.result
touch
$result_file
echo
"Running the test case against empty file, will fail, but don't worry"
./mysql-test-run
$test_name
./mysql-test-run
--do-test
=
$test_name
reject_file
=
$result_file
.reject
...
...
mysql-test/r/query_cache.result
View file @
61be9477
...
...
@@ -2,7 +2,7 @@ flush query cache;
flush query cache;
reset query cache;
flush status;
drop table if exists t1,t2,t3;
drop table if exists t1,t2,t3
,t11,t21
;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
select * from t1;
...
...
@@ -173,6 +173,59 @@ show status like "Qcache_free_blocks";
Variable_name Value
Qcache_free_blocks 1
drop table t1, t2;
create table t1 (a text not null);
create table t11 (a text not null);
create table t2 (a text not null);
create table t21 (a text not null);
create table t3 (a text not null);
insert into t1 values("1111111111111111111111111111111111111111111111111111");
insert into t11 select * from t1;
insert into t21 select * from t1;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t3 select * from t1;
insert into t3 select * from t2;
insert into t3 select * from t1;
select * from t11;
select * from t21;
show status like "Qcache_total_blocks";
Variable_name Value
Qcache_total_blocks 7
show status like "Qcache_free_blocks";
Variable_name Value
Qcache_free_blocks 1
insert into t11 values("");
select * from t3;
show status like "Qcache_total_blocks";
Variable_name Value
Qcache_total_blocks 8
show status like "Qcache_free_blocks";
Variable_name Value
Qcache_free_blocks 1
flush query cache;
show status like "Qcache_total_blocks";
Variable_name Value
Qcache_total_blocks 7
show status like "Qcache_free_blocks";
Variable_name Value
Qcache_free_blocks 1
drop table t1, t2, t3, t11, t21;
set sql_query_cache_type=demand;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
...
...
@@ -264,7 +317,6 @@ insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
drop table t2;
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 4
...
...
@@ -279,4 +331,48 @@ show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
reset query cache;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
select * from t1;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
drop table t1,t2;
create database foo;
create table foo.t1 (i int not null auto_increment, a int, primary key (i));
insert into foo.t1 (a) values (1);
select * from foo.t1 where i is null;
i a
1 1
select * from foo.t1;
i a
1 1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
drop database foo;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
create table t1 (a char(1) not null);
insert into t1 values("");
select * from t1;
a
set CHARACTER SET cp1251_koi8;
select * from t1;
a
set CHARACTER SET DEFAULT;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
drop table t1;
mysql-test/t/query_cache-master.opt
View file @
61be9477
--set-variable=query_cache_size=1
M
--set-variable=query_cache_size=1
355776
mysql-test/t/query_cache.test
View file @
61be9477
...
...
@@ -8,7 +8,7 @@ flush query cache; # This crashed in some versions
flush
query
cache
;
# This crashed in some versions
reset
query
cache
;
flush
status
;
drop
table
if
exists
t1
,
t2
,
t3
;
drop
table
if
exists
t1
,
t2
,
t3
,
t11
,
t21
;
#
# First simple test
...
...
@@ -86,6 +86,53 @@ show status like "Qcache_free_blocks";
flush
query
cache
;
show
status
like
"Qcache_free_blocks"
;
drop
table
t1
,
t2
;
# With join results...
create
table
t1
(
a
text
not
null
);
create
table
t11
(
a
text
not
null
);
create
table
t2
(
a
text
not
null
);
create
table
t21
(
a
text
not
null
);
create
table
t3
(
a
text
not
null
);
insert
into
t1
values
(
"1111111111111111111111111111111111111111111111111111"
);
insert
into
t11
select
*
from
t1
;
insert
into
t21
select
*
from
t1
;
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
#results of t3 must be > 0.5Mb
insert
into
t3
select
*
from
t1
;
insert
into
t3
select
*
from
t2
;
insert
into
t3
select
*
from
t1
;
disable_result_log
;
select
*
from
t11
;
select
*
from
t21
;
enable_result_log
;
show
status
like
"Qcache_total_blocks"
;
show
status
like
"Qcache_free_blocks"
;
disable_result_log
;
insert
into
t11
values
(
""
);
select
*
from
t3
;
enable_result_log
;
show
status
like
"Qcache_total_blocks"
;
show
status
like
"Qcache_free_blocks"
;
flush
query
cache
;
show
status
like
"Qcache_total_blocks"
;
show
status
like
"Qcache_free_blocks"
;
drop
table
t1
,
t2
,
t3
,
t11
,
t21
;
#
# SELECT SQL_CACHE ...
#
...
...
@@ -154,7 +201,6 @@ insert into t2 select * from t1; # 987
insert
into
t1
select
*
from
t2
;
# 1597
insert
into
t2
select
*
from
t1
;
# 2584
insert
into
t1
select
*
from
t2
;
# 4181
drop
table
t2
;
show
status
like
"Qcache_hits"
;
disable_result_log
;
...
...
@@ -167,6 +213,50 @@ enable_result_log;
show
status
like
"Qcache_hits"
;
show
status
like
"Qcache_queries_in_cache"
;
reset
query
cache
;
#
# Query bigger then query_cache_limit
#
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
insert
into
t2
select
*
from
t1
;
insert
into
t1
select
*
from
t2
;
disable_result_log
;
select
*
from
t1
;
enable_result_log
;
show
status
like
"Qcache_queries_in_cache"
;
drop
table
t1
,
t2
;
#
# noncachable ODBC work around (and prepare cache for drop database)
#
create
database
foo
;
create
table
foo
.
t1
(
i
int
not
null
auto_increment
,
a
int
,
primary
key
(
i
));
insert
into
foo
.
t1
(
a
)
values
(
1
);
select
*
from
foo
.
t1
where
i
is
null
;
#
# drop db
#
select
*
from
foo
.
t1
;
show
status
like
"Qcache_queries_in_cache"
;
drop
database
foo
;
show
status
like
"Qcache_queries_in_cache"
;
#
# Charset convertion (cp1251_koi8 always present)
#
create
table
t1
(
a
char
(
1
)
not
null
);
insert
into
t1
values
(
""
);
select
*
from
t1
;
set
CHARACTER
SET
cp1251_koi8
;
select
*
from
t1
;
set
CHARACTER
SET
DEFAULT
;
show
status
like
"Qcache_queries_in_cache"
;
drop
table
t1
;
# The following tests can't be done as the values differen on 32 and 64 bit
...
...
sql/sql_cache.cc
View file @
61be9477
...
...
@@ -1737,18 +1737,6 @@ void Query_cache::invalidate_table(TABLE *table)
invalidate_table
(
table_block
);
}
void
Query_cache
::
invalidate_table_in_db
(
Query_cache_block
*
table_block
,
char
*
db
)
{
/*
table key consist of data_base_name + '\0' + table_name +'\0'...
=> we may use strcmp to compare database names.
*/
if
(
strcmp
(
db
,
(
char
*
)(
table_block
->
table
()
->
db
()))
==
0
)
invalidate_table
(
table_block
);
}
void
Query_cache
::
invalidate_table
(
Query_cache_block
*
table_block
)
{
Query_cache_block_table
*
list_root
=
table_block
->
table
(
0
);
...
...
sql/sql_cache.h
View file @
61be9477
...
...
@@ -268,8 +268,6 @@ protected:
Query_cache_block
*
query_block
);
void
invalidate_table
(
TABLE_LIST
*
table
);
void
invalidate_table
(
TABLE
*
table
);
void
invalidate_table_in_db
(
Query_cache_block
*
table_block
,
char
*
db
);
void
invalidate_table
(
Query_cache_block
*
table_block
);
my_bool
register_all_tables
(
Query_cache_block
*
block
,
TABLE_LIST
*
tables_used
,
...
...
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