Re: fix for BUG #3720: wrong results at using ltree
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nikita Glukhov <n.gluhov@postgrespro.ru>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>, Alexander Korotkov <a.korotkov@postgrespro.ru>, Pgsql Hackers <pgsql-hackers@postgresql.org>, Oleg Bartunov <obartunov@postgrespro.ru>, Thomas Munro <thomas.munro@gmail.com>, Filip Rembiałkowski <filip.rembialkowski@gmail.com>, Teodor Sigaev <teodor@sigaev.ru>
Date: 2020-03-28T23:26:52Z
Lists: pgsql-hackers
Attachments
- ltree-not-fixes-2.patch (text/x-diff) patch
Nikita Glukhov <n.gluhov@postgrespro.ru> writes: > On 24.01.2020 21:29, Tomas Vondra wrote: >> Unfortunately, the current code is somewhat undercommented :-( > The main problem is that no one really understands how it works now. Indeed. I was disturbed to realize that lquery_op.c, despite being far from trivial code, contained NOT ONE SINGLE COMMENT before today, other than the content-free file header and a commented-out (visibly unsafe, too) debugging printing function. This is a long way south of minimally acceptable, in my book. Anyway, I concur that Nikita's two patches are bug fixes, so I pushed them. Nonetheless, he *did* hijack this thread, so in hopes of restoring attention to the original topic, here's a rebased version of the original patch. My main complaint about it remains the same, that it changes a disturbingly large number of existing regression-test results, suggesting that there's not a meeting of the minds about what this logic is supposed to do. Maybe it's okay or maybe it's not, but who's going to decide? Also, now that I've looked at it a bit more, I'd be inclined to strip out the parts of the patch that remove setting up the LQUERY_HASNOT flag. Even if we're not using that right now, we might want it again someday, and we're not saving much of anything by introducing a minor on-disk incompatibility. regards, tom lane
Commits
-
Back-patch addition of stack overflow and interrupt checks for lquery.
- fade4d4dffca 11.8 landed
- e48ff22d39db 9.6.18 landed
- cffa57f52cc4 9.5.22 landed
- 94c9152dc880 12.3 landed
- 8b902e438608 10.13 landed
-
Fix lquery's NOT handling, and add ability to quantify non-'*' items.
- 70dc4c509b33 13.0 landed
-
Improve error messages in ltree_in and lquery_in.
- e07e2a40bd0c 13.0 landed
-
Fix lquery's behavior for consecutive '*' items.
- 9950c8aadf0e 13.0 landed
-
Protect against overflow of ltree.numlevel and lquery.numlevel.
- 8e1e630d004e 9.5.22 landed
- 95f7ddfdad99 13.0 landed
- 5feb3d0b3f6b 11.8 landed
- 39491aa0da48 9.6.18 landed
- 2bb6bdbe5da7 12.3 landed
- 2618ac6c6535 10.13 landed