cql3/prepare_expr: force token() receiver name to be partition key token #13815
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Let's say that we have a prepared statement with a token restriction:
After calling
prepare
the drivers receives some information about the prepared statment, including names of values bound to each bind marker.In case of a partition token restriction (
token(p1, p2) = ?
) there's an expectation that the name assigned to this bind marker will be"partition key token"
.In a recent change the code handling
token()
expressions has been unified with the code that handles generic function calls, and as a result the name has changed totoken(p1, p2)
.It turns out that the Java driver relies on the name being
"partition key token"
, so a change totoken(p1, p2)
broke some things.This patch sets the name back to
"partition key token"
. To achieve this we detect any restrictions that match the patterntoken(p1, p2, p3) = X
and set the receiver name for X to"partition key token"
.Fixes: #13769