mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-22976 CAST(JSON_EXTRACT() AS DECIMAL) does not handle boolean values
Item_func_json_extract did not implement val_decimal(), so CAST(JSON_EXTRACT('{"x":true}', '$.x') AS DECIMAL) erroneously returned 0 with a warning because of convertion from the string "true" to decimal. Implementing val_decimal(), so boolean values are correctly handled.
This commit is contained in:
@ -171,6 +171,7 @@ public:
|
||||
String *val_str(String *);
|
||||
longlong val_int();
|
||||
double val_real();
|
||||
my_decimal *val_decimal(my_decimal *);
|
||||
uint get_n_paths() const { return arg_count - 1; }
|
||||
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
|
||||
{ return get_item_copy<Item_func_json_extract>(thd, mem_root, this); }
|
||||
|
Reference in New Issue
Block a user