]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
cassandra: Disable prepared statements with protocol v3 and older
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 12 Sep 2017 10:23:51 +0000 (13:23 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 27 Sep 2017 10:39:34 +0000 (13:39 +0300)
src/lib-sql/driver-cassandra.c

index 0788412dc6edb0d411f721adde9d33abb2c38620..7d4513e1fd9b9d840e6392df0c876aa272742c3f 100644 (file)
@@ -675,6 +675,13 @@ static struct sql_db *driver_cassandra_init_v(const char *connect_string)
        } 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);