Re: BUG #17583: Server crashes on executing CROSS JOIN with very big number of tables

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Егор Чиндяскин <kyzevan23@mail.ru>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2022-08-13T19:23:11Z
Lists: pgsql-bugs
Richard Guo <guofenglinux@gmail.com> writes:
> On Fri, Aug 12, 2022 at 5:03 PM Richard Guo <guofenglinux@gmail.com> wrote:
>> Function transformFromClauseItem() is driven to stack overflow. We need
>> to add some check_stack_depth() checks here and maybe other more places.

> Attach a patch to add the check for transformFromClauseItem.

Pushed.  It's possible there are some other places, but I think most
of the parser doesn't need it because it'll call transformExpr which
already checks.

			regards, tom lane



Commits

  1. Catch stack overflow when recursing in transformFromClauseItem().