Skip to content

Commit 2d4bd4a

Browse files
committed
ext/pgsql: pgsql.allow_persistent, no need to use such large type for boolean state.
also ext/odbc, simplifying odd comparison with non persistent connections.
1 parent 2ee4d35 commit 2d4bd4a

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

ext/odbc/php_odbc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2194,7 +2194,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
21942194
}
21952195
}
21962196

2197-
if (ODBCG(allow_persistent) <= 0) {
2197+
if (!ODBCG(allow_persistent)) {
21982198
persistent = 0;
21992199
}
22002200

ext/pgsql/pgsql.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ PHP_INI_BEGIN()
405405
STD_PHP_INI_BOOLEAN( "pgsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_persistent, zend_pgsql_globals, pgsql_globals)
406406
STD_PHP_INI_ENTRY_EX("pgsql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_persistent, zend_pgsql_globals, pgsql_globals, display_link_numbers)
407407
STD_PHP_INI_ENTRY_EX("pgsql.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_pgsql_globals, pgsql_globals, display_link_numbers)
408-
STD_PHP_INI_BOOLEAN( "pgsql.auto_reset_persistent", "0", PHP_INI_SYSTEM, OnUpdateBool, auto_reset_persistent, zend_pgsql_globals, pgsql_globals)
408+
STD_PHP_INI_BOOLEAN( "pgsql.auto_reset_persistent", "0", PHP_INI_SYSTEM, OnUpdateLong, auto_reset_persistent, zend_pgsql_globals, pgsql_globals)
409409
STD_PHP_INI_BOOLEAN( "pgsql.ignore_notice", "0", PHP_INI_ALL, OnUpdateBool, ignore_notices, zend_pgsql_globals, pgsql_globals)
410410
STD_PHP_INI_BOOLEAN( "pgsql.log_notice", "0", PHP_INI_ALL, OnUpdateBool, log_notices, zend_pgsql_globals, pgsql_globals)
411411
PHP_INI_END()

ext/pgsql/php_pgsql.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,10 @@ static const php_stream_ops php_stream_pgsql_fd_ops = {
184184
ZEND_BEGIN_MODULE_GLOBALS(pgsql)
185185
zend_long num_links,num_persistent;
186186
zend_long max_links,max_persistent;
187-
zend_long allow_persistent;
187+
bool allow_persistent;
188+
int ignore_notices;
188189
zend_long auto_reset_persistent;
189-
int ignore_notices,log_notices;
190+
int log_notices;
190191
zend_object *default_link; /* default link when connection is omitted */
191192
HashTable field_oids;
192193
HashTable table_oids;

0 commit comments

Comments
 (0)