summaryrefslogtreecommitdiff
path: root/sql/sql_partition.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-10-18 10:24:53 +0400
committerAlexander Barkov <bar@mariadb.com>2019-10-18 10:24:53 +0400
commite0b6294338fdfc8a4a8b42e6b199c588453be879 (patch)
tree9b3942c46a0dc0f915eb631c65679587a7a34250 /sql/sql_partition.cc
parent0b9cee2cbfe6bce17dca980764076c65e14513f5 (diff)
downloadmariadb-git-e0b6294338fdfc8a4a8b42e6b199c588453be879.tar.gz
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.
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r--sql/sql_partition.cc2
1 files changed, 1 insertions, 1 deletions
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;