[MDEV-31276] Wrong message on second execution of prepare statement for GROUP_CONCAT() function with 'outer_join_with_cache=off' Created: 2023-05-15  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Optimizer, Prepared Statements
Affects Version/s: 10.4, 10.5, 10.6, 10.8, 10.9, 10.10, 11.0, 11.1
Fix Version/s: 10.4, 10.5, 10.6, 11.0, 11.1

Type: Bug Priority: Major
Reporter: Lena Startseva Assignee: Dmitry Shulga
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-31003 Second execution for ps-protocol Stalled

 Description   

Wrong message on second execution of prepare statement for GROUP_CONCAT() function with optimizer_switch='outer_join_with_cache=off' (with 'outer_join_with_cache=on' messages are correct ) and left join:

SET optimizer_switch='outer_join_with_cache=off';
 
set group_concat_max_len=5;
create table t1 (a int, b varchar(20));
create table t2 (a int, c varchar(20));
insert into t1 values (1,"aaaaaaaaaa"),(2,"bbbbbbbbbb");
insert into t2 values (1,"cccccccccc"),(2,"dddddddddd");
 
prepare stmt1 from "select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by t1.a";
 
execute stmt1;
execute stmt1;
 
deallocate prepare stmt1;
 
drop table t1, t2;
set group_concat_max_len=default;

Actual result:

execute stmt1;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning	1260	Row 1 was cut by GROUP_CONCAT()
Warning	1260	Row 2 was cut by GROUP_CONCAT()
execute stmt1;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning	1260	Row 3 was cut by GROUP_CONCAT()
Warning	1260	Row 4 was cut by GROUP_CONCAT()
deallocate prepare stmt1;

Expected result:

execute stmt1;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning	1260	Row 1 was cut by GROUP_CONCAT()
Warning	1260	Row 2 was cut by GROUP_CONCAT()
execute stmt1;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning	1260	Row 1 was cut by GROUP_CONCAT()
Warning	1260	Row 2 was cut by GROUP_CONCAT()
deallocate prepare stmt1;


Generated at Thu Feb 08 10:22:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.