BUG #16863: Assert failed in set_plain_rel_size() on processing ~* with a long prefix

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: exclusion(at)gmail(dot)com
Subject: BUG #16863: Assert failed in set_plain_rel_size() on processing ~* with a long prefix
Date: 2021-02-12 19:00:01
Message-ID: 16863-35bf75b1b5ee4032@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16863
Logged by: Alexander Lakhin
Email address: exclusion(at)gmail(dot)com
PostgreSQL version: 13.2
Operating system: Ubuntu 20.04
Description:

On executing the query:
CREATE TABLE test (t text);
SELECT * FROM test WHERE t ~* ('^' || repeat('-', 500));

I get an assertion failure with the following callstack:
Core was generated by `postgres: law regression [local] SELECT
'.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig(at)entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig(at)entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f2fec581859 in __GI_abort () at abort.c:79
#2 0x0000559da7963ff8 in ExceptionalCondition (
conditionName=conditionName(at)entry=0x559da7ab4690 "rel->rows > 0 ||
IS_DUMMY_REL(rel)",
errorType=errorType(at)entry=0x559da79bf028 "FailedAssertion",
fileName=fileName(at)entry=0x559da7ab43b1 "allpaths.c",
lineNumber=lineNumber(at)entry=462) at assert.c:67
#3 0x0000559da7731c94 in set_rel_size (root=root(at)entry=0x559da8c23528,
rel=rel(at)entry=0x559da8c24058, rti=rti(at)entry=1,
rte=rte(at)entry=0x559da8b43978) at allpaths.c:462
#4 0x0000559da7731cd7 in set_base_rel_sizes
(root=root(at)entry=0x559da8c23528) at allpaths.c:323
#5 0x0000559da7733ae8 in make_one_rel (root=root(at)entry=0x559da8c23528,
joinlist=joinlist(at)entry=0x559da8c24700)
at allpaths.c:185
#6 0x0000559da775a68f in query_planner (root=root(at)entry=0x559da8c23528,
qp_callback=qp_callback(at)entry=0x559da775e617 <standard_qp_callback>,
qp_extra=qp_extra(at)entry=0x7ffe0e874eb0)
at planmain.c:269
#7 0x0000559da77617bd in grouping_planner
(root=root(at)entry=0x559da8c23528,
inheritance_update=inheritance_update(at)entry=false,
tuple_fraction=<optimized out>, tuple_fraction(at)entry=0)
at planner.c:2058
#8 0x0000559da7763d5a in subquery_planner (glob=glob(at)entry=0x559da8b43748,
parse=parse(at)entry=0x559da8b43860,
parent_root=parent_root(at)entry=0x0,
hasRecursion=hasRecursion(at)entry=false,
tuple_fraction=tuple_fraction(at)entry=0)
at planner.c:1015
#9 0x0000559da77643f0 in standard_planner (parse=0x559da8b43860,
query_string=<optimized out>, cursorOptions=256,
boundParams=<optimized out>) at planner.c:405
#10 0x0000559da77649e4 in planner (parse=parse(at)entry=0x559da8b43860,
query_string=query_string(at)entry=0x559da8b42550 "SELECT * FROM test WHERE
t ~* ('^' || repeat('-', 500));",
cursorOptions=cursorOptions(at)entry=256,
boundParams=boundParams(at)entry=0x0) at planner.c:275
#11 0x0000559da783e71c in pg_plan_query
(querytree=querytree(at)entry=0x559da8b43860,
query_string=query_string(at)entry=0x559da8b42550 "SELECT * FROM test WHERE
t ~* ('^' || repeat('-', 500));",
cursorOptions=cursorOptions(at)entry=256,
boundParams=boundParams(at)entry=0x0) at postgres.c:875
#12 0x0000559da783e7d9 in pg_plan_queries (querytrees=0x559da8c234f0,
query_string=query_string(at)entry=0x559da8b42550 "SELECT * FROM test WHERE
t ~* ('^' || repeat('-', 500));",
cursorOptions=cursorOptions(at)entry=256,
boundParams=boundParams(at)entry=0x0) at postgres.c:966
#13 0x0000559da783eca9 in exec_simple_query (
query_string=query_string(at)entry=0x559da8b42550 "SELECT * FROM test WHERE
t ~* ('^' || repeat('-', 500));")
at postgres.c:1158
#14 0x0000559da7840cb0 in PostgresMain (argc=<optimized out>,
argv=argv(at)entry=0x559da8b6d7c8, dbname=<optimized out>,
username=<optimized out>) at postgres.c:4329
#15 0x0000559da77ac39f in BackendRun (port=port(at)entry=0x559da8b63ad0) at
postmaster.c:4526
#16 0x0000559da77af4fa in BackendStartup (port=port(at)entry=0x559da8b63ad0) at
postmaster.c:4210
#17 0x0000559da77af741 in ServerLoop () at postmaster.c:1739
#18 0x0000559da77b0c6a in PostmasterMain (argc=3, argv=<optimized out>) at
postmaster.c:1412
#19 0x0000559da76f9e16 in main (argc=3, argv=0x559da8b3c980) at main.c:210

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Lakhin 2021-02-12 20:00:01 Re: BUG #16863: Assert failed in set_plain_rel_size() on processing ~* with a long prefix
Previous Message Tom Lane 2021-02-12 18:57:48 Re: BUG #16862: Unexpected result of checking for null "IS NOT NULL" in function