Re: Patch bug: Fix jsonpath .* on Arrays

2024-07-21 Thread David E. Wheeler
On Jul 21, 2024, at 20:54, Michael Paquier wrote: > What I mean is that the main regression test suite did not complain on > your original patch posted here: > https://www.postgresql.org/message-id/A95346F9-6147-46E0-809E-532A485D71D6%40justatheory.com > > But the new tests showed a difference,

Re: Patch bug: Fix jsonpath .* on Arrays

2024-07-21 Thread Michael Paquier
On Fri, Jul 19, 2024 at 09:49:50AM -0400, David E. Wheeler wrote: >> It was fun to see that HEAD was silenced with the first patch of this >> thread that tweaked the behavior with arrays. > > Uh, what? Sorry I don’t follow. What I mean is that the main regression test suite did not complain on yo

Re: Patch bug: Fix jsonpath .* on Arrays

2024-07-19 Thread David E. Wheeler
On Jul 19, 2024, at 01:42, Michael Paquier wrote: > Sorry for the delay. Finally came back to it, and applied the tests. > Thanks! Awesome, thank you! > It was fun to see that HEAD was silenced with the first patch of this > thread that tweaked the behavior with arrays. Uh, what? Sorry I don’

Re: Patch bug: Fix jsonpath .* on Arrays

2024-07-18 Thread Michael Paquier
On Mon, Jul 15, 2024 at 10:29:32AM -0400, David E. Wheeler wrote: > It’s here: > > https://commitfest.postgresql.org/48/5017/ Sorry for the delay. Finally came back to it, and applied the tests. Thanks! It was fun to see that HEAD was silenced with the first patch of this thread that tweaked

Re: Patch bug: Fix jsonpath .* on Arrays

2024-07-15 Thread David E. Wheeler
On Jul 15, 2024, at 07:07, Stepan Neretin wrote: > Hi! Looks good to me now! Please, register a patch in CF. > Best regards, Stepan Neretin. It’s here: https://commitfest.postgresql.org/48/5017/ Best, David

Re: Patch bug: Fix jsonpath .* on Arrays

2024-07-15 Thread Stepan Neretin
On Mon, Jul 8, 2024 at 11:09 PM David E. Wheeler wrote: > On Jun 27, 2024, at 04:17, Michael Paquier wrote: > > > The tests of jsonb_jsonpath.sql include a lot of patterns for @? and > > jsonb_path_query with the lax and strict modes, so shouldn't these > > additions be grouped closer to the exi

Re: Patch bug: Fix jsonpath .* on Arrays

2024-07-08 Thread David E. Wheeler
On Jun 27, 2024, at 04:17, Michael Paquier wrote: > The tests of jsonb_jsonpath.sql include a lot of patterns for @? and > jsonb_path_query with the lax and strict modes, so shouldn't these > additions be grouped closer to the existing tests rather than added at > the end of the file? I’ve move

Re: Patch bug: Fix jsonpath .* on Arrays

2024-06-27 Thread David E. Wheeler
On Jun 27, 2024, at 04:17, Michael Paquier wrote: > The tests of jsonb_jsonpath.sql include a lot of patterns for @? and > jsonb_path_query with the lax and strict modes, so shouldn't these > additions be grouped closer to the existing tests rather than added at > the end of the file? I think y

Re: Patch bug: Fix jsonpath .* on Arrays

2024-06-27 Thread Michael Paquier
On Thu, Jun 27, 2024 at 11:53:14AM +0700, Stepan Neretin wrote: > HI! Now it looks good for me. The tests of jsonb_jsonpath.sql include a lot of patterns for @? and jsonb_path_query with the lax and strict modes, so shouldn't these additions be grouped closer to the existing tests rather than adde

Re: Patch bug: Fix jsonpath .* on Arrays

2024-06-26 Thread Stepan Neretin
On Thu, Jun 27, 2024 at 1:16 AM David E. Wheeler wrote: > On Jun 25, 2024, at 13:48, David E. Wheeler wrote: > > > I have since realized it’s not a complete fix for the issue, and hacked > around it in my Go version. Would be fine to remove that bit, but IIRC this > was the only execution functi

Re: Patch bug: Fix jsonpath .* on Arrays

2024-06-26 Thread David E. Wheeler
On Jun 25, 2024, at 13:48, David E. Wheeler wrote: > I have since realized it’s not a complete fix for the issue, and hacked > around it in my Go version. Would be fine to remove that bit, but IIRC this > was the only execution function that would return `jperNotFound` when it in > fact adds i

Re: Patch bug: Fix jsonpath .* on Arrays

2024-06-25 Thread David E. Wheeler
On Jun 25, 2024, at 12:46 AM, Степан Неретин wrote: > Hi! Looks good to me, but I have several comments. Thanks for your review! > Your patch improves tests, but why did you change formatting in > jsonpath_exec.c? What's the motivation? It’s not just formatting. From the commit message: > Wh

Re: Patch bug: Fix jsonpath .* on Arrays

2024-06-24 Thread Степан Неретин
  >Вторник, 25 июня 2024, 11:17 +07:00 от David E. Wheeler >: >  >On Jun 7, 2024, at 10:23, David E. Wheeler < da...@justatheory.com > wrote: >  >> Rebased and moved the new tests to the end of the file. >Bah, sorry, that was the previous patch. Here’s v3. > >D >      Hi! Looks good to me, bu

Re: Patch bug: Fix jsonpath .* on Arrays

2024-06-07 Thread David E. Wheeler
On Jun 7, 2024, at 10:23, David E. Wheeler wrote: > Rebased and moved the new tests to the end of the file. Bah, sorry, that was the previous patch. Here’s v3. D v3-0001-Add-tests-for-jsonpath-.-on-arrays.patch Description: Binary data

Re: Patch bug: Fix jsonpath .* on Arrays

2024-06-07 Thread David E. Wheeler
On Jun 4, 2024, at 20:45, David E. Wheeler wrote: > Oh FFS, unwrapping still breaks my brain. You’re right, of course. Here’s a > new patch that demonstrates that behavior, since that code path is not > currently represented in tests AFAICT (I would have expected to have broken > it with this

Re: Patch bug: Fix jsonpath .* on Arrays

2024-06-05 Thread David E. Wheeler
On Jun 4, 2024, at 20:45, David E. Wheeler wrote: > Here’s a new patch that demonstrates that behavior, since that code path is > not currently represented in tests AFAICT (I would have expected to have > broken it with this patch). Commitfest link: https://commitfest.postgresql.org/48/5017

Re: Patch bug: Fix jsonpath .* on Arrays

2024-06-04 Thread David E . Wheeler
On Jun 4, 2024, at 12:28 PM, David G. Johnston wrote: > This seems to be working correctly. Lax mode causes the first array level to > unwrap and produce new context item values. Then the wildcard member > accessor is applied to each. Numbers don’t have members so no matches exist > in the

Re: Patch bug: Fix jsonpath .* on Arrays

2024-06-04 Thread David G. Johnston
On Tuesday, June 4, 2024, David E. Wheeler wrote: > Hackers, > > The behavior of the .* jpiAnyKey jsonpath selector seems incorrect. > > ``` > select jsonb_path_query('[1,2,3]', '$.*'); > jsonb_path_query > -- > (0 rows) > > select jsonb_path_query('[1,2,3,{"b": [3,4,5]}]', '$.*')

Patch bug: Fix jsonpath .* on Arrays

2024-06-04 Thread David E. Wheeler
Hackers, The behavior of the .* jpiAnyKey jsonpath selector seems incorrect. ``` select jsonb_path_query('[1,2,3]', '$.*'); jsonb_path_query -- (0 rows) select jsonb_path_query('[1,2,3,{"b": [3,4,5]}]', '$.*'); jsonb_path_query -- [3, 4, 5] ``` The first exampl