Merged revision 3471, 3472 & 3473 from maria-5.5-galera.
This commit is contained in:
parent
43c6c2ac77
commit
a500865c13
@ -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}
|
{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)
|
static void usage(my_bool version)
|
||||||
{
|
{
|
||||||
@ -112,7 +117,7 @@ static void usage(my_bool version)
|
|||||||
my_print_default_files(config_file);
|
my_print_default_files(config_file);
|
||||||
my_print_variables(my_long_options);
|
my_print_variables(my_long_options);
|
||||||
printf("\nExample usage:\n%s --defaults-file=example.cnf client client-server mysql\n", my_progname);
|
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;
|
opt_defaults_file_used= 1;
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
exit(0);
|
cleanup_and_exit(0);
|
||||||
case 'I':
|
case 'I':
|
||||||
case '?':
|
case '?':
|
||||||
usage(0);
|
usage(0);
|
||||||
@ -174,7 +179,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* Check out the args */
|
/* Check out the args */
|
||||||
if (get_options(&argc,&argv))
|
if (get_options(&argc,&argv))
|
||||||
exit(1);
|
cleanup_and_exit(1);
|
||||||
|
|
||||||
nargs= argc + 1;
|
nargs= argc + 1;
|
||||||
if (opt_mysqld)
|
if (opt_mysqld)
|
||||||
|
47
mysql-test/suite/galera/r/unique_key.result
Normal file
47
mysql-test/suite/galera/r/unique_key.result
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
#
|
||||||
|
# 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
|
54
mysql-test/suite/galera/t/unique_key.test
Normal file
54
mysql-test/suite/galera/t/unique_key.test
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
--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
|
8
mysql-test/suite/wsrep/r/pool_of_threads.result
Normal file
8
mysql-test/suite/wsrep/r/pool_of_threads.result
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
#
|
||||||
|
# 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.
|
1
mysql-test/suite/wsrep/t/pool_of_threads.opt
Normal file
1
mysql-test/suite/wsrep/t/pool_of_threads.opt
Normal file
@ -0,0 +1 @@
|
|||||||
|
--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
|
11
mysql-test/suite/wsrep/t/pool_of_threads.test
Normal file
11
mysql-test/suite/wsrep/t/pool_of_threads.test
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--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 */
|
wsrep_close_threads(thd); /* this won't close all threads */
|
||||||
sleep(1); /* so give some time to exit for those which can */
|
sleep(1); /* so give some time to exit for those which can */
|
||||||
WSREP_INFO("Some threads may fail to exit.");
|
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
|
#endif // WITH_WSREP
|
||||||
clean_up(!opt_abort && (exit_code || !opt_bootstrap)); /* purecov: inspected */
|
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
|
// at server shutdown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my_thread_end();
|
||||||
if (thread_handling > SCHEDULER_ONE_THREAD_PER_CONNECTION)
|
if (thread_handling > SCHEDULER_ONE_THREAD_PER_CONNECTION)
|
||||||
{
|
{
|
||||||
mysql_mutex_lock(&LOCK_thread_count);
|
mysql_mutex_lock(&LOCK_thread_count);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user