[Bug] Left() string function behaves not identically to the mysql implementation (#6811)
See Fix #6810
This commit is contained in:
@ -120,6 +120,7 @@ StringVal StringFunctions::substring(FunctionContext* context, const StringVal&
|
||||
// string left(string input, int len)
|
||||
// This behaves identically to the mysql implementation.
|
||||
StringVal StringFunctions::left(FunctionContext* context, const StringVal& str, const IntVal& len) {
|
||||
if (len.val >= str.len) return str;
|
||||
return substring(context, str, 1, len);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user