diff --git a/NEWS b/NEWS index 7f08765f436..c8d6d3ab232 100644 --- a/NEWS +++ b/NEWS @@ -54,6 +54,9 @@ PHP NEWS . Fixed bug GH-12767 (Unable to turn on autocommit mode with setAttribute()). (SakiTakamachi) +- PGSQL: + . Fixed auto_reset_persistent handling and allow_persistent type. (David Carlier) + - PHPDBG: . Fixed bug GH-12962 (Double free of init_file in phpdbg_prompt.c). (nielsdos) diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 443232894b2..636fb4029da 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -2194,7 +2194,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) } } - if (ODBCG(allow_persistent) <= 0) { + if (!ODBCG(allow_persistent)) { persistent = 0; } diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 9b61bb75165..e0ffa886449 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -406,7 +406,7 @@ PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN( "pgsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_persistent, zend_pgsql_globals, pgsql_globals) STD_PHP_INI_ENTRY_EX("pgsql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_persistent, zend_pgsql_globals, pgsql_globals, display_link_numbers) STD_PHP_INI_ENTRY_EX("pgsql.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_pgsql_globals, pgsql_globals, display_link_numbers) -STD_PHP_INI_BOOLEAN( "pgsql.auto_reset_persistent", "0", PHP_INI_SYSTEM, OnUpdateBool, auto_reset_persistent, zend_pgsql_globals, pgsql_globals) +STD_PHP_INI_BOOLEAN( "pgsql.auto_reset_persistent", "0", PHP_INI_SYSTEM, OnUpdateLong, auto_reset_persistent, zend_pgsql_globals, pgsql_globals) STD_PHP_INI_BOOLEAN( "pgsql.ignore_notice", "0", PHP_INI_ALL, OnUpdateBool, ignore_notices, zend_pgsql_globals, pgsql_globals) STD_PHP_INI_BOOLEAN( "pgsql.log_notice", "0", PHP_INI_ALL, OnUpdateBool, log_notices, zend_pgsql_globals, pgsql_globals) PHP_INI_END() diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h index 5286ccec636..b9a5fec11d5 100644 --- a/ext/pgsql/php_pgsql.h +++ b/ext/pgsql/php_pgsql.h @@ -184,9 +184,10 @@ static const php_stream_ops php_stream_pgsql_fd_ops = { ZEND_BEGIN_MODULE_GLOBALS(pgsql) zend_long num_links,num_persistent; zend_long max_links,max_persistent; - zend_long allow_persistent; + bool allow_persistent; + int ignore_notices; zend_long auto_reset_persistent; - int ignore_notices,log_notices; + int log_notices; zend_object *default_link; /* default link when connection is omitted */ HashTable field_oids; HashTable table_oids;