From 478d4021171f23df8483f971bc1c3caa975c9831 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Feb 2004 12:30:20 +0400 Subject: [PATCH 1/3] Fix for bug#2021: Wron error message from the client BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + libmysql/libmysql.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 777c590ce62..b91c6519e48 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -5,6 +5,7 @@ bar@bar.mysql.r18.ru bar@bar.udmsearch.izhnet.ru bell@sanja.is.com.ua bk@admin.bk +gluh@gluh.mysql.r18.ru greg@gcw.ath.cx greg@mysql.com guilhem@mysql.com diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index c50193c5e2c..eff8c87ee3f 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -438,11 +438,7 @@ simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg, if (mysql->net.vio == 0) { /* Do reconnect if possible */ if (mysql_reconnect(mysql)) - { - net->last_errno=CR_SERVER_GONE_ERROR; - strmov(net->last_error,ER(net->last_errno)); goto end; - } } if (mysql->status != MYSQL_STATUS_READY) { @@ -1610,6 +1606,8 @@ static my_bool mysql_reconnect(MYSQL *mysql) { /* Allov reconnect next time */ mysql->server_status&= ~SERVER_STATUS_IN_TRANS; + mysql->net.last_errno= CR_SERVER_GONE_ERROR; + strmov(mysql->net.last_error, ER(mysql->net.last_errno)); DBUG_RETURN(1); } mysql_init(&tmp_mysql); From ca9f94190d749c57ce383416d24a1e95ebb29fb8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Feb 2004 18:58:15 +0400 Subject: [PATCH 2/3] fixed bug #2762 "grammar error in myisam/mi_check.c" --- myisam/mi_check.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 89fcfe74cea..e6fe2aa706e 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -115,7 +115,9 @@ int chk_status(MI_CHECK *param, register MI_INFO *info) /* Don't count this as a real warning, as check can correct this ! */ uint save=param->warning_printed; mi_check_print_warning(param, - "%d clients is using or hasn't closed the table properly", + share->state.open_count==1 ? + "%d client is using or hasn't closed the table properly" : + "%d clients are using or haven't closed the table properly", share->state.open_count); /* If this will be fixed by the check, forget the warning */ if (param->testflag & T_UPDATE_STATE) From bc9de3d4552f2294bad973d0b9fbe07de3d07c1d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Mar 2004 22:11:33 +0400 Subject: [PATCH 3/3] fixed Bug #3051 "FLOOR returns invalid" mysql-test/r/func_math.result: added test for Bug #3051 "FLOOR returns invalid" mysql-test/t/func_math.test: added test for Bug #3051 "FLOOR returns invalid" --- mysql-test/r/func_math.result | 6 ++++++ mysql-test/t/func_math.test | 8 ++++++++ sql/item_func.cc | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 5e774fe9886..e183b479a6c 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -32,3 +32,9 @@ ASIN(0.8+0.2) 1.570796 ASIN(1.2-0.2) 1.570796 +floor(log(4)/log(2)) +2 +floor(log(8)/log(2)) +3 +floor(log(16)/log(2)) +4 diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 42ba8c73f69..c39c966547b 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -24,3 +24,11 @@ SELECT ACOS(0.2*5.0); SELECT ACOS(0.5*2.0); SELECT ASIN(0.8+0.2); SELECT ASIN(1.2-0.2); + +# +# Bug #3051 FLOOR returns invalid +# + +select floor(log(4)/log(2)); +select floor(log(8)/log(2)); +select floor(log(16)/log(2)); diff --git a/sql/item_func.cc b/sql/item_func.cc index 037f7861630..dcd4e4a020c 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -572,7 +572,8 @@ longlong Item_func_ceiling::val_int() longlong Item_func_floor::val_int() { - double value=args[0]->val(); + // the volatile's for BUG #3051 to calm optimizer down (because of gcc's bug) + volatile double value=args[0]->val(); null_value=args[0]->null_value; return (longlong) floor(value); }