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 1pnhgc-0000Pv-5k for pgsql-bugs@arkaria.postgresql.org; Sat, 15 Apr 2023 15:19:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pnhga-0002zN-4l for pgsql-bugs@arkaria.postgresql.org; Sat, 15 Apr 2023 15:19:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1pnhgZ-0002zE-R4 for pgsql-bugs@lists.postgresql.org; Sat, 15 Apr 2023 15:19:31 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from <9erthalion6@gmail.com>) id 1pnhgS-0034Ah-DR for pgsql-bugs@lists.postgresql.org; Sat, 15 Apr 2023 15:19:31 +0000 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-504e232fe47so3689181a12.2 for ; Sat, 15 Apr 2023 08:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681571962; x=1684163962; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0d4hMrNVURDV7pLBf2hlwREgxsi0AqdfkMrT9NBgFQ8=; b=U/F/8YM0JnnOy0FqvT31GIQOksK1RdzR3ULz8RKCwpo1sFz1sCSraB99cztvGl/YEi bDJym27vflG8e12lyM2UjFNlq4YdSY0Uy+ivcQ627ncyDKq3G7asb0lK9hJiSoKk93yD snn7oO0EpuuG0e/WORiMdobDdJWCbYcPnlYjLbNvCuuPLtOF6SJndgQNSqf7itkioAl2 z0cTmq9EY2WUffK8J/vdsnELcupDMjFVRJih4YMEyEwidHuSVZqcfAkbrGGtwzwTfFQZ zEI88YICpnwUICY5Icd6kKpomToabluN13kpTqeNRjuavnrg9EciJBFP0Boi44M8VWlt Jl/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681571962; x=1684163962; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0d4hMrNVURDV7pLBf2hlwREgxsi0AqdfkMrT9NBgFQ8=; b=ChsU2is5TC8hqCOhMXTyQwtYe+RyVfcI20H4LacImT/Q2w2Ziida3gpW4ub5YHZS5O gf9PzRISB+WMzmrdA3W0zWrrgKWyohJs+Wjw8A1h/ThiDK0cbIau2nzEipFiIcPBKVM1 tA85DdKDKVz1I5GP4JN8rsMDRDQVv2wF3n17HaLhnVd9aWmeJwivE5i/2W+e9f8Uhrop 4rR2UNSXP6+oka7pnqMDAAJXp00O5dHfaUG4FDmAFpQ/8RuGUbMbTu0yT/OpxA/db8YI QZh90/UfmhNwu//Km8CqIWPl1mepR8S8FGHWFNJ8R/+exCwlKuMI6pYqJf6/BvnKNLdM iMcw== X-Gm-Message-State: AAQBX9eOaGuXH/LRbBj+s/43LBxD0PVKiU/nyybRhwlPmG/EpFy09Bqd c8M/zYg8XjIiOecz2ZDZLfs= X-Google-Smtp-Source: AKy350bPznIlrPGSmbizBGl2IfV16YjNvhrPvbVzEnE6wwvuivQNjV41cZ+0pzfy0GBmdni+dfCCSA== X-Received: by 2002:a05:6402:68f:b0:506:98e8:7e58 with SMTP id f15-20020a056402068f00b0050698e87e58mr356458edy.34.1681571962244; Sat, 15 Apr 2023 08:19:22 -0700 (PDT) Received: from erthalion.local (dslb-094-222-018-125.094.222.pools.vodafone-ip.de. [94.222.18.125]) by smtp.gmail.com with ESMTPSA id dy11-20020a05640231eb00b00506956c99d9sm545874edb.15.2023.04.15.08.19.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Apr 2023 08:19:21 -0700 (PDT) Date: Sat, 15 Apr 2023 17:17:09 +0200 From: Dmitry Dolgov <9erthalion6@gmail.com> To: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17897: Crash on assignment to array of constraint-less domain over composite type Message-ID: <20230415151709.jh7ygoak2fc2msdb@erthalion.local> References: <17897-4216c546c3874044@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17897-4216c546c3874044@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Fri, Apr 14, 2023 at 07:00:01PM +0000, PG Bug reporting form wrote: > > The following modified excerpt from regress/sql/domain.sql: > create type comptype as (cf1 int, cf2 int); > create domain dcomptype as comptype; > > create table dcomptable (f1 dcomptype[]); > insert into dcomptable values (null); > update dcomptable set f1[1].cf2 = 5; > > causes a server crash with the following stack trace: > [...] > Not reproduced on REL_11_STABLE, but reproduced on REL_12_STABLE .. master > since 04fe805a1 made a constraint-less domain represented as a RelabelType > (not CoerceToDomain) and thus the fix for [1] (ae7b1dd59) doesn't cover > this > case. Looks like it could be fixed in the same way as in ae7b1dd59 ? diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c index 4c6700de04..06fbf19423 100644 --- a/src/backend/executor/execExpr.c +++ b/src/backend/executor/execExpr.c @@ -3253,6 +3253,12 @@ isAssignmentIndirectionExpr(Expr *expr) return isAssignmentIndirectionExpr(cd->arg); } + else if (IsA(expr, RelabelType)) + { + RelabelType *rt = (RelabelType *) expr; + + return isAssignmentIndirectionExpr(rt->arg); + } return false; }