summaryrefslogtreecommitdiff
path: root/sql/handler.h
diff options
context:
space:
mode:
authorunknown <thek@adventure.(none)>2007-07-12 15:30:34 +0200
committerunknown <thek@adventure.(none)>2007-07-12 15:30:34 +0200
commit5ee37c143924ef853f5c603c1110d143835f02df (patch)
treedc4dd71b27761b64dbdb9547e84a618fab3f35b9 /sql/handler.h
parenta64be676a4cd799c7b7259d950df7040879a8889 (diff)
parent30810f80b1070cbfd4579835353bb6e84fd1b233 (diff)
downloadmariadb-git-5ee37c143924ef853f5c603c1110d143835f02df.tar.gz
Merge adventure.(none):/home/thek/Development/cpp/bug28249/my50-bug28249
into adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime mysql-test/t/query_cache.test: Auto merged sql/ha_myisam.cc: Auto merged sql/handler.h: Auto merged mysql-test/r/query_cache.result: SCCS merged
Diffstat (limited to 'sql/handler.h')
-rw-r--r--sql/handler.h45
1 files changed, 39 insertions, 6 deletions
diff --git a/sql/handler.h b/sql/handler.h
index 2680c9859f6..a3767573178 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -843,16 +843,49 @@ public:
/* Type of table for caching query */
virtual uint8 table_cache_type() { return HA_CACHE_TBL_NONTRANSACT; }
- /* ask handler about permission to cache table when query is to be cached */
+
+
+ /**
+ @brief Register a named table with a call back function to the query cache.
+
+ @param thd The thread handle
+ @param table_key A pointer to the table name in the table cache
+ @param key_length The length of the table name
+ @param[out] engine_callback The pointer to the storage engine call back
+ function
+ @param[out] engine_data Storage engine specific data which could be
+ anything
+
+ This method offers the storage engine, the possibility to store a reference
+ to a table name which is going to be used with query cache.
+ The method is called each time a statement is written to the cache and can
+ be used to verify if a specific statement is cachable. It also offers
+ the possibility to register a generic (but static) call back function which
+ is called each time a statement is matched against the query cache.
+
+ @note If engine_data supplied with this function is different from
+ engine_data supplied with the callback function, and the callback returns
+ FALSE, a table invalidation on the current table will occur.
+
+ @return Upon success the engine_callback will point to the storage engine
+ call back function, if any, and engine_data will point to any storage
+ engine data used in the specific implementation.
+ @retval TRUE Success
+ @retval FALSE The specified table or current statement should not be
+ cached
+ */
+
virtual my_bool register_query_cache_table(THD *thd, char *table_key,
- uint key_length,
- qc_engine_callback
- *engine_callback,
- ulonglong *engine_data)
+ uint key_length,
+ qc_engine_callback
+ *engine_callback,
+ ulonglong *engine_data)
{
*engine_callback= 0;
- return 1;
+ return TRUE;
}
+
+
/*
RETURN
true Primary key (if there is one) is clustered key covering all fields