diff options
| author | Vince <github@darkain.com> | 2016-11-08 14:23:04 -0800 |
|---|---|---|
| committer | Nikita Popov <nikic@php.net> | 2017-01-03 12:13:08 +0100 |
| commit | cfd6e1484283f9d693e457320e6a0d82422b9b33 (patch) | |
| tree | 0e6c5aed8a125663d331530d80065c495fe36bf2 /ext/mysqli/mysqli_nonapi.c | |
| parent | ff4e330eae7aa2550c483d480cb98054e251da55 (diff) | |
| download | php-git-cfd6e1484283f9d693e457320e6a0d82422b9b33.tar.gz | |
Fix Bug #73462 - Persistent connections don't set $connect_errno
Persistent connections skipped resetting $connect_error and $connect_errno values
This adds the "clear error" line to persistent connections for consistency
Diffstat (limited to 'ext/mysqli/mysqli_nonapi.c')
| -rw-r--r-- | ext/mysqli/mysqli_nonapi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 49db7bbfe6..1c25fafba3 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -183,6 +183,10 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne mysqlnd_restart_psession(mysql->mysql); #endif MyG(num_active_persistent)++; + + /* clear error */ + php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql)); + goto end; } else { mysqli_close(mysql->mysql, MYSQLI_CLOSE_IMPLICIT); |
