Re: fix for BUG #3720: wrong results at using ltree

Nikita Glukhov <n.gluhov@postgrespro.ru>

From: Nikita Glukhov <n.gluhov@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>, Pgsql Hackers <pgsql-hackers@postgresql.org>
Cc: Filip Rembiałkowski <filip.rembialkowski@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, Alexander Korotkov <a.korotkov@postgrespro.ru>, Oleg Bartunov <obartunov@postgrespro.ru>, Thomas Munro <thomas.munro@gmail.com>, Teodor Sigaev <teodor@sigaev.ru>
Date: 2020-03-30T22:47:05Z
Lists: pgsql-hackers
On 31.03.2020 1:35, Tom Lane wrote:
> Nikita Glukhov <n.gluhov@postgrespro.ru> writes:
>> And we even can simply transform this tail call into a loop:
>>
>> -if (tlen > 0 && qlen > 0)
>> +while (tlen > 0 && qlen > 0)
> Yeah, the same occurred to me ... and then we can drop the other loop too.

I think now it looks as simple as the whole algorithm is.


-- 
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

  1. Back-patch addition of stack overflow and interrupt checks for lquery.

  2. Fix lquery's NOT handling, and add ability to quantify non-'*' items.

  3. Improve error messages in ltree_in and lquery_in.

  4. Fix lquery's behavior for consecutive '*' items.

  5. Protect against overflow of ltree.numlevel and lquery.numlevel.