]> granicus.if.org Git - php/commitdiff
Fixed bogus query failure claim, on some queries such as OPTIMIZE table.
authorIlia Alshanetsky <iliaa@php.net>
Fri, 24 Jun 2005 23:58:06 +0000 (23:58 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 24 Jun 2005 23:58:06 +0000 (23:58 +0000)
ext/pdo_mysql/mysql_driver.c

index 293a822affbc79e6037bbb6143b73a1f4410c0bd..3300fa335897625ab230f5a9ed1a3e26c287051b 100755 (executable)
@@ -151,7 +151,8 @@ static long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRM
                pdo_mysql_error(dbh);
                return -1;
        } else {
-               return mysql_affected_rows(H->server);
+               long c = mysql_affected_rows(H->server);
+               return c >0 ? c : 0;
        }
 }