You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by jg...@apache.org on 2021/01/27 18:21:06 UTC

[incubator-age] branch master updated: Patch for github issue #15

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

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


The following commit(s) were added to refs/heads/master by this push:
     new c433b13  Patch for github issue #15
c433b13 is described below

commit c433b13b8d4eea652bccfbf9001ccc3f96e60789
Author: John Gemignani <jr...@gmail.com>
AuthorDate: Wed Jan 27 10:11:53 2021 -0800

    Patch for github issue #15
    
    [apache/incubator-age] return value out of range (#15)
    /src/backend/utils/adt/agtype_util.c line 1536 Non-boolean value
    returned from function returning bool
    
    Added comments and changed type of value returned to match function
    prototype. Technically, though, execution will never reach this point.
    This is merely to make the compiler happy.
---
 src/backend/utils/adt/agtype_util.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/backend/utils/adt/agtype_util.c b/src/backend/utils/adt/agtype_util.c
index 232ba3e..904f400 100644
--- a/src/backend/utils/adt/agtype_util.c
+++ b/src/backend/utils/adt/agtype_util.c
@@ -1500,6 +1500,7 @@ static int compare_two_floats_orderability(float8 lhs, float8 rhs)
  */
 static bool equals_agtype_scalar_value(agtype_value *a, agtype_value *b)
 {
+    /* if the values are of the same type */
     if (a->type == b->type)
     {
         switch (a->type)
@@ -1532,8 +1533,12 @@ static bool equals_agtype_scalar_value(agtype_value *a, agtype_value *b)
                                    a->type)));
         }
     }
-    ereport(ERROR, (errmsg("agtype input scalars must be of same type")));
-    return -1;
+    /* otherwise, the values are of differing type */
+    else
+        ereport(ERROR, (errmsg("agtype input scalars must be of same type")));
+
+    /* execution will never reach this point due to the ereport call */
+    return false;
 }
 
 /*