mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.0'
* PHP-8.0: Fix locale dependent parsing of PostgreSQL version number
This commit is contained in:
commit
882b418a01
1 changed files with 6 additions and 3 deletions
|
@ -598,7 +598,8 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
|||
}
|
||||
}
|
||||
pgsql = (PGconn *) le->ptr;
|
||||
if (PQprotocolVersion(pgsql) >= 3 && atof(PQparameterStatus(pgsql, "server_version")) >= 7.2) {
|
||||
/* consider to use php_version_compare() here */
|
||||
if (PQprotocolVersion(pgsql) >= 3 && zend_strtod(PQparameterStatus(pgsql, "server_version"), NULL) >= 7.2) {
|
||||
pg_result = PQexec(pgsql, "RESET ALL;");
|
||||
PQclear(pg_result);
|
||||
}
|
||||
|
@ -4063,14 +4064,16 @@ PHP_FUNCTION(pg_get_notify)
|
|||
if (result_type & PGSQL_NUM) {
|
||||
add_index_string(return_value, 0, pgsql_notify->relname);
|
||||
add_index_long(return_value, 1, pgsql_notify->be_pid);
|
||||
if (PQprotocolVersion(pgsql) >= 3 && atof(PQparameterStatus(pgsql, "server_version")) >= 9.0) {
|
||||
/* consider to use php_version_compare() here */
|
||||
if (PQprotocolVersion(pgsql) >= 3 && zend_strtod(PQparameterStatus(pgsql, "server_version"), NULL) >= 9.0) {
|
||||
add_index_string(return_value, 2, pgsql_notify->extra);
|
||||
}
|
||||
}
|
||||
if (result_type & PGSQL_ASSOC) {
|
||||
add_assoc_string(return_value, "message", pgsql_notify->relname);
|
||||
add_assoc_long(return_value, "pid", pgsql_notify->be_pid);
|
||||
if (PQprotocolVersion(pgsql) >= 3 && atof(PQparameterStatus(pgsql, "server_version")) >= 9.0) {
|
||||
/* consider to use php_version_compare() here */
|
||||
if (PQprotocolVersion(pgsql) >= 3 && zend_strtod(PQparameterStatus(pgsql, "server_version"), NULL) >= 9.0) {
|
||||
add_assoc_string(return_value, "payload", pgsql_notify->extra);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue