diff options
author | unknown <Sinisa@sinisa.nasamreza.org> | 2004-01-09 22:28:29 +0200 |
---|---|---|
committer | unknown <Sinisa@sinisa.nasamreza.org> | 2004-01-09 22:28:29 +0200 |
commit | d84ee4d503783a174346393436e7a8ecc7b941bd (patch) | |
tree | 98f4fd0bc97145251b223e218e21c8f1f8a2228b | |
parent | 229cc612776f757de6822eb97eb4e9a97226e760 (diff) | |
download | mariadb-git-d84ee4d503783a174346393436e7a8ecc7b941bd.tar.gz |
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
sql/sql_parse.cc:
A fix for a bug #2207, with mysql server haning on option setting
sql/item_func.h:
Fix for a bug #2219, regarding a bad cast to integer from NULL
mysql-test/t/null.test:
Fix for a bug #2219, regarding a bad cast to integer from NULL
mysql-test/r/null.result:
Fix for a bug #2219, regarding a bad cast to integer from NULL
-rw-r--r-- | mysql-test/r/null.result | 3 | ||||
-rw-r--r-- | mysql-test/t/null.test | 1 | ||||
-rw-r--r-- | sql/item_func.h | 8 | ||||
-rw-r--r-- | sql/sql_parse.cc | 2 |
4 files changed, 10 insertions, 4 deletions
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index c4af221e117..aa56bce6453 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -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 1 SIMPLE t1 range idx idx 4 NULL 2 Using where drop table t1; +select cast(NULL as signed); +cast(NULL as signed) +NULL diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test index c11ed78253b..9f3b6646e7f 100644 --- a/mysql-test/t/null.test +++ b/mysql-test/t/null.test @@ -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 or b is null; drop table t1; +select cast(NULL as signed); diff --git a/sql/item_func.h b/sql/item_func.h index ac67b5a4065..33a4357d26c 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -212,8 +212,8 @@ class Item_func_signed :public Item_int_func { public: Item_func_signed(Item *a) :Item_int_func(a) {} - double val() { return args[0]->val(); } - longlong val_int() { return args[0]->val_int(); } + double val() { null_value=args[0]->null_value; return args[0]->val(); } + longlong val_int() { null_value=args[0]->null_value; return args[0]->val_int(); } void fix_length_and_dec() { max_length=args[0]->max_length; unsigned_flag=0; } void print(String *str); @@ -224,8 +224,8 @@ class Item_func_unsigned :public Item_int_func { public: Item_func_unsigned(Item *a) :Item_int_func(a) {} - double val() { return args[0]->val(); } - longlong val_int() { return args[0]->val_int(); } + double val() { null_value=args[0]->null_value; return args[0]->val(); } + longlong val_int() { null_value=args[0]->null_value; return args[0]->val_int(); } void fix_length_and_dec() { max_length=args[0]->max_length; unsigned_flag=1; } void print(String *str); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 465d840e2b8..3f36b48f5e6 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1624,9 +1624,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd, switch (command) { case MYSQL_OPTION_MULTI_STATEMENTS_ON: thd->client_capabilities|= CLIENT_MULTI_STATEMENTS; + send_eof(thd); break; case MYSQL_OPTION_MULTI_STATEMENTS_OFF: thd->client_capabilities&= ~CLIENT_MULTI_STATEMENTS; + send_eof(thd); break; default: send_error(thd, ER_UNKNOWN_COM_ERROR); |