Merge branch 'PHP-8.0'

* PHP-8.0:
  Revert "Fix #80892: PDO::PARAM_INT is treated the same as PDO::PARAM_STR"
This commit is contained in:
Matteo Beccati 2021-04-29 12:06:11 +02:00
commit f84936b30c
No known key found for this signature in database
GPG key ID: 8F408F082EBB88C7
2 changed files with 1 additions and 100 deletions

View file

@ -52,19 +52,6 @@
#define VARCHARLABEL "varchar"
#define VARCHAROID 1043
#define PG_INT32_MIN (-0x7FFFFFFF-1)
#define PG_INT32_MAX (0x7FFFFFFF)
#if defined(_MSC_VER)
# define strtoll(s, f, b) _atoi64(s)
#elif !defined(HAVE_STRTOLL)
# if defined(HAVE_ATOLL)
# define strtoll(s, f, b) atoll(s)
# else
# define strtoll(s, f, b) strtol(s, f, b)
# endif
#endif
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 *
S->param_formats[param->paramno] = 0;
}
if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_INT) {
/* we need to check if the number requires bigints */
long long val = strtoll(Z_STRVAL_P(parameter), NULL, 10);
if (val > PG_INT32_MAX || val < PG_INT32_MIN) {
S->param_types[param->paramno] = INT8OID;
} else {
S->param_types[param->paramno] = INT4OID;
}
} else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB) {
if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB) {
S->param_types[param->paramno] = 0;
S->param_formats[param->paramno] = 1;
} else {