ok, call pdo_mysql_error() before returning -1

This commit is contained in:
Andrey Hristov 2005-07-12 19:32:13 +00:00
parent 8899425e26
commit 5232c4a544

View File

@ -177,8 +177,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len,
return 0; return 0;
} }
S->stmt = mysql_stmt_init(H->server); if (!(S->stmt = mysql_stmt_init(H->server))) {
if (!S->stmt) {
pdo_mysql_error(dbh); pdo_mysql_error(dbh);
if (nsql) { if (nsql) {
efree(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; return -1;
} else { } else {
my_ulonglong c= mysql_affected_rows(H->server); 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);
} }
} }