mirror of https://github.com/apache/cassandra
Validate statements inside batch
This commit is contained in:
parent
19ff1932cd
commit
2e61cd5e07
|
|
@ -128,6 +128,8 @@ public class BatchStatement implements CQLStatement, MeasurableForPreparedCache
|
|||
{
|
||||
if (timestampSet && statement.isTimestampSet())
|
||||
throw new InvalidRequestException("Timestamp must be set either on BATCH or individual statements");
|
||||
|
||||
statement.validate(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ public abstract class ModificationStatement implements CQLStatement, MeasurableF
|
|||
public void validate(ClientState state) throws InvalidRequestException
|
||||
{
|
||||
if (hasConditions() && attrs.isTimestampSet())
|
||||
throw new InvalidRequestException("Custom timestamps are not allowed when conditions are used");
|
||||
throw new InvalidRequestException("Cannot provide custom timestamp for conditional update");
|
||||
|
||||
if (isCounter())
|
||||
{
|
||||
|
|
@ -765,9 +765,6 @@ public abstract class ModificationStatement implements CQLStatement, MeasurableF
|
|||
if (stmt.isCounter())
|
||||
throw new InvalidRequestException("Conditional updates are not supported on counter tables");
|
||||
|
||||
if (attrs.timestamp != null)
|
||||
throw new InvalidRequestException("Cannot provide custom timestamp for conditional update");
|
||||
|
||||
if (ifNotExists)
|
||||
{
|
||||
// To have both 'IF NOT EXISTS' and some other conditions doesn't make sense.
|
||||
|
|
|
|||
Loading…
Reference in New Issue