Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127663 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 442FD1A00BC for ; Sun, 15 Jun 2025 14:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1749999021; bh=C1YHIfhhBzP9TkdWTagBwBrSDK9eQ3uGrIyWEA7RBh8=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=PweiHQlBlbo1mpGLgOhrmX0wtV1ldLql8yFE96wNk5GTWSJuwYmlXkwwOS2kNaQpV +XEXMClDxOXzIazLWflptFHeifjtq1aJrT+pXEtwlhbYuWOkrb5ZH+eW1H6isusU3y /AmBnHZMbElpg0BM3G9Qk6+qz/s0R51RAAtosSFCK8WQD339zGIdhZmhSGKgs97tPN fWS7drTe5s+xGRuA/R6sPBCpk2vJUlCzW5fJsMDDgKiz84X2Iry8tXOcAFikBQnzM6 F2ssTZy4dRszDbuaGXKbuD1Su7UEb2TPK1CeFhBZuV/9+hoTbP78SMe9jpfAIxzivE 0l2Uu3Juc/6bQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7712918004D for ; Sun, 15 Jun 2025 14:50:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-4317.protonmail.ch (mail-4317.protonmail.ch [185.70.43.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 15 Jun 2025 14:50:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail3; t=1749999136; x=1750258336; bh=C1YHIfhhBzP9TkdWTagBwBrSDK9eQ3uGrIyWEA7RBh8=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=vb0k/xXyGSJn08TO/e4MdPKl4FuzMC6p57wdXt9Be4BjLiwYcXDLmMOQqB0/3M2+K adRMnV5k7WvWP+3RK9Toi6qEJs5cirIDOuGLEG3BJLmpEcNiC/bWVX45Q1I6EK1HMm x6xmrNTAORVJpur6FgK1vsc0eZMUECLX+8YOTWJcjfrNj7HmnjtfvP6fzNpiBEx4cL nEdQKM/EqaQ0jSN7kEUhciceOr2Il1hn3tQBtznR3VoNHXFRvJmhCis15/WudgUcYV FFbRlGYCX0AnjztaWGSQoyWX6AkDocvc/+44z4ZQfHRbjJmH0ka+oEG5X/fLzuQeoL 9MY0lkwLVCf8g== Date: Sun, 15 Jun 2025 14:52:11 +0000 To: Calvin Buckley Cc: php internals Subject: Re: [PHP-DEV] Interest in a binary parameter type in PDO? Message-ID: In-Reply-To: <193E3B72-AE8B-4686-8ACB-9CB68E3947BC@cmpct.info> References: <193E3B72-AE8B-4686-8ACB-9CB68E3947BC@cmpct.info> Feedback-ID: 96993444:user:proton X-Pm-Message-ID: 1507c8efe8454c89568af9eae51c7f44a374495d Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: internals@gpb.moe ("Gina P. Banyard") On Wednesday, 23 October 2024 at 17:36, Calvin Buckley = wrote: > Hi internals, >=20 > I've been debugging some recent issues users have had, as well as > discussing some related ones. I've come to the conclusion there's a lot > issues with applications trying to access binary data via PDO drivers. >=20 > For example >=20 > - Binary data when quoting in SQL Server can easily get mangled, as the > quoter can't handle binary data and truncates the string. It's > possible other drivers are like this too. > - ODBC drivers can be unpredictable behaviour wise when binding binary > data as SQL_C_CHAR (like what the get_col handler does). In the case > of one driver, it will hex encode the data and can confuse the size > handling in the get_col handler. >=20 > I've thought about overriding the LOB semantics for quick fixes, but > this isn't the right solution, as a LOB and binary data are orthogonal; > i.e. CLOBs are LOB strings and VARBINARY doesn't have LOB semantics. A > binary type (or modifier, i.e. like intl/natl, not to bikeshed tho) can > also be used w/ string columns in the database to possibly override i.e. > automatic charset encoding changes from an ODBC driver. >=20 > I had previously made an issue and PR (links below), but I'm discussing > on internals to revitalize the conversation after being motivated by > recent issues. I'd like to hear from users, database extn. developers, > and userland database library extension developers if this is the right > approach, and if I should move forward dusting off the PR and probably > writing an RFC. Said PR includes the changes needed for DBLIB, ODBC, and > SQLite driver wise, as well as some tests. MySQL/Postgres/Firebird > support would need to be added. >=20 > ~calvinb >=20 > [issue]: https://github.com/php/php-src/issues/11462 > [pr]: https://github.com/php/php-src/pull/11674 Sorry for the late reply, I think this makes a lot of sense and would be in favour of including this = in PDO. Best regards, Gina P. Banyard