List:MySQL and Perl« Previous MessageNext Message »
From:Jochen Wiedmann Date:May 1 2002 8:45pm
Subject:Re: DBD::mysql "fetch() without execute()" error
View as plain text  
Hi, Steve,

I've been reading your patch. Considering the idea
and the patch that Jay has supplied earlier tonight
I suggest that you try whether the following works
as well. If it does, we might leave the detection
of a fetch without execute unchanged.


Regards,

Jochen


--- dbdimp.c.orig       Wed May  1 20:41:41 2002
+++ dbdimp.c    Wed May  1 20:43:23 2002
@@ -1350,12 +1350,16 @@
     Safefree(salloc);

     /** Store the result from the Query */
-    if (!(*cdaPtr = (use_mysql_use_result ?
-                    mysql_use_result(svsock) : mysql_store_result(svsock)))) {
+    *cdaPtr = use_mysql_use_result ?
+      mysql_use_result(svsock) : mysql_store_result(svsock);
+    if (mysql_errno(svsock)) {
+      do_error(h, mysql_errno(svsock), mysql_error(svsock));
+    }
+    if (!*cdaPtr) {
         return mysql_affected_rows(svsock);
+    } else {
+      return mysql_num_rows(*cdaPtr);
     }
-
-    return mysql_num_rows((*cdaPtr));
 }
Thread
DBD::mysql "fetch() without execute()" errorSteve Hay1 May
  • Re: DBD::mysql "fetch() without execute()" errorChuck O'Donnell1 May
  • Re: DBD::mysql "fetch() without execute()" errorJay Lawrence1 May
  • Re: DBD::mysql "fetch() without execute()" errorSteve Hay1 May
    • Re: DBD::mysql "fetch() without execute()" errorJochen Wiedmann1 May
  • Re: DBD::mysql "fetch() without execute()" errorSteve Hay1 May
    • Re: DBD::mysql "fetch() without execute()" errorChuck O'Donnell1 May
      • Dealing with Lost connection to MySQL server during query and mysql_use_result - a solutionJay Lawrence1 May
  • Re: DBD::mysql "fetch() without execute()" errorSteve Hay2 May
    • Re: DBD::mysql "fetch() without execute()" errorJochen Wiedmann2 May
  • installing/creating Innodb tablesRajeev Rumale3 May
  • storing Binary filesRajeev Rumale28 May