summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2023-05-03 13:27:59 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2023-05-03 13:27:59 +0200
commitcf56f2d7e8f80d92f88a575bbb0f5d414f1992da (patch)
treee284cfe7cc1c229467321f3d0d8304c0b2996247 /sql/item.cc
parentd8997f875e2d78300999876e25d348cf6ad3f73e (diff)
parentf0f1f2de0eeebfce041c27ee1544c9cd45f05f18 (diff)
downloadmariadb-git-cf56f2d7e8f80d92f88a575bbb0f5d414f1992da.tar.gz
Merge branch '10.8' into 10.9
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 8081df91ce4..e1a1dff3dde 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -10567,7 +10567,8 @@ int Item_cache_str::save_in_field(Field *field, bool no_conversions)
bool Item_cache_row::allocate(THD *thd, uint num)
{
item_count= num;
- return (!(values=
+ return (!values &&
+ !(values=
(Item_cache **) thd->calloc(sizeof(Item_cache *)*item_count)));
}
@@ -10603,11 +10604,12 @@ bool Item_cache_row::setup(THD *thd, Item *item)
return 1;
for (uint i= 0; i < item_count; i++)
{
- Item_cache *tmp;
Item *el= item->element_index(i);
- if (!(tmp= values[i]= el->get_cache(thd)))
+
+ if ((!values[i]) && !(values[i]= el->get_cache(thd)))
return 1;
- tmp->setup(thd, el);
+
+ values[i]->setup(thd, el);
}
return 0;
}