Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Pick connections based on batch first statement's shard" #569

Merged
merged 2 commits into from
Oct 4, 2022

Conversation

cvybhu
Copy link
Contributor

@cvybhu cvybhu commented Oct 4, 2022

The new code, and in particualr the fancy GAT workaroound, cause problems when trying to pass batch values by reference, as described in #568.

Fixes: #568
Unfixes: #448

This reverts commit 24ee954.

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I added appropriate Fixes: annotations to PR description.

cvybhu added 2 commits October 4, 2022 17:37
The new code, and in particualr the fancy GAT workaroound,
cause problems when trying to pass batch values by reference,
as described in scylladb#568.

Fixes: scylladb#568
Unfixes: scylladb#448

This reverts commit 24ee954.

Signed-off-by: Jan Ciolek <[email protected]>
Modified test_batch() to also test passing
a bound value to batch statement by reference.

This wasn't tested, and because of that we didn't
catch the regression described in scylladb#568.

Signed-off-by: Jan Ciolek <[email protected]>
@cvybhu cvybhu requested a review from piodul October 4, 2022 15:42
@@ -388,7 +388,8 @@ async fn test_batch() {
batch.append_statement(&format!("INSERT INTO {}.t_batch (a, b, c) VALUES (7, 11, '')", ks)[..]);
batch.append_statement(prepared_statement.clone());

let values = ((1_i32, 2_i32, "abc"), (), (1_i32, 4_i32, "hello"));
let four_value: i32 = 4;
let values = ((1_i32, 2_i32, "abc"), (), (1_i32, &four_value, "hello"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a tiny nitpick/clarification: "abc" and "hello" already are references (&str), but their lifetime is 'static. The problem with the code that is being reverted is that it doesn't work for references with non-static lifetimes.

No need to do anything here, I think it is obvious that the commit description talks about non-static references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passing batch values by reference doesn't work
2 participants