]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth smysql: mimic error message format from mysql tooling 9024/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Sat, 11 Apr 2020 19:47:43 +0000 (21:47 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Sat, 11 Apr 2020 19:47:43 +0000 (21:47 +0200)
modules/gmysqlbackend/smysql.cc

index 74087425e262d9462638628033df0ff56c18e238..7e78283dae5c6be241c14ad6454381e263a9433b 100644 (file)
@@ -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<SSqlStatement> SMySQL::prepare(const string& query, int nparams)