[Bug] Fix the core problem of function split_part and add the UT of core case (#4721)

issue:#4720
This commit is contained in:
HappenLee
2020-10-13 10:09:39 +08:00
committed by GitHub
parent f431d8d94c
commit c00a5cb543
2 changed files with 5 additions and 1 deletions

View File

@ -984,7 +984,7 @@ StringVal StringFunctions::split_part(FunctionContext* context, const StringVal&
for (int i = 1; i <= field.val; i++) { // find
int last_index = i - 1;
find[last_index] = index_of(content.ptr, 0, content.len, delimiter.ptr, 0, delimiter.len, from);
from = find[last_index] + 1;
from = find[last_index] + delimiter.len;
if (find[last_index] == -1) {
break;
}