summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-07-16 16:10:42 +0400
committerunknown <konstantin@mysql.com>2005-07-16 16:10:42 +0400
commit7bdc4dd0a1fb5f4140aeb00a3e6582395fd9a516 (patch)
treeea1197200b27da47e112efb6409727341fd75e87
parent40efb3622d9666ff23edee23678acd0b3e024476 (diff)
downloadmariadb-git-7bdc4dd0a1fb5f4140aeb00a3e6582395fd9a516.tar.gz
After-merge fixes (4.1 -> 5.0).
mysql-test/r/sp.result: Test results fixed: rewritten test for Bug#6129 mysql-test/r/view.result: Push a change to the result file from Sanja's patch. mysql-test/t/sp.test: Rewrite the test for Bug#6129 (now that stored procedures don't evaluate system variables at parse, the test produced different results). The old test failed with 1 in the second invocation (the old result was wrong). sql/item_func.cc: After-merge fix. sql/item_func.h: After-merge fix. sql/mysql_priv.h: After-merge fix. sql/mysqld.cc: Rollback the patch for Bug#7403 (it breaks the test suite).
-rw-r--r--mysql-test/r/sp.result26
-rw-r--r--mysql-test/r/view.result2
-rw-r--r--mysql-test/t/sp.test19
-rw-r--r--sql/item_func.cc2
-rw-r--r--sql/item_func.h6
-rw-r--r--sql/mysql_priv.h2
-rw-r--r--sql/mysqld.cc8
7 files changed, 34 insertions, 31 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 158dd9bb949..fd63204e32f 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -2657,16 +2657,22 @@ end|
call avg ()|
drop procedure avg|
drop procedure if exists bug6129|
-set @@sql_mode = 'traditional'|
-create procedure bug6129(mode text)
-select @@sql_mode = mode|
-call bug6129(@@sql_mode)|
-@@sql_mode = mode
-1
-set @@sql_mode = ''|
-call bug6129(@@sql_mode)|
-@@sql_mode = mode
-0
+set @old_mode= @@sql_mode;
+set @@sql_mode= "";
+create procedure bug6129()
+select @@sql_mode|
+call bug6129()|
+@@sql_mode
+
+set @@sql_mode= "NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO"|
+call bug6129()|
+@@sql_mode
+NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO
+set @@sql_mode= "NO_ZERO_IN_DATE"|
+call bug6129()|
+@@sql_mode
+NO_ZERO_IN_DATE
+set @@sql_mode=@old_mode;
drop procedure bug6129|
drop procedure if exists bug9856|
create procedure bug9856()
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index e7bc3a1bb1f..a132279c6bc 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -1836,7 +1836,7 @@ create table t2 (b timestamp default now());
create view v1 as select a,b,t1.a < now() from t1,t2 where t1.a < now();
SHOW CREATE VIEW v1;
View Create View
-v1 CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select sql_no_cache `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b`,(`test`.`t1`.`a` < now()) AS `t1.a < now()` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` < now())
+v1 CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select sql_no_cache `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b`,(`test`.`t1`.`a` < now()) AS `t1.a < now()` from (`test`.`t1` join `test`.`t2`) where (`test`.`t1`.`a` < now())
drop view v1;
drop table t1, t2;
CREATE TABLE t1 ( a varchar(50) );
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 209386fcba4..d9e6163cbc7 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -3377,15 +3377,16 @@ drop procedure avg|
--disable_warnings
drop procedure if exists bug6129|
--enable_warnings
-set @@sql_mode = 'traditional'|
-create procedure bug6129(mode text)
- select @@sql_mode = mode|
-
-# 1
-call bug6129(@@sql_mode)|
-set @@sql_mode = ''|
-# 0
-call bug6129(@@sql_mode)|
+set @old_mode= @@sql_mode;
+set @@sql_mode= "";
+create procedure bug6129()
+ select @@sql_mode|
+call bug6129()|
+set @@sql_mode= "NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO"|
+call bug6129()|
+set @@sql_mode= "NO_ZERO_IN_DATE"|
+call bug6129()|
+set @@sql_mode=@old_mode;
drop procedure bug6129|
diff --git a/sql/item_func.cc b/sql/item_func.cc
index faf73536eb6..c3bdb11418f 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4229,7 +4229,7 @@ Item_func_get_system_var(sys_var *var_arg, enum_var_type var_type_arg,
bool
-Item_func_get_system_var::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
+Item_func_get_system_var::fix_fields(THD *thd, Item **ref)
{
Item *item= var->item(thd, var_type, &component);
DBUG_ENTER("Item_func_get_system_var::fix_fields");
diff --git a/sql/item_func.h b/sql/item_func.h
index b8638161787..43a85e6aa0b 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -1210,15 +1210,17 @@ public:
Item_func_get_system_var(sys_var *var_arg, enum_var_type var_type_arg,
LEX_STRING *component_arg, const char *name_arg,
size_t name_len_arg);
- bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref);
+ bool fix_fields(THD *thd, Item **ref);
/*
Stubs for pure virtual methods. Should never be called: this
item is always substituted with a constant in fix_fields().
*/
- double val() { DBUG_ASSERT(0); return 0.0; }
+ double val_real() { DBUG_ASSERT(0); return 0.0; }
longlong val_int() { DBUG_ASSERT(0); return 0; }
String* val_str(String*) { DBUG_ASSERT(0); return 0; }
void fix_length_and_dec() { DBUG_ASSERT(0); }
+ /* TODO: fix to support views */
+ const char *func_name() const { return "get_system_var"; }
};
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index b7d5098e230..49eb50be580 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -477,7 +477,7 @@ typedef my_bool (*qc_engine_callback)(THD *thd, char *table_key,
class user_var_entry;
enum enum_var_type
{
- OPT_DEFAULT, OPT_SESSION, OPT_GLOBAL
+ OPT_DEFAULT= 0, OPT_SESSION, OPT_GLOBAL
};
class sys_var;
#include "item.h"
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index a9a81b47cda..78d9af387da 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -685,13 +685,7 @@ static void close_connections(void)
{
DBUG_PRINT("quit",("Informing thread %ld that it's time to die",
tmp->thread_id));
- /*
- Re: bug 7403 - close_connection will be called mulitple times
- bug a wholesale clean up of our network code is a very large
- project. This will wake up the socket on Windows and prevent the
- printing of the error message that we are force closing a connection.
- */
- close_connection(tmp, 0, 1);
+ tmp->killed= THD::KILL_CONNECTION;
if (tmp->mysys_var)
{
tmp->mysys_var->abort=1;