Commit c617037b authored by unknown's avatar unknown

Enabled usage of new system variables for ndb

  - ndb_use_exact_count
  - ndb_autoincrement_prefetch_sz
  - ndb_use_transactions
  - ndb_force_send
moved "inlined" functions to .cc file since they are virtual anyways
enabled printout od ndb errors in warnings even if mapping existst to mysql error code


sql/ha_ndbcluster.h:
  Enabled usage of new system variables for ndb
    - ndb_use_exact_count
    - ndb_autoincrement_prefetch_sz
    - ndb_use_transactions
    - ndb_force_send
  moved "inlined" functions to .cc file since they are virtual anyways
sql/mysqld.cc:
  Enabled usage of new system variables for ndb
    - ndb_use_exact_count
    - ndb_autoincrement_prefetch_sz
    - ndb_use_transactions
    - ndb_force_send
sql/set_var.cc:
  Enabled usage of new system variables for ndb
    - ndb_use_exact_count
    - ndb_autoincrement_prefetch_sz
    - ndb_use_transactions
    - ndb_force_send
sql/sql_class.h:
  Enabled usage of new system variables for ndb
    - ndb_use_exact_count
    - ndb_autoincrement_prefetch_sz
    - ndb_use_transactions
    - ndb_force_send
parent 692311f5
This diff is collapsed.
......@@ -118,15 +118,14 @@ class ha_ndbcluster: public handler
int reset();
int external_lock(THD *thd, int lock_type);
int start_stmt(THD *thd);
const char * table_type() const { return("ndbcluster");}
const char * table_type() const;
const char ** bas_ext() const;
ulong table_flags(void) const { return m_table_flags; }
ulong table_flags(void) const;
ulong index_flags(uint idx, uint part, bool all_parts) const;
uint max_supported_record_length() const { return NDB_MAX_TUPLE_SIZE; };
uint max_supported_keys() const { return MAX_KEY; }
uint max_supported_key_parts() const
{ return NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY; };
uint max_supported_key_length() const { return NDB_MAX_KEY_SIZE;};
uint max_supported_record_length() const;
uint max_supported_keys() const;
uint max_supported_key_parts() const;
uint max_supported_key_length() const;
int rename_table(const char *from, const char *to);
int delete_table(const char *name);
......@@ -135,28 +134,9 @@ class ha_ndbcluster: public handler
THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
bool low_byte_first() const
{
#ifdef WORDS_BIGENDIAN
return FALSE;
#else
return TRUE;
#endif
}
bool has_transactions() { return TRUE; }
const char* index_type(uint key_number) {
switch (get_index_type(key_number)) {
case ORDERED_INDEX:
case UNIQUE_ORDERED_INDEX:
case PRIMARY_KEY_ORDERED_INDEX:
return "BTREE";
case UNIQUE_INDEX:
case PRIMARY_KEY_INDEX:
default:
return "HASH";
}
}
bool low_byte_first() const;
bool has_transactions();
const char* index_type(uint key_number);
double scan_time();
ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
......@@ -165,7 +145,7 @@ class ha_ndbcluster: public handler
static Thd_ndb* seize_thd_ndb();
static void release_thd_ndb(Thd_ndb* thd_ndb);
uint8 table_cache_type() { return HA_CACHE_TBL_NOCACHE; }
uint8 table_cache_type();
private:
int alter_table_name(const char *from, const char *to);
......@@ -256,6 +236,10 @@ class ha_ndbcluster: public handler
char *m_blobs_buffer;
uint32 m_blobs_buffer_size;
uint m_dupkey;
bool m_ha_not_exact_count;
bool m_force_send;
ha_rows m_autoincrement_prefetch;
bool m_transaction_on;
void set_rec_per_key();
void records_update();
......@@ -265,6 +249,8 @@ class ha_ndbcluster: public handler
void no_uncommitted_rows_reset(THD *);
friend int execute_no_commit(ha_ndbcluster*, NdbConnection*);
friend int execute_commit(ha_ndbcluster*, NdbConnection*);
friend int execute_no_commit_ie(ha_ndbcluster*, NdbConnection*);
};
bool ndbcluster_init(void);
......
......@@ -3947,7 +3947,11 @@ enum options_mysqld
OPT_INNODB_FILE_PER_TABLE, OPT_CRASH_BINLOG_INNODB,
OPT_INNODB_LOCKS_UNSAFE_FOR_BINLOG,
OPT_SAFE_SHOW_DB, OPT_INNODB_SAFE_BINLOG,
OPT_INNODB, OPT_ISAM, OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, OPT_SKIP_SAFEMALLOC,
OPT_INNODB, OPT_ISAM,
OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, OPT_NDB_USE_EXACT_COUNT,
OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
OPT_NDB_USE_TRANSACTIONS,
OPT_SKIP_SAFEMALLOC,
OPT_TEMP_POOL, OPT_TX_ISOLATION,
OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL,
......@@ -4386,9 +4390,31 @@ Disable with --skip-ndbcluster (will save memory).",
(gptr*) &opt_ndbcluster, (gptr*) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 1, 0, 0,
0, 0, 0},
#ifdef HAVE_NDBCLUSTER_DB
{"ndb-connectstring", OPT_NDB_CONNECTSTRING, "Connect string for ndbcluster.",
(gptr*) &ndbcluster_connectstring, (gptr*) &ndbcluster_connectstring, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ndb-connectstring", OPT_NDB_CONNECTSTRING,
"Connect string for ndbcluster.",
(gptr*) &ndbcluster_connectstring, (gptr*) &ndbcluster_connectstring,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ndb_autoincrement_prefetch_sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
"Specify number of autoincrement values that are prefetched",
(gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz,
(gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz,
0, GET_INT, REQUIRED_ARG, 32, 1, 256, 0, 0, 0},
{"ndb_force_send", OPT_NDB_FORCE_SEND,
"Force send of buffers to ndb immediately without waiting for other threads",
(gptr*) &global_system_variables.ndb_force_send,
(gptr*) &global_system_variables.ndb_force_send,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
{"ndb_use_exact_count", OPT_NDB_USE_EXACT_COUNT,
"Use exact records count during query planning and for "
"fast select 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},
{"ndb_use_transactions", OPT_NDB_USE_TRANSACTIONS,
"Use transactions in ndb",
(gptr*) &global_system_variables.ndb_use_transactions,
(gptr*) &global_system_variables.ndb_use_transactions,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
#endif
{"new", 'n', "Use very new possible 'unsafe' functions.",
(gptr*) &global_system_variables.new_mode,
......
......@@ -359,6 +359,23 @@ sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks",
sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment",
&srv_auto_extend_increment);
#endif
#ifdef HAVE_NDBCLUSTER_DB
// ndb thread specific variable settings
sys_var_thd_ulong
sys_ndb_autoincrement_prefetch_sz("ndb_autoincrement_prefetch_sz",
&SV::ndb_autoincrement_prefetch_sz);
sys_var_thd_bool
sys_ndb_force_send("ndb_force_send",
&SV::ndb_force_send);
sys_var_thd_bool
sys_ndb_use_exact_count("ndb_use_exact_count",
&SV::ndb_use_exact_count);
sys_var_thd_bool
sys_ndb_use_transactions("ndb_use_transactions",
&SV::ndb_use_transactions);
// ndb server global variable settings
// none
#endif
/* Time/date/datetime formats */
......@@ -612,6 +629,12 @@ sys_var *sys_variables[]=
&sys_innodb_table_locks,
&sys_innodb_max_purge_lag,
&sys_innodb_autoextend_increment,
#endif
#ifdef HAVE_NDBCLUSTER_DB
&sys_ndb_autoincrement_prefetch_sz,
&sys_ndb_force_send,
&sys_ndb_use_exact_count,
&sys_ndb_use_transactions,
#endif
&sys_unique_checks,
&sys_warning_count
......@@ -772,6 +795,13 @@ struct show_var_st init_vars[]= {
{sys_myisam_sort_buffer_size.name, (char*) &sys_myisam_sort_buffer_size, SHOW_SYS},
#ifdef __NT__
{"named_pipe", (char*) &opt_enable_named_pipe, SHOW_MY_BOOL},
#endif
#ifdef HAVE_NDBCLUSTER_DB
{sys_ndb_autoincrement_prefetch_sz.name,
(char*) &sys_ndb_autoincrement_prefetch_sz, 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_transactions.name,(char*) &sys_ndb_use_transactions, SHOW_SYS},
#endif
{sys_net_buffer_length.name,(char*) &sys_net_buffer_length, SHOW_SYS},
{sys_net_read_timeout.name, (char*) &sys_net_read_timeout, SHOW_SYS},
......
......@@ -399,6 +399,12 @@ struct system_variables
#ifdef HAVE_INNOBASE_DB
my_bool innodb_table_locks;
#endif /* HAVE_INNOBASE_DB */
#ifdef HAVE_NDBCLUSTER_DB
ulong ndb_autoincrement_prefetch_sz;
my_bool ndb_force_send;
my_bool ndb_use_exact_count;
my_bool ndb_use_transactions;
#endif /* HAVE_NDBCLUSTER_DB */
my_bool old_passwords;
/* Only charset part of these variables is sensible */
......
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