-
Notifications
You must be signed in to change notification settings - Fork 467
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I discovered that left() function incorrectly processes large negative integers below INT_MIN instead of throwing error.
How are you accessing AGE (Command line, driver, etc.)?
- Command line
What is the command that caused the error?
When a negative integer bigger than INT_MIN is used as the length of left() function, an error will be caused:
SELECT * FROM cypher('test_graph', $$
RETURN LEFT('abcdef', -2147483648) AS ref0
$$) AS (ref0 agtype);ERROR: left() negative values are not supported for length
However, when executing query with large negative integer below -2147483648, the original text will be returned:
SELECT * FROM cypher('test_graph', $$
RETURN LEFT('abcdef', -2147483649) AS ref0, -2147483649 < 0 as ref1
$$) AS (ref0 agtype, ref1 agtype); ref0 | ref1
----------+------
"abcdef" | true
Expected behavior
Both queries above should fail with an error.
Environment:
- Latest in Docker hub
Additional context
I also found this bug in neo4j. Here is the link: neo4j/neo4j#13671
jrgemignani
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working