From 0b23966fe2b5f2147271b690e41f2e671f89d9fd Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 6 Apr 2010 20:36:06 +0200 Subject: [PATCH] fixes for builbot failures mysql-test/t/connect.test: replace the port correctly sql/set_var.cc: opensolaris gcc (or just an old gcc ?) does not like offsetof() as a case label. --- mysql-test/r/connect.result | 4 ++-- mysql-test/t/connect.test | 12 ++++++------ sql/set_var.cc | 18 ++++++------------ 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index 7ea5df82758..690a6fb3bc3 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -227,12 +227,12 @@ Connection on extra port 2 ok # ------------------------------------------------------------------ CREATE USER mysqltest_up1 IDENTIFIED VIA mysql_native_password using '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'; CREATE USER mysqltest_up2 IDENTIFIED VIA mysql_old_password using '09301740536db389'; -connect(localhost,mysqltest_up1,foo,test,13001,MASTER_SOCKET); +connect(localhost,mysqltest_up1,foo,test,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'mysqltest_up1'@'localhost' (using password: YES) select user(), current_user(); user() current_user() mysqltest_up1@localhost mysqltest_up1@% -connect(localhost,mysqltest_up2,newpw,test,13001,MASTER_SOCKET); +connect(localhost,mysqltest_up2,newpw,test,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'mysqltest_up2'@'localhost' (using password: YES) select user(), current_user(); user() current_user() diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test index 13008b67312..a8c8b659c3c 100644 --- a/mysql-test/t/connect.test +++ b/mysql-test/t/connect.test @@ -336,18 +336,18 @@ CREATE USER mysqltest_up2 IDENTIFIED VIA mysql_old_password using '09301740536db --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --error ER_ACCESS_DENIED_ERROR -connect(pcon1,localhost,mysqltest_up1,foo,,$MASTER_EXTRA_PORT,); - -connect(pcon2,localhost,mysqltest_up1,bar,,$MASTER_EXTRA_PORT,); +connect(pcon1,localhost,mysqltest_up1,foo,,$MASTER_MYPORT,); +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +connect(pcon2,localhost,mysqltest_up1,bar,,$MASTER_MYPORT,); connection pcon2; select user(), current_user(); disconnect pcon2; --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --error ER_ACCESS_DENIED_ERROR -connect(pcon3,localhost,mysqltest_up2,newpw,,$MASTER_EXTRA_PORT,); - -connect(pcon4,localhost,mysqltest_up2,oldpw,,$MASTER_EXTRA_PORT,); +connect(pcon3,localhost,mysqltest_up2,newpw,,$MASTER_MYPORT,); +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +connect(pcon4,localhost,mysqltest_up2,oldpw,,$MASTER_MYPORT,); connection pcon4; select user(), current_user(); disconnect pcon4; diff --git a/sql/set_var.cc b/sql/set_var.cc index e63c93f32ef..29c09554b2e 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2551,21 +2551,15 @@ bool sys_var_key_cache_long::update(THD *thd, set_var *var) pthread_mutex_unlock(&LOCK_global_system_variables); - switch (offset) { - - case offsetof(KEY_CACHE, param_block_size): + if (offset == offsetof(KEY_CACHE, param_block_size)) error= (bool) (ha_resize_key_cache(key_cache)); - break; - - case offsetof(KEY_CACHE, param_division_limit): - case offsetof(KEY_CACHE, param_age_threshold): + else + if (offset == offsetof(KEY_CACHE, param_division_limit) || + offset == offsetof(KEY_CACHE, param_age_threshold)) error= (bool) (ha_change_key_cache_param(key_cache)); - break; - - case offsetof(KEY_CACHE, param_partitions): + else + if (offset == offsetof(KEY_CACHE, param_partitions)) error= (bool) (ha_repartition_key_cache(key_cache)); - break; - } pthread_mutex_lock(&LOCK_global_system_variables); key_cache->in_init= 0;