Re: mysqli_fetch_field() mysqlnd & libmysql differences
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:
>
> type libmysql mysqlnd
> ---- -------- -------
> TEXT 65535 196605
> CHAR(2) 2 6
>
> 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
The width of the field. This corresponds to the display length,
in bytes.
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.
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.
I'll mark #60333 as bogus (expected behavior) once master works for
login ...
johannes
--
Johannes Schlüter, MySQL Engineering Connectors and Client Connectivity
ORACLE Deutschland B.V. & Co. KG, Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603 Geschäftsführer: Jürgen Kunz
Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher
Thread (19 messages)