New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in Sql.Function Left? #2605
Comments
Yep, looks like a bug. |
I'll make PR. |
Thanks. Please check if we have test coverage for this function (looks like at least client-side part is missing) and add missing test case. |
@MaceWindu Where is the best place to insert the tests for functions? I've searched the folders and nothing fits. public static string? Substring(string? str, int? startIndex, int? length)
{
return str == null || startIndex == null || length == null ? null : str.Substring(startIndex.Value - 1, length.Value);
} |
Tests for those functions are there https://github.com/linq2db/linq2db/blob/master/Tests/Linq/Linq/StringFunctionTests.cs |
Ok, already started and decided to add tests to all non-db string functions. |
Finished. |
Hi,
Just reading the code and found this:
Why startIndex = 1 in
str.Substring(1, length.Value)
?Shouldn't be there startIndex = 0?
(startIndex = The zero-based starting character position of a substring in this instance.)
The text was updated successfully, but these errors were encountered: