[MDEV-10774] weird result with myisam, group_concat and bit column Created: 2016-09-08  Updated: 2023-09-19

Status: Confirmed
Project: MariaDB Server
Component/s: Storage Engine - MyISAM
Affects Version/s: 10.0.22, 5.5, 10.0, 10.1, 10.2, 10.3
Fix Version/s: 10.1

Type: Bug Priority: Major
Reporter: Patrick Schaaf Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

openSUSE linux


Issue Links:
Duplicate
is duplicated by MDEV-31959 GROUP BY with GROUP_CONCAT breaks BIT... Confirmed

 Description   

A colleague noted weird results for a certain SELECT involving

  • a bit() column
  • an unrelated int ID column
  • group_concat on the ID column with additional value being the bit
  • and myISAM

Test case:

create database if not exists kicker;
use kicker;
drop table if exists test;
create table test (
	id int(10) unsigned not null,
	val bit(1) not null,
	primary key (id)
) ENGINE=MyISAM;
insert into test set id = 1, val = 0;
insert into test set id = 2, val = 1;
select * from test;
select id, val FROM kicker.test group by id;
select GROUP_CONCAT(id), not not val FROM kicker.test group by id;
SELECT GROUP_CONCAT(id), val FROM kicker.test GROUP BY id;
SELECT GROUP_CONCAT(id, val), val FROM kicker.test GROUP BY id;

The first three selects are OKAY. The last two... show val as bit value 1 for in BOTH result rows.

The last select even shows the correct bit values 0 and 1 respectively in the GROUP_CONCATted colum, but again both rows have val as bit value 1.

The results are correct when I replace ENGINE=MyISAM with InnoDB.

This happens on mariadb 5.5.28 and 10.0.22, both as packaged by openSUSE (11.4 and tumbleweed, respectively)



 Comments   
Comment by Elena Stepanova [ 2016-09-19 ]

Reproducible on all of 5.5-10.2 and MySQL 5.5-5.7.

There was a somewhat similar upstream bug https://bugs.mysql.com/bug.php?id=56570 which is now closed as 'Not a bug', although I don't quite understand the reasoning.
Still bar participated in the analysis of the upstream bug, I expect he'll be able to clarify.

Generated at Thu Feb 08 07:44:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.