Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57425 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51093 invoked from network); 19 Jan 2012 12:50:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2012 12:50:58 -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:49824] helo=acsinet15.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 91/81-37696-0B1181F4 for ; Thu, 19 Jan 2012 07:50:57 -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 q0JCopld012755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 19 Jan 2012 12:50:52 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 q0JCoo7Y023167 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Jan 2012 12:50:51 GMT Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q0JConlk002686; Thu, 19 Jan 2012 06:50:50 -0600 Received: from [10.164.7.144] (/193.9.13.101) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 19 Jan 2012 04:50:49 -0800 To: Daniel Convissor Cc: PHP Internals List In-Reply-To: <20111118210619.GA13490@panix.com> References: <20111118210619.GA13490@panix.com> Content-Type: text/plain; charset="UTF-8" Organization: Oracle Corporation Date: Thu, 19 Jan 2012 13:50:47 +0100 Message-ID: <1326977447.2722.10.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090209.4F1811AC.00C3,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 Fri, 2011-11-18 at 16:06 -0500, Daniel Convissor wrote: > The "length" property is what's tripping up my unit tests. I'm building > PHP 5.4 from svn for both tests. The only difference between them is > the with-mysqli declaration. Here is a table summarizing the situation: >=20 > type libmysql mysqlnd > ---- -------- ------- > TEXT 65535 196605 > CHAR(2) 2 6 >=20 > Is this intended behavior? Your server seems to be configured for UTF-8 by default. In my tests the behavior for both libraries (myslqnd & libmsql) is the same if you mind the character set (use SET NAMES etc.) The documentation tells unsigned long length =20 The width of the field. This corresponds to the display length, in bytes. =20 The server determines the length value before it generates the result set, so this is the minimum length required for a data type capable of holding the largest possible value from the result column, without knowing in advance the actual values that will be produced by the query for the result set. =20 http://dev.mysql.com/doc/refman/5.5/en/c-api-data-structures.html =20 So it is working in bytes and has to hold all possible values. I'll mark #60333 as bogus (expected behavior) once master works for login ... johannes --=20 Johannes Schl=C3=BCter, MySQL Engineering Connectors and Client Connectivit= y ORACLE Deutschland B.V. & Co. KG, Riesstr. 25, D-80992 M=C3=BCnchen Registergericht: Amtsgericht M=C3=BCnchen, HRA 95603 Gesch=C3=A4ftsf=C3=BCh= rer: J=C3=BCrgen Kunz Komplement=C3=A4rin: ORACLE Deutschland Verwaltung B.V. Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697 Gesch=C3=A4ftsf=C3=BChrer: Alexander van der Ven, Astrid Kepper, Val Maher