File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,17 @@ pub struct CassPrepared {
23
23
}
24
24
25
25
impl CassPrepared {
26
- pub fn new_from_prepared_statement ( statement : PreparedStatement ) -> Self {
26
+ pub fn new_from_prepared_statement ( mut statement : PreparedStatement ) -> Self {
27
+ // We already cache the metadata on cpp-rust-driver side (see CassPrepared::result_metadata field),
28
+ // thus we can enable the optimization on rust-driver side as well. This will prevent the server
29
+ // from sending redundant bytes representing a result metadata during EXECUTE.
30
+ //
31
+ // NOTE: We are aware that it makes cached metadata immutable. It is expected, though - there
32
+ // is an integration test for this for CQL protocol v4 (AlterDoesntUpdateColumnCount).
33
+ // This issue is addressed in CQL protocol v5, but Scylla doesn't support it yet, and probably
34
+ // won't support it in the near future.
35
+ statement. set_use_cached_result_metadata ( true ) ;
36
+
27
37
let variable_col_data_types = statement
28
38
. get_variable_col_specs ( )
29
39
. iter ( )
You can’t perform that action at this time.
0 commit comments