From 6152ab7b42c18d62030ef9c23e9abb3817c73f39 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 27 Jul 2021 23:45:30 +0200 Subject: MDEV-24511 null field is created with CREATE..SELECT When creating fields for UNION results, Field_null is not allowed. Should create binary(0) instead. --- sql/sql_union.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index c89e59a06f8..48d8c16db68 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -1154,7 +1154,8 @@ cont: Test if the aggregated data type is OK for a UNION element. E.g. in case of string data, DERIVATION_NONE is not allowed. */ - if (type->type_handler()->union_element_finalize(type)) + if (type->type() == Item::TYPE_HOLDER && type->type_handler()-> + union_element_finalize(static_cast(type))) goto err; } -- cgit v1.2.1