diff options
| author | Andrey Hristov <andrey@php.net> | 2005-07-12 19:32:13 +0000 |
|---|---|---|
| committer | Andrey Hristov <andrey@php.net> | 2005-07-12 19:32:13 +0000 |
| commit | 5232c4a5446a01f58d769698b6c773f586ed6d8b (patch) | |
| tree | fa30ec728379f1b01ffa69c280f603d39c9cffbc /ext/pdo_mysql/mysql_driver.c | |
| parent | 8899425e26b8d9653e122b5b4aee8a410040146a (diff) | |
| download | php-git-5232c4a5446a01f58d769698b6c773f586ed6d8b.tar.gz | |
ok, call pdo_mysql_error() before returning -1
Diffstat (limited to 'ext/pdo_mysql/mysql_driver.c')
| -rwxr-xr-x | ext/pdo_mysql/mysql_driver.c | 5 |
1 files changed, 2 insertions, 3 deletions
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); } } |
