Loading sql/ha_ndbcluster.cc +10 −5 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ // options from from mysqld.cc extern my_bool opt_ndb_optimized_node_selection; extern my_bool opt_ndb_linear_hash; extern enum ndb_distribution opt_ndb_distribution_id; extern const char *opt_ndbcluster_connectstring; // Default value for parallelism Loading Loading @@ -7450,7 +7450,7 @@ uint ha_ndbcluster::set_up_partition_info(partition_info *part_info, static void ndb_set_fragmentation(NDBTAB &tab, TABLE *form, uint pk_length) { NDBTAB::FragmentType ftype; NDBTAB::FragmentType ftype= NDBTAB::DistrKeyHash; ushort node_group[MAX_PARTITIONS]; uint no_nodes= g_ndb_cluster_connection->no_db_nodes(), no_fragments, i; DBUG_ENTER("ndb_set_fragmentation"); Loading Loading @@ -7481,10 +7481,15 @@ static void ndb_set_fragmentation(NDBTAB &tab, TABLE *form, uint pk_length) node_group[0]= 0; for (i= 1; i < no_fragments; i++) node_group[i]= UNDEF_NODEGROUP; if (opt_ndb_linear_hash) ftype= NDBTAB::DistrKeyLin; else switch (opt_ndb_distribution_id) { case ND_KEYHASH: ftype= NDBTAB::DistrKeyHash; break; case ND_LINHASH: ftype= NDBTAB::DistrKeyLin; break; } tab.setFragmentType(ftype); tab.setNodeGroupIds(&node_group, no_fragments); DBUG_VOID_RETURN; Loading sql/ha_ndbcluster.h +2 −0 Original line number Diff line number Diff line Loading @@ -113,6 +113,8 @@ struct negated_function_mapping NDB_FUNC_TYPE neg_fun; }; enum ndb_distribution { ND_KEYHASH= 0, ND_LINHASH= 1 }; /* Define what functions can be negated in condition pushdown. Note, these HAVE to be in the same order as in definition enum Loading sql/mysqld.cc +26 −12 Original line number Diff line number Diff line Loading @@ -362,7 +362,12 @@ my_bool opt_ndb_shm, opt_ndb_optimized_node_selection; ulong opt_ndb_cache_check_time; const char *opt_ndb_mgmd; ulong opt_ndb_nodeid; bool opt_ndb_linear_hash; const char *ndb_distribution_names[]= {"KEYHASH", "LINHASH", NullS}; TYPELIB ndb_distribution_typelib= { array_elements(ndb_distribution_names)-1, "", ndb_distribution_names, NULL }; const char *opt_ndb_distribution= ndb_distribution_names[ND_KEYHASH]; enum ndb_distribution opt_ndb_distribution_id= ND_KEYHASH; #endif my_bool opt_readonly, use_temp_pool, relay_log_purge; my_bool opt_sync_frm, opt_allow_suspicious_udfs; Loading Loading @@ -4311,7 +4316,7 @@ enum options_mysqld OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, OPT_NDB_SHM, OPT_NDB_OPTIMIZED_NODE_SELECTION, OPT_NDB_CACHE_CHECK_TIME, OPT_NDB_MGMD, OPT_NDB_NODEID, OPT_NDB_LINEAR_HASH, OPT_NDB_DISTRIBUTION, OPT_SKIP_SAFEMALLOC, OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_COMPLETION_TYPE, OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS, Loading Loading @@ -4879,16 +4884,11 @@ Disable with --skip-ndbcluster (will save memory).", (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz, (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz, 0, GET_ULONG, REQUIRED_ARG, 32, 1, 256, 0, 0, 0}, {"ndb-use-linear-hash", OPT_NDB_LINEAR_HASH, "Flag to indicate whether to use linear hash for default in new tables", (gptr*) &opt_ndb_linear_hash, (gptr*) &opt_ndb_linear_hash, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"ndb_use_linear_hash", OPT_NDB_LINEAR_HASH, "Flag to indicate whether to use linear hash for default in new tables", (gptr*) &opt_ndb_linear_hash, (gptr*) &opt_ndb_linear_hash, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"ndb-distibution", OPT_NDB_DISTRIBUTION, "Default distribution for new tables in ndb", (gptr*) &opt_ndb_distribution, (gptr*) &opt_ndb_distribution, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ndb-force-send", OPT_NDB_FORCE_SEND, "Force send of buffers to ndb immediately without waiting for " "other threads.", Loading Loading @@ -6674,6 +6674,20 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt_ndb_constrbuf[opt_ndb_constrbuf_len]= 0; opt_ndbcluster_connectstring= opt_ndb_constrbuf; break; case OPT_NDB_DISTRIBUTION: int id; if ((id= find_type(argument, &ndb_distribution_typelib, 2)) <= 0) { fprintf(stderr, "Unknown ndb distribution type: '%s' " "(should be '%s' or '%s')\n", argument, ndb_distribution_names[ND_KEYHASH], ndb_distribution_names[ND_LINHASH]); exit(1); } opt_ndb_distribution_id= (enum ndb_distribution)(id-1); break; #endif case OPT_INNODB: #ifdef HAVE_INNOBASE_DB Loading Loading
sql/ha_ndbcluster.cc +10 −5 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ // options from from mysqld.cc extern my_bool opt_ndb_optimized_node_selection; extern my_bool opt_ndb_linear_hash; extern enum ndb_distribution opt_ndb_distribution_id; extern const char *opt_ndbcluster_connectstring; // Default value for parallelism Loading Loading @@ -7450,7 +7450,7 @@ uint ha_ndbcluster::set_up_partition_info(partition_info *part_info, static void ndb_set_fragmentation(NDBTAB &tab, TABLE *form, uint pk_length) { NDBTAB::FragmentType ftype; NDBTAB::FragmentType ftype= NDBTAB::DistrKeyHash; ushort node_group[MAX_PARTITIONS]; uint no_nodes= g_ndb_cluster_connection->no_db_nodes(), no_fragments, i; DBUG_ENTER("ndb_set_fragmentation"); Loading Loading @@ -7481,10 +7481,15 @@ static void ndb_set_fragmentation(NDBTAB &tab, TABLE *form, uint pk_length) node_group[0]= 0; for (i= 1; i < no_fragments; i++) node_group[i]= UNDEF_NODEGROUP; if (opt_ndb_linear_hash) ftype= NDBTAB::DistrKeyLin; else switch (opt_ndb_distribution_id) { case ND_KEYHASH: ftype= NDBTAB::DistrKeyHash; break; case ND_LINHASH: ftype= NDBTAB::DistrKeyLin; break; } tab.setFragmentType(ftype); tab.setNodeGroupIds(&node_group, no_fragments); DBUG_VOID_RETURN; Loading
sql/ha_ndbcluster.h +2 −0 Original line number Diff line number Diff line Loading @@ -113,6 +113,8 @@ struct negated_function_mapping NDB_FUNC_TYPE neg_fun; }; enum ndb_distribution { ND_KEYHASH= 0, ND_LINHASH= 1 }; /* Define what functions can be negated in condition pushdown. Note, these HAVE to be in the same order as in definition enum Loading
sql/mysqld.cc +26 −12 Original line number Diff line number Diff line Loading @@ -362,7 +362,12 @@ my_bool opt_ndb_shm, opt_ndb_optimized_node_selection; ulong opt_ndb_cache_check_time; const char *opt_ndb_mgmd; ulong opt_ndb_nodeid; bool opt_ndb_linear_hash; const char *ndb_distribution_names[]= {"KEYHASH", "LINHASH", NullS}; TYPELIB ndb_distribution_typelib= { array_elements(ndb_distribution_names)-1, "", ndb_distribution_names, NULL }; const char *opt_ndb_distribution= ndb_distribution_names[ND_KEYHASH]; enum ndb_distribution opt_ndb_distribution_id= ND_KEYHASH; #endif my_bool opt_readonly, use_temp_pool, relay_log_purge; my_bool opt_sync_frm, opt_allow_suspicious_udfs; Loading Loading @@ -4311,7 +4316,7 @@ enum options_mysqld OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, OPT_NDB_SHM, OPT_NDB_OPTIMIZED_NODE_SELECTION, OPT_NDB_CACHE_CHECK_TIME, OPT_NDB_MGMD, OPT_NDB_NODEID, OPT_NDB_LINEAR_HASH, OPT_NDB_DISTRIBUTION, OPT_SKIP_SAFEMALLOC, OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_COMPLETION_TYPE, OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS, Loading Loading @@ -4879,16 +4884,11 @@ Disable with --skip-ndbcluster (will save memory).", (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz, (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz, 0, GET_ULONG, REQUIRED_ARG, 32, 1, 256, 0, 0, 0}, {"ndb-use-linear-hash", OPT_NDB_LINEAR_HASH, "Flag to indicate whether to use linear hash for default in new tables", (gptr*) &opt_ndb_linear_hash, (gptr*) &opt_ndb_linear_hash, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"ndb_use_linear_hash", OPT_NDB_LINEAR_HASH, "Flag to indicate whether to use linear hash for default in new tables", (gptr*) &opt_ndb_linear_hash, (gptr*) &opt_ndb_linear_hash, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"ndb-distibution", OPT_NDB_DISTRIBUTION, "Default distribution for new tables in ndb", (gptr*) &opt_ndb_distribution, (gptr*) &opt_ndb_distribution, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ndb-force-send", OPT_NDB_FORCE_SEND, "Force send of buffers to ndb immediately without waiting for " "other threads.", Loading Loading @@ -6674,6 +6674,20 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt_ndb_constrbuf[opt_ndb_constrbuf_len]= 0; opt_ndbcluster_connectstring= opt_ndb_constrbuf; break; case OPT_NDB_DISTRIBUTION: int id; if ((id= find_type(argument, &ndb_distribution_typelib, 2)) <= 0) { fprintf(stderr, "Unknown ndb distribution type: '%s' " "(should be '%s' or '%s')\n", argument, ndb_distribution_names[ND_KEYHASH], ndb_distribution_names[ND_LINHASH]); exit(1); } opt_ndb_distribution_id= (enum ndb_distribution)(id-1); break; #endif case OPT_INNODB: #ifdef HAVE_INNOBASE_DB Loading