]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
cassandra: Make sure timestamp is always logged (if set) with debug_queries=y
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 7 Feb 2018 13:28:45 +0000 (15:28 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Fri, 9 Feb 2018 08:31:43 +0000 (10:31 +0200)
It wasn't logged in some code paths.

src/lib-sql/driver-cassandra.c

index 0ce04b29f3e561de92f233c1f75590405860da38..27603567d77cbccb93f433252bffdf41051e0482 100644 (file)
@@ -1372,6 +1372,7 @@ driver_cassandra_result_more(struct sql_result **_result, bool async,
           the caller" error text, so it won't be in the debug log output. */
        i_free_and_null(old_result->error);
 
+       new_result->timestamp = old_result->timestamp;
        new_result->consistency = old_result->consistency;
        new_result->page_num = old_result->page_num + 1;
        new_result->page0_start_time = old_result->page0_start_time;
@@ -1573,6 +1574,7 @@ driver_cassandra_transaction_commit(struct sql_transaction_context *_ctx,
                        /* wait for prepare to finish */
                } else {
                        ctx->stmt->result->statement = ctx->stmt->cass_stmt;
+                       ctx->stmt->result->timestamp = ctx->stmt->timestamp;
                        (void)driver_cassandra_send_query(ctx->stmt->result);
                        pool_unref(&ctx->stmt->stmt.pool);
                }
@@ -1984,6 +1986,7 @@ driver_cassandra_statement_query(struct sql_statement *_stmt,
                                                   callback, context);
        if (stmt->cass_stmt != NULL) {
                stmt->result->statement = stmt->cass_stmt;
+               stmt->result->timestamp = stmt->timestamp;
        } else if (stmt->prep != NULL) {
                /* wait for prepare to finish */
                return;