]> 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)
committerGitLab <gitlab@git.dovecot.net>
Tue, 10 Jan 2017 09:54:53 +0000 (11:54 +0200)
src/lib-sql/driver-cassandra.c

index d33945af8880c5cf810ddc1103fcd26408f9d6a6..64e6064c3a9973dfd68c3da97766234fa3abd97e 100644 (file)
@@ -1006,6 +1006,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";