agensgraph icon indicating copy to clipboard operation
agensgraph copied to clipboard

optional match query error A result was returned when none was expected.;

Open VinACE opened this issue 6 years ago • 5 comments

[FAIL] DataAccessException->StatementCallback; SQL [ OPTIONAL MATCH (m : mat )-[ r1 : B_BY ]->(p : plant) return m, r1, p limit 10 ;]; A result was returned when none was expected.; nested exception is org.postgresql.util.PSQLException: A result was returned when none was expected., SQL Code->0100E

But the above query works without the optional keyword MATCH (m : mat )-[ r1 : B_BY ]->(p : plant) return m, r1, p limit 10

VinACE avatar Sep 12 '18 06:09 VinACE

Could you explain the execution environment? Does it occur in AgensBrowser?

bylee5 avatar Sep 12 '18 07:09 bylee5

~> agens b_c agens (AgensGraph 1.4devel, based on PostgreSQL 10.3) Is this what you are asking for, Also Iam running the queries in agens browser -- this one gave the below error again A result was returned when none was expected.; nested exception is org.postgresql.util.PSQLException: A result was returned when none was expected., SQL Code->0100E

but the same query worked in the terminal..

VinACE avatar Sep 12 '18 07:09 VinACE

It appears to be an AgensBrowser bug rather than an AgensGraph.

bylee5 avatar Sep 12 '18 08:09 bylee5

I'm getting the same, in the browser, where a simple:

optional match (a)-[r]-() return *;

gives the above mentioned error, while the command line client returns:

postgres=# optional match (a)-[r]-() return *;
                             a                             |              r
-----------------------------------------------------------+-----------------------------
 source_type[10.1]{"name": "clients-list"}                 | type[14.1][13.1,10.1]{}
 source_type[10.1]{"name": "clients-list"}                 | depends[12.1][10.5,10.1]{}
 ...
 source_type[10.2]{"name": "products-list"}                | depends[12.9][10.6,10.2]{}
 source_type[10.2]{"name": "products-list"}                | depends[12.11][10.3,10.2]{}
 ...
 source_type[10.3]{"name": "product-details"}              | type[14.4][13.5,10.3]{}
 source_type[10.3]{"name": "product-details"}              | depends[12.12][10.3,10.5]{}
 ...
(28 rows)

Moreover, if I remove the optional keyword from the query on the CLI client, I get the exact same rows in result and the browser is able to draw the corresponding graph. Hence I expect the latter to be able to show the graph when the query has the optional keyword too.

AgensGraph 2.1.3 AgensBrowser 1.0

watery avatar Mar 16 '21 15:03 watery

I don't know if this is related, but I get the same error running (in the browser):

match(a) return a;

while everything is fine for (notice the missing space between the match keyword and the opening parenthesis):

match (a) return a;

Of course they both give the same result when run from the command line.

So maybe there's an issue handling the keywords optional and match during query parsing?

watery avatar Mar 16 '21 16:03 watery