From 9a32ffd8da3d70847e1867b45d6171a1686f8f33 Mon Sep 17 00:00:00 2001 From: crdv7 <15974123760@163.com> Date: Mon, 31 Aug 2026 16:24:35 +0800 Subject: [PATCH] Fix locale-dependent ordering in cypher_merge tests 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 ac08a971a..66ba01e49 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 86b3e0235..e6cd0f553 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