mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-23 10:00:35 +00:00
Let's say that we have a prepared statement with a token restriction: ```cql SELECT * FROM some_table WHERE token(p1, p2) = ? ``` 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 to `token(p1, p2)`. It turns out that the Java driver relies on the name being `"partition key token"`, so a change to `token(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 pattern `token(p1, p2, p3) = X` and set the receiver name for X to `"partition key token"`. Fixes: #13769 Signed-off-by: Jan Ciolek <jan.ciolek@scylladb.com>