SOLR-8652: Lower case the limit clause

This commit is contained in:
jbernste 2016-02-06 21:42:01 -05:00
parent 75a81795b8
commit 3d47612b04
2 changed files with 3 additions and 3 deletions

View File

@ -361,6 +361,6 @@ class StatementImpl implements Statement {
private boolean containsLimit(String sql) {
String[] tokens = sql.split("\\s+");
String secondToLastToken = tokens[tokens.length-2];
return ("limit").equals(secondToLastToken);
return ("limit").equals(secondToLastToken.toLowerCase(Locale.getDefault()));
}
}

View File

@ -177,8 +177,8 @@ public class JdbcTest extends AbstractFullDistribZkTestBase {
assert(!rs.next());
stmt.close();
//Test simple loop. Since limit is set it will override the statement maxRows
rs = stmt.executeQuery("select id, a_i, a_s, a_f from collection1 order by a_i asc limit 100");
//Test simple loop. Since limit is set it will override the statement maxRows.
rs = stmt.executeQuery("select id, a_i, a_s, a_f from collection1 order by a_i asc LIMIT 100");
int count = 0;
while(rs.next()) {
++count;