Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98754 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29308 invoked from network); 10 Apr 2017 07:06:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Apr 2017 07:06:08 -0000 Authentication-Results: pb1.pair.com header.from=php@beccati.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php@beccati.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain beccati.com designates 176.9.123.236 as permitted sender) X-PHP-List-Original-Sender: php@beccati.com X-Host-Fingerprint: 176.9.123.236 box.beccati.com Received: from [176.9.123.236] ([176.9.123.236:36341] helo=box.beccati.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/C0-22499-DDE2BE85 for ; Mon, 10 Apr 2017 03:06:06 -0400 Received: from authenticated-user (box.beccati.com [176.9.123.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by box.beccati.com (Postfix) with ESMTPSA id 7E9FF2001DF; Mon, 10 Apr 2017 09:06:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=beccati.com; s=mail; t=1491807961; bh=NjBjOzLEynefWkfi/wxmKj0gQaFyWb7KdSkKFySJ2no=; h=Subject:To:References:From:Date:In-Reply-To:From; b=RTo9K+pPmekNFexKTMRaDBlT/DWiKnm+PdtKgchaL+xdwJr63L+aIhQCO8tDKHFYI KnqgSTK/5OCDRC0qFNNTrzr6G+HIxsSVKuUy6Dk18R/klukYlO12HDowkY15CF9egf JqBVoGYu+mLDK/cDeVxhDe1fQ2QSN3ING5Gn388WvJ2t42Z2GUm06Z4QWhjFqCo//a pCm1AGoqD+fcQQvemqNah9ehM8jLHLMGiMnSII4VohdLlYHJ4RTjZlWQtq4hXVfQIL Pdb2cMBP8A3sn51zoYyTA8u9yn8Np0M8nw8fiYKXK0UyPokJRDVjk2xaPkOfZi/EAM S1zflFT9XoL4A== To: Adam Baratz , "internals@lists.php.net" References: Message-ID: <5e3e3e9b-f5b9-a19e-c4cb-6af0f5985d94@beccati.com> Date: Mon, 10 Apr 2017 09:05:59 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] PDO Float Type From: php@beccati.com (Matteo Beccati) Hi Adam, On 05/04/2017 17:30, Adam Baratz wrote: > Hi, > > The PDO extension does not have a type to represent floating point values. > The current recommended practice is to use PDO::PARAM_STR. > > I had poked at this topic in an earlier thread: > https://externals.io/thread/551 > > There was some hesitation about how complicated this would be to implement. > After looking through each of the supported drivers, it seems like it would > actually be a fairly light lift. In some cases, switching PDO::PARAM_STR > for a new float type constant will save a type cast and have the same > results. > > I wrote up a proposal here: > https://wiki.php.net/rfc/pdo_float_type > > I tried to be as thorough as possible in understanding the impact on each > supported driver. I'd appreciate any feedback on this concept as well as > its impact on drivers. Thanks for that. I generally have very little use for float types on a database, but I guess their support should have been included from day 1 in PDO. That said, I think the proposed type is likely to be misused for NUMERIC/DECIMAL fields, which would be pretty bad. Maybe we should also add PDO::PARAM_NUMERIC in order to avoid mistakes? Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/