Mercurial > dovecot > core-2.2
changeset 22531:65df17ce8844
cassandra: Disable prepared statements with protocol v3 and older
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Tue, 12 Sep 2017 13:23:51 +0300 |
parents | 5f7b8aa18c27 |
children | 10d5c2886b60 |
files | src/lib-sql/driver-cassandra.c |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-sql/driver-cassandra.c Tue Aug 22 14:35:11 2017 +0300 +++ b/src/lib-sql/driver-cassandra.c Tue Sep 12 13:23:51 2017 +0300 @@ -675,6 +675,13 @@ } T_END; cass_log_set_level(db->log_level); + if (db->protocol_version > 0 && db->protocol_version < 4) { + /* binding with column indexes requires v4 */ + db->api.v.prepared_statement_init = NULL; + db->api.v.prepared_statement_deinit = NULL; + db->api.v.statement_init_prepared = NULL; + } + db->timestamp_gen = cass_timestamp_gen_monotonic_new(); db->cluster = cass_cluster_new(); cass_cluster_set_timestamp_gen(db->cluster, db->timestamp_gen);