Oversize integer in CQL throws NumberFormatException

patch by dbrosius reviewed by pyaskevich for CASSANDRA-4291
This commit is contained in:
Dave Brosius 2012-05-30 20:17:13 -04:00
parent 043d180836
commit edfc06fdd0
2 changed files with 25 additions and 15 deletions

View File

@ -5,6 +5,7 @@
(CASSANDRA-4279)
* improve ability of STCS.getBuckets to deal with 100s of 1000s of
sstables, such as when convertinb back from LCS (CASSANDRA-4287)
* Oversize integer in CQL throws NumberFormatException (CASSANDRA-4291)
1.0.10

View File

@ -1021,21 +1021,30 @@ public class QueryProcessor
private static CQLStatement getStatement(String queryStr) throws InvalidRequestException, RecognitionException
{
// Lexer and parser
CharStream stream = new ANTLRStringStream(queryStr);
CqlLexer lexer = new CqlLexer(stream);
TokenStream tokenStream = new CommonTokenStream(lexer);
CqlParser parser = new CqlParser(tokenStream);
// Parse the query string to a statement instance
CQLStatement statement = parser.query();
// The lexer and parser queue up any errors they may have encountered
// along the way, if necessary, we turn them into exceptions here.
lexer.throwLastRecognitionError();
parser.throwLastRecognitionError();
return statement;
try
{
// Lexer and parser
CharStream stream = new ANTLRStringStream(queryStr);
CqlLexer lexer = new CqlLexer(stream);
TokenStream tokenStream = new CommonTokenStream(lexer);
CqlParser parser = new CqlParser(tokenStream);
// Parse the query string to a statement instance
CQLStatement statement = parser.query();
// The lexer and parser queue up any errors they may have encountered
// along the way, if necessary, we turn them into exceptions here.
lexer.throwLastRecognitionError();
parser.throwLastRecognitionError();
return statement;
}
catch (RuntimeException re)
{
InvalidRequestException ire = new InvalidRequestException("Failed parsing statement: [" + queryStr + "] reason: " + re.getClass().getSimpleName() + " " + re.getMessage());
ire.initCause(re);
throw ire;
}
}
private static void validateSchemaIsSettled() throws SchemaDisagreementException