Merge pull request #1688 from thibaultmeyer/bugfix/useless-comparison-test

Remove useless comparison test
This commit is contained in:
Rob Bygrave
2019-04-29 09:18:11 +12:00
committed by GitHub
3 changed files with 6 additions and 14 deletions
@@ -65,13 +65,9 @@ public class SqlServer2005SqlLimiter implements SqlLimiter {
sb.append(NEW_LINE).append(") ");
sb.append(rowNumberWindowAlias);
sb.append(" where ");
if (firstRow > 0) {
sb.append(" rn > ").append(firstRow);
if (lastRow > 0) {
sb.append(" and ");
}
}
sb.append(" rn > ").append(firstRow);
if (lastRow > 0) {
sb.append(" and ");
sb.append(" rn <= ").append(lastRow);
}
@@ -38,10 +38,8 @@ public class SqlServerSqlLimiter implements SqlLimiter {
}
sb.append(dbSql);
if (firstRow > 0) {
sb.append(" ").append("offset");
sb.append(" ").append(firstRow).append(" rows");
}
sb.append(" ").append("offset");
sb.append(" ").append(firstRow).append(" rows");
if (maxRows > 0) {
sb.append(" fetch next ").append(maxRows).append(" rows only");
}
@@ -48,10 +48,8 @@ class CQueryPlanRawSql extends CQueryPlan {
// an associated bean is in the raw SQL but is mapped columnIgnore
for (int i = 0; i < indexPositions.length; i++) {
if (indexPositions[i] == 0) {
if (i < indexPositions.length) {
// expect discriminator column to immediately proceed id column
indexPositions[i] = indexPositions[i + 1] - 1;
}
// expect discriminator column to immediately proceed id column
indexPositions[i] = indexPositions[i + 1] - 1;
}
}