Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oMwj6-0002IQ-PZ for pgsql-bugs@arkaria.postgresql.org; Sat, 13 Aug 2022 19:23:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oMwj5-0000mz-MG for pgsql-bugs@arkaria.postgresql.org; Sat, 13 Aug 2022 19:23:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oMwj5-0000mn-Dj for pgsql-bugs@lists.postgresql.org; Sat, 13 Aug 2022 19:23:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oMwj3-0003yJ-9D for pgsql-bugs@lists.postgresql.org; Sat, 13 Aug 2022 19:23:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 27DJNBhC402041; Sat, 13 Aug 2022 15:23:11 -0400 From: Tom Lane To: Richard Guo cc: =?UTF-8?B?0JXQs9C+0YAg0KfQuNC90LTRj9GB0LrQuNC9?= , PostgreSQL mailing lists Subject: Re: BUG #17583: Server crashes on executing CROSS JOIN with very big number of tables In-reply-to: References: <17583-33be55b9f981f75c@postgresql.org> Comments: In-reply-to Richard Guo message dated "Fri, 12 Aug 2022 17:22:57 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <402039.1660418591.1@sss.pgh.pa.us> Date: Sat, 13 Aug 2022 15:23:11 -0400 Message-ID: <402040.1660418591@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > On Fri, Aug 12, 2022 at 5:03 PM Richard Guo 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