]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
cassandra: Add support for "bigint" value type.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 9 Jan 2017 18:31:35 +0000 (20:31 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 10 Jan 2017 13:55:58 +0000 (15:55 +0200)
src/lib-sql/driver-cassandra.c

index d8c6d266b7eb051e24896c167ff17bff050b8ef5..ca2401c1e7ecb1a13102247e3c1bd3b4cd3337b8 100644 (file)
@@ -1001,6 +1001,18 @@ driver_cassandra_get_value(struct cassandra_result *result,
                type = "int32";
                break;
        }
+       case CASS_VALUE_TYPE_BIGINT: {
+               cass_int64_t num;
+
+               rc = cass_value_get_int64(value, &num);
+               if (rc == CASS_OK) {
+                       const char *str = t_strdup_printf("%lld", (long long)num);
+                       output_size = strlen(str);
+                       output = (const void *)str;
+               }
+               type = "int64";
+               break;
+       }
        default:
                rc = cass_value_get_bytes(value, &output, &output_size);
                type = "bytes";