mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 10.2 into 10.3
This commit is contained in:
@ -962,6 +962,41 @@ double Item_func_json_extract::val_real()
|
||||
}
|
||||
|
||||
|
||||
my_decimal *Item_func_json_extract::val_decimal(my_decimal *to)
|
||||
{
|
||||
json_value_types type;
|
||||
char *value;
|
||||
int value_len;
|
||||
|
||||
if (read_json(NULL, &type, &value, &value_len) != NULL)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case JSON_VALUE_STRING:
|
||||
case JSON_VALUE_NUMBER:
|
||||
{
|
||||
my_decimal *res= decimal_from_string_with_check(to, collation.collation,
|
||||
value,
|
||||
value + value_len);
|
||||
null_value= res == NULL;
|
||||
return res;
|
||||
}
|
||||
case JSON_VALUE_TRUE:
|
||||
int2my_decimal(E_DEC_FATAL_ERROR, 1, false/*unsigned_flag*/, to);
|
||||
return to;
|
||||
case JSON_VALUE_OBJECT:
|
||||
case JSON_VALUE_ARRAY:
|
||||
case JSON_VALUE_FALSE:
|
||||
case JSON_VALUE_NULL:
|
||||
break;
|
||||
};
|
||||
}
|
||||
int2my_decimal(E_DEC_FATAL_ERROR, 0, false/*unsigned_flag*/, to);
|
||||
return to;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Item_func_json_contains::fix_length_and_dec()
|
||||
{
|
||||
a2_constant= args[1]->const_item();
|
||||
|
Reference in New Issue
Block a user