Skip to content

Unexpected behavior when using empty string '' in string functions in Apache AGE #2201

@Phasheng

Description

@Phasheng

Describe the bug
I observed an unexpected behavior in Apache AGE when using empty strings ('') as arguments in string functions such as toLower. According to the documentation, toLower(NULL) returns NULL, which is expected. However, when passing an empty string '' as the argument inside the function, the result is unexpectedly NULL. In contrast, when directly checking if '' IS NULL, it correctly returns false.

How are you accessing AGE (Command line, driver, etc.)?

  • Command line

What is the command that caused the error?

SELECT * FROM cypher('test_graph', $$
  RETURN toLower('') IS NULL AS ref0
$$) AS (ref0 agtype);
-- Result: true

SELECT * FROM cypher('test_graph', $$
  RETURN '' IS NULL AS ref0
$$) AS (ref0 agtype);
-- Result: false

Expected behavior
The two queries executed above should both return false.

Environment (please complete the following information):

  • Version: latest in docker hub

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions