Skip to content

Conversation

@M4rcxs
Copy link
Contributor

@M4rcxs M4rcxs commented Jul 24, 2023

  • 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 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
@jrgemignani
Copy link
Contributor

@M4rcxs Please go back and correct all of toStringList, and related PRs. Please make sure you are compiling these locally with the correct flags.

src/backend/utils/adt/agtype.c: In function ‘age_tostringlist’:
src/backend/utils/adt/agtype.c:6278:13: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int64’ [-Wformat=]
             sprintf(buffer, "%d", elem->val.int_value);
             ^
src/backend/utils/adt/agtype.c:6213:11: warning: variable ‘float_num’ set but not used [-Wunused-but-set-variable]
     float float_num;
           ^

jrgemignani added a commit that referenced this pull request Aug 17, 2023
PR for moving the PG15 branch up to the current master branch.

Contains all of the latest work in the master branch, which is currently
at PostgreSQL version 15 at the time of this PR. When this PR is merged,
PG15 will be the latest.

Contains the following commits -

* Added the toStringList() function (#1084)
* Fix issue 1124: Segmentation fault when using specific tables (#1125)
* Added the toStringList() function (#1128)
* Fix issue 1000: Indexes created on WHERE (#1133)
MuhammadTahaNaveed pushed a commit to MuhammadTahaNaveed/age that referenced this pull request Aug 24, 2023
- 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
ProjectMutilation added a commit to ProjectMutilation/age that referenced this pull request Jan 21, 2026
Previously, when iterating through an agtype container, the code would
access `elem->val` even when `elem` was null.
This adds a null check to set the result type to AGTV_NULL when the
element is null, preventing a potential segmentation fault.

Fixes: 4274f10 ("Added the toStringList() function (apache#1084)")
Found by PostgresPro.
Signed-off-by: Maksim Korotkov <m.korotkov@postgrespro.ru>
ProjectMutilation added a commit to ProjectMutilation/age that referenced this pull request Jan 21, 2026
Previously, when iterating through an agtype container, the code would
access `elem->val` even when `elem` was null.
This adds a null check to set the result type to AGTV_NULL when the
element is null, preventing a potential segmentation fault.

Fixes: 4274f10 ("Added the toStringList() function (apache#1084)")
Found by PostgresPro.
Signed-off-by: Maksim Korotkov <m.korotkov@postgrespro.ru>
ProjectMutilation added a commit to ProjectMutilation/age that referenced this pull request Jan 21, 2026
Previously, when iterating through an agtype container, the code would
access `elem->val` even when `elem` was null.
This adds a null check to set the result type to AGTV_NULL when the
element is null, preventing a potential segmentation fault.

Fixes: 4274f10 ("Added the toStringList() function (apache#1084)")
Found by PostgresPro.
Signed-off-by: Maksim Korotkov <m.korotkov@postgrespro.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants