Files
scylladb/cql3
Jan Ciolek 8a256f63db cql3/prepare_expr: force token() receiver name to be partition key token
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>
2023-05-09 12:32:57 +02:00
..
2023-04-29 13:11:31 +02:00
2023-02-28 22:26:43 +02:00
2023-02-14 11:19:03 +02:00
2023-04-06 09:50:32 -04:00
2023-04-29 13:11:31 +02:00
2023-01-18 10:38:24 +02:00
2023-02-15 11:09:04 +02:00
2023-04-26 14:09:58 +08:00
2023-01-18 10:38:24 +02:00
2023-02-15 11:09:04 +02:00
2023-04-28 16:59:29 +08:00
2023-02-15 11:09:04 +02:00
2023-02-19 21:05:45 +02:00