You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug#21383284: ASSERTION IN SELECT_LEX::SETUP_CONDS
JSON_SEARCH evaluates the escape expression at resolve time in
Item_func_json_search::fix_fields(), but it doesn't check if the
evaluation is successful, and it could end up returning false
(indicating success) even though an error has been raised.
SELECT_LEX::setup_conds() has an assert which checks that no error has
been raised if fix_fields() returns false. This assert gets hit if a
JSON_SEARCH call is in a WHERE clause and the evaluation of the escape
expression fails.
Errors could be raised either when fix_fields() calls val_str() on the
item representing the escape expression, or when it calls fix_fields()
on its synthetic Item_func_like object.
Item_func_json_search::fix_fields() also allocates some objects
without checking if the allocation was successful.
This patch makes fix_fields() check for all of the above error
conditions and return true to indicate that an error has happened.
ERROR 22032: Invalid JSON text in argument 1 to function json_extract: "Number too big to be stored in double." at position 6 in '1E+36181012216111515851075235238'.
ERROR 22032: Invalid JSON text in argument 1 to function json_extract: "Number too big to be stored in double." at position 7 in '-1E+36181012216111515851075235238'.
12819
+
#
12820
+
# Bug#21383284: ASSERTION IN SELECT_LEX::SETUP_CONDS
12821
+
#
12822
+
SELECT 1 FROM dual WHERE JSON_SEARCH('{}', 'one', 'foo', 'too-long-escape');
12823
+
ERROR HY000: Incorrect arguments to ESCAPE
12824
+
SELECT 1 FROM dual WHERE JSON_SEARCH('{}', 'one', 'foo', JSON_EXTRACT('', '$'));
12825
+
ERROR 22032: Invalid JSON text in argument 1 to function json_extract: "The document is empty." at position 0 in ''.
0 commit comments