Skip to content

Commit

Permalink
Merge pull request #194 from muzarski/null-api-strings-it
Browse files Browse the repository at this point in the history
ci: enable NullStringApiArgsTest suite
  • Loading branch information
muzarski authored Oct 16, 2024
2 parents 3bb9a49 + ff12066 commit 5f8e82a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ifndef SCYLLA_TEST_FILTER
SCYLLA_TEST_FILTER := $(subst ${SPACE},${EMPTY},ClusterTests.*\
:BasicsTests.*\
:ConfigTests.*\
:NullStringApiArgsTest.*\
:ConsistencyTwoNodeClusterTests.*\
:ConsistencyThreeNodeClusterTests.*\
:SerialConsistencyTests.*\
Expand All @@ -31,6 +32,7 @@ ifndef CASSANDRA_TEST_FILTER
CASSANDRA_TEST_FILTER := $(subst ${SPACE},${EMPTY},ClusterTests.*\
:BasicsTests.*\
:ConfigTests.*\
:NullStringApiArgsTest.*\
:ConsistencyTwoNodeClusterTests.*\
:ConsistencyThreeNodeClusterTests.*\
:SerialConsistencyTests.*\
Expand Down
10 changes: 6 additions & 4 deletions scylla-rust-wrapper/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,12 @@ pub unsafe extern "C" fn cass_session_prepare_n(
query: *const c_char,
query_length: size_t,
) -> *const CassFuture {
let query_str = match ptr_to_cstr_n(query, query_length) {
Some(v) => v,
None => return std::ptr::null(),
};
let query_str = ptr_to_cstr_n(query, query_length)
// Apparently nullptr denotes an empty statement string.
// It seems to be intended (for some weird reason, why not save a round-trip???)
// to receive a server error in such case (CASS_ERROR_SERVER_SYNTAX_ERROR).
// There is a test for this: `NullStringApiArgsTest.Integration_Cassandra_PrepareNullQuery`.
.unwrap_or_default();
let query = Query::new(query_str.to_string());
let cass_session: &CassSession = ptr_to_ref(cass_session_raw);

Expand Down

0 comments on commit 5f8e82a

Please sign in to comment.