1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-24 14:20:59 +03:00

MCOL-1008 Fix bad length on bulk DML insert

If a VARCHAR was defined as less than 255 characters and a data via LDI
or INSERT...SELECT was > 127 characters the length field would contain a
negative number.

In 1.0.11 and 1.1.0 this was not a problem because we cast the negative
back again. With MCOL-877 we stoped doing the double-cast. This patch
casts properly the first time.
This commit is contained in:
Andrew Hutchings
2017-11-11 09:31:09 +00:00
parent 024c96afed
commit 766f0b812b

View File

@@ -893,12 +893,12 @@ int ha_calpont_impl_write_batch_row_(uchar *buf, TABLE* table, cal_impl_if::cal_
{
if (ci.columnTypes[colpos].colWidth < 256)
{
dataLength = *(int8_t*) buf;
dataLength = *(uint8_t*) buf;
buf++;
}
else
{
dataLength = *(int16_t*) buf;
dataLength = *(uint16_t*) buf;
buf = buf + 2 ;
}
escape.assign((char*)buf, dataLength);
@@ -909,7 +909,7 @@ int ha_calpont_impl_write_batch_row_(uchar *buf, TABLE* table, cal_impl_if::cal_
{
if (ci.columnTypes[colpos].colWidth < 86)
{
dataLength = *(int8_t*) buf;
dataLength = *(uint8_t*) buf;
buf++;
}
else