From e0b6294338fdfc8a4a8b42e6b199c588453be879 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 18 Oct 2019 10:24:53 +0400 Subject: MDEV-20855 Crash with PARTITION BY LIST and extended characters The code in convert_charset_partition_constant() did not take into account that the call for item->safe_charset_converter() can return NULL when conversion is not safe. Note, 10.2 was not affected. The test for NULL presents in 10.2, but it disappeared in 10.3 in a mistake. Restoring the test. --- sql/sql_partition.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_partition.cc') diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index d23ee8583e3..00a78ce3199 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -146,7 +146,7 @@ Item* convert_charset_partition_constant(Item *item, CHARSET_INFO *cs) item= item->safe_charset_converter(thd, cs); context->table_list= NULL; thd->where= "convert character set partition constant"; - if (item->fix_fields_if_needed(thd, (Item**)NULL)) + if (item && item->fix_fields_if_needed(thd, (Item**)NULL)) item= NULL; thd->where= save_where; context->table_list= save_list; -- cgit v1.2.1