-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server crashes when executing SELECT * FROM cypher('list_comprehension' ...) #1850
Comments
@MuhammadTahaNaveed, hello! One more crash on postgres REL_16_STABLE and Age PG16 on build without cassert.
test.sql: CREATE EXTENSION age;
SET search_path TO ag_catalog;
SELECT create_graph('list_comprehension');
SELECT * FROM cypher('list_comprehension', $$ MATCH(u {list: [0, 2, 4, 6, 8, 10, 12]}) WITh u, collect(u.list) AS v SET u += {b: [u IN range(0, 5)]} SET u.c = [u IN v[0]] RETURN u $$) AS (u agtype);
SELECT * FROM cypher('list_comprehension', $$ MATCH(u {list: [0, 2, 4, 6, 8, 10, 12]}) SET u.c = collect(u.list) RETURN u $$) AS (u agtype); backtrace: #0 MakeExpandedObjectReadOnlyInternal (d=0) at ../../../../src/include/postgres.h:314
#1 0x0000557a290fc397 in ExecInterpExpr (state=0x557a2b3cc9b0, econtext=0x557a2b3cbcb8, isnull=0x7fff2c6eb177) at execExprInterp.c:698
#2 0x0000557a290f9007 in ExecInterpExprStillValid (state=0x557a2b3cc9b0, econtext=0x557a2b3cbcb8, isNull=0x7fff2c6eb177) at execExprInterp.c:1870
#3 0x0000557a291137b6 in ExecEvalExprSwitchContext (isNull=0x7fff2c6eb177, econtext=0x557a2b3cbcb8, state=0x557a2b3cc9b0) at ../../../src/include/executor/executor.h:355
#4 ExecProject (projInfo=0x557a2b3cc9a8) at ../../../src/include/executor/executor.h:389
#5 project_aggregates (aggstate=aggstate@entry=0x557a2b3cb790) at nodeAgg.c:1385
#6 0x0000557a2911468e in agg_retrieve_direct (aggstate=aggstate@entry=0x557a2b3cb790) at nodeAgg.c:2528
#7 0x0000557a291148fe in ExecAgg (pstate=0x557a2b3cb790) at nodeAgg.c:2180
#8 0x0000557a291076ff in ExecProcNodeFirst (node=0x557a2b3cb790) at execProcnode.c:464
#9 0x0000557a29134676 in ExecProcNode (node=0x557a2b3cb790) at ../../../src/include/executor/executor.h:273
#10 SubqueryNext (node=<optimized out>) at nodeSubqueryscan.c:53
#11 0x0000557a2910a5d1 in ExecScanFetch (node=node@entry=0x557a2b3548a0, accessMtd=accessMtd@entry=0x557a29134655 <SubqueryNext>,
recheckMtd=recheckMtd@entry=0x557a2913462b <SubqueryRecheck>) at execScan.c:132
#12 0x0000557a2910a748 in ExecScan (node=0x557a2b3548a0, accessMtd=accessMtd@entry=0x557a29134655 <SubqueryNext>, recheckMtd=recheckMtd@entry=0x557a2913462b <SubqueryRecheck>)
at execScan.c:198
#13 0x0000557a29134650 in ExecSubqueryScan (pstate=<optimized out>) at nodeSubqueryscan.c:87
#14 0x0000557a291076ff in ExecProcNodeFirst (node=0x557a2b3548a0) at execProcnode.c:464
#15 0x00007fb469fd0c48 in ExecProcNode (node=0x557a2b3548a0) at /tmp/pgsql/include/server/executor/executor.h:273
#16 exec_cypher_set (node=0x557a2b354180) at src/backend/executor/cypher_set.c:614
#17 0x0000557a291193b1 in ExecCustomScan (pstate=0x557a2b354180) at nodeCustom.c:124
#18 0x0000557a291076ff in ExecProcNodeFirst (node=0x557a2b354180) at execProcnode.c:464
#19 0x0000557a2912fb4b in ExecProcNode (node=0x557a2b354180) at ../../../src/include/executor/executor.h:273
#20 ExecNestLoop (pstate=0x557a2b353f68) at nodeNestloop.c:109
#21 0x0000557a291076ff in ExecProcNodeFirst (node=0x557a2b353f68) at execProcnode.c:464
#22 0x0000557a2911135c in ExecProcNode (node=0x557a2b353f68) at ../../../src/include/executor/executor.h:273
#23 fetch_input_tuple (aggstate=aggstate@entry=0x557a2b3539b8) at nodeAgg.c:562
#24 0x0000557a291146e5 in agg_retrieve_direct (aggstate=aggstate@entry=0x557a2b3539b8) at nodeAgg.c:2365
#25 0x0000557a291148fe in ExecAgg (pstate=0x557a2b3539b8) at nodeAgg.c:2180
#26 0x0000557a291076ff in ExecProcNodeFirst (node=0x557a2b3539b8) at execProcnode.c:464
#27 0x0000557a29134676 in ExecProcNode (node=0x557a2b3539b8) at ../../../src/include/executor/executor.h:273
#28 SubqueryNext (node=<optimized out>) at nodeSubqueryscan.c:53
#29 0x0000557a2910a5d1 in ExecScanFetch (node=node@entry=0x557a2b353828, accessMtd=accessMtd@entry=0x557a29134655 <SubqueryNext>,
recheckMtd=recheckMtd@entry=0x557a2913462b <SubqueryRecheck>) at execScan.c:132
#30 0x0000557a2910a748 in ExecScan (node=0x557a2b353828, accessMtd=accessMtd@entry=0x557a29134655 <SubqueryNext>, recheckMtd=recheckMtd@entry=0x557a2913462b <SubqueryRecheck>)
at execScan.c:198
#31 0x0000557a29134650 in ExecSubqueryScan (pstate=<optimized out>) at nodeSubqueryscan.c:87
#32 0x0000557a291076ff in ExecProcNodeFirst (node=0x557a2b353828) at execProcnode.c:464
#33 0x00007fb469fd0c48 in ExecProcNode (node=0x557a2b353828) at /tmp/pgsql/include/server/executor/executor.h:273
#34 exec_cypher_set (node=0x557a2b353068) at src/backend/executor/cypher_set.c:614
#35 0x0000557a291193b1 in ExecCustomScan (pstate=0x557a2b353068) at nodeCustom.c:124
#36 0x0000557a291076ff in ExecProcNodeFirst (node=0x557a2b353068) at execProcnode.c:464
#37 0x0000557a29100e7a in ExecProcNode (node=0x557a2b353068) at ../../../src/include/executor/executor.h:273
#38 ExecutePlan (estate=estate@entry=0x557a2b352db0, planstate=0x557a2b353068, use_parallel_mode=<optimized out>, operation=operation@entry=CMD_SELECT, sendTuples=sendTuples@entry=true, numberTuples=numberTuples@entry=0, direction=ForwardScanDirection, dest=0x557a2b3f7aa0, execute_once=true) at execMain.c:1670
#39 0x0000557a29100fe0 in standard_ExecutorRun (queryDesc=0x557a2b3bf350, direction=ForwardScanDirection, count=0, execute_once=<optimized out>) at execMain.c:365
#40 0x0000557a291010be in ExecutorRun (queryDesc=queryDesc@entry=0x557a2b3bf350, direction=direction@entry=ForwardScanDirection, count=count@entry=0, execute_once=<optimized out>) at execMain.c:309
#41 0x0000557a292aa85d in PortalRunSelect (portal=portal@entry=0x557a2b2f4d30, forward=forward@entry=true, count=0, count@entry=9223372036854775807, dest=dest@entry=0x557a2b3f7aa0) at pquery.c:924
#42 0x0000557a292abe22 in PortalRun (portal=portal@entry=0x557a2b2f4d30, count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true, run_once=run_once@entry=true, dest=dest@entry=0x557a2b3f7aa0, altdest=altdest@entry=0x557a2b3f7aa0, qc=0x7fff2c6eb8d0) at pquery.c:768
#43 0x0000557a292a8364 in exec_simple_query (query_string=query_string@entry=0x557a2b2774a0 "SELECT * FROM cypher('list_comprehension', $$ MATCH(u {list: [0, 2, 4, 6, 8, 10, 12]}) WITh u, collect(u.list) AS v SET u += {b: [u IN range(0, 5)]} SET u.c = [u IN v[0]] RETURN u $$) AS (u agtype);") at postgres.c:1274
#44 0x0000557a292aa209 in PostgresMain (dbname=<optimized out>, username=<optimized out>) at postgres.c:4637
#45 0x0000557a2921bfad in BackendRun (port=port@entry=0x557a2b2aaee0) at postmaster.c:4464
#46 0x0000557a2921ed6f in BackendStartup (port=port@entry=0x557a2b2aaee0) at postmaster.c:4192
#47 0x0000557a2921ef0d in ServerLoop () at postmaster.c:1782
#48 0x0000557a292201f3 in PostmasterMain (argc=argc@entry=3, argv=argv@entry=0x557a2b271aa0) at postmaster.c:1466
#49 0x0000557a291540f6 in main (argc=3, argv=0x557a2b271aa0) at main.c:198 |
hello @saygoodbyye The issue is with the query that you have already reported before i.e.
The following query is expected to return error and it does
I am working on a fix for the bug that you reported. I will update you as soon as I have an update or a fix. |
Resolved server crashes related to list comprehension in Cypher queries, addressing issue apache#1850.
I think you should breakdown your complex query into simple blocks then execute one by one to isolate the error within the query -- Create the extension and graph -- Test simpler Cypher queries -- Step 2: Unwind a list If the simplified queries work increase the complexities step by step -- Step 3: Collect a list -- Step 4: Add matching and setting properties SELECT * FROM cypher('list_comprehension', $$ MATCH (n {list: [0, 2, 4, 6, 8, 10, 12]}) RETURN n $$) AS (n agtype); SELECT * FROM cypher('list_comprehension', $$ MATCH (n {list: [0, 2, 4, 6, 8, 10, 12]}) WITH n, collect(n.list) AS v RETURN v $$) AS (v agtype); |
This issue is stale because it has been open 60 days with no activity. Remove "Abondoned" label or comment or this will be closed in 14 days. |
Describe the bug
Server crashes when executing the following SQL-script
How are you accessing AGE (Command line, driver, etc.)?
Accessing AGE through command line.
What data setup do we need to do?
Apache AGE (PG16 branch) with PostgreSQL (REL_16_STABLE).
What is the necessary configuration info needed?
My PostgreSQL configuration:
What is the command that caused the error?
backtrace:
Expected behavior:
Expected ERROR to be shown or sql query to be succesfully executed
Best regards,
Egor Chindyaskin
Postgres Professional: https://postgrespro.com/
The text was updated successfully, but these errors were encountered: