hkjiang26 opened a new issue, #2590:
URL: https://github.com/apache/age/issues/2590

   **AGE Version:** Apache AGE extension 1.8.0 on PostgreSQL 18.6
   
   **Installation Method:** Docker
   
   **API:** Cypher
   
   ### Steps to reproduce
   
   ```sql
   LOAD 'age';
   SET search_path = ag_catalog, public;
   SELECT * FROM ag_catalog.create_graph('gdbug');
   SELECT * FROM cypher('gdbug', $$ RETURN (-9223372036854775807 - 1) / -1 $$) 
AS (r agtype);
   ```
   
   
   ### Expected behavior
   
   `+9223372036854775808` is outside the signed 64-bit range, so this should 
fail with a range error. The host database already does exactly that for the 
identical expression, and AGE inherits that behaviour everywhere except in its 
own agtype arithmetic:
   
   ```sql
   SELECT (-9223372036854775807 - 1) / -1;
   -- ERROR:  22003: bigint out of range
   -- LOCATION:  int84div, int8.c:986
   ```
   
   ### Actual behavior
   
   The Cypher path does not report a range error. The integer division is 
executed unchecked; the hardware raises `#DE`/`SIGFPE`, and PostgreSQL's signal 
handler converts it into a *floating-point* exception:
   
   ```
   ERROR:  22P01: floating-point exception
   DETAIL:  An invalid floating-point operation was signaled. This probably 
means
            an out-of-range result or an invalid operation, such as division by 
zero.
   LOCATION:  FloatExceptionHandler, postgres.c:3077
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to