Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x5PGG-0003Fm-13 for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Sep 2026 15:03:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x5PGF-001Foi-2T for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Sep 2026 15:03:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x57Pt-000RTL-2v for pgsql-bugs@lists.postgresql.org; Fri, 11 Sep 2026 20:00:09 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x57Pr-00000005Bzd-3zvF for pgsql-bugs@lists.postgresql.org; Fri, 11 Sep 2026 20:00:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=p4335gPPgfe18RVQG43XLmF+eZzUl8L11BVfT6yK9C4=; b=DKHLB8Byyat23MIUnR4Dk8itGX DR7y0ikJLI5toy6wnnsMryS0HSVUjuAAdYwSl8kU+EmljIs6PBilF8WqOeFXwzRAI9gFNixPgItoS loD+DYEFj5CAOYclAbKY2TLpiJeNw7N2Fek0iXXty5W77SZSBl+49md1B2+oN+eJYMBXB3pErldE4 XYMe/1FsJKKufzVp0faryFxAKqBduesrGJhy3ChY0e4U1kRswS2hwqODciXi/oVQgeSzzo8BaJbVM XNY+/W/rk6OQNTMud7lOjvn5ZnW7WyNrV8W8nzr+VQk+cxk+JVVeFG47wy5FHbaKgfMwMD31AT0KN aECvczGQ==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x57Pr-00FWYH-1V for pgsql-bugs@lists.postgresql.org; Fri, 11 Sep 2026 20:00:07 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x57Pp-00000006WAV-3p5W for pgsql-bugs@lists.postgresql.org; Fri, 11 Sep 2026 20:00:05 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19684: Assertion in tuplesort_begin_heap() falsified by parallel plan with sort To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: exclusion@gmail.com Reply-To: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Date: Fri, 11 Sep 2026 20:00:01 +0000 Message-ID: <19684-fa0b7fdc7d235fd9@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19684 Logged by: Alexander Lakhin Email address: exclusion@gmail.com PostgreSQL version: 19beta3 Operating system: Ubuntu 24.04 Description: =20 The following script: SET cpu_tuple_cost =3D 1000; SET min_parallel_table_scan_size =3D 1; CREATE TABLE t(i int); SELECT FROM t UNION SELECT FROM t; triggers: TRAP: failed Assert("nkeys > 0"), File: "tuplesortvariants.c", Line: 195, PID: 1465852 EXPLAIN shows: QUERY PLAN ---------------------------------------------------------------------------= -------------------- Unique (cost=3D3188844.07..3188856.82 rows=3D2 width=3D0) -> Sort (cost=3D3188844.07..3188856.82 rows=3D5100 width=3D0) -> Gather (cost=3D1000.00..3188530.00 rows=3D5100 width=3D0) Workers Planned: 2 -> Parallel Append (cost=3D0.00..3187020.00 rows=3D2124 width=3D0) -> Parallel Seq Scan on t (cost=3D0.00..1062510.00 rows=3D1062 width=3D0) -> Parallel Seq Scan on t t_1 (cost=3D0.00..1062510.= 00 rows=3D1062 width=3D0) Without asserts enabled, SELECT succeeds and EXPLAIN (ANALYZE) shows the same plan. Reproduced starting from 66c0185a3/12933dc60.