diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-06-21 16:07:29 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-04-24 16:06:54 +0200 |
commit | e91fd8783a5343dcd32917e35fa03b2dbe00021d (patch) | |
tree | d81b3c17de7bd7f322dd02f05deba5d0fd6cbf26 /sql | |
parent | d3b2228fd8b9ba13f8adedfee144d222b32b1cec (diff) | |
download | mariadb-git-e91fd8783a5343dcd32917e35fa03b2dbe00021d.tar.gz |
don't cast random items to Item_result_field*
do it only for items that inherit from Item_result_field*
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_select.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 62365f48404..eb9e0492dc7 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -16281,27 +16281,27 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, /* Fall through */ case Item::COND_ITEM: + case Item::SUBSELECT_ITEM: + case Item::REF_ITEM: + case Item::EXPR_CACHE_ITEM: + if (make_copy_field) + { + DBUG_ASSERT(((Item_result_field*)item)->result_field); + *from_field= ((Item_result_field*)item)->result_field; + } + /* Fall through */ case Item::FIELD_AVG_ITEM: case Item::FIELD_STD_ITEM: - case Item::SUBSELECT_ITEM: - /* The following can only happen with 'CREATE TABLE ... SELECT' */ case Item::PROC_ITEM: case Item::INT_ITEM: case Item::REAL_ITEM: case Item::DECIMAL_ITEM: case Item::STRING_ITEM: case Item::DATE_ITEM: - case Item::REF_ITEM: case Item::NULL_ITEM: case Item::VARBIN_ITEM: case Item::CACHE_ITEM: - case Item::EXPR_CACHE_ITEM: case Item::PARAM_ITEM: - if (make_copy_field) - { - DBUG_ASSERT(((Item_result_field*)item)->result_field); - *from_field= ((Item_result_field*)item)->result_field; - } return create_tmp_field_from_item(thd, item, table, (make_copy_field ? 0 : copy_func), modify_item); |