]> granicus.if.org Git - php/commitdiff
no need to check for execution status, always free a result set if there
authorHartmut Holzgraefe <hholzgra@php.net>
Sun, 27 Feb 2005 12:05:46 +0000 (12:05 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Sun, 27 Feb 2005 12:05:46 +0000 (12:05 +0000)
is one

ext/pdo_mysql/mysql_statement.c

index ad0441beb54c0d1a52432dabfef098c959cf3c66..7f5530dbf245d6899144a2ed143c4dca7df674fc 100755 (executable)
@@ -49,13 +49,12 @@ static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
        pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
        pdo_mysql_db_handle *H = S->H;
 
-       if (stmt->executed) {
-               /* ensure that we free any previous unfetched results */
-               if (S->result) {
-                       mysql_free_result(S->result);
-                       S->result = NULL;
-               }
+       /* ensure that we free any previous unfetched results */
+       if (S->result) {
+               mysql_free_result(S->result);
+               S->result = NULL;
        }
+
        if (mysql_real_query(H->server, stmt->active_query_string, stmt->active_query_stringlen) != 0) {
                pdo_mysql_error_stmt(stmt);
                return 0;