You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "hkjiang26 (via GitHub)" <gi...@apache.org> on 2026/08/13 06:43:47 UTC

[I] `reduce()`/list comprehension in a `LIMIT` or `SKIP` clause raises internal error `unsupported SubLink` (0A000) [age]

hkjiang26 opened a new issue, #2518:
URL: https://github.com/apache/age/issues/2518

   ## Bug description
   
   Putting a `reduce()` expression — or a list comprehension — inside a `LIMIT` or `SKIP` clause makes AGE 1.8.0 fail with the internal error `ERROR: 0A000: unsupported SubLink`. The query has no subquery and no outer variable; the trigger is the `reduce`'s own list iteration variable (`b IN [0]`). Neo4j runs the same statement normally. 
   
   ## Access method
   
   - Command line via `psql`, inside the official Docker container `apache/age:1.8.0`
   
   ## Data setup
   
   No data is required — the error reproduces on an empty graph. Only the graph itself must exist:
   
   ```pgsql
   CREATE EXTENSION IF NOT EXISTS age;
   LOAD 'age';
   SET search_path = ag_catalog, "$user", public;
   SELECT create_graph('graph_test');
   ```
   
   ## Configuration
   
   - None beyond the stock AGE extension. No additional modules (no PostGIS, etc.), default `search_path` handling as shown above.
   
   ## Command that triggers the error
   
   ```pgsql
   SELECT * FROM cypher('graph_test', $$ RETURN 1 LIMIT reduce(a = 1, b IN [0] | a + b) $$) AS (c0 agtype);
   ```
   
   ```
   ERROR:  unsupported SubLink
   ```
   
   (SQLSTATE `0A000`, internal error.) Run the statement on its own (e.g. `psql -c "..."`): when several statements are piped to `psql` at once, stdout/stderr buffering can push the `ERROR` line to a different position in the output and make it look like the query succeeded.
   
   The failure is specific to `LIMIT`/`SKIP`: the same `reduce` returns a row without one, and `LIMIT` accepts other data-free expressions:
   
   ```pgsql
   -- works: reduce without LIMIT
   SELECT * FROM cypher('graph_test', $$ RETURN reduce(a = 1, b IN [0] | a + b) $$) AS (c0 agtype);
   -- works: arithmetic / function in LIMIT
   SELECT * FROM cypher('graph_test', $$ RETURN 1 LIMIT 1 + 1 $$) AS (c0 agtype);
   SELECT * FROM cypher('graph_test', $$ RETURN 1 LIMIT size([0, 0]) $$) AS (c0 agtype);
   ```
   
   ## Environment
   
   - Version: 1.8.0 (official `apache/age:1.8.0` Docker image)
   - PostgreSQL: 18.1 (Debian 18.1-1.pgdg13+2), x86_64
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] `reduce()`/list comprehension in a `LIMIT` or `SKIP` clause raises internal error `unsupported SubLink` (0A000) [age]

Posted by "gregfelice (via GitHub)" <gi...@apache.org>.
gregfelice commented on issue #2518:
URL: https://github.com/apache/age/issues/2518#issuecomment-5370015307

   Confirmed still reproducing on current master (`4d9b2506`, AGE 1.8.0) built against PostgreSQL 18.4, in a fresh database:
   
   ```
   ERROR:  unsupported SubLink
   LINE 1: ...ECT * FROM cypher('graph_test', $$ RETURN 1 LIMIT reduce(a =...
   ```
   
   Triaged as part of a sweep over the current fuzz-report backlog against master. This one is a clean error rather than a crash — recording it so it is not assumed stale just because it was filed against an older image.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org