php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #59881
Patch db2-bugfix revision 2014-07-09 07:52 UTC by stas@php.net

Patch db2-bugfix for ibm_db2 Bug #59881

Patch version 2014-07-09 07:52 UTC

Return to Bug #59881 | Download this patch
Patch Revisions:

Developer: stas@php.net

Index: ibm_db2.c
===================================================================
--- ibm_db2.c	(revision 334211)
+++ ibm_db2.c	(working copy)
@@ -220,6 +220,8 @@
 	PHP_FE(db2_conn_errormsg,	NULL)
 	PHP_FE(db2_conn_error,	NULL)
 	PHP_FE(db2_stmt_error,	NULL)
+	PHP_FE(db2_conn_error_clear,	NULL)
+	PHP_FE(db2_stmt_error_clear,	NULL)
 	PHP_FE(db2_next_result,	NULL)
 	PHP_FE(db2_num_fields,	NULL)
 	PHP_FE(db2_num_rows,	NULL)
@@ -682,7 +684,8 @@
 PHP_RSHUTDOWN_FUNCTION (ibm_db2) 
 {
 	zend_hash_apply(&EG(persistent_list), (apply_func_t) _php_ibm_db2_conn TSRMLS_CC);
-
+	_php_db2_clear_conn_err_cache(TSRMLS_C);
+	_php_db2_clear_stmt_err_cache(TSRMLS_C);
 	return SUCCESS;
 }
 /* }}} */
@@ -4425,6 +4428,32 @@
 }
 /* }}} */
 
+/* {{{ proto string db2_conn_error_clear()
+Clears global connection error state */
+PHP_FUNCTION(db2_conn_error_clear)
+{
+    if (zend_parse_parameters_none() == FAILURE) {
+        return;
+    }
+    
+    _php_db2_clear_conn_err_cache(TSRMLS_C);
+    RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto string db2_stmt_error_clear()
+Clears global statement error state */
+PHP_FUNCTION(db2_stmt_error_clear)
+{
+    if (zend_parse_parameters_none() == FAILURE) {
+        return;
+    }
+    
+    _php_db2_clear_stmt_err_cache(TSRMLS_C);
+    RETURN_TRUE;
+}
+/* }}} */
+
 /* {{{ proto string db2_conn_error([resource connection])
 Returns a string containing the SQLSTATE returned by the last connection attempt */
 PHP_FUNCTION(db2_conn_error)
Index: php_ibm_db2.h
===================================================================
--- php_ibm_db2.h	(revision 334211)
+++ php_ibm_db2.h	(working copy)
@@ -235,6 +235,8 @@
 PHP_FUNCTION(db2_stmt_errormsg);
 PHP_FUNCTION(db2_conn_error);
 PHP_FUNCTION(db2_stmt_error);
+PHP_FUNCTION(db2_conn_error_clear);
+PHP_FUNCTION(db2_stmt_error_clear);
 PHP_FUNCTION(db2_next_result);
 PHP_FUNCTION(db2_num_fields);
 PHP_FUNCTION(db2_num_rows);
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jan 24 23:01:23 2021 UTC