-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add necessary implementation to pass all PreparedTests
Added retry policy definition: * constructor for Default retry policy: cass_retry_policy_default_new * destructor for CassRetryPolicy: cass_retry_policy_free Added implementation of cass_row_get_column_by_name. Modified PrepareFromExistingSimpleStatement and PrepareFromExistingBoundStatement tests to prepare statements with Default retry policy instead of DowngradingConsistency as the latter is deprecated and is not supported by rust driver. Statement setters validations are commented out in tests as their corresponding implementations in rust bindings are not present(src/testing.cpp). In FailFastWhenPreparedIDChangesDuringReprepare test, the result's error message is changed according to the error message the rust driver returns. PreparedIDUnchangedDuringReprepare test is ignored, as it is also ignored in cpp-driver.
- Loading branch information
Showing
7 changed files
with
92 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use crate::argconv::free_arced; | ||
use scylla::retry_policy::{DefaultRetryPolicy, FallthroughRetryPolicy}; | ||
use std::sync::Arc; | ||
|
||
pub enum RetryPolicy { | ||
DefaultRetryPolicy(DefaultRetryPolicy), | ||
FallthroughRetryPolicy(FallthroughRetryPolicy), | ||
} | ||
|
||
pub type CassRetryPolicy = RetryPolicy; | ||
|
||
#[no_mangle] | ||
pub extern "C" fn cass_retry_policy_default_new() -> *const CassRetryPolicy { | ||
Arc::into_raw(Arc::new(RetryPolicy::DefaultRetryPolicy( | ||
DefaultRetryPolicy, | ||
))) | ||
} | ||
|
||
#[no_mangle] | ||
pub unsafe extern "C" fn cass_retry_policy_free(retry_policy: *const CassRetryPolicy) { | ||
free_arced(retry_policy); | ||
} |
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