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
e9492cca
Commit
e9492cca
authored
May 05, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid using ndb tables in query cache
parent
ee627d25
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
5 deletions
+83
-5
mysql-test/r/ndb_cache.result
mysql-test/r/ndb_cache.result
+43
-0
mysql-test/t/ndb_cache.test
mysql-test/t/ndb_cache.test
+31
-0
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+2
-2
sql/handler.h
sql/handler.h
+4
-2
sql/sql_cache.cc
sql/sql_cache.cc
+3
-1
No files found.
mysql-test/r/ndb_cache.result
0 → 100644
View file @
e9492cca
set GLOBAL query_cache_size=1355776;
reset query cache;
flush status;
drop table if exists t1,t2;
CREATE TABLE t1 (a int) ENGINE=ndbcluster;
CREATE TABLE t2 (a int);
select * from t1;
a
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
select * from t2;
a
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 t1;
a
select * from t2;
a
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
drop table t1, t2;
SET GLOBAL query_cache_size=0;
mysql-test/t/ndb_cache.test
0 → 100644
View file @
e9492cca
--
source
include
/
have_query_cache
.
inc
--
source
include
/
have_ndb
.
inc
set
GLOBAL
query_cache_size
=
1355776
;
reset
query
cache
;
flush
status
;
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
CREATE
TABLE
t1
(
a
int
)
ENGINE
=
ndbcluster
;
CREATE
TABLE
t2
(
a
int
);
select
*
from
t1
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
select
*
from
t2
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
select
*
from
t1
;
select
*
from
t2
;
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
drop
table
t1
,
t2
;
SET
GLOBAL
query_cache_size
=
0
;
sql/ha_ndbcluster.h
View file @
e9492cca
...
@@ -107,7 +107,7 @@ class ha_ndbcluster: public handler
...
@@ -107,7 +107,7 @@ class ha_ndbcluster: public handler
return
true
;
return
true
;
#endif
#endif
}
}
bool
has_transactions
()
{
return
true
;}
bool
has_transactions
()
{
return
true
;
}
const
char
*
index_type
(
uint
key_number
)
{
const
char
*
index_type
(
uint
key_number
)
{
switch
(
get_index_type
(
key_number
))
{
switch
(
get_index_type
(
key_number
))
{
...
@@ -130,7 +130,7 @@ class ha_ndbcluster: public handler
...
@@ -130,7 +130,7 @@ class ha_ndbcluster: public handler
static
Ndb
*
seize_ndb
();
static
Ndb
*
seize_ndb
();
static
void
release_ndb
(
Ndb
*
ndb
);
static
void
release_ndb
(
Ndb
*
ndb
);
uint8
table_cache_type
()
{
return
HA_CACHE_TBL_NOCACHE
;
}
private:
private:
int
alter_table_name
(
const
char
*
from
,
const
char
*
to
);
int
alter_table_name
(
const
char
*
from
,
const
char
*
to
);
...
...
sql/handler.h
View file @
e9492cca
...
@@ -138,8 +138,10 @@
...
@@ -138,8 +138,10 @@
/* Table caching type */
/* Table caching type */
#define HA_CACHE_TBL_NONTRANSACT 0
#define HA_CACHE_TBL_NONTRANSACT 0
#define HA_CACHE_TBL_ASKTRANSACT 1
#define HA_CACHE_TBL_NOCACHE 1
#define HA_CACHE_TBL_TRANSACT 2
#define HA_CACHE_TBL_ASKTRANSACT 2
#define HA_CACHE_TBL_TRANSACT 4
enum
db_type
enum
db_type
{
{
...
...
sql/sql_cache.cc
View file @
e9492cca
...
@@ -2614,12 +2614,14 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
...
@@ -2614,12 +2614,14 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
*/
*/
if
(
tables_used
->
table
->
db_type
==
DB_TYPE_MRG_ISAM
||
if
(
tables_used
->
table
->
db_type
==
DB_TYPE_MRG_ISAM
||
tables_used
->
table
->
tmp_table
!=
NO_TMP_TABLE
||
tables_used
->
table
->
tmp_table
!=
NO_TMP_TABLE
||
(
*
tables_type
&
HA_CACHE_TBL_NOCACHE
)
||
(
tables_used
->
db_length
==
5
&&
(
tables_used
->
db_length
==
5
&&
my_strnncoll
(
table_alias_charset
,
(
uchar
*
)
tables_used
->
db
,
6
,
my_strnncoll
(
table_alias_charset
,
(
uchar
*
)
tables_used
->
db
,
6
,
(
uchar
*
)
"mysql"
,
6
)
==
0
))
(
uchar
*
)
"mysql"
,
6
)
==
0
))
{
{
DBUG_PRINT
(
"qcache"
,
DBUG_PRINT
(
"qcache"
,
(
"select not cacheable: used MRG_ISAM, temporary or system table(s)"
));
(
"select not cacheable: used MRG_ISAM, temporary, \
system or other non-cacheable table(s)"
));
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
if
(
tables_used
->
table
->
db_type
==
DB_TYPE_MRG_MYISAM
)
if
(
tables_used
->
table
->
db_type
==
DB_TYPE_MRG_MYISAM
)
...
...
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