alternator: table creation time is in seconds

The "Timestamp" type returned for CreationDateTime can be one of several
things but if it is a number, it is supposed to be the time in *seconds*
since the epoch - not in milliseconds. Returning milliseconds as we
wrongly did causes boto3 (AWS's Python driver) to throw a parse exception
on this response.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
This commit is contained in:
Nadav Har'El
2019-05-02 00:05:16 +03:00
parent c0518183c2
commit 9d72bc3167

View File

@@ -113,7 +113,7 @@ static void add_column(schema_builder& builder, sstring name, sstring type, colu
}
static void supplement_table_info(Json::Value& descr, const schema& schema) {
descr[CREATION_DATE_TIME] = std::chrono::duration_cast<std::chrono::milliseconds>(gc_clock::now().time_since_epoch()).count();
descr[CREATION_DATE_TIME] = std::chrono::duration_cast<std::chrono::seconds>(gc_clock::now().time_since_epoch()).count();
descr[TABLE_STATUS] = ACTIVE;
descr[TABLE_ID] = schema.id().to_sstring().c_str();
}