Skip to content

Commit

Permalink
cassandra: Disable prepared statements with protocol v3 and older
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Sep 27, 2017
1 parent f90f6a2 commit fbe89fb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib-sql/driver-cassandra.c
Expand Up @@ -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);
Expand Down

0 comments on commit fbe89fb

Please sign in to comment.