You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-1390 Fix SUBSTRING_INDEX for negative count
If negative count number is more than the number of characters in the string then it should always return the string. For example if a table contains SUBSTRING_INDEX('zzz', 'z', -5) should return 'zzz'. Before this patch it would return NULL.
This commit is contained in:
@ -71,6 +71,9 @@ std::string Func_substring_index::getStrVal(rowgroup::Row& row,
|
||||
if ( count > (int64_t) end )
|
||||
return str;
|
||||
|
||||
if (( count < 0 ) && ((count * -1) > end))
|
||||
return str;
|
||||
|
||||
string value = str;
|
||||
|
||||
if ( count > 0 ) {
|
||||
|
Reference in New Issue
Block a user