]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: Display the needed size when a MySQL result was truncated 5820/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 12 Oct 2017 15:32:52 +0000 (17:32 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 12 Oct 2017 15:32:52 +0000 (17:32 +0200)
modules/gmysqlbackend/smysql.cc

index 5e9354254a4e7123dec3e756d641baef1552ef63..aab16daf9d5643b381501cb3bc0f728c2407fbf5 100644 (file)
@@ -233,8 +233,8 @@ public:
     row.reserve(d_fnum);
 
     for(int i=0;i<d_fnum;i++) {
-      if (*d_res_bind[i].error) {
-        L<<Logger::Warning<<"Result field at row " << d_residx << " column " << i << " has errno " << *d_res_bind[i].error << endl;
+      if (err == MYSQL_DATA_TRUNCATED && *d_res_bind[i].error) {
+        L<<Logger::Warning<<"Result field at row " << d_residx << " column " << i << " has been truncated, we allocated " << d_res_bind[i].buffer_length << " bytes but at least " << *d_res_bind[i].length << " was needed" << endl;
       }
       if (*d_res_bind[i].is_null) {
         row.push_back("");