]> 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>
Tue, 12 Sep 2017 10:23:51 +0000 (13:23 +0300)
src/lib-sql/driver-cassandra.c

index 32c78f2ba315710889c91b4e1df88e4776c6949d..a87a981a51d466d44683e912acfacc4fae2128cb 100644 (file)
@@ -680,6 +680,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);