Skip to content

Commit 5a86028

Browse files
committed
Deprecate PreparedStatement::get_result_set_col_specs
It was replaced by `get_current_result_set_col_specs`. Old method may use stale metadata, and is thus not recommended.
1 parent 534e752 commit 5a86028

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scylla/src/statement/prepared.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,17 @@ impl PreparedStatement {
536536
self.shared.current_result_metadata.store(new_metadata);
537537
}
538538

539-
/// Access column specifications of the result set returned after the execution of this statement
539+
/// Access column specifications of the result set returned after the preparation of this statement
540+
///
541+
/// In 1.4.0, result metadata became mutable to allow us to update it when server
542+
/// sends a new one (which happens in CQLv5, or CQLv4 with Scylla's metadata id extension). This method can't
543+
/// be changed to support it because of Copy bound on ColumnSpecs. This method now uses metadata initially sent
544+
/// by the server, which may be different than the one currently used. Please use get_current_result_set_col_specs instead."
545+
// TODO(2.0): Remove this
546+
#[deprecated(
547+
since = "1.4.0",
548+
note = "This method may return outdated metadata. Use get_current_result_set_col_specs() instead."
549+
)]
540550
pub fn get_result_set_col_specs(&self) -> ColumnSpecs<'_, 'static> {
541551
ColumnSpecs::new(self.shared.initial_result_metadata.col_specs())
542552
}

0 commit comments

Comments
 (0)