Proposed fix for Bug #15259 (invalid empty array returned by intarray "&" operator)

Started by Alexey Kryuchkovalmost 8 years ago2 messageshackers
Jump to latest
#1Alexey Kryuchkov
alexey.kruchkov@gmail.com

The attached patch fixes Bug #15259 [1]/messages/by-id/153053285112.13258.434620894305716755@wrigleys.postgresql.org in the intarray module, making the
'&' array intersection operator return proper zero-dimensional empty arrays
instead of one-dimensional, zero-length "empty" arrays.

In [2]/messages/by-id/20570.1506198383@sss.pgh.pa.us this problem was addressed by changing the behaviour of
construct_[md_]array(), but the intarray module does not use these
functions. The patch I propose contains the relevant fixes to the
intarray module, along with regression tests.

[1]: /messages/by-id/153053285112.13258.434620894305716755@wrigleys.postgresql.org
/messages/by-id/153053285112.13258.434620894305716755@wrigleys.postgresql.org
[2]: /messages/by-id/20570.1506198383@sss.pgh.pa.us

Best regards,

Alexey Kryuchkov

Attachments:

intarray-correct-empty-array-dimensions-15259.patchtext/x-patch; charset=US-ASCII; name=intarray-correct-empty-array-dimensions-15259.patchDownload+36-0
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alexey Kryuchkov (#1)
Re: Proposed fix for Bug #15259 (invalid empty array returned by intarray "&" operator)

Alexey Kryuchkov <alexey.kruchkov@gmail.com> writes:

The attached patch fixes Bug #15259 [1] in the intarray module, making the
'&' array intersection operator return proper zero-dimensional empty arrays
instead of one-dimensional, zero-length "empty" arrays.

LGTM, pushed. Thanks for the report and patch!

regards, tom lane