Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

when use "select count(*) from foregin_table_name" will cause "CypherSyntaxError" #16

Closed
222momo opened this issue Dec 25, 2021 · 3 comments
Labels

Comments

@222momo
Copy link

222momo commented Dec 25, 2021

when use "select count(*) from foregin_table_name" will cause "CypherSyntaxError"

  • Postgres version: 10.9
  • Neo4j version : 3.5
  • Steps to reproduce
  • 1.create a foreign table of neo4j in pg, e.g.
  • CREATE FOREIGN TABLE neo2.dwf_node_location( state character varying NULL COLLATE pg_catalog."default", city character varying NULL COLLATE pg_catalog."default" ) SERVER neo2 OPTIONS (cypher 'MATCH (n:Location) RETURN n.state AS state,n.city AS city');
  • 2.excute sql
  • select count(*) from dwf_node_location
  • Expected behavior
  • result is 4
  • Actual behavior
  • but it causes "CypherSyntaxError" .The debug info is as follows.
    image

Reason

I found these codes cause the bug
the file is neo4jPg/neo4jfdw.py
in line 169
if(needUpdateProjection and len(columns) < len(self.columns)):
I rewrite the code.
if(needUpdateProjection and len(columns) > 0 and len(columns) < len(self.columns)):
The CypherSyntaxError disappeared.

@222momo 222momo added the bug label Dec 25, 2021
@stale
Copy link

stale bot commented Feb 23, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 23, 2022
@sim51 sim51 removed the wontfix label Feb 23, 2022
@sim51
Copy link
Owner

sim51 commented Feb 23, 2022

Thanks stale bot, I forgot this issue :D
Sorry for the lag momo.

@sim51 sim51 closed this as completed in 9e68b0b Feb 23, 2022
@sim51
Copy link
Owner

sim51 commented Feb 23, 2022

A new unit test has been added for this use-case (ie. a count(*) without a here clause).

The fix is part of the release 4.3.2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants