From: Peter van Dijk Date: Sat, 11 Apr 2020 19:47:43 +0000 (+0200) Subject: auth smysql: mimic error message format from mysql tooling X-Git-Tag: rec-4.4.0-alpha1~5^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F9024%2Fhead;p=thirdparty%2Fpdns.git auth smysql: mimic error message format from mysql tooling --- diff --git a/modules/gmysqlbackend/smysql.cc b/modules/gmysqlbackend/smysql.cc index 74087425e2..7e78283dae 100644 --- a/modules/gmysqlbackend/smysql.cc +++ b/modules/gmysqlbackend/smysql.cc @@ -515,7 +515,7 @@ SMySQL::~SMySQL() SSqlException SMySQL::sPerrorException(const string &reason) { - return SSqlException(reason+string(": ")+mysql_error(&d_db)); + return SSqlException(reason+string(": ERROR ")+std::to_string(mysql_errno(&d_db))+" ("+string(mysql_sqlstate(&d_db))+"): "+mysql_error(&d_db)); } std::unique_ptr SMySQL::prepare(const string& query, int nparams)