[MCOL-4517] columnstore batch insert doesn't work for decimals with utf8mb4 tables Created: 2021-01-27  Updated: 2021-02-01  Resolved: 2021-02-01

Status: Closed
Project: MariaDB ColumnStore
Component/s: cpimport
Affects Version/s: 1.5.3
Fix Version/s: 5.5.1

Type: Bug Priority: Major
Reporter: antoine Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Environment:

debian 9



 Description   

there seems to be an issue with insert... select in tables with utf8mb4 charset and decimal columns

drop table if exists mcs;
 
create table mcs(
	s varchar(5) DEFAULT NULL,
	d decimal(7,3)
) engine=Columnstore default charset=utf8mb4;
 
set columnstore_use_import_for_batchinsert = 1;
insert into mcs(d)
select 1;
 
=> "Error code 9999: Values saturated" 

the problem is not present when not using cpimport, i.e. using columnstore_use_import_for_batchinsert = 0;

interestingly, the bug disappears if the table definition has the decimal column first, as in here:

drop table if exists mcs;
 
create table mcs(
	d decimal(7,3),
	s varchar(5) DEFAULT NULL
) engine=Columnstore default charset=utf8mb4;
 
set columnstore_import_for_batchinsert_delimiter = 5;
set columnstore_use_import_for_batchinsert = 1;
insert into mcs(d)
select 1;
 
=> 1 row affected

it seems that, to trigger the issue, we need a table with all of the following:

  1. at least one varchar column in utf8mb4 (column or table, makes no difference)
  2. at least one decimal column (scale/precision seems to have no effect)
  3. decimal(s) column(s) not in first position(s) in the table

setup:

  • columnstore is set to use utf8
  • setting mariadb in utf8mb4/utf8mb4_unicode_ci or utf8/utf8_general_ci makes no difference

Generated at Thu Feb 08 02:50:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.