|
52 | 52 | #define VARCHARLABEL "varchar"
|
53 | 53 | #define VARCHAROID 1043
|
54 | 54 |
|
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 |
| - |
68 | 55 |
|
69 | 56 |
|
70 | 57 | 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 *
|
400 | 387 | S->param_formats[param->paramno] = 0;
|
401 | 388 | }
|
402 | 389 |
|
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) { |
413 | 391 | S->param_types[param->paramno] = 0;
|
414 | 392 | S->param_formats[param->paramno] = 1;
|
415 | 393 | } else {
|
|
0 commit comments