Debian Codegraph @

mysql-test/suite/json_ndb/t/json_group_concat_ndb.test

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