From 84b404804aff5cd5284bc02ef178dc2bcc620320 Mon Sep 17 00:00:00 2001 From: Thomas Dreibholz Date: Mon, 2 Dec 2024 18:20:22 +0100 Subject: [PATCH] Fixed cast for version 1 timestamp export. --- src/hpct-query.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hpct-query.cc b/src/hpct-query.cc index 3c08f0d4..24563b19 100644 --- a/src/hpct-query.cc +++ b/src/hpct-query.cc @@ -531,10 +531,10 @@ int main(int argc, char** argv) if(tableVersion == 1) { std::string ts; if( (backend & DatabaseBackendType::SQL_PostgreSQL) == DatabaseBackendType::SQL_PostgreSQL ) { - ts = "(1000000000 * CAST(EXTRACT(EPOCH FROM TimeStamp) AS BIGINT))"; + ts = "CAST((1000000000.0 * EXTRACT(EPOCH FROM TimeStamp)) AS BIGINT)"; } else { - ts = "(1000000000 * CAST(UNIX_TIMESTAMP(TimeStamp) AS UNSIGNED))"; + ts = "CAST((1000000000.0 * UNIX_TIMESTAMP(TimeStamp)) AS UNSIGNED)"; } statement << "SELECT" @@ -685,10 +685,10 @@ int main(int argc, char** argv) if(tableVersion == 1) { std::string ts; if( (backend & DatabaseBackendType::SQL_PostgreSQL) == DatabaseBackendType::SQL_PostgreSQL ) { - ts = "(1000000000 * CAST(EXTRACT(EPOCH FROM TimeStamp) AS BIGINT))"; + ts = "CAST((1000000000.0 * EXTRACT(EPOCH FROM TimeStamp)) AS BIGINT)"; } else { - ts = "(1000000000 * CAST(UNIX_TIMESTAMP(TimeStamp) AS UNSIGNED))"; + ts = "CAST((1000000000.0 * UNIX_TIMESTAMP(TimeStamp)) AS UNSIGNED)"; } statement << "SELECT"