1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge branch '11.4' into 11.5

This commit is contained in:
Oleksandr Byelkin
2024-05-23 17:01:43 +02:00
1470 changed files with 43538 additions and 14960 deletions

View File

@ -1443,3 +1443,98 @@ drop table t1;
#
# End of 10.3 tests
#
#
# MDEV-31276: Execution of PS from grouping query with join
# and GROUP_CONCAT set function
#
create table t1 (a int, b varchar(20)) engine=myisam;
create table t2 (a int, c varchar(20)) engine=myisam;
insert into t1 values (1,"aaaaaaaaaa"),(2,"bbbbbbbbbb");
insert into t2 values (1,"cccccccccc"),(2,"dddddddddd");
insert into t2 values (1,"eeeeeee"),(2,"fffffff");
set group_concat_max_len=5;
select count(*), group_concat(t1.b,t2.c)
from t1 join t2 on t1.a=t2.a group by t1.a;
count(*) group_concat(t1.b,t2.c)
2 aaaaa
2 bbbbb
Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
explain select count(*), group_concat(t1.b,t2.c)
from t1 join t2 on t1.a=t2.a group by t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
prepare stmt from "select count(*), group_concat(t1.b,t2.c)
from t1 join t2 on t1.a=t2.a group by t1.a";
execute stmt;
count(*) group_concat(t1.b,t2.c)
2 aaaaa
2 bbbbb
Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
execute stmt;
count(*) group_concat(t1.b,t2.c)
2 aaaaa
2 bbbbb
Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
deallocate prepare stmt;
set join_cache_level=0;
select count(*), group_concat(t1.b,t2.c)
from t1 join t2 on t1.a=t2.a group by t1.a;
count(*) group_concat(t1.b,t2.c)
2 aaaaa
2 bbbbb
Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
explain select count(*), group_concat(t1.b,t2.c)
from t1 join t2 on t1.a=t2.a group by t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
prepare stmt from "select count(*), group_concat(t1.b,t2.c)
from t1 join t2 on t1.a=t2.a group by t1.a";
execute stmt;
count(*) group_concat(t1.b,t2.c)
2 aaaaa
2 bbbbb
Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
execute stmt;
count(*) group_concat(t1.b,t2.c)
2 aaaaa
2 bbbbb
Warnings:
Warning 1260 Row 1 was cut by group_concat()
Warning 1260 Row 2 was cut by group_concat()
deallocate prepare stmt;
set join_cache_level=default;
set group_concat_max_len=default;
drop table t1,t2;
#
# MDEV-33772 Bad SEPARATOR value in GROUP_CONCAT on character set conversion
#
SET NAMES utf8, @@collation_connection=latin1_swedish_ci;
CREATE TABLE t1 (c VARCHAR(10)) CHARACTER SET latin1;
INSERT INTO t1 VALUES ('a'),('A');
CREATE OR REPLACE VIEW v1 AS
SELECT GROUP_CONCAT(c SEPARATOR 'ß') AS c1 FROM t1 GROUP BY c;
SELECT * FROM v1;
c1
aßA
SELECT HEX(c1) FROM v1;
HEX(c1)
61DF41
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select group_concat(`t1`.`c` separator 'ß') AS `c1` from `t1` group by `t1`.`c` utf8mb3 latin1_swedish_ci
DROP VIEW v1;
DROP TABLE t1;
SET NAMES latin1;
# End of 10.5 tests