Hi, I was trying sqlsmith on REL_11_STABLE (commit 1b957e59b92dc44c14708762f882d7910463a9ac) with a database i have at hand, and got an assertion failure. It seems to happen during planning on prunning time but only when tables get bigger than certain size.
I configured it with "--enable-debug --enable-depend --enable-cassert", attached is the backtrace and a script to reproduce the problem. -- Jaime Casanova www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
set = {__val = {0, 94906079940272, 4613425733568182272, 0,
4607182418800017408, 0, 0, 0, 0, 0, 4613425733568182272, 0, 0, 0,
4613425733568182272, 0}}
pid = <optimized out>
tid = <optimized out>
#1 0x00007f42bbbe642a in __GI_abort () at abort.c:89
save_stage = 2
act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0},
sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer =
0x7f42ae94cc38}
sigs = {__val = {32, 0 <repeats 15 times>}}
#2 0x000056510b3ca743 in ExceptionalCondition
(conditionName=conditionName@entry=0x56510b570418 "!(relid_subplan_map[rti] ==
0)",
errorType=errorType@entry=0x56510b419c9d "FailedAssertion",
fileName=fileName@entry=0x56510b56ff67 "partprune.c",
lineNumber=lineNumber@entry=244) at assert.c:54
No locals.
#3 0x000056510b2298f5 in make_partition_pruneinfo
(root=root@entry=0x56510becb828, partitioned_rels=0x7f42ae94cc38,
subpaths=0x7f42ae94ca18,
prunequal=prunequal@entry=0x7f42ae950360) at partprune.c:244
rti = <optimized out>
targetpart = 0x0
pinfolist = 0x0
doruntimeprune = false
relid_subplan_map = 0x7f42ae950398
relid_subpart_map = 0x7f42ae950430
lc = <optimized out>
i = <optimized out>
#4 0x000056510b1f4004 in create_append_plan (best_path=0x7f42ae94cb78,
root=0x56510becb828) at createplan.c:1098
prunequal = 0x7f42ae950360
subplans = <optimized out>
subpaths = <optimized out>
rel = 0x56510be5e038
partpruneinfos = 0x0
tlist = 0x7f42ae94d000
#5 create_plan_recurse (root=root@entry=0x56510becb828,
best_path=0x7f42ae94cb78, flags=flags@entry=1) at createplan.c:390
plan = <optimized out>
__func__ = "create_plan_recurse"
#6 0x000056510b1f3a3f in create_limit_plan (flags=1, best_path=0x7f42ae94ce88,
root=0x56510becb828) at createplan.c:2406
plan = <optimized out>
subplan = <optimized out>
#7 create_plan_recurse (root=root@entry=0x56510becb828,
best_path=0x7f42ae94ce88, flags=flags@entry=1) at createplan.c:487
plan = <optimized out>
__func__ = "create_plan_recurse"
#8 0x000056510b1f6580 in create_plan (root=root@entry=0x56510becb828,
best_path=<optimized out>) at createplan.c:318
plan = <optimized out>
#9 0x000056510b204474 in standard_planner (parse=0x56510bb4c728,
cursorOptions=256, boundParams=<optimized out>) at planner.c:412
result = <optimized out>
glob = 0x56510bec8798
tuple_fraction = 0
root = 0x56510becb828
final_rel = <optimized out>
best_path = <optimized out>
top_plan = <optimized out>
lp = <optimized out>
lr = <optimized out>
#10 0x000056510b2bac5d in pg_plan_query (querytree=0x56510bb4c728,
cursorOptions=256, boundParams=0x0) at postgres.c:809
plan = <optimized out>
#11 0x000056510b2bad3e in pg_plan_queries (querytrees=<optimized out>,
cursorOptions=cursorOptions@entry=256, boundParams=boundParams@entry=0x0) at
postgres.c:875
stmt = <optimized out>
stmt_list = 0x0
query_list = 0x56510becb7c8
#12 0x000056510b2bb229 in exec_simple_query (
query_string=0x56510bb254c8 "select \n (select pg_catalog.avg(actu_codi)
from public.actualizar_sistema)\n as c0, \n sample_0.radi_nume_temp as c1,
\n sample_0.radi_usua_ante as c2, \n (select anex_borrado from public.anexos
"...) at postgres.c:1050
portal = <optimized out>
snapshot_set = true
commandTag = 0x56510b537dd6 "SELECT"
completionTag =
"\000\000\000\000\002\000\000\000\t\000\000\000QV\000\000\000\000\000\000\000\000\000\000Q\000\000\000\000\000\000\000\310T\262\vQV\000\000
\a\265\vQV", '\000' <repeats 11 times>, "\331r\216\375\177\000"
querytree_list = <optimized out>
plantree_list = <optimized out>
receiver = <optimized out>
format = 0
dest = DestRemote
parsetree_list = 0x56510bb4c5d8
parsetree_item = 0x56510bb4c5b0
save_log_statement_stats = false
was_logged = false
use_implicit_block = false
msec_str =
"\000\000\000\000\002\000\000\000\t\000\000\000QV\000\000\000\000\000\000\000\000\000\000Q\000\000\000\000\000\000"
__func__ = "exec_simple_query"
#13 0x000056510b2bceb5 in PostgresMain (argc=<optimized out>,
argv=argv@entry=0x56510bb508c8, dbname=<optimized out>, username=<optimized
out>) at postgres.c:4153
query_string = 0x56510bb254c8 "select \n (select
pg_catalog.avg(actu_codi) from public.actualizar_sistema)\n as c0, \n
sample_0.radi_nume_temp as c1, \n sample_0.radi_usua_ante as c2, \n (select
anex_borrado from public.anexos "...
input_message = {
data = 0x56510bb254c8 "select \n (select pg_catalog.avg(actu_codi)
from public.actualizar_sistema)\n as c0, \n sample_0.radi_nume_temp as c1,
\n sample_0.radi_usua_ante as c2, \n (select anex_borrado from public.anexos
"..., len = 591, maxlen = 1024, cursor = 591}
local_sigjmp_buf = {{__jmpbuf = {140726993344800, -2765235628838258191,
94906088752928, 94906088753352, 94906086184128, 94906088714576,
2766756562420464113,
8447755495760296433}, __mask_was_saved = 1, __saved_mask = {__val
= {0, 94906088575920, 1024, 140726993345360, 94906088753352, 94906086184128,
94906081047040, 0, 94906081017914, 94906086184128, 0,
140726993345360, 94906080932126, 94906088581400, 4398046511104,
94905892339712}}}}
send_ready_for_query = false
disable_idle_in_transaction_timeout = false
__func__ = "PostgresMain"
#14 0x000056510afa2ad2 in BackendRun (port=0x56510bb47150) at postmaster.c:4361
ac = 1
secs = 585689381
usecs = 908648
i = 1
av = 0x56510bb508c8
maxac = <optimized out>
#15 BackendStartup (port=0x56510bb47150) at postmaster.c:4033
bn = <optimized out>
pid = <optimized out>
#16 ServerLoop () at postmaster.c:1706
rmask = {fds_bits = {32, 0 <repeats 15 times>}}
selres = <optimized out>
now = <optimized out>
readmask = {fds_bits = {56, 0 <repeats 15 times>}}
last_lockfile_recheck_time = 1532374176
last_touch_time = 1532374108
__func__ = "ServerLoop"
#17 0x000056510b23e9fc in PostmasterMain (argc=3, argv=0x56510bb1f210) at
postmaster.c:1379
opt = <optimized out>
status = <optimized out>
userDoption = <optimized out>
listen_addr_saved = <optimized out>
i = <optimized out>
output_config_variable = <optimized out>
__func__ = "PostmasterMain"
#18 0x000056510afa413d in main (argc=3, argv=0x56510bb1f210) at main.c:228
No locals.
crash.sql
Description: application/sql
