Open callin2 opened 5 years ago
Thank you for the report.
I've tried to reproduce this by running the following query.
The first query gives me server closed the connection unexpectedly ...
error.
The second query gives me the expected result.
CREATE GRAPH g;
CREATE ({cid: '1c', sid: '1s', value: '192.168.0.1'});
CREATE ({cid: '2c', sid: '2s', value: '192.168.0.2'});
CREATE ({cid: '3c', sid: '3s', value: '192.168.0.3'});
CREATE ({cid: '4c', sid: '4s', value: '192.168.0.4'});
CREATE ({cid: '5c', sid: '5s', value: '192.168.0.5'});
CREATE ({cid: '6c', sid: '6s', value: '192.168.0.6'});
CREATE ({cid: '7c', sid: '7s', value: '192.168.0.7'});
CREATE ({cid: '8c', sid: '8s', value: '192.168.0.8'});
CREATE ({cid: '9c', sid: '9s', value: '192.168.0.9'});
-- 1
WITH ta AS (
MATCH (n) RETURN properties(n) AS prop LIMIT 5
)
SELECT ta.prop->'cid', ta.prop->'sid', ta.prop->'value' FROM ta;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
-- 2
SELECT ta.prop->'cid', ta.prop->'sid', ta.prop->'value'
FROM (MATCH (n) RETURN properties(n) AS prop LIMIT 5) AS ta;
?column? | ?column? | ?column?
----------+----------+---------------
"1c" | "1s" | "192.168.0.1"
"2c" | "2s" | "192.168.0.2"
"3c" | "3s" | "192.168.0.3"
"4c" | "4s" | "192.168.0.4"
"5c" | "5s" | "192.168.0.5"
(5 rows)
For me both of these return the same results. AgensGraph v2.1.0 on windows. CREATE GRAPH g; SET graph_path = g; CREATE ({cid: '1c', sid: '1s', value: '192.168.0.1'}); CREATE ({cid: '2c', sid: '2s', value: '192.168.0.2'}); CREATE ({cid: '3c', sid: '3s', value: '192.168.0.3'}); CREATE ({cid: '4c', sid: '4s', value: '192.168.0.4'}); CREATE ({cid: '5c', sid: '5s', value: '192.168.0.5'}); CREATE ({cid: '6c', sid: '6s', value: '192.168.0.6'}); CREATE ({cid: '7c', sid: '7s', value: '192.168.0.7'}); CREATE ({cid: '8c', sid: '8s', value: '192.168.0.8'}); CREATE ({cid: '9c', sid: '9s', value: '192.168.0.9'}); --1 with ta as (MATCH (n) RETURN properties(n) as prop limit 5) select ta.prop->'cid', ta.prop->'sid', ta.prop->'value' from ta; ?column? | ?column? | ?column? ----------+----------+--------------- "1c" | "1s" | "192.168.0.1" "2c" | "2s" | "192.168.0.2" "3c" | "3s" | "192.168.0.3" "4c" | "4s" | "192.168.0.4" "5c" | "5s" | "192.168.0.5" (5 rows) --2 select ta.prop->'cid', ta.prop->'sid', ta.prop->'value' from (MATCH (n) RETURN properties(n) as prop limit 5) as ta;
?column? | ?column? | ?column? ----------+----------+--------------- "1c" | "1s" | "192.168.0.1" "2c" | "2s" | "192.168.0.2" "3c" | "3s" | "192.168.0.3" "4c" | "4s" | "192.168.0.4" "5c" | "5s" | "192.168.0.5" (5 rows)
CTE query
subquery
I expect same result. but subquery's result is not what I expect!