Browse Source

* Catch case where status>0 for mysql_next_result (bug ID 30551)

git-svn-id: trunk@37862 -
michael 7 years ago
parent
commit
7b46b3d35e
1 changed files with 15 additions and 1 deletions
  1. 15 1
      packages/fcl-db/src/sqldb/mysql/mysqlconn.inc

+ 15 - 1
packages/fcl-db/src/sqldb/mysql/mysqlconn.inc

@@ -621,6 +621,7 @@ Var
   i : integer;
   ParamNames,ParamValues : array of string;
   Res: PMYSQL_RES;
+  Status : Integer;
 
 begin
   C:=Cursor as TCursorName;
@@ -682,7 +683,20 @@ begin
           C.FRes:=Res;
           C.FSelectable:=True;
           end;
-      until mysql_next_result(FMySQL)<>0;
+        Status:=mysql_next_result(FMySQL);
+        if (Status>0) then
+          begin
+          if not ForcedClose then
+            MySQLError(FMySQL, SErrGettingResult, Self)
+          else
+            begin
+            C.RowsAffected:=0;
+            C.FSelectable:= False;
+            C.FRes:=nil;
+            break;
+            end;
+          end;
+      until (Status<>0);
       end;
     end;
 end;