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: Revert "Fix #80892: PDO::PARAM_INT is treated the same as PDO::PARAM_STR"
This commit is contained in:
commit
f84936b30c
2 changed files with 1 additions and 100 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue