Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121592 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 59632 invoked from network); 5 Nov 2023 15:37:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Nov 2023 15:37:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A8B181804D0 for ; Sun, 5 Nov 2023 07:37:07 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 5 Nov 2023 07:37:07 -0800 (PST) Received: by mail-ua1-f43.google.com with SMTP id a1e0cc1a2514c-7ba962d534eso1442716241.3 for ; Sun, 05 Nov 2023 07:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=youmind.jp; s=google; t=1699198626; x=1699803426; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ugZSRwyl7qxCM5dqIyGjacRXke7heZiughRY2AN0iDw=; b=YyWNphyTOqxjaEo1reJoHBtfNdMm4Eml9vQdaBHSwHe28G+sMcw18yvdCkMsWnRPGb F2X6erCFnYWrGTl5862A/JJt3jiY0/lRWXqrHEHgYNULayleEu/K7XPXT+uwAuaalVwJ XwezsN1e0nvfX2X8uP2GnpdgebRbJMQzfw4Zfma0G9vixjuRDpQTB2INoGUlND8a2rKq qtrZOaZv3NF74oIWBgql82irTyTbPZBSsJLfaXnv84xqHMweQn2McqlxO11bIFgutsm1 Y9yN6L2B5HMxzl8Fv0YA9B3Wdk1q0jHtoar60JeHfLySckjUog65azrPlY+xRoOEdE0e peLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699198626; x=1699803426; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ugZSRwyl7qxCM5dqIyGjacRXke7heZiughRY2AN0iDw=; b=Hojf9k8JAA2Q5kQukAMygzqFZlgbzbeJ+f8Y6kMtgP0UL7QFHmZ45UJiIXtRhp7nqb VbNp3CAkf+sd6Dat39+S8sr9BM36M7AwQy88jFOtYtaHg+nssytju7ALs6P5aHAFIh79 tRidKK5dafD5cZRfoJrR0F/kjSG9a4MCOcjlOpM6a26byLv/jlgRXJc1s6E/r7YbfJhA 2bV79vsg+Kcp0PwEdWqPj29JWkPulYEeLe+64scvZSO0hT1jHqPhgg9KXI6Ud14Bw9dP Y1psqAvo00sTW5WMQzkuu0Y3O7HlMOve6LCJ/Y98WRyf0cgllc5OOf0vjEVvWkw14AxT dBtQ== X-Gm-Message-State: AOJu0Ywv61VXvmIa/SHNGlCYgt06pC4xM+vo86RxFQMZpq3V0tH/++YH z3Hn8iX5JqvcXhrM6CnEOMzcOnyzzHBT7FY6lnvTfAgNhrVoZWJMcto= X-Google-Smtp-Source: AGHT+IEbFl+NZLEN6qAF8ZYkiW0BF+p1sv5VXtyRmMyQqmStGaIYTdRN4k8lE4DcEyoZcE9etMga+FO30HYAWCbvrQk= X-Received: by 2002:a67:c29c:0:b0:45e:30e9:ff12 with SMTP id k28-20020a67c29c000000b0045e30e9ff12mr2054486vsj.17.1699198626292; Sun, 05 Nov 2023 07:37:06 -0800 (PST) MIME-Version: 1.0 References: <734FB3C6-EBE6-4F35-8738-436AF7D8B161@sakiot.com> <129fb16f-8d38-4951-b84d-f25799158e2b@beccati.com> In-Reply-To: <129fb16f-8d38-4951-b84d-f25799158e2b@beccati.com> Reply-To: Kentaro Takeda Date: Mon, 6 Nov 2023 00:36:55 +0900 Message-ID: To: Matteo Beccati Cc: Saki Takamachi , PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Fix the inconsistent behavior of PDO::PARAM_XXX From: internals@lists.php.net ("Kentaro Takeda via internals") Hi, Matteo, > The last time I tried to fix the PDO_PARAM_INT behavior on pdo_pgsql I broke Laravel and surely many other projects. > https://github.com/php/php-src/pull/6801 Thank you for providing an important example. Regarding this past issue with PostgreSQL, it can be solved by treating numbers larger than `int4` as `unknown` (as is the case now) rather than as `int8` (as in previous attempts). This approach aligns with PostgreSQL's capability to cast `integer` to `boolean` but not `smallint` or `bigint`. This consideration is crucial for ensuring interoperability. ```` postgres=# select 1::integer::boolean ; -- returns `t` postgres=# select 1::smallint::boolean ; -- `ERROR: cannot cast type smallint to boolean` postgres=# select 1::bigint::boolean ; -- `ERROR: cannot cast type bigint to boolean` ```` It is certainly not realistic to unify behavior across all databases. Also, as in the example above, there are certainly places where each database requires individual support. I think it would be good if a solution could be found that would allow for more correct behavior without breaking the behavior of existing applications. Your insights and contributions are interesting and invaluable. They are much appreciated. Best regards