You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[tokio::test]asyncfntest_counter_batch(){setup_tracing();let session = Arc::new(create_new_session_builder().build().await.unwrap());let ks = unique_keyspace_name();
session.query(format!("CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}}", ks),&[]).await.unwrap();
session
.query(format!("CREATE TABLE IF NOT EXISTS {}.t_batch (key int PRIMARY KEY, value counter)",
ks
),&[],).await.unwrap();let q = format!("UPDATE {}.t_batch SET value = value + ? WHERE key = ?", ks);letmut my_batch = Batch::new(BatchType::Counter);assert_eq!(BatchType::Counter, my_batch.get_type());
my_batch.append_statement(&q[..]);
my_batch.append_statement(&q[..]);
my_batch.append_statement(&q[..]);
session
.batch(&my_batch,((Counter(1),2),(Counter(1),2),(Counter(1),2)),).await.unwrap();}
This test fails with a server error:
---- transport::session_test::test_my_batch stdout ----
Unique name: test_rust_1720524333_0
thread 'transport::session_test::test_counter_batch' panicked at scylla/src/transport/session_test.rs:404:10:
called `Result::unwrap()` on an `Err` value: DbError(Invalid, "Cannot include a counter statement in a logged batch")
The driver sends a LOGGED batch, even though the user specified the batch type to be a COUNTER.
The issue was discovered by a faling integration test in cpp-rust-driver's CI after updating rust-driver's version to 0.13: scylladb/cpp-rust-driver#138.
The text was updated successfully, but these errors were encountered:
Here is the test that reproduces the issue:
This test fails with a server error:
The driver sends a LOGGED batch, even though the user specified the batch type to be a COUNTER.
The issue was discovered by a faling integration test in cpp-rust-driver's CI after updating rust-driver's version to 0.13: scylladb/cpp-rust-driver#138.
The text was updated successfully, but these errors were encountered: