Patch: Cover POSITION(bytea,bytea) with tests

Started by Aleksander Alekseevover 1 year ago6 messageshackers
Jump to latest
#1Aleksander Alekseev
aleksander@timescale.com

Hi,

This function is currently not covered by any tests. The proposed
patch fixes this.

--
Best regards,
Aleksander Alekseev

Attachments:

v1-0001-Cover-POSITION-bytea-bytea-with-tests.patchapplication/octet-stream; name=v1-0001-Cover-POSITION-bytea-bytea-with-tests.patchDownload+28-1
#2Ilia Evdokimov
ilya.evdokimov@tantorlabs.com
In reply to: Aleksander Alekseev (#1)
Re: Patch: Cover POSITION(bytea,bytea) with tests

On 27.02.2025 17:40, Aleksander Alekseev wrote:

Hi,

This function is currently not covered by any tests. The proposed
patch fixes this.

--
Best regards,
Aleksander Alekseev

Hi,

+1. The 'POSISTION' tests include 'text', 'bits' types, but not 'bytea'.

--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC.

#3Peter Smith
smithpb2250@gmail.com
In reply to: Aleksander Alekseev (#1)
Re: Patch: Cover POSITION(bytea,bytea) with tests

+1 for this.

Some minor comments:

1. I thought the new test cases should be located earlier in the file
where there were already a couple of POSITION tests.
(see "-- E021-11 position expression")

2. Maybe one of your test cases can be identical to the example from
the docs [1]https://www.postgresql.org/docs/17/functions-binarystring.html.
position('\x5678'::bytea in '\x1234567890'::bytea) → 3

======
[1]: https://www.postgresql.org/docs/17/functions-binarystring.html

Kind Regards,
Peter Smith.
Fujitsu Australia

#4Aleksander Alekseev
aleksander@timescale.com
In reply to: Peter Smith (#3)
Re: Patch: Cover POSITION(bytea,bytea) with tests

Hi Peter,

Some minor comments:

1. I thought the new test cases should be located earlier in the file
where there were already a couple of POSITION tests.
(see "-- E021-11 position expression")

2. Maybe one of your test cases can be identical to the example from
the docs [1].
position('\x5678'::bytea in '\x1234567890'::bytea) → 3

Thanks.

Here is the corrected patch.

--
Best regards,
Aleksander Alekseev

Attachments:

v2-0001-Cover-POSITION-bytea-bytea-with-tests.patchapplication/octet-stream; name=v2-0001-Cover-POSITION-bytea-bytea-with-tests.patchDownload+36-1
#5Rustam ALLAKOV
rustamallakov@gmail.com
In reply to: Aleksander Alekseev (#4)
Re: Patch: Cover POSITION(bytea,bytea) with tests

The following review has been posted through the commitfest application:
make installcheck-world: tested, passed
Implements feature: tested, passed
Spec compliant: tested, passed
Documentation: tested, passed

Hi Aleksander,
your patch looks good to me.
Changing status to `Ready for Committer`

Regards,
Rustam Allakov

The new status of this patch is: Ready for Committer

#6David Rowley
dgrowleyml@gmail.com
In reply to: Aleksander Alekseev (#4)
Re: Patch: Cover POSITION(bytea,bytea) with tests

On Tue, 18 Mar 2025 at 03:14, Aleksander Alekseev
<aleksander@timescale.com> wrote:

Here is the corrected patch.

I had a look at this and it all seems good to me.

Pushed.

David