-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adapter: Remove Canceled execute response (#25095)
Previously, the adapter could either send the client an Ok(ExecuteResponse::Canceled) response or an Err(AdapterError::Canceled) response. After aa34c5b the Ok(ExecuteResponse::Canceled) is never used so this commit removes it. Looking through the code it seems like Ok(ExecuteResponse::Canceled) and Err(AdapterError::Canceled) are handled identically. However, when querying Materialize through rust-postgres, when Materialize sends an Ok(ExecuteResponse::Canceled) response the rust client receives an Ok(_) result. When Materialize sends an Err(AdapterError::Canceled) response the rust client receives an Err(_) result. Err(_) is the correct result since canceling a statement causes it to have no effect and matches the PostgreSQL result. For example, imagine a user executes `let res = rust_client.batch_execute("INSERT INTO t VALUES (1)")`. When Materialize would send Ok(ExecuteResponse::Canceled) in response to a cancel, then `res` would be `Ok(())`, even though the `INSERT` was cancelled and had no effect. Now that Err(AdapterError::Canceled) is sent, `res` is `Err(_)`, which exactly matches the behavior of PostgreSQL. Why the difference existed previously is not understood by the author of this commit.
- Loading branch information
Showing
6 changed files
with
2 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters