Skip to content

Commit

Permalink
cassandra: Support "timestamp" type fields properly
Browse files Browse the repository at this point in the history
Fixes setting them with prepared statements. Reading them never worked
earlier.
  • Loading branch information
sirainen authored and cmouse committed Oct 17, 2017
1 parent b6c9cc2 commit 344c441
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib-sql/driver-cassandra.c
Expand Up @@ -1263,6 +1263,7 @@ driver_cassandra_get_value(struct cassandra_result *result,
type = "int32";
break;
}
case CASS_VALUE_TYPE_TIMESTAMP:
case CASS_VALUE_TYPE_BIGINT: {
cass_int64_t num;

Expand Down Expand Up @@ -1667,6 +1668,7 @@ driver_cassandra_bind_int(struct cassandra_sql_statement *stmt,
if (value < -2147483648 || value > 2147483647)
return CASS_ERROR_LIB_INVALID_VALUE_TYPE;
return cass_statement_bind_int32(stmt->cass_stmt, column_idx, value);
case CASS_VALUE_TYPE_TIMESTAMP:
case CASS_VALUE_TYPE_BIGINT:
return cass_statement_bind_int64(stmt->cass_stmt, column_idx, value);
case CASS_VALUE_TYPE_SMALL_INT:
Expand Down

0 comments on commit 344c441

Please sign in to comment.