1########### suite/json/t/json_group_concat_innodb.test               #
2# Tests group_concat json function using the innodb storage engine   #
3#                                                                    #
4# This test copies some tests originally in json.test                #
5######################################################################
6# Set the session storage engine
7set default_storage_engine=innodb;
8
9--source suite/json/inc/json_group_concat.inc
10
11create table t(j json, c varchar(20)) charset utf8mb4;
12show create table t;
13insert into t values (cast('[1,2,3]' as json), '[a,b,c]');
14insert into t values (cast(7 as json), '7'),  (cast(2 as json), '2');
15insert into t values (cast(7 as json), '7'),  (cast(2 as json), '2');
16
17select group_concat(j), group_concat(distinct j), group_concat(c) from t;
18select group_concat(j order by j), group_concat(distinct j order by j), group_concat(c order by c) from t;
19insert into t values (NULL, NULL);
20
21select group_concat(j), group_concat(distinct j), group_concat(c) from t;
22
23--echo #
24--echo # Bug#22992666 NULL VALUE IN JSON COLUMN CORRUPTS GROUP_CONCAT
25--echo #              WITH ORDER BY CLAUSE
26--echo #
27SELECT GROUP_CONCAT(j ORDER BY j) AS c1,
28       GROUP_CONCAT(DISTINCT j ORDER BY j) AS c2,
29       GROUP_CONCAT(c ORDER BY c) AS c3
30FROM t;
31
32drop table t;
33