diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2022-07-28 16:17:03 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-07-29 09:03:54 +0200 |
commit | cbcc0101ee3016b398490685d30db296b1892db7 (patch) | |
tree | 7aaddabaf91344e9ade04e64cecd6a74462cc7f9 /sql/item_cmpfunc.cc | |
parent | 4b77d38c2673feb5705ae335a54fe81c77e93b75 (diff) | |
download | mariadb-git-cbcc0101ee3016b398490685d30db296b1892db7.tar.gz |
MDEV-29188 Crash in JSON_EXTRACT
If we have null_value set then decimal/string value/result shoud be 0 pointer.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index f41414f8ae9..a3c0d4d95df 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -795,7 +795,9 @@ int Arg_comparator::compare_e_string() { String *res1,*res2; res1= (*a)->val_str(&value1); + DBUG_ASSERT((res1 == NULL) == (*a)->null_value); res2= (*b)->val_str(&value2); + DBUG_ASSERT((res2 == NULL) == (*b)->null_value); if (!res1 || !res2) return MY_TEST(res1 == res2); return MY_TEST(sortcmp(res1, res2, compare_collation()) == 0); @@ -832,10 +834,12 @@ int Arg_comparator::compare_decimal() { my_decimal decimal1; my_decimal *val1= (*a)->val_decimal(&decimal1); + DBUG_ASSERT((val1 == NULL) == (*a)->null_value); if (!(*a)->null_value) { my_decimal decimal2; my_decimal *val2= (*b)->val_decimal(&decimal2); + DBUG_ASSERT((val2 == NULL) == (*b)->null_value); if (!(*b)->null_value) { if (set_null) |