You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PagingHelper.SplitSQL(string, out SQLParts) method doesn't handle queries with comments. Here is a test case to illustrate the issue:
[Test]publicvoidEnsureSplitSQLHandlesComments(){varsql=@"/* comment */ select a, b, c from example order by a;";
PagingHelper.SQLParts parts;
PagingHelper.SplitSQL(sql,out parts);
Assert.AreEqual("order by a", parts.sqlOrderBy);
Assert.AreEqual("SELECT COUNT(*) FROM (select a, b, c from example ) npoco_tbl", parts.sqlCount);}
The root of the problem seems to be the RegexPagingHelper.rxColumns. It doesn't take comments into account:
PagingHelper.SplitSQL(string, out SQLParts)
method doesn't handle queries with comments. Here is a test case to illustrate the issue:The root of the problem seems to be the
Regex
PagingHelper.rxColumns
. It doesn't take comments into account:One possible solution could be to strip comments before the call to
.Match()
:The text was updated successfully, but these errors were encountered: