Commit a500865c authored by Nirbhay Choubey's avatar Nirbhay Choubey

Merged revision 3471, 3472 & 3473 from maria-5.5-galera.

parent 43c6c2ac
......@@ -98,6 +98,11 @@ static struct my_option my_long_options[] =
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
void cleanup_and_exit(int exit_code)
{
my_end(0);
exit(exit_code);
}
static void usage(my_bool version)
{
......@@ -112,7 +117,7 @@ static void usage(my_bool version)
my_print_default_files(config_file);
my_print_variables(my_long_options);
printf("\nExample usage:\n%s --defaults-file=example.cnf client client-server mysql\n", my_progname);
exit(0);
cleanup_and_exit(0);
}
......@@ -125,7 +130,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_defaults_file_used= 1;
break;
case 'n':
exit(0);
cleanup_and_exit(0);
case 'I':
case '?':
usage(0);
......@@ -174,7 +179,7 @@ int main(int argc, char **argv)
/* Check out the args */
if (get_options(&argc,&argv))
exit(1);
cleanup_and_exit(1);
nargs= argc + 1;
if (opt_mysqld)
......
#
# MDEV#5552 Deadlock when inserting NULL column value in column with
# UNIQUE index
#
USE test;
# On node_1
CREATE TABLE t1(c1 INT DEFAULT NULL, UNIQUE KEY c1(c1)) ENGINE=INNODB;
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM test.t1;
c1
NULL
NULL
# On node_2
SELECT * FROM test.t1;
c1
NULL
NULL
# On node_1
INSERT INTO t1 VALUES (1);
UPDATE t1 SET c1=NULL WHERE c1=1;
SELECT * FROM test.t1;
c1
NULL
NULL
NULL
# On node_2
SELECT * FROM test.t1;
c1
NULL
NULL
NULL
# On node_1
DELETE FROM t1 WHERE c1<=>NULL;
SELECT * FROM test.t1;
c1
# On node_2
SELECT * FROM test.t1;
c1
DROP TABLE t1;
# End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--echo #
--echo # MDEV#5552 Deadlock when inserting NULL column value in column with
--echo # UNIQUE index
--echo #
USE test;
--echo
--echo # On node_1
--connection node_1
CREATE TABLE t1(c1 INT DEFAULT NULL, UNIQUE KEY c1(c1)) ENGINE=INNODB;
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM test.t1;
--echo
--echo # On node_2
--connection node_2
SELECT * FROM test.t1;
--echo
--echo # On node_1
--connection node_1
INSERT INTO t1 VALUES (1);
UPDATE t1 SET c1=NULL WHERE c1=1;
SELECT * FROM test.t1;
--echo
--echo # On node_2
--connection node_2
SELECT * FROM test.t1;
--echo
--echo # On node_1
--connection node_1
DELETE FROM t1 WHERE c1<=>NULL;
SELECT * FROM test.t1;
--echo
--echo # On node_2
--connection node_2
SELECT * FROM test.t1;
--let $galera_diff_statement = SELECT * FROM t1
--source include/galera_diff.inc
# Cleanup
DROP TABLE t1;
--source include/galera_end.inc
--echo # End of test
#
# MDEV#5687: Maria doesn't shutdown following upgrade to 5.5.35-galera
#
SELECT @@GLOBAL.thread_handling;
@@GLOBAL.thread_handling
pool-of-threads
# End of test.
--binlog-format=row --innodb_autoinc_lock_mode=2 --innodb_locks_unsafe_for_binlog=1 --wsrep-provider=/usr/lib/galera/libgalera_smm.so --wsrep-cluster-address=gcomm:// --thread_handling=pool-of-threads
--source include/have_wsrep.inc
--echo
--echo #
--echo # MDEV#5687: Maria doesn't shutdown following upgrade to 5.5.35-galera
--echo #
# Note: This test is to ensure that server shuts down properly.
SELECT @@GLOBAL.thread_handling;
--echo # End of test.
......@@ -2045,6 +2045,10 @@ extern "C" void unireg_abort(int exit_code)
wsrep_close_threads(thd); /* this won't close all threads */
sleep(1); /* so give some time to exit for those which can */
WSREP_INFO("Some threads may fail to exit.");
/* In bootstrap mode we deinitialize wsrep here. */
if (opt_bootstrap && wsrep_inited)
wsrep_deinit();
}
#endif // WITH_WSREP
clean_up(!opt_abort && (exit_code || !opt_bootstrap)); /* purecov: inspected */
......@@ -5323,6 +5327,7 @@ pthread_handler_t start_wsrep_THD(void *arg)
// at server shutdown
}
my_thread_end();
if (thread_handling > SCHEDULER_ONE_THREAD_PER_CONNECTION)
{
mysql_mutex_lock(&LOCK_thread_count);
......
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