Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
1.0.11, 1.1.1
-
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.