Re: additional patch for contrib/tablefunc - added to regression
Gavin Sherry wrote:
Joe,
This test presumes that it will succeed. That is, if there is an infinite
recursion here, the test will just hang -- as far as I can tell -- and
will not *actually* report the failure.
No, look at expected/tablefunc.out:
-- recursion detection
INSERT INTO connectby_int VALUES(10,9);
INSERT INTO connectby_int VALUES(11,10);
INSERT INTO connectby_int VALUES(9,11);
-- should fail due to infinite recursion
SELECT * FROM connectby('connectby_int', 'keyid', 'parent_keyid', '2', 0, '~')
AS t(keyid int, parent_keyid int, level int, branch text);
ERROR: infinite recursion detected
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Unless I'm miss-understanding you?
Joe
Import Notes
Reference msg id not found: Pine.LNX.4.21.0209271120020.1221-100000@linuxworld.com.au
On Thu, 26 Sep 2002, Joe Conway wrote:
Gavin Sherry wrote:
Joe,
This test presumes that it will succeed. That is, if there is an infinite
recursion here, the test will just hang -- as far as I can tell -- and
will not *actually* report the failure.No, look at expected/tablefunc.out:
-- recursion detection
INSERT INTO connectby_int VALUES(10,9);
INSERT INTO connectby_int VALUES(11,10);
INSERT INTO connectby_int VALUES(9,11);
-- should fail due to infinite recursion
SELECT * FROM connectby('connectby_int', 'keyid', 'parent_keyid', '2', 0, '~')
AS t(keyid int, parent_keyid int, level int, branch text);
ERROR: infinite recursion detected
^^^^^^^^^^^^^^^^^^^^^^^^^^^Unless I'm miss-understanding you?
Correct me if i'm wrong: there was a but in connectby which meant that it
did not detect infinite recursion correct. You want to add a test to make
sure it continues to do so. However, if you bust the infinite recursion
detection it will, by definition, recurse infinitely and not elog() -- at
least in a reasonably time frame.
To handle this situation, you may need to use the psql timeout
functionality -- but I know nothing about it.
Gavin
Tom Lane wrote:
Joe Conway <mail@joeconway.com> writes:
I think you finally got through my thick skull. Now I see the
issue. OK, I'll rework the patch using a timeout.I think this is unnecessary. Bugs in any functionality tested by a
regression test could cause the system to go into an infinite loop;
but we don't put timeouts on all of them. In practice we rely on
the user to exercise some judgment about whether the tests are
proceeding normally.
Sounds good to me. I guess the patch stands as originally sent, unless other
objections arise.
Thanks,
Joe
Joe Conway wrote:
Tom Lane wrote:
Joe Conway <mail@joeconway.com> writes:
I think you finally got through my thick skull. Now I see the
issue. OK, I'll rework the patch using a timeout.I think this is unnecessary. Bugs in any functionality tested by a
regression test could cause the system to go into an infinite loop;
but we don't put timeouts on all of them. In practice we rely on
the user to exercise some judgment about whether the tests are
proceeding normally.Sounds good to me. I guess the patch stands as originally sent, unless other
objections arise.
Uh, I already deleted it. Can you shoot it to me again? :-)
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073