diff options
author | tomas@poseidon.ndb.mysql.com <> | 2004-11-24 11:56:51 +0000 |
---|---|---|
committer | tomas@poseidon.ndb.mysql.com <> | 2004-11-24 11:56:51 +0000 |
commit | ae471974ac158133976ce3510afe16db75fda798 (patch) | |
tree | d86695b0474eeb86f64c657158352d647493cfd3 /sql/sql_cache.h | |
parent | 49b02a8f2102e57008b9a216f8d0d6e0966e9db0 (diff) | |
download | mariadb-git-ae471974ac158133976ce3510afe16db75fda798.tar.gz |
sql/ha_innodb.cc
enabled query cache for ndb
modified engine interface somewhat
sql/ha_innodb.h
enabled query cache for ndb
modified engine interface somewhat
sql/ha_ndbcluster.cc
enabled query cache for ndb
modified engine interface somewhat
ndb will only allow caching and retrieval if running autocommit
- return false, but do not invalidate
commit count is used as engine data, i.e.
- store commit count before store of cache
- allow retrieval if commit count has not changed on a table
- invalidate if commit count has changed
sql/ha_ndbcluster.h
enabled query cache for ndb
modified engine interface somewhat
sql/handler.cc
enabled query cache for ndb
modified engine interface somewhat
sql/handler.h
enabled query cache for ndb
modified engine interface somewhat
new virtual handler method cached_table_registration called on each table before alowing store in query cache
- return TRUE - ok to cache, FALSE - not allowed to cache, invalidate queries if engine_data below has changed
- sets ulonglong (engine_data) that is stored in query cache for each table
- sets callback to be called for each table before usage of cached query, callback = 0 -> no check later
sql/mysql_priv.h
enabled query cache for ndb
modified engine interface somewhat
callcack prototype for callback to engine before query cache retrieval
sql/sql_cache.cc
enabled query cache for ndb
modified engine interface somewhat
if callback is set on table in cache, do callback to check if allowed to use cache
if not allowed to use cache, check if engine_data has changed, if so, invalidate all queries with that table
+ changes to store and pass callback and engine_data around
sql/sql_cache.h
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
sql/table.h
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
Diffstat (limited to 'sql/sql_cache.h')
-rw-r--r-- | sql/sql_cache.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/sql_cache.h b/sql/sql_cache.h index c933a2349af..7595bfbbd54 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -145,6 +145,10 @@ struct Query_cache_table char *tbl; uint32 key_len; uint8 table_type; + /* unique for every engine reference */ + qc_engine_callback callback_func; + /* data need by some engines */ + ulonglong engine_data_buff; inline char *db() { return (char *) data(); } inline char *table() { return tbl; } @@ -153,6 +157,10 @@ struct Query_cache_table inline void key_length(uint32 len) { key_len= len; } inline uint8 type() { return table_type; } inline void type(uint8 t) { table_type= t; } + inline qc_engine_callback callback() { return callback_func; } + inline void callback(qc_engine_callback fn){ callback_func= fn; } + inline ulonglong engine_data() { return engine_data_buff; } + inline void engine_data(ulonglong data) { engine_data_buff= data; } inline gptr data() { return (gptr)(((byte*)this)+ @@ -281,7 +289,9 @@ protected: TABLE_COUNTER_TYPE tables); my_bool insert_table(uint key_len, char *key, Query_cache_block_table *node, - uint32 db_length, uint8 cache_type); + uint32 db_length, uint8 cache_type, + qc_engine_callback callback, + ulonglong engine_data); void unlink_table(Query_cache_block_table *node); Query_cache_block *get_free_block (ulong len, my_bool not_less, ulong min); |