diff options
author | He Zhenxing <zhenxing.he@sun.com> | 2009-10-27 18:28:40 +0800 |
---|---|---|
committer | He Zhenxing <zhenxing.he@sun.com> | 2009-10-27 18:28:40 +0800 |
commit | 39f7da882e2a90e8d5eb3f49c4ba361f2b631ad9 (patch) | |
tree | 5a0ea6cc4d718179a71ee314d46ead16e973450a /mysql-test | |
parent | 871bc4bd64efc4d94280cfab91525d54710869e5 (diff) | |
parent | ce912c8ccf12d9a1c71e8adafb0e2c544bdc2efc (diff) | |
download | mariadb-git-39f7da882e2a90e8d5eb3f49c4ba361f2b631ad9.tar.gz |
Auto merge from 5.1-rep+2-delivery1
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/include/have_semisync_plugin.inc | 7 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 52 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_semi_sync.result | 4 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_semi_sync.test | 11 |
4 files changed, 48 insertions, 26 deletions
diff --git a/mysql-test/include/have_semisync_plugin.inc b/mysql-test/include/have_semisync_plugin.inc index 38e2fcd6115..37c9a744b6a 100644 --- a/mysql-test/include/have_semisync_plugin.inc +++ b/mysql-test/include/have_semisync_plugin.inc @@ -13,3 +13,10 @@ if (`select LENGTH('$SEMISYNC_MASTER_PLUGIN') = 0`) { skip Need semisync plugins; } + +# +# Check if --plugin-dir was setup for semisync +# +if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$SEMISYNC_PLUGIN_OPT'`) { + --skip SEMISYNC plugin requires that --plugin-dir is set to the semisync plugin dir (either the .opt file does not contain \$SEMISYNC_PLUGIN_OPT or another plugin is in use) +} diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 1c14104957d..6f3822cfd85 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1818,25 +1818,39 @@ sub environment_setup { # -------------------------------------------------------------------------- # Add the path where mysqld will find semisync plugins # -------------------------------------------------------------------------- - my $lib_semisync_master_plugin= - mtr_file_exists(vs_config_dirs('plugin/semisync',"libsemisync_master.so"), - "$basedir/plugin/semisync/.libs/libsemisync_master.so", - "$basedir/lib/mysql/plugin/libsemisync_master.so"); - my $lib_semisync_slave_plugin= - mtr_file_exists(vs_config_dirs('plugin/semisync',"libsemisync_slave.so"), - "$basedir/plugin/semisync/.libs/libsemisync_slave.so", - "$basedir/lib/mysql/plugin/libsemisync_slave.so"); - if ($lib_semisync_master_plugin && $lib_semisync_slave_plugin) - { - $ENV{'SEMISYNC_MASTER_PLUGIN'}= basename($lib_semisync_master_plugin); - $ENV{'SEMISYNC_SLAVE_PLUGIN'}= basename($lib_semisync_slave_plugin); - $ENV{'SEMISYNC_PLUGIN_OPT'}= "--plugin-dir=".dirname($lib_semisync_master_plugin); - } - else - { - $ENV{'SEMISYNC_MASTER_PLUGIN'}= ""; - $ENV{'SEMISYNC_SLAVE_PLUGIN'}= ""; - $ENV{'SEMISYNC_PLUGIN_OPT'}="--plugin-dir="; + if (!$opt_embedded_server) { + my $semisync_master_filename; + my $semisync_slave_filename; + if (IS_WINDOWS) + { + $semisync_master_filename = "semisync_master.dll"; + $semisync_slave_filename = "semisync_slave.dll"; + } + else + { + $semisync_master_filename = "libsemisync_master.so"; + $semisync_slave_filename = "libsemisync_slave.so"; + } + my $lib_semisync_master_plugin= + mtr_file_exists(vs_config_dirs('plugin/semisync',$semisync_master_filename), + "$basedir/plugin/semisync/.libs/" . $semisync_master_filename, + "$basedir/lib/mysql/plugin/" . $semisync_master_filename); + my $lib_semisync_slave_plugin= + mtr_file_exists(vs_config_dirs('plugin/semisync',$semisync_slave_filename), + "$basedir/plugin/semisync/.libs/" . $semisync_slave_filename, + "$basedir/lib/mysql/plugin/" . $semisync_slave_filename); + if ($lib_semisync_master_plugin && $lib_semisync_slave_plugin) + { + $ENV{'SEMISYNC_MASTER_PLUGIN'}= basename($lib_semisync_master_plugin); + $ENV{'SEMISYNC_SLAVE_PLUGIN'}= basename($lib_semisync_slave_plugin); + $ENV{'SEMISYNC_PLUGIN_OPT'}= "--plugin-dir=".dirname($lib_semisync_master_plugin); + } + else + { + $ENV{'SEMISYNC_MASTER_PLUGIN'}= ""; + $ENV{'SEMISYNC_SLAVE_PLUGIN'}= ""; + $ENV{'SEMISYNC_PLUGIN_OPT'}="--plugin-dir="; + } } # ---------------------------------------------------- diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result index 607b77fbd04..1e220b28d78 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result @@ -397,7 +397,7 @@ Rpl_semi_sync_slave_status OFF # Test non-semi-sync slave connect to semi-sync master # set sql_log_bin=0; -INSTALL PLUGIN rpl_semi_sync_master SONAME 'libsemisync_master.so'; +INSTALL PLUGIN rpl_semi_sync_master SONAME 'SEMISYNC_MASTER_PLUGIN'; set global rpl_semi_sync_master_timeout= 5000; /* 5s */ set sql_log_bin=1; @@ -416,7 +416,7 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; Variable_name Value include/stop_slave.inc [ reinstall semi-sync slave plugin and disable semi-sync ] -INSTALL PLUGIN rpl_semi_sync_slave SONAME 'libsemisync_slave.so'; +INSTALL PLUGIN rpl_semi_sync_slave SONAME 'SEMISYNC_SLAVE_PLUGIN'; set global rpl_semi_sync_slave_enabled= 0; SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled'; Variable_name Value diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test index faf961bb580..4900acc1e91 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test @@ -1,6 +1,5 @@ source include/have_semisync_plugin.inc; source include/not_embedded.inc; -source include/not_windows.inc; source include/have_innodb.inc; source include/master-slave.inc; @@ -61,7 +60,7 @@ let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', if (`select '$value' = 'No such row'`) { set sql_log_bin=0; - INSTALL PLUGIN rpl_semi_sync_master SONAME 'libsemisync_master.so'; + eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; set global rpl_semi_sync_master_timeout= 5000; /* 5s */ set sql_log_bin=1; } @@ -126,7 +125,7 @@ let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', V if (`select '$value' = 'No such row'`) { set sql_log_bin=0; - INSTALL PLUGIN rpl_semi_sync_slave SONAME 'libsemisync_slave.so'; + eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN'; set sql_log_bin=1; } enable_query_log; @@ -536,7 +535,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; connection master; set sql_log_bin=0; -INSTALL PLUGIN rpl_semi_sync_master SONAME 'libsemisync_master.so'; +replace_result $SEMISYNC_MASTER_PLUGIN SEMISYNC_MASTER_PLUGIN; +eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; set global rpl_semi_sync_master_timeout= 5000; /* 5s */ set sql_log_bin=1; set global rpl_semi_sync_master_enabled= 1; @@ -554,7 +554,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; source include/stop_slave.inc; echo [ reinstall semi-sync slave plugin and disable semi-sync ]; -INSTALL PLUGIN rpl_semi_sync_slave SONAME 'libsemisync_slave.so'; +replace_result $SEMISYNC_SLAVE_PLUGIN SEMISYNC_SLAVE_PLUGIN; +eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN'; set global rpl_semi_sync_slave_enabled= 0; SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled'; SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; |