Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cql3: expr: return more accurate error message for invalidated token(…
…) args before this change, we just print out the addresses of the elements in `column_defs`, if the argument passed to `token()` function are not valid. this is not quite helpful from user's perspective, as user would be more interested in the values. also, we could have more accurate error message for different error. in this change, following how Cassandra 4.1's behavior, three cases are identified, and corresponding errors are returned respectively: * duplicated partition keys * wrong order of partition key * missing keys where, if the partition key order is wrong, instead of the keys specified by user, the correct order is printed in the error message for helping user to correct the `token()` function. for better performance, the checks are performed only if the keys do not match, based on the assumption that the error handling path is not likely to be executed. tests are added accordingly. they tested with Canssandra 4.1.1 also. Fixes scylladb#13468 Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
- Loading branch information