Skip to content

Commit ad39a88

Browse files
committed
Added toStringList function
- This function is inspired by the "tostringlist" function in OpenCypher.https://neo4j.com/docs/cypher-manual/current/functions/list/#functions-tostringlist - toStringList() converts a list of values and returns a list of string values. If any values are not convertible to string they will be null in the list returned. - A list containing the converted elements; depending on the input value a converted value is either a string value or null. - Also added the regression tests - This PR fix the issue apache#1073
1 parent a4a8b2c commit ad39a88

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/backend/utils/adt/agtype.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -6159,8 +6159,6 @@ Datum age_tostringlist(PG_FUNCTION_ARGS)
61596159
agtype_value string_elem;
61606160
int count;
61616161
int i;
6162-
float float_num;
6163-
int float_size;
61646162
char buffer[64];
61656163

61666164
/* check for null */
@@ -6214,7 +6212,6 @@ Datum age_tostringlist(PG_FUNCTION_ARGS)
62146212

62156213
case AGTV_FLOAT:
62166214

6217-
float_num = elem->val.float_value;
62186215
sprintf(buffer, "%.*g", DBL_DIG, elem->val.float_value);
62196216
string_elem.val.string.val = pstrdup(buffer);
62206217
string_elem.val.string.len = strlen(buffer);
@@ -6225,7 +6222,7 @@ Datum age_tostringlist(PG_FUNCTION_ARGS)
62256222

62266223
case AGTV_INTEGER:
62276224

6228-
sprintf(buffer, "%d", elem->val.int_value);
6225+
sprintf(buffer, "%ld", elem->val.int_value);
62296226
string_elem.val.string.val = pstrdup(buffer);
62306227
string_elem.val.string.len = strlen(buffer);
62316228

0 commit comments

Comments
 (0)