You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by jo...@apache.org on 2022/12/27 17:27:24 UTC

[age] branch master updated: Fix function signature (age_length, age_toboolean, age_tofloat) from stable to immutable (#416)

This is an automated email from the ASF dual-hosted git repository.

joshinnis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/age.git


The following commit(s) were added to refs/heads/master by this push:
     new 14a4440  Fix function signature (age_length, age_toboolean, age_tofloat) from stable to immutable (#416)
14a4440 is described below

commit 14a4440b5ec6e98389f65ae1c86999f66f66f1e4
Author: Muhammad Taha Naveed <85...@users.noreply.github.com>
AuthorDate: Tue Dec 27 22:27:20 2022 +0500

    Fix function signature (age_length, age_toboolean, age_tofloat) from stable to immutable (#416)
    
    * Fix comment
    - IS_A_AGTYPE_SCALAR() checks that type is between AGTV_NULL and AGTV_ARRAY instead of AGTV_BOOL.
    
    * Fix function signatures
    
    - The functions age_length takes a set(path) of nodes(vertices and edges) as
      an argument and computes the length of path.This function does not
      modify database and is guaranteed to return same result given the same
      arguments forever.
    - The function age_toboolean just converts bool values in other data types
      passed as an argument to agtype. This function is also guaranteed to return
      same result given the same arguments forever.
    - The function age_tofloat also just converts float value in other data types
      passed as an argument to agtype. This function is also guaranteed to return
      same result given the same arguments forever.
    
    All these functions only performs operations on the arguments provided. These
    functions don't depend on table data at all.
---
 age--1.1.0.sql             | 6 +++---
 src/include/utils/agtype.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/age--1.1.0.sql b/age--1.1.0.sql
index 52277ce..690405c 100644
--- a/age--1.1.0.sql
+++ b/age--1.1.0.sql
@@ -3477,7 +3477,7 @@ AS 'MODULE_PATHNAME';
 CREATE FUNCTION ag_catalog.age_length(agtype)
 RETURNS agtype
 LANGUAGE c
-STABLE
+IMMUTABLE
 RETURNS NULL ON NULL INPUT
 PARALLEL SAFE
 AS 'MODULE_PATHNAME';
@@ -3485,7 +3485,7 @@ AS 'MODULE_PATHNAME';
 CREATE FUNCTION ag_catalog.age_toboolean(variadic "any")
 RETURNS agtype
 LANGUAGE c
-STABLE
+IMMUTABLE
 RETURNS NULL ON NULL INPUT
 PARALLEL SAFE
 AS 'MODULE_PATHNAME';
@@ -3493,7 +3493,7 @@ AS 'MODULE_PATHNAME';
 CREATE FUNCTION ag_catalog.age_tofloat(variadic "any")
 RETURNS agtype
 LANGUAGE c
-STABLE
+IMMUTABLE
 RETURNS NULL ON NULL INPUT
 PARALLEL SAFE
 AS 'MODULE_PATHNAME';
diff --git a/src/include/utils/agtype.h b/src/include/utils/agtype.h
index e5019d5..c7eab03 100644
--- a/src/include/utils/agtype.h
+++ b/src/include/utils/agtype.h
@@ -303,7 +303,7 @@ typedef struct
 
 /*
  * IMPORTANT NOTE: For agtype_value_type, IS_A_AGTYPE_SCALAR() checks that the
- * type is between AGTV_NULL and AGTV_BOOL, inclusive. So, new scalars need to
+ * type is between AGTV_NULL and AGTV_ARRAY, excluding AGTV_ARRAY. So, new scalars need to
  * be between these values.
  */
 enum agtype_value_type