mirror of https://github.com/apache/lucene.git
SOLR-8652: Lower case the limit clause
This commit is contained in:
parent
75a81795b8
commit
3d47612b04
|
@ -361,6 +361,6 @@ class StatementImpl implements Statement {
|
||||||
private boolean containsLimit(String sql) {
|
private boolean containsLimit(String sql) {
|
||||||
String[] tokens = sql.split("\\s+");
|
String[] tokens = sql.split("\\s+");
|
||||||
String secondToLastToken = tokens[tokens.length-2];
|
String secondToLastToken = tokens[tokens.length-2];
|
||||||
return ("limit").equals(secondToLastToken);
|
return ("limit").equals(secondToLastToken.toLowerCase(Locale.getDefault()));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -177,8 +177,8 @@ public class JdbcTest extends AbstractFullDistribZkTestBase {
|
||||||
assert(!rs.next());
|
assert(!rs.next());
|
||||||
stmt.close();
|
stmt.close();
|
||||||
|
|
||||||
//Test simple loop. Since limit is set it will override the statement maxRows
|
//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");
|
rs = stmt.executeQuery("select id, a_i, a_s, a_f from collection1 order by a_i asc LIMIT 100");
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while(rs.next()) {
|
while(rs.next()) {
|
||||||
++count;
|
++count;
|
||||||
|
|
Loading…
Reference in New Issue