1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Don't emit non-canonical empty arrays in array_remove().

Dean Rasheed
This commit is contained in:
Noah Misch
2013-05-31 21:50:59 -04:00
parent 01497e738e
commit 97c4d9b7c7
3 changed files with 15 additions and 0 deletions

View File

@ -5398,6 +5398,14 @@ array_replace_internal(ArrayType *array,
return array;
}
/* If all elements were removed return an empty array */
if (nresult == 0)
{
pfree(values);
pfree(nulls);
return construct_empty_array(element_type);
}
/* Allocate and initialize the result array */
if (hasnulls)
{