Skip to content

Commit

Permalink
Support lowercased 'consistency' command (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
kornilova203 authored Jun 7, 2024
1 parent 26d59a0 commit 935b7fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static boolean containsSpecialCommands(final String cql) {
* supported.
*/
public static SpecialCommands.SpecialCommandExecutor getCommandExecutor(final String cql) {
final Matcher matcher = Pattern.compile(CMD_CONSISTENCY_PATTERN).matcher(cql.trim());
final Matcher matcher = Pattern.compile(CMD_CONSISTENCY_PATTERN, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE).matcher(cql.trim());
if (!matcher.matches()) {
LOG.trace("CQL statement is not a supported special command: {}", cql);
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,11 @@ void givenBatchIncludingConsistencyLevelChanges_whenExecuteBatch_throwException(
batchStatement.close();
}

@Test
@Order(7)
void givenConsistencyLevel_whenSetConsistencyLevelViaLowercaseCommand_updateConsistencyLevel() throws Exception {
assertNotNull(sqlConnection);
sqlConnection.createStatement().execute("consistency LOCAL_SERIAL");
assertConsistencyLevelViaExecute(sqlConnection, "LOCAL_SERIAL");
}
}

0 comments on commit 935b7fd

Please sign in to comment.