Loading mysql-test/r/ndb_index_unique.result +9 −0 Original line number Diff line number Diff line Loading @@ -626,3 +626,12 @@ select * from t1 where code = '12' and month = 4 and year = 2004 ; id month year code 1 4 2004 12 drop table t1; create table t1 (a int primary key, b varchar(1000) not null, unique key (b)) engine=ndb charset=utf8; insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200)); insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200)); ERROR 23000: Duplicate entry '2' for key 1 select a, sha1(b) from t1; a sha1(b) 1 08f5d02c8b8bc244f275bdfc22c42c5cab0d9d7d drop table t1; mysql-test/t/ndb_index_unique.test +14 −0 Original line number Diff line number Diff line Loading @@ -309,4 +309,18 @@ select * from t1 where code = '12' and month = 4 and year = 2004 ; drop table t1; # bug#15918 Unique Key Limit in NDB Engine create table t1 (a int primary key, b varchar(1000) not null, unique key (b)) engine=ndb charset=utf8; insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200)); --error 1062 insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200)); select a, sha1(b) from t1; # perl -e 'print pack("H2000","e288ab6474"x200)' | sha1sum drop table t1; # End of 4.1 tests ndb/src/kernel/blocks/dbacc/Dbacc.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -1446,7 +1446,7 @@ private: Uint32 cexcPrevforward; Uint32 clocalkey[32]; union { Uint32 ckeys[2048]; Uint32 ckeys[2048 * MAX_XFRM_MULTIPLY]; Uint64 ckeys_align; }; Loading ndb/src/kernel/main.cpp +15 −9 Original line number Diff line number Diff line Loading @@ -63,8 +63,10 @@ extern "C" void handler_sigusr1(int signum); // child signalling failed restart void systemInfo(const Configuration & conf, const LogLevel & ll); static FILE *child_info_file_r= 0; static FILE *child_info_file_w= 0; // These are used already before fork if fetch_configuration() fails // (e.g. Unable to alloc node id). Set them to something reasonable. static FILE *child_info_file_r= stdin; static FILE *child_info_file_w= stdout; static void writeChildInfo(const char *token, int val) { Loading Loading @@ -270,8 +272,8 @@ int main(int argc, char** argv) #ifndef NDB_WIN32 signal(SIGUSR1, handler_sigusr1); pid_t child; while (1) pid_t child = -1; while (! theConfig->getForegroundMode()) // the cond is const { // setup reporting between child and parent int filedes[2]; Loading Loading @@ -393,8 +395,10 @@ int main(int argc, char** argv) if (child >= 0) g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); else else if (child > 0) g_eventLogger.info("Ndb pid: %d", getpid()); else g_eventLogger.info("Ndb started in foreground"); #else g_eventLogger.info("Ndb started"); #endif Loading Loading @@ -569,10 +573,7 @@ catchsigs(bool ignore){ #ifdef SIGPOLL SIGPOLL, #endif SIGSEGV, #ifdef SIGTRAP SIGTRAP #endif SIGSEGV }; static const int signals_ignore[] = { Loading @@ -586,6 +587,11 @@ catchsigs(bool ignore){ handler_register(signals_error[i], handler_error, ignore); for(i = 0; i < sizeof(signals_ignore)/sizeof(signals_ignore[0]); i++) handler_register(signals_ignore[i], SIG_IGN, ignore); #ifdef SIGTRAP Configuration* theConfig = globalEmulatorData.theConfiguration; if (! theConfig->getForegroundMode()) handler_register(SIGTRAP, handler_error, ignore); #endif #endif } Loading ndb/src/kernel/vm/Configuration.cpp +14 −3 Original line number Diff line number Diff line Loading @@ -48,11 +48,13 @@ extern EventLogger g_eventLogger; enum ndbd_options { OPT_INITIAL = NDB_STD_OPTIONS_LAST, OPT_NODAEMON OPT_NODAEMON, OPT_FOREGROUND }; NDB_STD_OPTS_VARS; static int _daemon, _no_daemon, _initial, _no_start; // XXX should be my_bool ??? static int _daemon, _no_daemon, _foreground, _initial, _no_start; /** * Arguments to NDB process */ Loading @@ -75,6 +77,11 @@ static struct my_option my_long_options[] = "Do not start ndbd as daemon, provided for testing purposes", (gptr*) &_no_daemon, (gptr*) &_no_daemon, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, { "foreground", OPT_FOREGROUND, "Run real ndbd in foreground, provided for debugging purposes" " (implies --nodaemon)", (gptr*) &_foreground, (gptr*) &_foreground, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; static void short_usage_sub(void) Loading Loading @@ -103,13 +110,14 @@ Configuration::init(int argc, char** argv) ndb_std_get_one_option))) exit(ho_error); if (_no_daemon) { if (_no_daemon || _foreground) { _daemon= 0; } DBUG_PRINT("info", ("no_start=%d", _no_start)); DBUG_PRINT("info", ("initial=%d", _initial)); DBUG_PRINT("info", ("daemon=%d", _daemon)); DBUG_PRINT("info", ("foreground=%d", _foreground)); DBUG_PRINT("info", ("connect_str=%s", opt_connect_str)); ndbSetOwnVersion(); Loading @@ -131,6 +139,8 @@ Configuration::init(int argc, char** argv) // Check daemon flag if (_daemon) _daemonMode = true; if (_foreground) _foregroundMode = true; // Save programname if(argc > 0 && argv[0] != 0) Loading @@ -151,6 +161,7 @@ Configuration::Configuration() _backupPath = 0; _initialStart = false; _daemonMode = false; _foregroundMode = false; m_config_retriever= 0; m_clusterConfig= 0; m_clusterConfigIter= 0; Loading Loading
mysql-test/r/ndb_index_unique.result +9 −0 Original line number Diff line number Diff line Loading @@ -626,3 +626,12 @@ select * from t1 where code = '12' and month = 4 and year = 2004 ; id month year code 1 4 2004 12 drop table t1; create table t1 (a int primary key, b varchar(1000) not null, unique key (b)) engine=ndb charset=utf8; insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200)); insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200)); ERROR 23000: Duplicate entry '2' for key 1 select a, sha1(b) from t1; a sha1(b) 1 08f5d02c8b8bc244f275bdfc22c42c5cab0d9d7d drop table t1;
mysql-test/t/ndb_index_unique.test +14 −0 Original line number Diff line number Diff line Loading @@ -309,4 +309,18 @@ select * from t1 where code = '12' and month = 4 and year = 2004 ; drop table t1; # bug#15918 Unique Key Limit in NDB Engine create table t1 (a int primary key, b varchar(1000) not null, unique key (b)) engine=ndb charset=utf8; insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200)); --error 1062 insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200)); select a, sha1(b) from t1; # perl -e 'print pack("H2000","e288ab6474"x200)' | sha1sum drop table t1; # End of 4.1 tests
ndb/src/kernel/blocks/dbacc/Dbacc.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -1446,7 +1446,7 @@ private: Uint32 cexcPrevforward; Uint32 clocalkey[32]; union { Uint32 ckeys[2048]; Uint32 ckeys[2048 * MAX_XFRM_MULTIPLY]; Uint64 ckeys_align; }; Loading
ndb/src/kernel/main.cpp +15 −9 Original line number Diff line number Diff line Loading @@ -63,8 +63,10 @@ extern "C" void handler_sigusr1(int signum); // child signalling failed restart void systemInfo(const Configuration & conf, const LogLevel & ll); static FILE *child_info_file_r= 0; static FILE *child_info_file_w= 0; // These are used already before fork if fetch_configuration() fails // (e.g. Unable to alloc node id). Set them to something reasonable. static FILE *child_info_file_r= stdin; static FILE *child_info_file_w= stdout; static void writeChildInfo(const char *token, int val) { Loading Loading @@ -270,8 +272,8 @@ int main(int argc, char** argv) #ifndef NDB_WIN32 signal(SIGUSR1, handler_sigusr1); pid_t child; while (1) pid_t child = -1; while (! theConfig->getForegroundMode()) // the cond is const { // setup reporting between child and parent int filedes[2]; Loading Loading @@ -393,8 +395,10 @@ int main(int argc, char** argv) if (child >= 0) g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); else else if (child > 0) g_eventLogger.info("Ndb pid: %d", getpid()); else g_eventLogger.info("Ndb started in foreground"); #else g_eventLogger.info("Ndb started"); #endif Loading Loading @@ -569,10 +573,7 @@ catchsigs(bool ignore){ #ifdef SIGPOLL SIGPOLL, #endif SIGSEGV, #ifdef SIGTRAP SIGTRAP #endif SIGSEGV }; static const int signals_ignore[] = { Loading @@ -586,6 +587,11 @@ catchsigs(bool ignore){ handler_register(signals_error[i], handler_error, ignore); for(i = 0; i < sizeof(signals_ignore)/sizeof(signals_ignore[0]); i++) handler_register(signals_ignore[i], SIG_IGN, ignore); #ifdef SIGTRAP Configuration* theConfig = globalEmulatorData.theConfiguration; if (! theConfig->getForegroundMode()) handler_register(SIGTRAP, handler_error, ignore); #endif #endif } Loading
ndb/src/kernel/vm/Configuration.cpp +14 −3 Original line number Diff line number Diff line Loading @@ -48,11 +48,13 @@ extern EventLogger g_eventLogger; enum ndbd_options { OPT_INITIAL = NDB_STD_OPTIONS_LAST, OPT_NODAEMON OPT_NODAEMON, OPT_FOREGROUND }; NDB_STD_OPTS_VARS; static int _daemon, _no_daemon, _initial, _no_start; // XXX should be my_bool ??? static int _daemon, _no_daemon, _foreground, _initial, _no_start; /** * Arguments to NDB process */ Loading @@ -75,6 +77,11 @@ static struct my_option my_long_options[] = "Do not start ndbd as daemon, provided for testing purposes", (gptr*) &_no_daemon, (gptr*) &_no_daemon, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, { "foreground", OPT_FOREGROUND, "Run real ndbd in foreground, provided for debugging purposes" " (implies --nodaemon)", (gptr*) &_foreground, (gptr*) &_foreground, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; static void short_usage_sub(void) Loading Loading @@ -103,13 +110,14 @@ Configuration::init(int argc, char** argv) ndb_std_get_one_option))) exit(ho_error); if (_no_daemon) { if (_no_daemon || _foreground) { _daemon= 0; } DBUG_PRINT("info", ("no_start=%d", _no_start)); DBUG_PRINT("info", ("initial=%d", _initial)); DBUG_PRINT("info", ("daemon=%d", _daemon)); DBUG_PRINT("info", ("foreground=%d", _foreground)); DBUG_PRINT("info", ("connect_str=%s", opt_connect_str)); ndbSetOwnVersion(); Loading @@ -131,6 +139,8 @@ Configuration::init(int argc, char** argv) // Check daemon flag if (_daemon) _daemonMode = true; if (_foreground) _foregroundMode = true; // Save programname if(argc > 0 && argv[0] != 0) Loading @@ -151,6 +161,7 @@ Configuration::Configuration() _backupPath = 0; _initialStart = false; _daemonMode = false; _foregroundMode = false; m_config_retriever= 0; m_clusterConfig= 0; m_clusterConfigIter= 0; Loading