summaryrefslogtreecommitdiff
path: root/ext/mysql/php_mysql.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysql/php_mysql.c')
-rw-r--r--ext/mysql/php_mysql.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index e79d6b8228..2bf457035b 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -322,6 +322,12 @@ PHP_RINIT_FUNCTION(mysql)
MySG(default_link)=-1;
MySG(num_links) = MySG(num_persistent);
+ /* Reset connect error/errno on every request */
+ if (MySG(connect_error)!=NULL) {
+ efree(MySG(connect_error));
+ MySG(connect_error)=NULL;
+ }
+ MySG(connect_errno)=0;
return SUCCESS;
}