1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-4099 Fix up first char insertion

This commit is contained in:
David Hall
2020-06-24 15:18:03 -05:00
parent 960c07a647
commit 9bd4255021

View File

@ -73,8 +73,6 @@ std::string Func_insert::getStrVal(rowgroup::Row& row,
if (isNull)
return "";
start--; // Because SQL syntax is 1 based and we want 0 based.
CHARSET_INFO* cs = fp[0]->data()->resultType().getCharset();
// binLen represents the number of bytes
@ -91,6 +89,8 @@ std::string Func_insert::getStrVal(rowgroup::Row& row,
if ((length < 0) || (length > strLen))
length = strLen;
start--; // Because SQL syntax is 1 based and we want 0 based.
// Convert start and length from characters to bytes.
start = cs->charpos(pos, end, start);
length = cs->charpos(pos+start, end, length);