Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57479 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88795 invoked from network); 23 Jan 2012 09:40:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jan 2012 09:40:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes.schlueter@oracle.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes.schlueter@oracle.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain oracle.com from 141.146.126.227 cause and error) X-PHP-List-Original-Sender: johannes.schlueter@oracle.com X-Host-Fingerprint: 141.146.126.227 acsinet15.oracle.com Received: from [141.146.126.227] ([141.146.126.227:45194] helo=acsinet15.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/10-22258-20B2D1F4 for ; Mon, 23 Jan 2012 04:40:18 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id q0N9eDdX015827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 Jan 2012 09:40:14 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q0N9eCrU014925 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Jan 2012 09:40:12 GMT Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q0N9eBfB010836; Mon, 23 Jan 2012 03:40:11 -0600 Received: from [192.168.2.230] (/188.174.39.134) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 23 Jan 2012 01:40:11 -0800 To: Daniel Convissor Cc: PHP Internals List , Ulf Wendel In-Reply-To: <20120121133107.GA7255@panix.com> References: <20111118210619.GA13490@panix.com> <1326977447.2722.10.camel@guybrush> <20120121133107.GA7255@panix.com> Content-Type: text/plain; charset="UTF-8" Organization: Oracle Corporation Date: Mon, 23 Jan 2012 10:40:04 +0100 Message-ID: <1327311604.5972.51.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090201.4F1D2AFE.00EE,ss=1,re=0.000,fgs=0 Subject: Re: [PHP-DEV] mysqli_fetch_field() mysqlnd & libmysql differences From: johannes.schlueter@oracle.com (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, On Sat, 2012-01-21 at 08:31 -0500, Daniel Convissor wrote: > Hi Johannes: > > > The documentation tells > > > > http://dev.mysql.com/doc/refman/5.5/en/c-api-data-structures.html > > > > So it is working in bytes and has to hold all possible values. > > That's how MySQL's internal API works. At the same time, PHP's users > expect PHP to behave as documented. http://php.net/mysqli_fetch_field says > length is "The width of the field, as specified in the table > definition." We have to live with the information the server gives us. The server gives us the information in bytes. And frankly in PHP a string has no encoding information, so in many cases that is a good answer. But nonetheless the documentation should be improved/fixed. johannes