1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Merge pull request #1308 from dhall-MariaDB/MCOL-4099

MCOL-4099 Fix up first char insertion
This commit is contained in:
Patrick LeBlanc
2020-06-29 10:34:41 -05:00
committed by GitHub

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);