1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-11-02 06:13:16 +03:00

fix(tests): add deterministic ordering for failing mtrs

This commit is contained in:
aleksei.bukhalov
2025-09-03 17:34:32 +02:00
committed by Leonid Fedorov
parent 77c3aea6eb
commit ebde9b5648
16 changed files with 610 additions and 659 deletions

View File

@@ -102,18 +102,18 @@ JSON_ARRAYAGG(b LIMIT 2)
["Hello","World","Hello","World"]
["This","Will","Work","!","This","Will","Work","!"]
[null,null]
SELECT JSON_ARRAYAGG(DISTINCT a) FROM t1;
JSON_ARRAYAGG(DISTINCT a)
[3,2,1]
SELECT JSON_ARRAYAGG(DISTINCT b) FROM t1;
JSON_ARRAYAGG(DISTINCT b)
["Will","World","Work",null,"!","This","Hello"]
SELECT JSON_ARRAYAGG(DISTINCT a LIMIT 2) FROM t1;
JSON_ARRAYAGG(DISTINCT a LIMIT 2)
[3,2,1]
SELECT JSON_ARRAYAGG(DISTINCT b LIMIT 2) FROM t1;
JSON_ARRAYAGG(DISTINCT b LIMIT 2)
["Will","World","Work",null,"!","This","Hello"]
SELECT JSON_ARRAYAGG(DISTINCT a ORDER BY a ASC) FROM t1;
JSON_ARRAYAGG(DISTINCT a ORDER BY a ASC)
[1,2,3]
SELECT JSON_ARRAYAGG(DISTINCT b ORDER BY b ASC) FROM t1;
JSON_ARRAYAGG(DISTINCT b ORDER BY b ASC)
[null,"!","Hello","This","Will","Work","World"]
SELECT JSON_ARRAYAGG(DISTINCT a ORDER BY a ASC LIMIT 2) FROM t1;
JSON_ARRAYAGG(DISTINCT a ORDER BY a ASC LIMIT 2)
[1,2,3]
SELECT JSON_ARRAYAGG(DISTINCT b ORDER BY b ASC LIMIT 2) FROM t1;
JSON_ARRAYAGG(DISTINCT b ORDER BY b ASC LIMIT 2)
[null,"!","Hello","This","Will","Work","World"]
#
# JSON aggregation
#
@@ -189,16 +189,16 @@ INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
SELECT JSON_ARRAYAGG(a) FROM t1;
JSON_ARRAYAGG(a)
[1,2,3,1,2,3]
SELECT JSON_ARRAYAGG(DISTINCT a) FROM t1;
JSON_ARRAYAGG(DISTINCT a)
[3,2,1]
SELECT JSON_ARRAYAGG(DISTINCT a ORDER BY a ASC) FROM t1;
JSON_ARRAYAGG(DISTINCT a ORDER BY a ASC)
[1,2,3]
INSERT INTO t1 VALUES (NULL,NULL), (NULL,NULL);
SELECT JSON_ARRAYAGG(a) FROM t1;
JSON_ARRAYAGG(a)
[1,2,3,1,2,3,null,null]
SELECT JSON_ARRAYAGG(DISTINCT a) FROM t1;
JSON_ARRAYAGG(DISTINCT a)
[null,2,3,1]
SELECT JSON_ARRAYAGG(DISTINCT a ORDER BY a ASC) FROM t1;
JSON_ARRAYAGG(DISTINCT a ORDER BY a ASC)
[null,1,2,3]
DROP TABLE t1;
CREATE TABLE t1(a VARCHAR(10), b INT)ENGINE=COLUMNSTORE;
INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
@@ -206,16 +206,16 @@ INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
SELECT JSON_ARRAYAGG(a) FROM t1;
JSON_ARRAYAGG(a)
[1,2,3,1,2,3]
SELECT JSON_ARRAYAGG(DISTINCT a) FROM t1;
JSON_ARRAYAGG(DISTINCT a)
[3,2,1]
SELECT JSON_ARRAYAGG(DISTINCT a ORDER BY a ASC) FROM t1;
JSON_ARRAYAGG(DISTINCT a ORDER BY a ASC)
[1,2,3]
INSERT INTO t1 VALUES (NULL,NULL), (NULL,NULL);
SELECT JSON_ARRAYAGG(a) FROM t1;
JSON_ARRAYAGG(a)
[1,2,3,1,2,3,null,null]
SELECT JSON_ARRAYAGG(DISTINCT a) FROM t1;
JSON_ARRAYAGG(DISTINCT a)
[null,2,3,1]
SELECT JSON_ARRAYAGG(DISTINCT a ORDER BY a ASC) FROM t1;
JSON_ARRAYAGG(DISTINCT a ORDER BY a ASC)
[null,1,2,3]
DROP TABLE t1;
#
#