neo4j / neo4j-browser

Neo4j Browser is the general purpose user interface for working with Neo4j. Query, visualize, administrate and monitor the database.
https://neo4j.com
GNU General Public License v3.0
700 stars 351 forks source link

:use `movies`; throws database not found error #1961

Open ikwattro opened 9 months ago

ikwattro commented 9 months ago

Neo4j Version: 5.15.0 Operating System: Any API: Any

The following statement throws database not found error although the database name is escaped.

:use `movies`;
A database with the "movies`;" name or alias could not be found.

Adding a space before the semicolon works.

Steps to reproduce

As above

Expected behavior

Since the database is escaped, Cypher should understand that the semicolon is not part of the database name.

Actual behavior

database not found error

arnefischereit commented 9 months ago

I assume you are running the above in Browser?

ikwattro commented 9 months ago

@arnefischereit yes

ikwattro commented 9 months ago

@arnefischereit and I just checked, in cypher-shell it does work correctly

neo4j@neo4j> :use `senzing`;
neo4j@senzing>
OskarDamkjaer commented 9 months ago

@ikwattro I did some testing and seems the problem is with the semicolon, a hint is in the error message that the database ""movies`;" wasn't found.

 :use `movies` // <-- works fine
 :use `movies`; // <-- breaks 

Should be straightforward to fix, I'll move the issue to Browser. Thanks for reporting it :+1:

ikwattro commented 9 months ago

@OskarDamkjaer Yes I got the issue was the semicolon, however it works from cypher-shell so I believe it should work from the browser surface as well. Secondly we generate multi-statements scripts to paste in the browser and it seems the :use clause is the only one causing issues with the semicolon.

OskarDamkjaer commented 9 months ago

@ikwattro I agree it's a bug we should fix. For your generated scripts I think I adding an extra space can would be a workaround you could use in the meantime:

:use `movies` ;
create ()

The above worked when I tried it just now.