This is an automated email from the ASF dual-hosted git repository.

MuhammadTahaNaveed pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/age.git


The following commit(s) were added to refs/heads/master by this push:
     new e9d7b1d9 Fix locale-dependent ordering in cypher_merge tests (#2558)
e9d7b1d9 is described below

commit e9d7b1d9d9c290b7b7d0d0ef2420f26d5b4bb872
Author: crdv7 <[email protected]>
AuthorDate: Sun Oct 11 14:24:03 2026 +0800

    Fix locale-dependent ordering in cypher_merge tests (#2558)
    
    The issue_1446 regression queries sort agtype labels using the database's
    default collation, so their row order varies across database collations. For
    example, C and en_US.utf8 order the mixed-case labels differently. Move the
    incidental ordering to the enclosing SQL queries and use the C collation so
    the expected output is independent of the database locale.
---
 regress/expected/cypher_merge.out | 8 ++++----
 regress/sql/cypher_merge.sql      | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/regress/expected/cypher_merge.out 
b/regress/expected/cypher_merge.out
index 21f79c6f..6cd2a756 100644
--- a/regress/expected/cypher_merge.out
+++ b/regress/expected/cypher_merge.out
@@ -1759,8 +1759,8 @@ $$) AS (a agtype);
 SELECT * FROM cypher('issue_1446', $$
     MATCH (n)
     RETURN labels(n) AS label, count(*) AS cnt
-    ORDER BY label
-$$) AS (label agtype, cnt agtype);
+$$) AS (label agtype, cnt agtype)
+ORDER BY label::text COLLATE "C";
  label | cnt 
 -------+-----
  ["A"] | 1
@@ -1807,8 +1807,8 @@ $$) AS (a agtype);
 SELECT * FROM cypher('issue_1446', $$
     MATCH (n)
     RETURN labels(n) AS label, count(*) AS cnt
-    ORDER BY label
-$$) AS (label agtype, cnt agtype);
+$$) AS (label agtype, cnt agtype)
+ORDER BY label::text COLLATE "C";
    label    | cnt 
 ------------+-----
  ["X"]      | 1
diff --git a/regress/sql/cypher_merge.sql b/regress/sql/cypher_merge.sql
index c1a5c72f..799b1441 100644
--- a/regress/sql/cypher_merge.sql
+++ b/regress/sql/cypher_merge.sql
@@ -811,8 +811,8 @@ $$) AS (a agtype);
 SELECT * FROM cypher('issue_1446', $$
     MATCH (n)
     RETURN labels(n) AS label, count(*) AS cnt
-    ORDER BY label
-$$) AS (label agtype, cnt agtype);
+$$) AS (label agtype, cnt agtype)
+ORDER BY label::text COLLATE "C";
 SELECT * FROM cypher('issue_1446', $$
     MATCH ()-[e]->()
     RETURN count(*) AS edge_count
@@ -833,8 +833,8 @@ $$) AS (a agtype);
 SELECT * FROM cypher('issue_1446', $$
     MATCH (n)
     RETURN labels(n) AS label, count(*) AS cnt
-    ORDER BY label
-$$) AS (label agtype, cnt agtype);
+$$) AS (label agtype, cnt agtype)
+ORDER BY label::text COLLATE "C";
 SELECT * FROM cypher('issue_1446', $$
     MATCH ()-[e]->()
     RETURN count(*) AS edge_count

Reply via email to