1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-09 10:41:14 +03:00

Merge pull request #802 from mariadb-corporation/MCOL-3399-1.2

MCOL-3399 Fix VARCHAR LDI length processing
This commit is contained in:
David.Hall
2019-07-11 00:30:54 -05:00
committed by GitHub

View File

@@ -862,12 +862,6 @@ int ha_calpont_impl_write_batch_row_(uchar* buf, TABLE* table, cal_impl_if::cal_
case CalpontSystemCatalog::VARCHAR:
{
size_t length;
if (ci.utf8)
length = (ci.columnTypes[colpos].colWidth * 3);
else
length = ci.columnTypes[colpos].colWidth;
if (nullVal && (ci.columnTypes[colpos].constraintType != CalpontSystemCatalog::NOTNULL_CONSTRAINT))
{
fprintf(ci.filePtr, "%c", ci.delimiter);
@@ -911,7 +905,6 @@ int ha_calpont_impl_write_batch_row_(uchar* buf, TABLE* table, cal_impl_if::cal_
dataLength = *(uint16_t*) buf;
buf = buf + 2 ;
}
length = dataLength;
escape.assign((char*)buf, dataLength);
boost::replace_all(escape, "\\", "\\\\");
fprintf(ci.filePtr, "%c%.*s%c%c", ci.enclosed_by, (int)escape.length(), escape.c_str(), ci.enclosed_by, ci.delimiter);
@@ -928,7 +921,6 @@ int ha_calpont_impl_write_batch_row_(uchar* buf, TABLE* table, cal_impl_if::cal_
dataLength = *(uint16_t*) buf;
buf = buf + 2 ;
}
length = dataLength;
escape.assign((char*)buf, dataLength);
boost::replace_all(escape, "\\", "\\\\");
@@ -936,8 +928,10 @@ int ha_calpont_impl_write_batch_row_(uchar* buf, TABLE* table, cal_impl_if::cal_
fprintf(ci.filePtr, "%c%.*s%c%c", ci.enclosed_by, (int)escape.length(), escape.c_str(), ci.enclosed_by, ci.delimiter);
}
}
buf += length;
if (ci.utf8)
buf += (ci.columnTypes[colpos].colWidth * 3);
else
buf += ci.columnTypes[colpos].colWidth;
break;
}