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

   **Describe the bug:**
   The server crashes with Segmentation Fault error whenever the _value_ 
property of a Node or Edge is set to `rand()` or `pi()`
   ```
   Program received signal SIGSEGV, Segmentation fault.
   
   0x00005650823d9abb in datumTransfer (value=4592508940796821504, 
       typByVal=typByVal@entry=false, typLen=-1) at datum.c:192
   192          if (!typByVal && typLen == -1 &&
   ```
   
   **How to produce the error?**
   ```
   SELECT * from cypher('demo', $$
     MATCH (n)
     SET n.value = rand()
     RETURN n
   $$) as (result agtype);
   ```
   And
   ```
   SELECT * from cypher('demo', $$
     MATCH (n)
     SET n.value = pi()
     RETURN n
   $$) as (result agtype);
   ```
   **Important:**
   ```
   /*
   * Check for openCypher functions that are directly mapped to PG
   * functions. We may want to find a better way to do this, as there
   * could be many.
   */
   
   if (pg_strcasecmp(name, "rand") == 0)
       funcname = SystemFuncName("random");
   else if (pg_strcasecmp(name, "pi") == 0)
       funcname = SystemFuncName("pi");
   else if (pg_strcasecmp(name, "count") == 0)
       funcname = SystemFuncName("count");
   ```
   **Additional context:**
   Using `rand() + 0` or `pi() + 0` resolves the issue and allows the program 
to function properly.
   
   **Environment:**
   - PostgreSQL 11.18 
   - Apache Age (master branch)
   
   


-- 
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: dev-unsubscr...@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to