summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-05-18 11:29:43 +0400
committerAlexander Barkov <bar@mariadb.com>2020-05-19 10:55:39 +0400
commit06fb78c6acf0cf22ab756e5b89652aa6a5e8485e (patch)
tree454663c5bdea1e0194f076b25e62574996935e4f /sql/sql_yacc.yy
parent4869e7f4a8d1e997936de775536bf3708cf99529 (diff)
downloadmariadb-git-06fb78c6acf0cf22ab756e5b89652aa6a5e8485e.tar.gz
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.
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 14d71139dad..edcd2171721 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -13673,13 +13673,13 @@ expr_or_default:
expr { $$= $1;}
| DEFAULT
{
- $$= new (thd->mem_root) Item_default_value(thd, Lex->current_context());
+ $$= new (thd->mem_root) Item_default_specification(thd);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
| IGNORE_SYM
{
- $$= new (thd->mem_root) Item_ignore_value(thd, Lex->current_context());
+ $$= new (thd->mem_root) Item_ignore_specification(thd);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}