Thread: Patch: Cover POSITION(bytea,bytea) with tests

Patch: Cover POSITION(bytea,bytea) with tests

From
Aleksander Alekseev
Date:
Hi,

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

--
Best regards,
Aleksander Alekseev

Attachment

Re: Patch: Cover POSITION(bytea,bytea) with tests

From
Ilia Evdokimov
Date:
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.




Re: Patch: Cover POSITION(bytea,bytea) with tests

From
Peter Smith
Date:
+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].
position('\x5678'::bytea in '\x1234567890'::bytea) → 3

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

Kind Regards,
Peter Smith.
Fujitsu Australia



Re: Patch: Cover POSITION(bytea,bytea) with tests

From
Aleksander Alekseev
Date:
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

Attachment

Re: Patch: Cover POSITION(bytea,bytea) with tests

From
Rustam ALLAKOV
Date:
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

Re: Patch: Cover POSITION(bytea,bytea) with tests

From
David Rowley
Date:
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