summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-05-05 11:22:10 +0300
committerunknown <bell@sanja.is.com.ua>2004-05-05 11:22:10 +0300
commitea646dce60994b8a5d36d575ed371144cd01eeb3 (patch)
tree0a4b2c48d0cb89c7b1aea86ed25e230b0689bfd6 /sql
parentaf847c22af26e1cc308eeab08d35942741809408 (diff)
downloadmariadb-git-ea646dce60994b8a5d36d575ed371144cd01eeb3.tar.gz
avoid using ndb tables in query cache
sql/ha_ndbcluster.h: fixed layout prohibit using query cache with ndb tables sql/handler.h: new caching type sql/sql_cache.cc: support of new caching type (caching prohibited)
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_ndbcluster.h4
-rw-r--r--sql/handler.h6
-rw-r--r--sql/sql_cache.cc4
3 files changed, 9 insertions, 5 deletions
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index ed66d07d79b..bd601f39fc4 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -107,7 +107,7 @@ class ha_ndbcluster: public handler
return true;
#endif
}
- bool has_transactions() { return true;}
+ bool has_transactions() { return true; }
const char* index_type(uint key_number) {
switch (get_index_type(key_number)) {
@@ -130,7 +130,7 @@ class ha_ndbcluster: public handler
static Ndb* seize_ndb();
static void release_ndb(Ndb* ndb);
-
+ uint8 table_cache_type() { return HA_CACHE_TBL_NOCACHE; }
private:
int alter_table_name(const char *from, const char *to);
diff --git a/sql/handler.h b/sql/handler.h
index 62ff74c436a..ac5dceba8ab 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -138,8 +138,10 @@
/* Table caching type */
#define HA_CACHE_TBL_NONTRANSACT 0
-#define HA_CACHE_TBL_ASKTRANSACT 1
-#define HA_CACHE_TBL_TRANSACT 2
+#define HA_CACHE_TBL_NOCACHE 1
+#define HA_CACHE_TBL_ASKTRANSACT 2
+#define HA_CACHE_TBL_TRANSACT 4
+
enum db_type
{
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index e1a15eff475..f17f4bb2b7f 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -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 ||
tables_used->table->tmp_table != NO_TMP_TABLE ||
+ (*tables_type & HA_CACHE_TBL_NOCACHE) ||
(tables_used->db_length == 5 &&
my_strnncoll(table_alias_charset, (uchar*)tables_used->db, 6,
(uchar*)"mysql",6) == 0))
{
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);
}
if (tables_used->table->db_type == DB_TYPE_MRG_MYISAM)