Skip to content

Commit

Permalink
Merge branch 'main' into execute_fallible
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai authored Dec 8, 2022
2 parents ce05c0c + 6a0eff3 commit 6d48a93
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ async fn use_statement(session: &CassandraConnection) {
.prepare("INSERT INTO table_1 (id) VALUES (?);")
.await;

// change the keyspace to be incorrect
run_query(session, "USE test_prepare_statements_empty;").await;

// observe query completing against the original keyspace without errors
assert_eq!(
session
Expand All @@ -111,13 +108,16 @@ async fn use_statement(session: &CassandraConnection) {
Ok(Vec::<Vec<ResultValue>>::new())
);

// change the keyspace to be incorrect
run_query(session, "USE test_prepare_statements_empty;").await;

// observe that the query succeeded despite the keyspace being incorrect at the time.
assert_query_result(
session,
"SELECT id FROM test_prepare_statements.table_1 WHERE id = 358;",
&[&[ResultValue::Int(358)]],
)
.await;
assert_eq!(
session
.execute_prepared(&prepared, &[ResultValue::Int(358)])
.await,
Vec::<Vec<ResultValue>>::new()
);
}

pub async fn test<Fut>(session: &CassandraConnection, connection_creator: impl Fn() -> Fut)
Expand Down

0 comments on commit 6d48a93

Please sign in to comment.