bitnine-oss / agensgraph

AgensGraph, a transactional graph database based on PostgreSQL
http://www.agensgraph.org
Other
1.32k stars 146 forks source link

Call graph_labid function will kill the connection, in AG2.5 and AG2.12 #570

Closed fourmicao closed 2 years ago

fourmicao commented 2 years ago

When I call graph_labid, connection will be killed.

graphdb=# set graph_path=xxdb; SET graphdb=# select graph_labid('companies'); 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.

Only if the parameter is a number, connection is not killed.

graphdb=# select graph_labid('9.3'); graph_labid

       0

(1 row)

If the parameter is a string, valid or invalid identifier, will kill the connection: graphdb=# select graph_labid('%$^&'); 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.

fourmicao commented 2 years ago

I made a mistake in pass parameter when calling graph_labid function, correct sytax should be 'graph_path_name.vertexoredgename::cstring'. graphdb=# select graph_labid('xxdb.companies'::cstring); graph_labid

       5

(1 row)

graphdb=# select graph_labid('wronggraph.wrongobject'::cstring); graph_labid

       0

(1 row)

Maybe my previous test was misleading, but wrong syntax function call can kill connection is a not good idea.