From dad7e157826540b2174f80250c9de875c6132967 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Sun, 8 Nov 2015 11:31:57 +0100 Subject: [PATCH] fix: psql, store serials in lowercase --- src/db/psql.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/db/psql.cpp b/src/db/psql.cpp index 619c3a7..a001b76 100644 --- a/src/db/psql.cpp +++ b/src/db/psql.cpp @@ -128,8 +128,9 @@ void PostgresJobProvider::writeBack( std::shared_ptr job, std::shared_ptr(); } - - std::string q = "UPDATE certs SET crt_name=" + txn.quote( res->crt_name ) + ", serial=" + txn.quote( res->serial ) + ", \"caid\" = " + txn.quote( read_id ) + ", created=" + txn.quote( pgTime(res->before) ) + ", expire=" + txn.quote( pgTime(res->after) ) + " WHERE id=" + txn.quote( job->target ); + std::string serial = res->serial; + std::transform(serial.begin(), serial.end(), serial.begin(), ::tolower); + std::string q = "UPDATE certs SET crt_name=" + txn.quote( res->crt_name ) + ", serial=" + txn.quote( serial ) + ", \"caid\" = " + txn.quote( read_id ) + ", created=" + txn.quote( pgTime(res->before) ) + ", expire=" + txn.quote( pgTime(res->after) ) + " WHERE id=" + txn.quote( job->target ); // TODO write more thingies back r = txn.exec( q ); -- 2.39.2