Skip to content

Commit

Permalink
Fix StartsWith on Sqlite (#20716)
Browse files Browse the repository at this point in the history
For non-constant patterns

Fixes #20715
  • Loading branch information
roji authored Apr 23, 2020
1 parent f81085d commit 49c997d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private SqlExpression TranslateStartsEndsWith(SqlExpression instance, SqlExpress
_sqlExpressionFactory.Like(
instance,
_sqlExpressionFactory.Add(
instance,
pattern,
_sqlExpressionFactory.Constant("%"))),
_sqlExpressionFactory.Equal(
_sqlExpressionFactory.Function(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public override void Count_query()
SELECT COUNT(*)
FROM ""Customers"" AS ""c""
WHERE (@__ef_filter__TenantPrefix_0 = '') OR (""c"".""CompanyName"" IS NOT NULL AND (((""c"".""CompanyName"" LIKE ""c"".""CompanyName"" || '%') AND (substr(""c"".""CompanyName"", 1, length(@__ef_filter__TenantPrefix_0)) = @__ef_filter__TenantPrefix_0)) OR (@__ef_filter__TenantPrefix_0 = '')))");
WHERE (@__ef_filter__TenantPrefix_0 = '') OR (""c"".""CompanyName"" IS NOT NULL AND (((""c"".""CompanyName"" LIKE @__ef_filter__TenantPrefix_0 || '%') AND (substr(""c"".""CompanyName"", 1, length(@__ef_filter__TenantPrefix_0)) = @__ef_filter__TenantPrefix_0)) OR (@__ef_filter__TenantPrefix_0 = '')))");
}

private void AssertSql(params string[] expected)
Expand Down

0 comments on commit 49c997d

Please sign in to comment.