Skip to content

Commit 7bc9df4

Browse files
committed
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4: Revert "Fix #80892: PDO::PARAM_INT is treated the same as PDO::PARAM_STR"
2 parents 47bed58 + b8e49fe commit 7bc9df4

File tree

3 files changed

+5
-100
lines changed

3 files changed

+5
-100
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ PHP NEWS
1515
- ODBC:
1616
. Fixed bug #80460 (ODBC doesn't account for SQL_NO_TOTAL indicator). (cmb)
1717

18+
- PDO_pgsql:
19+
. Reverted bug fix for #80892 (PDO::PARAM_INT is treated the same as
20+
PDO::PARAM_STR). (Matteo)
21+
1822
- pgsql:
1923
. Fixed php_pgsql_fd_cast() wrt. php_stream_can_cast(). (cmb)
2024

ext/pdo_pgsql/pgsql_statement.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,6 @@
5252
#define VARCHARLABEL "varchar"
5353
#define VARCHAROID 1043
5454

55-
#define PG_INT32_MIN (-0x7FFFFFFF-1)
56-
#define PG_INT32_MAX (0x7FFFFFFF)
57-
58-
#if defined(_MSC_VER)
59-
# define strtoll(s, f, b) _atoi64(s)
60-
#elif !defined(HAVE_STRTOLL)
61-
# if defined(HAVE_ATOLL)
62-
# define strtoll(s, f, b) atoll(s)
63-
# else
64-
# define strtoll(s, f, b) strtol(s, f, b)
65-
# endif
66-
#endif
67-
6855

6956

7057
static int pgsql_stmt_dtor(pdo_stmt_t *stmt)
@@ -401,16 +388,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
401388
S->param_formats[param->paramno] = 0;
402389
}
403390

404-
if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_INT) {
405-
/* we need to check if the number requires bigints */
406-
long long val = strtoll(Z_STRVAL_P(parameter), NULL, 10);
407-
408-
if (val > PG_INT32_MAX || val < PG_INT32_MIN) {
409-
S->param_types[param->paramno] = INT8OID;
410-
} else {
411-
S->param_types[param->paramno] = INT4OID;
412-
}
413-
} else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB) {
391+
if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB) {
414392
S->param_types[param->paramno] = 0;
415393
S->param_formats[param->paramno] = 1;
416394
} else {

ext/pdo_pgsql/tests/bug_80892.phpt

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)