From 0261ae86447532f18e2e864feede27901cc12e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Thu, 30 Jul 2015 12:31:19 +0000 Subject: [PATCH] Bugfix: OK packets where considered errors --- lib/MySQL_Session.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index d59067e54..e0473f517 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -1816,9 +1816,10 @@ void MySQL_Session::MySQL_Result_to_MySQL_wire(MYSQL *mysql, MYSQL_RES *result, //free(l); //free(p); } else { // no result set - if (num_fields) { + int myerrno=mysql_errno(mysql); + if (myerrno==0) { num_rows = mysql_affected_rows(mysql); - myprot->generate_pkt_OK(true,NULL,NULL,sid,num_rows,mysql->insert_id,0,mysql->warning_count,mysql->info); + myprot->generate_pkt_OK(true,NULL,NULL,sid,num_rows,mysql->insert_id,mysql->status,mysql->warning_count,mysql->info); } else { // error char sqlstate[10];