Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
### What is the issue The `NON_DAEMON` IndexRegistry returns `true` for all calls to `supportsExpression`. This leads to an incorrect result from the `getEqBehavior` method where we get `MATCH` instead of `EQ` because the index indicates that it can handle `ANALYZER_MATCHES` expressions and `EQ` expressions. It is an odd edge case because the javadoc for the `NON_DAEMON` object is: ```java /** * An {@code IndexRegistry} intended for use when Cassandra is initialized in client or tool mode. * Contains a single stub {@code Index} which possesses no actual indexing or searching capabilities * but enables query validation and preparation to succeed. Useful for tools which need to prepare * CQL statements without instantiating the whole ColumnFamilyStore infrastructure. */ ``` This presents a problem for the eq/match logic where we want to find a nuanced solution to the different solutions. My proposal here is to just make it use the EQ behavior, but that might have adverse side effects in untested code. ### What does this PR fix and why was it fixed The original fix used in #1434 was just to avoid the NPE we hit, but it allowed for the wrong result in eq behavior. This fix is to say that we should just return `EQ` in that case. It's possible this fix has negative consequences that we haven't seen yet, but at the very least, the CNDB tests pass with it.
- Loading branch information