mirror of
https://github.com/php/php-src.git
synced 2024-11-28 20:34:29 +08:00
ok, call pdo_mysql_error() before returning -1
This commit is contained in:
parent
8899425e26
commit
5232c4a544
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user