From: Andrey Hristov Date: Tue, 12 Jul 2005 19:32:13 +0000 (+0000) Subject: ok, call pdo_mysql_error() before returning -1 X-Git-Tag: php-5.1.0b3~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5232c4a5446a01f58d769698b6c773f586ed6d8b;p=php ok, call pdo_mysql_error() before returning -1 --- diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 08b4429880..2f7d9437c9 100755 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -177,8 +177,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, return 0; } - S->stmt = mysql_stmt_init(H->server); - if (!S->stmt) { + if (!(S->stmt = mysql_stmt_init(H->server))) { pdo_mysql_error(dbh); if (nsql) { efree(nsql); @@ -226,7 +225,7 @@ static long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRM return -1; } else { my_ulonglong c= mysql_affected_rows(H->server); - return c != (my_ulonglong)-1 ? c:-1; + return c != (my_ulonglong)-1 ? c:(pdo_mysql_error(dbh),-1); } }