Re: BUG #18877: PostgreSQL triggers assertion failure - Mailing list pgsql-bugs
From | Kirill Reshke |
---|---|
Subject | Re: BUG #18877: PostgreSQL triggers assertion failure |
Date | |
Msg-id | CALdSSPipq9ZNW0gEPdvJN0R=XZ7Me66-S0_O07U5AsgNjcPnnA@mail.gmail.com Whole thread Raw |
In response to | BUG #18877: PostgreSQL triggers assertion failure (PG Bug reporting form <noreply@postgresql.org>) |
List | pgsql-bugs |
On Fri, 4 Apr 2025 at 20:57, PG Bug reporting form <noreply@postgresql.org> wrote: > > The following bug has been logged on the website: > > Bug reference: 18877 > Logged by: Yu Liang > Email address: luy70@psu.edu > PostgreSQL version: 17.4 > Operating system: Ubuntu 24.04 LTS ARM64 VM > Description: > > In the debug build of PostgreSQL 17.4, compiled with `configure > --enable-debug --prefix=$(pwd) --exec-prefix=$(pwd) --enable-cassert`, > triggered Assertion Failure when executing the following statement: > > ```sql > SELECT ALL GROUP BY ALL ( ), CUBE ( CASE WHEN FALSE THEN TRUE END ) > INTERSECT ALL SELECT ALL FROM JSON_ARRAY ( WITH any_cte_name AS ( ( TABLE > v00 ) ) VALUES ( FALSE ) ), any_table_name GROUP BY CUBE ( CASE WHEN TRUE > THEN FALSE END ); > ``` > > The assertion triggered is: Assert("IsA(cte->ctequery, InsertStmt) || > IsA(cte->ctequery, UpdateStmt) || IsA(cte->ctequery, DeleteStmt) || > IsA(cte->ctequery, MergeStmt)"). > File: "/home/postgresql/postgres/bld/../src/backend/parser/parse_cte.c", > Line: 150. > Hi! I rechecked on master, issue persist here too. bt: ``` (gdb) bt #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89 #3 0x0000739820e4527e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #4 0x0000739820e288ff in __GI_abort () at ./stdlib/abort.c:79 #5 0x000061fef3d4c870 in ExceptionalCondition ( conditionName=0x61fef3eb5600 "IsA(cte->ctequery, InsertStmt) || IsA(cte->ctequery, UpdateStmt) || IsA(cte->ctequery, DeleteStmt) || IsA(cte->ctequery, MergeStmt)", fileName=0x61fef3eb5588 "parse_cte.c", lineNumber=147) at assert.c:66 #6 0x000061fef370d92d in transformWithClause (pstate=0x61ff1f53a9a8, withClause=0x61ff1f44e9e8) at parse_cte.c:147 #7 0x000061fef36c745c in transformValuesClause (pstate=0x61ff1f53a9a8, stmt=0x61ff1f44ea98) at analyze.c:1641 #8 0x000061fef36c4f8b in transformStmt (pstate=0x61ff1f53a9a8, parseTree=0x61ff1f44ea98) at analyze.c:456 #9 0x000061fef36c4b10 in parse_sub_analyze (parseTree=0x61ff1f44ea98, parentParseState=0x61ff1f47a388, parentCTE=0x0, locked_from_parent=false, resolve_unknowns=true) at analyze.c:234 #10 0x000061fef36fe961 in transformRangeSubselect (pstate=0x61ff1f47a388, r=0x61ff1f53a3c8) at parse_clause.c:430 #11 0x000061fef370056c in transformFromClauseItem (pstate=0x61ff1f47a388, n=0x61ff1f53a3c8, top_nsitem=0x7ffe1cf76d70, namespace=0x7ffe1cf76d78) at parse_clause.c:1087 #12 0x000061fef36fe136 in transformFromClause (pstate=0x61ff1f47a388, frmList=0x61ff1f53d070) at parse_clause.c:131 #13 0x000061fef36c6dc2 in transformSelectStmt (pstate=0x61ff1f47a388, stmt=0x61ff1f47a278) at analyze.c:1497 #14 0x000061fef36c4fb5 in transformStmt (pstate=0x61ff1f47a388, parseTree=0x61ff1f47a278) at analyze.c:458 #15 0x000061fef36c4b10 in parse_sub_analyze (parseTree=0x61ff1f47a278, parentParseState=0x61ff1f479c98, parentCTE=0x0, locked_from_parent=false, resolve_unknowns=true) at analyze.c:234 #16 0x000061fef3714afe in transformSubLink (pstate=0x61ff1f479c98, sublink=0x61ff1f53a378) at parse_expr.c:1881 #17 0x000061fef371126d in transformExprRecurse (pstate=0x61ff1f479c98, expr=0x61ff1f53a378) at parse_expr.c:253 #18 0x000061fef371906c in transformJsonArrayQueryConstructor (pstate=0x61ff1f479c98, ctor=0x61ff1f44ec18) at parse_expr.c:3823 #19 0x000061fef371148a in transformExprRecurse (pstate=0x61ff1f479c98, expr=0x61ff1f44ec18) at parse_expr.c:342 #20 0x000061fef3710ee4 in transformExpr (pstate=0x61ff1f479c98, expr=0x61ff1f44ec18, exprKind=EXPR_KIND_FROM_FUNCTION) at parse_expr.c:128 #21 0x000061fef36fee2e in transformRangeFunction (pstate=0x61ff1f479c98, r=0x61ff1f44ec68) at parse_clause.c:587 #22 0x000061fef37005ee in transformFromClauseItem (pstate=0x61ff1f479c98, n=0x61ff1f44ec68, top_nsitem=0x7ffe1cf77380, namespace=0x7ffe1cf77388) at parse_clause.c:1100 #23 0x000061fef36fe136 in transformFromClause (pstate=0x61ff1f479c98, frmList=0x61ff1f44ed88) at parse_clause.c:131 #24 0x000061fef36c6dc2 in transformSelectStmt (pstate=0x61ff1f479c98, stmt=0x61ff1f44f068) at analyze.c:1497 #25 0x000061fef36c4fb5 in transformStmt (pstate=0x61ff1f479c98, parseTree=0x61ff1f44f068) at analyze.c:458 #26 0x000061fef36c4b10 in parse_sub_analyze (parseTree=0x61ff1f44f068, parentParseState=0x61ff1f44f308, parentCTE=0x0, locked_from_parent=false, resolve_unknowns=false) at analyze.c:234 #27 0x000061fef36c8d25 in transformSetOperationTree (pstate=0x61ff1f44f308, stmt=0x61ff1f44f068, isTopLevel=false, targetlist=0x7ffe1cf77648) at analyze.c:2207 #28 0x000061fef36c90b0 in transformSetOperationTree (pstate=0x61ff1f44f308, stmt=0x61ff1f44f178, isTopLevel=true, targetlist=0x0) at analyze.c:2297 #29 0x000061fef36c7ff4 in transformSetOperationStmt (pstate=0x61ff1f44f308, stmt=0x61ff1f44f178) at analyze.c:1915 #30 0x000061fef36c4fd1 in transformStmt (pstate=0x61ff1f44f308, parseTree=0x61ff1f44f178) at analyze.c:460 #31 0x000061fef36c4e13 in transformOptionalSelectInto (pstate=0x61ff1f44f308, parseTree=0x61ff1f44f178) at analyze.c:388 #32 0x000061fef36c4cfe in transformTopLevelStmt (pstate=0x61ff1f44f308, parseTree=0x61ff1f44f288) at analyze.c:341 #33 0x000061fef36c480c in parse_analyze_fixedparams (parseTree=0x61ff1f44f288, sourceText=0x61ff1f44d7e0 "SELECT ALL GROUP BY ALL ( ), CUBE ( CASE WHEN FALSE THEN TRUE END )\nINTERSECT ALL SELECT ALL FROM JSON_ARRAY ( WITH any_cte_name AS ( ( TABLE\nv00 ) ) VALUES ( FALSE ) ), any_table_name GROUP BY CUBE ("..., paramTypes=0x0, numParams=0, queryEnv=0x0) at analyze.c:122 #34 0x000061fef3b3e7b2 in pg_analyze_and_rewrite_fixedparams (parsetree=0x61ff1f44f288, query_string=0x61ff1f44d7e0 "SELECT ALL GROUP BY ALL ( ), CUBE ( CASE WHEN FALSE THEN TRUE END )\nINTERSECT ALL SELECT ALL FROM JSON_ARRAY ( WITH any_cte_name AS ( ( TABLE\nv00 ) ) VALUES ( FALSE ) ), any_table_name GROUP BY CUBE ("..., paramTypes=0x0, numParams=0, queryEnv=0x0) at postgres.c:682 #35 0x000061fef3b3f265 in exec_simple_query ( query_string=0x61ff1f44d7e0 "SELECT ALL GROUP BY ALL ( ), CUBE ( CASE WHEN FALSE THEN TRUE END )\nINTERSECT ALL SELECT ALL FROM JSON_ARRAY ( WITH any_cte_name AS ( ( TABLE\nv00 ) ) VALUES ( FALSE ) ), any_table_name GROUP BY CUBE ("...) at postgres.c:1189 #36 0x000061fef3b44be5 in PostgresMain (dbname=0x61ff1f488e90 "reshke", username=0x61ff1f488e78 "reshke") at postgres.c:4768 #37 0x000061fef3b3ab3f in BackendMain (startup_data=0x7ffe1cf77d30, startup_data_len=24) at backend_startup.c:124 #38 0x000061fef3a3be3b in postmaster_child_launch (child_type=B_BACKEND, child_slot=1, startup_data=0x7ffe1cf77d30, startup_data_len=24, client_sock=0x7ffe1cf77d90) at launch_backend.c:290 #39 0x000061fef3a42895 in BackendStartup (client_sock=0x7ffe1cf77d90) at postmaster.c:3579 #40 0x000061fef3a3fdd9 in ServerLoop () at postmaster.c:1701 #41 0x000061fef3a3f6cf in PostmasterMain (argc=3, argv=0x61ff1f447080) at postmaster.c:1399 --Type <RET> for more, q to quit, c to continue without paging-- #42 0x000061fef38dd0c6 in main (argc=3, argv=0x61ff1f447080) at main.c:227 (gdb) ``` cte->ctequery is T_Query here, commandType = CMD_SELECT -- Best regards, Kirill Reshke
pgsql-bugs by date: