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

Release 0.13.2 #1064

Merged
merged 11 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/semver_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ jobs:
run: rustup update
- name: Install semver-checks
# Official action uses binary releases fetched from GitHub
# If this pipeline becomes too slow, we should do this too
run: cargo install cargo-semver-checks --no-default-features
# If this pipeline becomes too slow, we should do this too.
run: cargo install cargo-semver-checks --no-default-features --features gix-reqwest
- name: Verify the API compatibilty with PR base
id: semver-pr-check
run: |
Expand Down Expand Up @@ -147,6 +147,6 @@ jobs:
- name: Update rust toolchain
run: rustup update
- name: Install semver-checks
run: cargo install cargo-semver-checks --no-default-features
run: cargo install cargo-semver-checks --no-default-features --features gix-reqwest
- name: Run semver-checks to see if it agrees with version updates
run: make semver-version
6 changes: 3 additions & 3 deletions Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions scylla-cql/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "scylla-cql"
version = "0.2.1"
version = "0.2.2"
edition = "2021"
description = "CQL data types and primitives, for interacting with Scylla."
repository = "https://github.com/scylladb/scylla-rust-driver"
Expand All @@ -10,7 +10,7 @@ categories = ["database"]
license = "MIT OR Apache-2.0"

[dependencies]
scylla-macros = { version = "0.5.1", path = "../scylla-macros" }
scylla-macros = { version = "0.5.2", path = "../scylla-macros" }
byteorder = "1.3.4"
bytes = "1.0.1"
tokio = { version = "1.12", features = ["io-util", "time"] }
Expand Down
6 changes: 5 additions & 1 deletion scylla-cql/src/frame/response/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,11 @@ fn deser_rows(
let server_metadata = deser_result_metadata(buf)?;

let metadata = match cached_metadata {
Some(metadata) => metadata.clone(),
Some(cached) => ResultMetadata {
col_count: cached.col_count,
paging_state: server_metadata.paging_state,
col_specs: cached.col_specs.clone(),
},
None => {
// No cached_metadata provided. Server is supposed to provide the result metadata.
if server_metadata.col_count != server_metadata.col_specs.len() {
Expand Down
2 changes: 1 addition & 1 deletion scylla-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "scylla-macros"
version = "0.5.1"
version = "0.5.2"
edition = "2021"
description = "proc macros for scylla async CQL driver"
repository = "https://github.com/scylladb/scylla-rust-driver"
Expand Down
7 changes: 4 additions & 3 deletions scylla/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "scylla"
version = "0.13.1"
version = "0.13.2"
edition = "2021"
description = "Async CQL driver for Rust, optimized for Scylla, fully compatible with Apache Cassandra™"
repository = "https://github.com/scylladb/scylla-rust-driver"
Expand Down Expand Up @@ -40,8 +40,8 @@ full-serialization = [
]

[dependencies]
scylla-macros = { version = "0.5.1", path = "../scylla-macros" }
scylla-cql = { version = "0.2.1", path = "../scylla-cql" }
scylla-macros = { version = "0.5.2", path = "../scylla-macros" }
scylla-cql = { version = "0.2.2", path = "../scylla-cql" }
byteorder = "1.3.4"
bytes = "1.0.1"
futures = "0.3.6"
Expand Down Expand Up @@ -96,3 +96,4 @@ harness = false

[lints.rust]
unreachable_pub = "warn"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(scylla_cloud_tests)'] }
1 change: 1 addition & 0 deletions scylla/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pub use scylla_cql::macros::IntoUserType;
/// - serialization will succed if suffix of UDT fields is missing. If there are missing fields in the
/// middle it will fail. Note that if "skip_name_checks" is enabled, and the types happen to match,
/// it is possible for serialization to succeed with unexpected result.
///
/// This behavior is the default to support ALTERing UDTs by adding new fields.
/// You can require exact match of fields using `force_exact_match` attribute.
///
Expand Down
41 changes: 26 additions & 15 deletions scylla/src/transport/cql_types_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::cql_to_rust::FromCqlVal;
use crate::frame::response::result::CqlValue;
use crate::frame::value::{Counter, CqlDate, CqlTime, CqlTimestamp};
use crate::macros::FromUserType;
use crate::test_utils::{create_new_session_builder, setup_tracing};
use crate::test_utils::{create_new_session_builder, scylla_supports_tablets, setup_tracing};
use crate::transport::session::Session;
use crate::utils::test_utils::unique_keyspace_name;
use itertools::Itertools;
Expand All @@ -16,23 +16,27 @@ use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use std::str::FromStr;

// Used to prepare a table for test
// Creates a new keyspace
// Creates a new keyspace, without tablets if requested and the ScyllaDB instance supports them.
// Drops and creates table {table_name} (id int PRIMARY KEY, val {type_name})
async fn init_test(table_name: &str, type_name: &str) -> Session {
async fn init_test_maybe_without_tablets(
table_name: &str,
type_name: &str,
supports_tablets: bool,
) -> Session {
let session: Session = 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();
let mut create_ks = format!(
"CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = \
{{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}}",
ks
);

if !supports_tablets && scylla_supports_tablets(&session).await {
create_ks += " AND TABLETS = {'enabled': false}"
}

session.query(create_ks, &[]).await.unwrap();
session.use_keyspace(ks, false).await.unwrap();

session
Expand All @@ -54,6 +58,13 @@ async fn init_test(table_name: &str, type_name: &str) -> Session {
session
}

// Used to prepare a table for test
// Creates a new keyspace
// Drops and creates table {table_name} (id int PRIMARY KEY, val {type_name})
async fn init_test(table_name: &str, type_name: &str) -> Session {
init_test_maybe_without_tablets(table_name, type_name, true).await
}

// This function tests serialization and deserialization mechanisms by sending insert and select
// queries to running Scylla instance.
// To do so, it:
Expand Down Expand Up @@ -267,7 +278,7 @@ async fn test_counter() {

// Can't use run_tests, because counters are special and can't be inserted
let type_name = "counter";
let session: Session = init_test(type_name, type_name).await;
let session: Session = init_test_maybe_without_tablets(type_name, type_name, false).await;

for (i, test) in tests.iter().enumerate() {
let update_bound_value = format!("UPDATE {} SET val = val + ? WHERE id = ?", type_name);
Expand Down
Loading
Loading