Copilot commented on code in PR #2412:
URL: https://github.com/apache/age/pull/2412#discussion_r3375528318


##########
regress/sql/expr.sql:
##########
@@ -3739,3 +3739,45 @@ SELECT * FROM drop_graph('list', true);
 --
 -- End of tests
 --
+
+--
+-- Issue 2391 - map literals must preserve keys whose values are null
+--
+SELECT create_graph('issue_2391');
+-- single-key null
+SELECT * FROM cypher('issue_2391', $$
+  RETURN {a: null} AS m
+$$) AS (m agtype);
+-- multiple null values
+SELECT * FROM cypher('issue_2391', $$
+  RETURN {companyName: null, sinceYear: null} AS m
+$$) AS (m agtype);
+-- keys() must see the null-valued key
+SELECT * FROM cypher('issue_2391', $$
+  RETURN keys({a: null}) AS ks
+$$) AS (ks agtype);
+-- coalesce passes a non-null map (map itself is not null) through
+SELECT * FROM cypher('issue_2391', $$
+  RETURN coalesce({a: null}, null) AS m
+$$) AS (m agtype);
+-- nested map values inside an expression also preserve nulls
+SELECT * FROM cypher('issue_2391', $$
+  RETURN {outer: {inner: null, kept: 1}} AS m
+$$) AS (m agtype);
+-- mixed non-null and null values are all preserved in order

Review Comment:
   This comment claims mixed null/non-null map values are preserved "in order", 
but the adjacent test output shows key order can differ (e.g., the two-null 
example prints keys in a different order than written). Since ordering isn’t 
what the test is asserting, it’s safer to avoid implying an order guarantee 
here.



##########
regress/sql/expr.sql:
##########
@@ -3739,3 +3739,45 @@ SELECT * FROM drop_graph('list', true);
 --
 -- End of tests
 --
+
+--
+-- Issue 2391 - map literals must preserve keys whose values are null

Review Comment:
   The "End of tests" marker now appears before the new Issue 2391 regression 
block, which makes the section header misleading when scanning the file. 
Consider adjusting the marker text (or moving it to the actual end) so it 
doesn’t imply the script terminates here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to