Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4Rkm-0004PZ-Rh for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Mar 2019 14:54:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h4Rkl-0001f9-Ao for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Mar 2019 14:54:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4Rjk-0004RO-Nn for pgsql-hackers@lists.postgresql.org; Thu, 14 Mar 2019 14:53:36 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4Rjh-00029h-8d for pgsql-hackers@postgresql.org; Thu, 14 Mar 2019 14:53:35 +0000 Received: by mail-pf1-x430.google.com with SMTP id a3so3987498pff.11 for ; Thu, 14 Mar 2019 07:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=y/UILGqr901O8jrU5LqIENiOdxgaopNdmFtYssGKygU=; b=AK7TMCDzC8ZuDgJ3kuNAjHWlf4GVQo9rXk6Kgs93z/zbBKnxj5/FT/IohlRry/u7Fw e0XI6nbrO3Wgy78KN0KZirmvz8k34EC663Vtyb6T7RWzKbnFHG6RPt5Q7wGvT53k4BRh km9byOq+w7RaZ/2xAPbOLUKO3smGxPBKp1gMtfd1tYkwOxfZnZV9iQ/NB9Ud2WRFl3Uq NM3wgepQ9xF/fY4F0+j16W8q/zYH4t0PbkpD4HZ3qvxLsBzyxe3A+CG2bv9ibpLvzJDY 57d6oM+AN0n0YYLTG+Ux+VptbuwyJtefpLT14tUCfEaTqjP2FBIcWsLFMB83q/wIa+k9 PLVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=y/UILGqr901O8jrU5LqIENiOdxgaopNdmFtYssGKygU=; b=JkGfrGIUjrsCluAXSoevGn+/1KdfPiaSDOIhFg43w7jG/bgTW1VFH4Srs0agoz/lHB 5uiD1ln3PS6QSWfWQVNoQWWEjcQXxy5RYHvFgC1GhbSxnVIQuLAk18NGB/43rq9cJUQa WOA2rB2dHbFnW3ypqkoTF4I8ajI1ajMu4JjJENisblJQJ8/AbKmFQQ2svIZAKFu7QhTt zThv38TgGbMzWM8mzxz/zsLop/s0ZrvcIx4ANtAa4BCd5h45J+IflRtUA737A/PJrrRW nFwrjfKvvTZ9nyfyVnAvDdPGsPRJhVvOGXlQpP4m5pxvPymIYbyodtrj+oN3PRDihApx Z+gw== X-Gm-Message-State: APjAAAX7XTPGSJW6YNj6rqEIsA4N7Xrm/2BSLoL78nlgSiW17qK7BLNL pC1utoQkCwN5/CNHk1D+GmgYE8zC0tagc2i6/E2nlr7n1DD4XIZawd4XrLKJ3X6fU9yO1mApkIh EqKUOWofUTJxQRHhrq/PeCan33Wk4WzGx2JwtfCS622PAm8PDwvFKSpfMxG7+MCDzpxbfNdT5qc CB24iL4WUNYg== X-Google-Smtp-Source: APXvYqxhWisEcEVvfNk9YUPIihHv5MwB2a/a+wzaEQu7x4LlgBGmhEoaGD3Sr8QzRl7Y10dl1Iw16w== X-Received: by 2002:a63:c80c:: with SMTP id z12mr45727054pgg.397.1552575211291; Thu, 14 Mar 2019 07:53:31 -0700 (PDT) Received: from localhost.localdomain ([114.143.109.178]) by smtp.gmail.com with ESMTPSA id x23sm49784463pfe.0.2019.03.14.07.53.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:53:29 -0700 (PDT) To: PostgreSQL-development From: tushar Subject: [sqlsmith] Failed assertion at relnode.c Message-ID: <7d72ab20-c725-3ce2-f99d-4e64dd8a0de6@enterprisedb.com> Date: Thu, 14 Mar 2019 20:23:26 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, While running sqlsmith against 12devel, got the the following assertion-  (issue is reproducible  on v10/v11 as well) TRAP: FailedAssertion("!(bms_is_subset(appendrel->lateral_relids, required_outer))", File: "relnode.c", Line: 1521) stack trace - #0  0x00007f2a2f349277 in raise () from /lib64/libc.so.6 #1  0x00007f2a2f34a968 in abort () from /lib64/libc.so.6 #2  0x0000000000893727 in ExceptionalCondition (conditionName=conditionName@entry=0xa44ae8 "!(bms_is_subset(appendrel->lateral_relids, required_outer))",     errorType=errorType@entry=0x8e1de9 "FailedAssertion", fileName=fileName@entry=0xa441e4 "relnode.c", lineNumber=lineNumber@entry=1521) at assert.c:54 #3  0x00000000006f2e0c in get_appendrel_parampathinfo (appendrel=appendrel@entry=0x7f2a300e0b10, required_outer=required_outer@entry=0x0) at relnode.c:1521 #4  0x00000000006e7d1d in create_append_path (root=root@entry=0x0, rel=rel@entry=0x7f2a300e0b10, subpaths=subpaths@entry=0x0, partial_subpaths=partial_subpaths@entry=0x0,     required_outer=required_outer@entry=0x0, parallel_workers=parallel_workers@entry=0, parallel_aware=parallel_aware@entry=false, partitioned_rels=partitioned_rels@entry=0x0,     rows=rows@entry=-1) at pathnode.c:1239 #5  0x00000000006a7fc7 in set_dummy_rel_pathlist (rel=rel@entry=0x7f2a300e0b10) at allpaths.c:1976 #6  0x00000000006a95e9 in set_subquery_pathlist (rte=, rti=2, rel=0x7f2a300e0b10, root=0x29975e0) at allpaths.c:2162 #7  set_rel_size (root=root@entry=0x29975e0, rel=rel@entry=0x7f2a300e0b10, rti=rti@entry=2, rte=) at allpaths.c:422 #8  0x00000000006ab1ed in set_base_rel_sizes (root=) at allpaths.c:324 #9  make_one_rel (root=root@entry=0x29975e0, joinlist=joinlist@entry=0x7f2a300e1e88) at allpaths.c:186 #10 0x00000000006cad5d in query_planner (root=root@entry=0x29975e0, tlist=tlist@entry=0x7f2a300e0608, qp_callback=qp_callback@entry=0x6cb920 ,     qp_extra=qp_extra@entry=0x7ffc93d63d20) at planmain.c:265 #11 0x00000000006cf3ac in grouping_planner (root=root@entry=0x29975e0, inheritance_update=inheritance_update@entry=false, tuple_fraction=, tuple_fraction@entry=0)     at planner.c:1933 #12 0x00000000006d1b85 in subquery_planner (glob=glob@entry=0x29beb88, parse=parse@entry=0x29be638, parent_root=parent_root@entry=0x0, hasRecursion=hasRecursion@entry=false,     tuple_fraction=tuple_fraction@entry=0) at planner.c:1001 #13 0x00000000006d2e36 in standard_planner (parse=0x29be638, cursorOptions=256, boundParams=0x0) at planner.c:417 #14 0x000000000078793d in pg_plan_query (querytree=querytree@entry=0x29be638, cursorOptions=cursorOptions@entry=256, boundParams=boundParams@entry=0x0) at postgres.c:878 #15 0x0000000000787a1e in pg_plan_queries (querytrees=, cursorOptions=cursorOptions@entry=256, boundParams=boundParams@entry=0x0) at postgres.c:968 #16 0x0000000000787eba in exec_simple_query (     query_string=0x29979f8 "select\n  subq_1.c5 as c0\nfrom\n pg_catalog.pg_description as ref_0,\n  lateral (select\n subq_0.c11 as c0,\n        ref_0.objsubid as c1,\n ref_0.classoid as c2,\n        ref_2.action_referen"...) at postgres.c:1143 #17 0x00000000007890d2 in PostgresMain (argc=, argv=argv@entry=0x29c1300, dbname=0x29c1140 "postgres", username=) at postgres.c:4256 #18 0x000000000047cee2 in BackendRun (port=, port=) at postmaster.c:4399 #19 BackendStartup (port=0x29b9120) at postmaster.c:4090 #20 ServerLoop () at postmaster.c:1703 #21 0x00000000007105ff in PostmasterMain (argc=argc@entry=3, argv=argv@entry=0x2991ce0) at postmaster.c:1376 #22 0x000000000047e083 in main (argc=3, argv=0x2991ce0) at main.c:228 (gdb) q Query - ==== select   subq_1.c5 as c0 from   pg_catalog.pg_description as ref_0,   lateral (select         subq_0.c11 as c0,         ref_0.objsubid as c1,         ref_0.classoid as c2,         ref_2.action_reference_new_row as c3,         ref_4.opfmethod as c4,         pg_catalog.pg_postmaster_start_time() as c5       from         pg_catalog.pg_prepared_statements as ref_1             inner join information_schema.triggers as ref_2               left join pg_catalog.pg_subscription_rel as ref_3               on ((select idx_scan from pg_catalog.pg_stat_all_indexes limit 1 offset 6)                      > (select idx_blks_read from pg_catalog.pg_statio_sys_indexes limit 1 offset 1)                     )             on (cast(null as macaddr) <= cast(null as macaddr))           left join pg_catalog.pg_opfamily as ref_4           on (ref_0.description is NULL),         lateral (select               ref_2.trigger_schema as c0,               ref_2.action_reference_old_row as c1,               ref_4.opfmethod as c2,               ref_1.statement as c3,               ref_0.objoid as c4,               ref_2.action_reference_old_table as c5,               ref_2.event_object_catalog as c6,               ref_2.event_object_schema as c7,               ref_2.trigger_catalog as c8,               ref_0.description as c9,               ref_4.opfname as c10,               sample_0.stxname as c11             from               pg_catalog.pg_statistic_ext as sample_0 tablesample system (2.7)             where cast(null as point) @ cast(null as polygon)             limit 105) as subq_0       where (true)         and ((ref_4.opfname is NULL)           and (cast(null as int8) < ref_0.objsubid))) as subq_1 where subq_1.c5 is not NULL limit 79; -- regards,tushar EnterpriseDB https://www.enterprisedb.com/ The Enterprise PostgreSQL Company