mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-21995 Server crashes in Item_field::real_type_handler with table value constructor
1. Code simplification: Item_default_value handled all these values: a. DEFAULT(field) b. DEFAULT c. IGNORE and had various conditions to distinguish (a) from (b) and from (c). Introducing a new abstract class Item_contextually_typed_value_specification, to handle (b) and (c), so the hierarchy now looks as follows: Item Item_result_field Item_ident Item_field Item_default_value - DEFAULT(field) Item_contextually_typed_value_specification Item_default_specification - DEFAULT Item_ignore_specification - IGNORE 2. Introducing a new virtual method is_evaluable_expression() to determine if an Item is: - a normal expression, so its val_xxx()/get_date() methods can be called - or a just an expression substitute, whose value methods cannot be called. 3. Disallowing Items that are not evalualble expressions in table value constructors.
This commit is contained in:
@ -2610,3 +2610,14 @@ $$
|
||||
a
|
||||
0
|
||||
1
|
||||
#
|
||||
# MDEV-21995 Server crashes in Item_field::real_type_handler with table value constructor
|
||||
#
|
||||
VALUES (IGNORE);
|
||||
ERROR HY000: 'ignore' is not allowed in this context
|
||||
VALUES (DEFAULT);
|
||||
ERROR HY000: 'default' is not allowed in this context
|
||||
EXECUTE IMMEDIATE 'VALUES (?)' USING IGNORE;
|
||||
ERROR HY000: 'ignore' is not allowed in this context
|
||||
EXECUTE IMMEDIATE 'VALUES (?)' USING DEFAULT;
|
||||
ERROR HY000: 'default' is not allowed in this context
|
||||
|
Reference in New Issue
Block a user