mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/pdo_odbc: Do not populate message if there is no driver error (#17478)
This commit is contained in:
committed by
GitHub
parent
951d2f81c7
commit
df8ac4af91
@@ -43,18 +43,18 @@ PDOTest::dropTableIfExists($db, "test38253");
|
||||
--EXPECTF--
|
||||
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: No fetch class specified in %s on line %d
|
||||
|
||||
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error%s on line %d
|
||||
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
|
||||
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: No fetch function specified in %s on line %d
|
||||
|
||||
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error%s on line %d
|
||||
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
|
||||
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: No fetch-into object specified. in %s on line %d
|
||||
|
||||
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error%s on line %d
|
||||
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
|
||||
@@ -41,6 +41,11 @@ static void pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *in
|
||||
einfo = &S->einfo;
|
||||
}
|
||||
|
||||
/* If we don't have a driver error do not populate the info array */
|
||||
if (strlen(einfo->last_err_msg) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
message = strpprintf(0, "%s (%s[%ld] at %s:%d)",
|
||||
einfo->last_err_msg,
|
||||
einfo->what, (long) einfo->last_error,
|
||||
|
||||
Reference in New Issue
Block a user