From: Andreas Seltenreich <seltenreich@gmx.de>
To: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Chapman Flack <chap@anastigmatix.net>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: [HACKERS] MERGE SQL Statement for PG11
Date: Sat, 07 Apr 2018 21:11:48 +0200
Message-ID: <871sfq3k7f.fsf@ansel.ydns.eu> (raw)
In-Reply-To: <CABOikdPs6=fQiHZsOt12pJ7+1w3ChaCkNpHJmYAdhaovpBBSUA@mail.gmail.com>
References: <CANP8+jLdJoqjzkEdfqy_Rw43gUk08btunpJVV7Yiw=UqtOtePw@mail.gmail.com>
<CAH2-WznpEqdzL_sgWOHfmb9jz6612JLkhdN5YcdmdW3qX3g4Uw@mail.gmail.com>
<CANP8+jKTuZ5NDCLkqXBm9kMeaT-jNxxhkMg+FOpLni=pwOQ=BA@mail.gmail.com>
<CANP8+jKJee2Luip7tv4KrK8R_EP5PbOvDD+vfUpp9uBFmfK9yg@mail.gmail.com>
<CANP8+jK8YRSCrg8m8XiRMmoy9DfvL=hUQ1SpS=+y=920evbTvg@mail.gmail.com>
<CAFj8pRCUbOsyD5ny1UvoZciEbk3Q1YJj+gjEta=1X8dGb1cjSA@mail.gmail.com>
<CANP8+jL86yJU0cx09DCWZVT=ZAo4JK1oqS_0s0t=WUN-FP9iaQ@mail.gmail.com>
<CAFj8pRApqwbS9ZBf38=vg38rU90dotukx22xxV+Oe8fiCv=3Kg@mail.gmail.com>
<CANP8+jKoE=AXPz+gMdxXgod7UO_C8OGwJ6aD+A4b5nfxLOzQrA@mail.gmail.com>
<20180129154457.GC11613@momjian.us>
<CANP8+jLDtMxYXJ95ffA3PYqAVfTkh3V42W9TYWAJH6PsAgOocg@mail.gmail.com>
<495e24a5-d5bf-3ef2-ccdd-dd112c1c3a15@anastigmatix.net>
<CANP8+j+icDb4=+zVUiRN60TAf9s9WT+6dOoWQqDu+B90xATRHA@mail.gmail.com>
<CAFj8pRA7=C9yPJW_iG2Es-qBkZt-hSUFmF+cqZGoHU5SAPj_kw@mail.gmail.com>
<CANP8+j+YDPtO9KsMX2ztXLxHjpmjef3ytfmhRfvK48db0o4btg@mail.gmail.com>
<87k1vtdexn.fsf@ansel.ydns.eu>
<CANP8+jLQ81X0dR2k2i6eOwg4226GGoTbRS6_e=6oDdmBRXwXYQ@mail.gmail.com>
<87a7wpc5n3.fsf@ansel.ydns.eu>
<CABOikdPtfpMoeWR827-fRy0Q2=3scGaRFDHY+HZ_cG0zJYV09w@mail.gmail.com>
<87371yczqk.fsf@ansel.ydns.eu>
<CABOikdPs6=fQiHZsOt12pJ7+1w3ChaCkNpHJmYAdhaovpBBSUA@mail.gmail.com>
Hi,
sqlsmith triggered an assertion with the following MERGE statement
against the regression database. Testing was done with master at
039eb6e92f. Backtrace below.
regards,
Andreas
MERGE INTO public.pagg_tab_ml_p3 as target_0
USING public.hash_i4_heap as ref_0
ON target_0.b = ref_0.seqno
WHEN MATCHED AND ((select bitcol from public.brintest limit 1 offset 92)
> cast(null as "bit"))
and (false)
THEN UPDATE set
b = target_0.b,
a = target_0.b
WHEN NOT MATCHED
AND cast(null as text) ~ cast(nullif(case when cast(null as float8) <= cast(null as float8) then cast(null as text) else cast(null as text) end
,
cast(null as text)) as text)
THEN DO NOTHING;
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007f25474cf42a in __GI_abort () at abort.c:89
#2 0x0000556c14b75bb3 in ExceptionalCondition (
conditionName=conditionName@entry=0x556c14d09bf8 "!(list != ((List *) ((void *)0)))",
errorType=errorType@entry=0x556c14bc4dbd "FailedAssertion", fileName=fileName@entry=0x556c14d3022c "list.c",
lineNumber=lineNumber@entry=390) at assert.c:54
#3 0x0000556c1495d580 in list_nth_cell (list=<optimized out>, n=<optimized out>) at list.c:390
#4 0x0000556c1495d5d6 in list_nth (list=list@entry=0x0, n=<optimized out>) at list.c:413
#5 0x0000556c14911fa5 in adjust_partition_tlist (tlist=0x0, map=<optimized out>, map=<optimized out>) at execPartition.c:1266
#6 0x0000556c14913049 in ExecInitPartitionInfo (mtstate=mtstate@entry=0x556c16c163e8, resultRelInfo=<optimized out>,
proute=proute@entry=0x556c16c29988, estate=estate@entry=0x556c16c15bf8, partidx=0) at execPartition.c:683
#7 0x0000556c1490ff80 in ExecMergeMatched (junkfilter=0x556c16c15bf8, tupleid=0x7ffe8088a10a, slot=0x556c16c22e20,
estate=0x556c16c15bf8, mtstate=0x556c16c163e8) at execMerge.c:205
#8 ExecMerge (mtstate=mtstate@entry=0x556c16c163e8, estate=estate@entry=0x556c16c15bf8, slot=slot@entry=0x556c16c22e20,
junkfilter=junkfilter@entry=0x556c16c2b730, resultRelInfo=resultRelInfo@entry=0x556c16c15e48) at execMerge.c:127
#9 0x0000556c14933614 in ExecModifyTable (pstate=0x556c16c163e8) at nodeModifyTable.c:2179
#10 0x0000556c1490c0ca in ExecProcNode (node=0x556c16c163e8) at ../../../src/include/executor/executor.h:239
#11 ExecutePlan (execute_once=<optimized out>, dest=0x556c16c111b8, direction=<optimized out>, numberTuples=0,
sendTuples=<optimized out>, operation=CMD_MERGE, use_parallel_mode=<optimized out>, planstate=0x556c16c163e8,
estate=0x556c16c15bf8) at execMain.c:1729
#12 standard_ExecutorRun (queryDesc=0x556c16c1bce8, direction=<optimized out>, count=0, execute_once=<optimized out>)
at execMain.c:364
#13 0x0000556c14a6ba52 in ProcessQuery (plan=<optimized out>,
sourceText=0x556c16b2ac08 "...", params=0x0,
queryEnv=0x0, dest=0x556c16c111b8, completionTag=0x7ffe8088a500 "") at pquery.c:161
#14 0x0000556c14a6bceb in PortalRunMulti (portal=portal@entry=0x556c16b96468, isTopLevel=isTopLevel@entry=true,
setHoldSnapshot=setHoldSnapshot@entry=false, dest=dest@entry=0x556c16c111b8, altdest=altdest@entry=0x556c16c111b8,
completionTag=completionTag@entry=0x7ffe8088a500 "") at pquery.c:1291
#15 0x0000556c14a6c979 in PortalRun (portal=portal@entry=0x556c16b96468, count=count@entry=9223372036854775807,
isTopLevel=isTopLevel@entry=true, run_once=run_once@entry=true, dest=dest@entry=0x556c16c111b8,
altdest=altdest@entry=0x556c16c111b8, completionTag=0x7ffe8088a500 "") at pquery.c:804
#16 0x0000556c14a6859b in exec_simple_query (
query_string=0x556c16b2ac08 "MERGE INTO public.pagg_tab_ml_p3 as target_0\nUSING public.hash_i4_heap as ref_0\nON target_0.b = ref_0.seqno\nWHEN MATCHED AND ((select bitcol from public.brintest limit 1 offset 92)\n > cast(null as \"bi"...) at postgres.c:1121
#17 0x0000556c14a6a341 in PostgresMain (argc=<optimized out>, argv=argv@entry=0x556c16b56ad8, dbname=<optimized out>,
username=<optimized out>) at postgres.c:4149
#18 0x0000556c1474eac4 in BackendRun (port=0x556c16b4c030) at postmaster.c:4409
#19 BackendStartup (port=0x556c16b4c030) at postmaster.c:4081
#20 ServerLoop () at postmaster.c:1754
#21 0x0000556c149ec017 in PostmasterMain (argc=3, argv=0x556c16b257d0) at postmaster.c:1362
#22 0x0000556c1475006d in main (argc=3, argv=0x556c16b257d0) at main.c:228
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: seltenreich@gmx.de, pavan.deolasee@gmail.com, simon@2ndquadrant.com, pavel.stehule@gmail.com, chap@anastigmatix.net, pgsql-hackers@lists.postgresql.org
Subject: Re: [HACKERS] MERGE SQL Statement for PG11
In-Reply-To: <871sfq3k7f.fsf@ansel.ydns.eu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox