summaryrefslogtreecommitdiff
path: root/sql/sql_cache.h
diff options
context:
space:
mode:
authorMats Kindahl <mats@sun.com>2010-03-31 16:05:33 +0200
committerMats Kindahl <mats@sun.com>2010-03-31 16:05:33 +0200
commite409d6f69c91a9f097802455dd61a2387e16d5f0 (patch)
tree19f32879e77ada23d733f35173a25f410d655ebe /sql/sql_cache.h
parent36430c53f98931028ce318bed7f2834a4ff30195 (diff)
downloadmariadb-git-e409d6f69c91a9f097802455dd61a2387e16d5f0.tar.gz
WL#5030: Split and remove mysql_priv.h
This patch: - Moves all definitions from the mysql_priv.h file into header files for the component where the variable is defined - Creates header files if the component lacks one - Eliminates all include directives from mysql_priv.h - Eliminates all circular include cycles - Rename time.cc to sql_time.cc - Rename mysql_priv.h to sql_priv.h
Diffstat (limited to 'sql/sql_cache.h')
-rw-r--r--sql/sql_cache.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/sql/sql_cache.h b/sql/sql_cache.h
index 9d1f32d6ef1..4fbd372d643 100644
--- a/sql/sql_cache.h
+++ b/sql/sql_cache.h
@@ -16,6 +16,16 @@
#ifndef _SQL_CACHE_H
#define _SQL_CACHE_H
+#include "hash.h"
+#include "my_base.h" /* ha_rows */
+
+class MY_LOCALE;
+class TABLE_LIST;
+class Time_zone;
+struct LEX;
+struct TABLE;
+typedef struct st_changed_table_list CHANGED_TABLE_LIST;
+
/* Query cache */
/*
@@ -66,6 +76,11 @@ struct Query_cache_result;
class Query_cache;
struct Query_cache_tls;
struct LEX;
+class THD;
+
+typedef my_bool (*qc_engine_callback)(THD *thd, char *table_key,
+ uint key_length,
+ ulonglong *engine_data);
/**
This class represents a node in the linked chain of queries
@@ -502,5 +517,68 @@ protected:
void unlock(void);
};
+#ifdef HAVE_QUERY_CACHE
+struct Query_cache_query_flags
+{
+ unsigned int client_long_flag:1;
+ unsigned int client_protocol_41:1;
+ unsigned int protocol_type:2;
+ unsigned int more_results_exists:1;
+ unsigned int in_trans:1;
+ unsigned int autocommit:1;
+ unsigned int pkt_nr;
+ uint character_set_client_num;
+ uint character_set_results_num;
+ uint collation_connection_num;
+ ha_rows limit;
+ Time_zone *time_zone;
+ ulong sql_mode;
+ ulong max_sort_length;
+ ulong group_concat_max_len;
+ ulong default_week_format;
+ ulong div_precision_increment;
+ MY_LOCALE *lc_time_names;
+};
+#define QUERY_CACHE_FLAGS_SIZE sizeof(Query_cache_query_flags)
+#include "sql_cache.h"
+#define query_cache_abort(A) query_cache.abort(A)
+#define query_cache_end_of_result(A) query_cache.end_of_result(A)
+#define query_cache_store_query(A, B) query_cache.store_query(A, B)
+#define query_cache_destroy() query_cache.destroy()
+#define query_cache_result_size_limit(A) query_cache.result_size_limit(A)
+#define query_cache_init() query_cache.init()
+#define query_cache_resize(A) query_cache.resize(A)
+#define query_cache_set_min_res_unit(A) query_cache.set_min_res_unit(A)
+#define query_cache_invalidate3(A, B, C) query_cache.invalidate(A, B, C)
+#define query_cache_invalidate1(A) query_cache.invalidate(A)
+#define query_cache_send_result_to_client(A, B, C) \
+ query_cache.send_result_to_client(A, B, C)
+#define query_cache_invalidate_by_MyISAM_filename_ref \
+ &query_cache_invalidate_by_MyISAM_filename
+/* note the "maybe": it's a read without mutex */
+#define query_cache_maybe_disabled(T) \
+ (T->variables.query_cache_type == 0 || query_cache.query_cache_size == 0)
+#define query_cache_is_cacheable_query(L) \
+ (((L)->sql_command == SQLCOM_SELECT) && (L)->safe_to_cache_query)
+#else
+#define QUERY_CACHE_FLAGS_SIZE 0
+#define query_cache_store_query(A, B)
+#define query_cache_destroy()
+#define query_cache_result_size_limit(A)
+#define query_cache_init()
+#define query_cache_resize(A)
+#define query_cache_set_min_res_unit(A)
+#define query_cache_invalidate3(A, B, C)
+#define query_cache_invalidate1(A)
+#define query_cache_send_result_to_client(A, B, C) 0
+#define query_cache_invalidate_by_MyISAM_filename_ref NULL
+
+#define query_cache_abort(A)
+#define query_cache_end_of_result(A)
+#define query_cache_invalidate_by_MyISAM_filename_ref NULL
+#define query_cache_maybe_disabled(T) 1
+#define query_cache_is_cacheable_query(L) 0
+#endif /*HAVE_QUERY_CACHE*/
+
extern Query_cache query_cache;
#endif