Skip to content

Commit f84936b

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

File tree

2 files changed

+1
-100
lines changed

2 files changed

+1
-100
lines changed

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)
@@ -400,16 +387,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
400387
S->param_formats[param->paramno] = 0;
401388
}
402389

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

ext/pdo_pgsql/tests/bug_80892.phpt

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

0 commit comments

Comments
 (0)