From 1f6e6fcfc5ed1edf938082ad242019fc8fb3730b Mon Sep 17 00:00:00 2001 From: Rushmore Mushambi Date: Tue, 20 Aug 2024 15:50:10 +0200 Subject: [PATCH] Fix release builds (#4559) --- core/src/cf/gc.rs | 1 + core/src/cf/reader.rs | 1 + core/src/gql/schema.rs | 3 +++ core/src/kvs/tr.rs | 1 + src/gql/mod.rs | 11 +++++++---- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/core/src/cf/gc.rs b/core/src/cf/gc.rs index b7121d3e..72e3d4bf 100644 --- a/core/src/cf/gc.rs +++ b/core/src/cf/gc.rs @@ -1,5 +1,6 @@ use crate::err::Error; use crate::key::change; +#[cfg(debug_assertions)] use crate::key::debug::Sprintable; use crate::kvs::Transaction; use crate::vs; diff --git a/core/src/cf/reader.rs b/core/src/cf/reader.rs index ea212d34..99ea03ac 100644 --- a/core/src/cf/reader.rs +++ b/core/src/cf/reader.rs @@ -1,6 +1,7 @@ use crate::cf::{ChangeSet, DatabaseMutation, TableMutations}; use crate::err::Error; use crate::key::change; +#[cfg(debug_assertions)] use crate::key::debug::Sprintable; use crate::kvs::Transaction; use crate::sql::statements::show::ShowSince; diff --git a/core/src/gql/schema.rs b/core/src/gql/schema.rs index df0a19dd..b50d67b7 100644 --- a/core/src/gql/schema.rs +++ b/core/src/gql/schema.rs @@ -607,6 +607,7 @@ fn kind_to_type(kind: Kind, types: &mut Vec) -> Result Kind::Set(_, _) => return Err(schema_error("Kind::Set is not yet supported")), Kind::Array(k, _) => TypeRef::List(Box::new(kind_to_type(*k, types)?)), Kind::Function(_, _) => return Err(schema_error("Kind::Function is not yet supported")), + Kind::Range => return Err(schema_error("Kind::Range is not yet supported")), }; let out = match optional { @@ -670,6 +671,7 @@ fn filter_from_type( Kind::Set(_, _) => {} Kind::Array(_, _) => {} Kind::Function(_, _) => {} + Kind::Range => {} }; Ok(filter) } @@ -1110,5 +1112,6 @@ fn gql_to_sql_kind(val: &GqlValue, kind: Kind) -> Result { _ => Err(type_error(kind, val)), }, Kind::Function(_, _) => Err(resolver_error("Sets are not yet supported")), + Kind::Range => Err(resolver_error("Ranges are not yet supported")), } } diff --git a/core/src/kvs/tr.rs b/core/src/kvs/tr.rs index 51f761a8..046920dc 100644 --- a/core/src/kvs/tr.rs +++ b/core/src/kvs/tr.rs @@ -6,6 +6,7 @@ use crate::dbs::node::Timestamp; use crate::doc::CursorValue; use crate::err::Error; use crate::idg::u32::U32; +#[cfg(debug_assertions)] use crate::key::debug::Sprintable; use crate::kvs::batch::Batch; use crate::kvs::clock::SizedClock; diff --git a/src/gql/mod.rs b/src/gql/mod.rs index 88269777..1b289603 100644 --- a/src/gql/mod.rs +++ b/src/gql/mod.rs @@ -76,10 +76,13 @@ where }; #[cfg(debug_assertions)] - let state = req.extensions() - .get::() - .expect("state extractor should always succeed"); - debug_assert!(Arc::ptr_eq(&state.datastore, &cache.datastore)); + { + let state = req + .extensions() + .get::() + .expect("state extractor should always succeed"); + debug_assert!(Arc::ptr_eq(&state.datastore, &cache.datastore)); + } let executor = match cache.get_schema(session).await { Ok(e) => e,