Skip to content

Commit

Permalink
[AGE agtype_util.c] Fix issue #870 regarding orderability
Browse files Browse the repository at this point in the history
Fixed issue #870 
 Odd behavior in context of orderability of different agtypes.

Implemented the solution suggested here:
#870 (comment)

Clearance given here:
#870 (comment)
  • Loading branch information
CapnSpek authored Jun 15, 2023
1 parent e22c5ac commit a3c517c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/backend/utils/adt/agtype_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,22 @@ static int get_type_sort_priority(enum agtype_value_type type)
{
if (type == AGTV_OBJECT)
return 0;
if (type == AGTV_VERTEX)
if (type == AGTV_PATH)
return 1;
if (type == AGTV_ARRAY)
if (type == AGTV_EDGE)
return 2;
if (type == AGTV_STRING)
if (type == AGTV_VERTEX)
return 3;
if (type == AGTV_BOOL)
if (type == AGTV_ARRAY)
return 4;
if (type == AGTV_NUMERIC || type == AGTV_INTEGER || type == AGTV_FLOAT)
if (type == AGTV_STRING)
return 5;
if (type == AGTV_NULL)
if (type == AGTV_BOOL)
return 6;
if (type == AGTV_NUMERIC || type == AGTV_INTEGER || type == AGTV_FLOAT)
return 7;
if (type == AGTV_NULL)
return 8;
return -1;
}

Expand Down

0 comments on commit a3c517c

Please sign in to comment.