diff options
author | gkodinov/kgeorge@macbook.gmz <> | 2006-11-28 15:44:11 +0200 |
---|---|---|
committer | gkodinov/kgeorge@macbook.gmz <> | 2006-11-28 15:44:11 +0200 |
commit | 42cd956752be97efe01ed83825e5b320b98d56a3 (patch) | |
tree | fa4c02c70637d0f12ec543e10f073cc0738788a3 /sql/item_func.h | |
parent | 5198354584e56682e5d5b87ee680582aac44ea61 (diff) | |
download | mariadb-git-42cd956752be97efe01ed83825e5b320b98d56a3.tar.gz |
BUG#11927: Warnings shown for CAST( chr as signed) but not (chr + 0)
When implicitly converting string fields to numbers the
string-to-number conversion error was not sent to the client.
Added code to send the conversion error as warning.
We also need to prevent generation of warnings from the places
where val_xxx() methods are called for the sole purpose of updating
the Item::null_value flag.
To achieve that a special function is added (and called) :
update_null_value(). This function will set the no_errors flag and
will call val_xxx(). The warning generation in Field_string::val_xxx()
will use the flag when generating the conversion warnings.
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index 99f7d16855e..af4e4bdbcbc 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -157,7 +157,7 @@ public: return (null_value=args[0]->get_time(ltime)); } bool is_null() { - (void) val_int(); /* Discard result. It sets null_value as side-effect. */ + update_null_value(); return null_value; } void signal_divide_by_null(); @@ -241,7 +241,7 @@ public: virtual double real_op()= 0; virtual my_decimal *decimal_op(my_decimal *)= 0; virtual String *str_op(String *)= 0; - bool is_null() { (void) val_real(); return null_value; } + bool is_null() { update_null_value(); return null_value; } }; /* function where type of result detected by first argument */ |