Commit b815d7e5 authored by unknown's avatar unknown

enabling control of query cache for ndb

parent 9f90db61
...@@ -3004,7 +3004,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) ...@@ -3004,7 +3004,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
m_transaction_on= FALSE; m_transaction_on= FALSE;
else else
m_transaction_on= thd->variables.ndb_use_transactions; m_transaction_on= thd->variables.ndb_use_transactions;
// m_use_local_query_cache= thd->variables.ndb_use_local_query_cache; m_use_local_query_cache= thd->variables.ndb_use_local_query_cache;
m_active_trans= thd->transaction.all.ndb_tid ? m_active_trans= thd->transaction.all.ndb_tid ?
(NdbConnection*)thd->transaction.all.ndb_tid: (NdbConnection*)thd->transaction.all.ndb_tid:
......
...@@ -2227,7 +2227,11 @@ extern "C" pthread_handler_decl(handle_shutdown,arg) ...@@ -2227,7 +2227,11 @@ extern "C" pthread_handler_decl(handle_shutdown,arg)
#endif #endif
const char *load_default_groups[]= { "mysqld","server",MYSQL_BASE_VERSION,0,0}; const char *load_default_groups[]= {
#ifdef HAVE_NDBCLUSTER_DB
"mysql_cluster",
#endif
"mysqld","server",MYSQL_BASE_VERSION,0,0};
bool open_log(MYSQL_LOG *log, const char *hostname, bool open_log(MYSQL_LOG *log, const char *hostname,
const char *opt_name, const char *extension, const char *opt_name, const char *extension,
...@@ -3950,6 +3954,7 @@ enum options_mysqld ...@@ -3950,6 +3954,7 @@ enum options_mysqld
OPT_INNODB, OPT_ISAM, OPT_INNODB, OPT_ISAM,
OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, OPT_NDB_USE_EXACT_COUNT, OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, OPT_NDB_USE_EXACT_COUNT,
OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
OPT_NDB_USE_LOCAL_QUERY_CACHE,
OPT_SKIP_SAFEMALLOC, OPT_SKIP_SAFEMALLOC,
OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_TEMP_POOL, OPT_TX_ISOLATION,
OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS, OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
...@@ -4409,6 +4414,12 @@ Disable with --skip-ndbcluster (will save memory).", ...@@ -4409,6 +4414,12 @@ Disable with --skip-ndbcluster (will save memory).",
(gptr*) &global_system_variables.ndb_use_exact_count, (gptr*) &global_system_variables.ndb_use_exact_count,
(gptr*) &global_system_variables.ndb_use_exact_count, (gptr*) &global_system_variables.ndb_use_exact_count,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
{"ndb_use_local_query_cache", OPT_NDB_USE_LOCAL_QUERY_CACHE,
"Use local query cache, note that this cache will _not_ "
"be invalidated if data is updated through other mysql servers",
(gptr*) &global_system_variables.ndb_use_local_query_cache,
(gptr*) &global_system_variables.ndb_use_local_query_cache,
0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"new", 'n', "Use very new possible 'unsafe' functions.", {"new", 'n', "Use very new possible 'unsafe' functions.",
(gptr*) &global_system_variables.new_mode, (gptr*) &global_system_variables.new_mode,
......
...@@ -371,6 +371,9 @@ sys_var_thd_bool ...@@ -371,6 +371,9 @@ sys_var_thd_bool
sys_ndb_use_exact_count("ndb_use_exact_count", sys_ndb_use_exact_count("ndb_use_exact_count",
&SV::ndb_use_exact_count); &SV::ndb_use_exact_count);
sys_var_thd_bool sys_var_thd_bool
sys_ndb_use_local_query_cache("ndb_use_local_query_cache",
&SV::ndb_use_local_query_cache);
sys_var_thd_bool
sys_ndb_use_transactions("ndb_use_transactions", sys_ndb_use_transactions("ndb_use_transactions",
&SV::ndb_use_transactions); &SV::ndb_use_transactions);
// ndb server global variable settings // ndb server global variable settings
...@@ -634,6 +637,7 @@ sys_var *sys_variables[]= ...@@ -634,6 +637,7 @@ sys_var *sys_variables[]=
&sys_ndb_autoincrement_prefetch_sz, &sys_ndb_autoincrement_prefetch_sz,
&sys_ndb_force_send, &sys_ndb_force_send,
&sys_ndb_use_exact_count, &sys_ndb_use_exact_count,
&sys_ndb_use_local_query_cache,
&sys_ndb_use_transactions, &sys_ndb_use_transactions,
#endif #endif
&sys_unique_checks, &sys_unique_checks,
...@@ -801,6 +805,8 @@ struct show_var_st init_vars[]= { ...@@ -801,6 +805,8 @@ struct show_var_st init_vars[]= {
(char*) &sys_ndb_autoincrement_prefetch_sz, SHOW_SYS}, (char*) &sys_ndb_autoincrement_prefetch_sz, SHOW_SYS},
{sys_ndb_force_send.name, (char*) &sys_ndb_force_send, SHOW_SYS}, {sys_ndb_force_send.name, (char*) &sys_ndb_force_send, SHOW_SYS},
{sys_ndb_use_exact_count.name,(char*) &sys_ndb_use_exact_count, SHOW_SYS}, {sys_ndb_use_exact_count.name,(char*) &sys_ndb_use_exact_count, SHOW_SYS},
{sys_ndb_use_local_query_cache.name,
(char*) &sys_ndb_use_local_query_cache, SHOW_SYS},
{sys_ndb_use_transactions.name,(char*) &sys_ndb_use_transactions, SHOW_SYS}, {sys_ndb_use_transactions.name,(char*) &sys_ndb_use_transactions, SHOW_SYS},
#endif #endif
{sys_net_buffer_length.name,(char*) &sys_net_buffer_length, SHOW_SYS}, {sys_net_buffer_length.name,(char*) &sys_net_buffer_length, SHOW_SYS},
......
...@@ -403,6 +403,7 @@ struct system_variables ...@@ -403,6 +403,7 @@ struct system_variables
ulong ndb_autoincrement_prefetch_sz; ulong ndb_autoincrement_prefetch_sz;
my_bool ndb_force_send; my_bool ndb_force_send;
my_bool ndb_use_exact_count; my_bool ndb_use_exact_count;
my_bool ndb_use_local_query_cache;
my_bool ndb_use_transactions; my_bool ndb_use_transactions;
#endif /* HAVE_NDBCLUSTER_DB */ #endif /* HAVE_NDBCLUSTER_DB */
my_bool old_passwords; my_bool old_passwords;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment