Skip to content
Permalink
Browse files
Fix is_array_path to accept a single vertex.
Fixed the is_array_path function to accept a single vertex.
  • Loading branch information
jrgemignani committed Jan 11, 2022
1 parent c7f5c90 commit a7a651ba752a33d702802455715000ebb99ae422
Showing 2 changed files with 9 additions and 17 deletions.
@@ -317,7 +317,6 @@ static inline Datum agtype_from_cstring(char *str, int len)
/* callback for annotation (typecasts) */
sem.agtype_annotation = agtype_in_agtype_annotation;


parse_agtype(lex, &sem);

/* after parsing, the item member has the composed agtype structure */
@@ -328,13 +327,11 @@ size_t check_string_length(size_t len)
{
if (len > AGTENTRY_OFFLENMASK)
{
ereport(
ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("string too long to represent as agtype string"),
errdetail(
"Due to an implementation restriction, agtype strings cannot exceed %d bytes.",
AGTENTRY_OFFLENMASK)));
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("string too long to represent as agtype string"),
errdetail("Due to an implementation restriction, agtype strings cannot exceed %d bytes.",
AGTENTRY_OFFLENMASK)));
}

return len;
@@ -665,8 +662,8 @@ static bool is_array_path(agtype_value *agtv)
Assert(agtv != NULL);
Assert(agtv->type == AGTV_ARRAY);

/* the array needs to have an odd number of elements greater than 2 */
if (agtv->val.array.num_elems < 3 ||
/* the array needs to have an odd number of elements */
if (agtv->val.array.num_elems < 1 ||
(agtv->val.array.num_elems - 1) % 2 != 0)
return false;

@@ -1765,7 +1762,6 @@ agtype_value *integer_to_agtype_value(int64 int_value)
return agtv;
}


PG_FUNCTION_INFO_V1(_agtype_build_path);

/*
@@ -3206,7 +3202,6 @@ Datum agtype_btree_cmp(PG_FUNCTION_ARGS)
&agtype_rhs->root));
}


PG_FUNCTION_INFO_V1(agtype_typecast_numeric);
/*
* Execute function to typecast an agtype to an agtype numeric
@@ -3354,7 +3349,6 @@ Datum agtype_typecast_int(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(agtype_value_to_agtype(&result_value));
}


PG_FUNCTION_INFO_V1(agtype_typecast_float);
/*
* Execute function to typecast an agtype to an agtype float
@@ -3723,7 +3717,6 @@ Datum _property_constraint_check(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(agtype_deep_contains(&property_it, &constraint_it));
}


PG_FUNCTION_INFO_V1(age_id);

Datum age_id(PG_FUNCTION_ARGS)
@@ -2961,10 +2961,9 @@ Datum age_match_vle_terminal_edge(PG_FUNCTION_ARGS)
(has_veid ? veid == gida[gidasize - 1] : true));
}

/* PG helper function to build an agtype (Datum) edge for matching */
PG_FUNCTION_INFO_V1(age_build_vle_match_edge);
/*
* PG helper function to build an agtype (Datum) edge for matching.
*/

Datum age_build_vle_match_edge(PG_FUNCTION_ARGS)
{
agtype_in_state result;

0 comments on commit a7a651b

Please sign in to comment.