lang/php74: Update from 7.4.18 to 7.4.19
PDO_pgsql: Revert "Fixed bug #80892 (PDO::PARAM_INT is treated the same as PDO::PARAM_STR)" Sponsored by: Bounce Experts
This commit is contained in:
parent
88cd79030f
commit
1f37ed93a6
@ -1,7 +1,5 @@
|
||||
CATEGORIES= databases
|
||||
|
||||
PORTREVISION= 1
|
||||
|
||||
MASTERDIR= ${.CURDIR}/../../lang/php74
|
||||
|
||||
PKGNAMESUFFIX= -pdo_pgsql
|
||||
|
@ -1,42 +0,0 @@
|
||||
--- pgsql_statement.c.orig 2021-04-27 14:35:54 UTC
|
||||
+++ pgsql_statement.c
|
||||
@@ -54,21 +54,8 @@
|
||||
#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)
|
||||
{
|
||||
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
|
||||
@@ -403,16 +390,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, str
|
||||
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 {
|
@ -1,80 +0,0 @@
|
||||
--- tests/bug_80892.phpt.orig 2021-04-27 14:35:54 UTC
|
||||
+++ tests/bug_80892.phpt
|
||||
@@ -1,77 +0,0 @@
|
||||
---TEST--
|
||||
-Bug #80892 PDO::PARAM_INT is treated the same as PDO::PARAM_STR
|
||||
---SKIPIF--
|
||||
-<?php
|
||||
-if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
|
||||
-require __DIR__ . '/config.inc';
|
||||
-require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
|
||||
-PDOTest::skip();
|
||||
-?>
|
||||
---FILE--
|
||||
-<?php
|
||||
-require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
|
||||
-
|
||||
-/** @var PDO $db */
|
||||
-$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
|
||||
-$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
-$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
|
||||
-
|
||||
-$db->exec("CREATE OR REPLACE FUNCTION bug80892 (x bigint) RETURNS varchar AS $$ SELECT 'bigint' $$ LANGUAGE sql");
|
||||
-$db->exec("CREATE OR REPLACE FUNCTION bug80892 (x int) RETURNS varchar AS $$ SELECT 'int' $$ LANGUAGE sql");
|
||||
-$db->exec("CREATE OR REPLACE FUNCTION bug80892 (x text) RETURNS varchar AS $$ SELECT 'text' $$ LANGUAGE sql");
|
||||
-
|
||||
-// Sanity check
|
||||
-var_dump($db->query("SELECT bug80892(2147483648)")->fetchColumn());
|
||||
-var_dump($db->query("SELECT bug80892(1)")->fetchColumn());
|
||||
-var_dump($db->query("SELECT bug80892('1')")->fetchColumn());
|
||||
-
|
||||
-// No binding
|
||||
-$stmt = $db->prepare("SELECT bug80892(?)");
|
||||
-$stmt->execute([1]);
|
||||
-var_dump($stmt->fetchColumn());
|
||||
-
|
||||
-// Bind int value as string
|
||||
-$stmt = $db->prepare("SELECT bug80892(?)");
|
||||
-$stmt->bindValue(1, 1, PDO::PARAM_STR);
|
||||
-$stmt->execute();
|
||||
-var_dump($stmt->fetchColumn());
|
||||
-
|
||||
-// Bind int value as int
|
||||
-$stmt = $db->prepare("SELECT bug80892(?)");
|
||||
-$stmt->bindValue(1, 1, PDO::PARAM_INT);
|
||||
-$stmt->execute();
|
||||
-var_dump($stmt->fetchColumn());
|
||||
-
|
||||
-// Bind string value as int
|
||||
-$stmt = $db->prepare("SELECT bug80892(?)");
|
||||
-$stmt->bindValue(1, '1', PDO::PARAM_INT);
|
||||
-$stmt->execute();
|
||||
-var_dump($stmt->fetchColumn());
|
||||
-
|
||||
-// Bind bigint string value as int
|
||||
-$stmt = $db->prepare("SELECT bug80892(?)");
|
||||
-$stmt->bindValue(1, '2147483648', PDO::PARAM_INT);
|
||||
-$stmt->execute();
|
||||
-var_dump($stmt->fetchColumn());
|
||||
-
|
||||
-// Bind negative bigint (string on 32bit) as int
|
||||
-$stmt = $db->prepare("SELECT bug80892(?)");
|
||||
-$stmt->bindValue(1, PHP_INT_SIZE == 4 ? '-33333333333' : -33333333333, PDO::PARAM_INT);
|
||||
-$stmt->execute();
|
||||
-var_dump($stmt->fetchColumn());
|
||||
-
|
||||
-$db->exec("DROP FUNCTION bug80892 (bigint)");
|
||||
-$db->exec("DROP FUNCTION bug80892 (int)");
|
||||
-$db->exec("DROP FUNCTION bug80892 (text)");
|
||||
-
|
||||
-?>
|
||||
---EXPECT--
|
||||
-string(6) "bigint"
|
||||
-string(3) "int"
|
||||
-string(4) "text"
|
||||
-string(4) "text"
|
||||
-string(4) "text"
|
||||
-string(3) "int"
|
||||
-string(3) "int"
|
||||
-string(6) "bigint"
|
||||
-string(6) "bigint"
|
@ -1,4 +1,3 @@
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= devel
|
||||
|
||||
MASTERDIR= ${.CURDIR}/../../lang/php74
|
||||
|
@ -1,5 +1,5 @@
|
||||
PORTNAME= php74
|
||||
DISTVERSION= 7.4.18
|
||||
DISTVERSION= 7.4.19
|
||||
PORTREVISION?= 0
|
||||
CATEGORIES?= lang devel www
|
||||
MASTER_SITES= PHP/distributions
|
||||
|
@ -1,3 +1,3 @@
|
||||
TIMESTAMP = 1619897998
|
||||
SHA256 (php-7.4.18.tar.xz) = ab97f22b128d21dcbc009b50a37aaea0051b2721cbcd122d9e00e6ffc3c4b7e1
|
||||
SIZE (php-7.4.18.tar.xz) = 10340980
|
||||
TIMESTAMP = 1620427253
|
||||
SHA256 (php-7.4.19.tar.xz) = 6c17172c4a411ccb694d9752de899bb63c72a0a3ebe5089116bc13658a1467b2
|
||||
SIZE (php-7.4.19.tar.xz) = 10341424
|
||||
|
Loading…
Reference in New Issue
Block a user