[MCOL-1043] Load data infile with varchar latin1 column may crash mysqld Created: 2017-11-20  Updated: 2017-12-13  Resolved: 2017-11-20

Status: Closed
Project: MariaDB ColumnStore
Component/s: MDB Plugin
Affects Version/s: 1.0.11, 1.1.1
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: David Hall (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None


 Description   

LDI using cpimport calls ha_calpont_impl_write_batch_row_. In here we check the column's datatype and parse the input row accordingly. For varchar, if the max length < 256, we take the first byte and use it as a length. However, we interpret that byte as a signed integer. Any value > 127 is seen as negative and string::assign asserts, shutting down mysqld. The value should be interpreted as an unsigned 1 byte int.

For utf8, it should also be used as unsigned, but because the break-over to a two byte length is 87, rather 256, it's not possible to get values from 128-255 mis-interpreted as 1 byte signed and so won't break mysqld.

For two byte lengths, latin1 is wrongly interpreted as signed, but utf8 is correctly interpreted as unsigned.



 Comments   
Comment by David Hall (Inactive) [ 2017-11-20 ]

The function is question is ha_calpont_impl_write_batch_row_() in ha_calpont_dml.cpp

Comment by David Hall (Inactive) [ 2017-11-20 ]

Duplicates MCOL-1008

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