Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121599 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 47610 invoked from network); 6 Nov 2023 13:57:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Nov 2023 13:57:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 98BB0180087 for ; Mon, 6 Nov 2023 05:57:55 -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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS9370 160.16.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (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 ; Mon, 6 Nov 2023 05:57:54 -0800 (PST) Received: from smtpclient.apple (softbank060067217005.bbtec.net [60.67.217.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id 219A0401EE; Mon, 6 Nov 2023 22:57:52 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1699279072; bh=HNqCctY0VsHQmH5KOU7M4KRd+6Ryt8Zr+tB+7JuHwCo=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=JY2XY9oHVTcmhG9xQOVtl/pqVCohgDp1cbe65EDZO2T3PNF1RYpuGcfHsDtjKCKpJ Aji3nVqdHi7kokS8FOemYBx90FvIv4YSqU8Bh6w/BZWuutCq7Wb/C3DYEbFpziB6pU LgcP/49bBX/VwlGW2K5n1PKFInIp7p7mK6A1wk88= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) In-Reply-To: <5F393F67-5615-4238-803A-729591ECE405@sakiot.com> Date: Mon, 6 Nov 2023 22:57:39 +0900 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <5BE939AD-9E03-43CE-B08D-9B9A30CA507A@sakiot.com> References: <129fb16f-8d38-4951-b84d-f25799158e2b@beccati.com> <5F393F67-5615-4238-803A-729591ECE405@sakiot.com> To: Matteo Beccati X-Mailer: Apple Mail (2.3731.700.6) Subject: Re: [PHP-DEV] Fix the inconsistent behavior of PDO::PARAM_XXX From: saki@sakiot.com (Saki Takamachi) Hi, I think this is probably the same problem that Matteo ran into, but when = using emulate mode, pgsql errors out with code like this: ``` true, ], ); $db->exec('CREATE TABLE test2 (val BOOLEAN)'); $stmt =3D $db->prepare('INSERT INTO test2 VALUES(:val)'); $stmt->bindValue(':val', 1, PDO::PARAM_INT); $stmt->execute(); ``` ``` Fatal error: Uncaught PDOException: SQLSTATE[42804]: Datatype mismatch: = 7 ERROR: column "val" is of type boolean but expression is of type = integer ``` It seems a little strange that whether an error occurs or not depends on = whether you are in emulation mode or not. Saki=