null.result, null.test:

   Fix for a bug #2219, regarding a bad cast to integer from NULL
item_func.h:
  Fix for a bug #2219, regarding a bad cast to integer from NULL
sql_parse.cc:
  A fix for a bug #2207, with mysql server haning on option setting
parent 37467ebe
...@@ -153,3 +153,6 @@ explain select * from t1 where a between 2 and 3 or b is null; ...@@ -153,3 +153,6 @@ explain select * from t1 where a between 2 and 3 or b is null;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 4 NULL 2 Using where 1 SIMPLE t1 range idx idx 4 NULL 2 Using where
drop table t1; drop table t1;
select cast(NULL as signed);
cast(NULL as signed)
NULL
...@@ -97,3 +97,4 @@ insert into t1 values ...@@ -97,3 +97,4 @@ insert into t1 values
explain select * from t1 where a between 2 and 3; explain select * from t1 where a between 2 and 3;
explain select * from t1 where a between 2 and 3 or b is null; explain select * from t1 where a between 2 and 3 or b is null;
drop table t1; drop table t1;
select cast(NULL as signed);
...@@ -212,8 +212,8 @@ class Item_func_signed :public Item_int_func ...@@ -212,8 +212,8 @@ class Item_func_signed :public Item_int_func
{ {
public: public:
Item_func_signed(Item *a) :Item_int_func(a) {} Item_func_signed(Item *a) :Item_int_func(a) {}
double val() { return args[0]->val(); } double val() { null_value=args[0]->null_value; return args[0]->val(); }
longlong val_int() { return args[0]->val_int(); } longlong val_int() { null_value=args[0]->null_value; return args[0]->val_int(); }
void fix_length_and_dec() void fix_length_and_dec()
{ max_length=args[0]->max_length; unsigned_flag=0; } { max_length=args[0]->max_length; unsigned_flag=0; }
void print(String *str); void print(String *str);
...@@ -224,8 +224,8 @@ class Item_func_unsigned :public Item_int_func ...@@ -224,8 +224,8 @@ class Item_func_unsigned :public Item_int_func
{ {
public: public:
Item_func_unsigned(Item *a) :Item_int_func(a) {} Item_func_unsigned(Item *a) :Item_int_func(a) {}
double val() { return args[0]->val(); } double val() { null_value=args[0]->null_value; return args[0]->val(); }
longlong val_int() { return args[0]->val_int(); } longlong val_int() { null_value=args[0]->null_value; return args[0]->val_int(); }
void fix_length_and_dec() void fix_length_and_dec()
{ max_length=args[0]->max_length; unsigned_flag=1; } { max_length=args[0]->max_length; unsigned_flag=1; }
void print(String *str); void print(String *str);
......
...@@ -1624,9 +1624,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1624,9 +1624,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
switch (command) { switch (command) {
case MYSQL_OPTION_MULTI_STATEMENTS_ON: case MYSQL_OPTION_MULTI_STATEMENTS_ON:
thd->client_capabilities|= CLIENT_MULTI_STATEMENTS; thd->client_capabilities|= CLIENT_MULTI_STATEMENTS;
send_eof(thd);
break; break;
case MYSQL_OPTION_MULTI_STATEMENTS_OFF: case MYSQL_OPTION_MULTI_STATEMENTS_OFF:
thd->client_capabilities&= ~CLIENT_MULTI_STATEMENTS; thd->client_capabilities&= ~CLIENT_MULTI_STATEMENTS;
send_eof(thd);
break; break;
default: default:
send_error(thd, ER_UNKNOWN_COM_ERROR); send_error(thd, ER_UNKNOWN_COM_ERROR);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment