Doc #60333 [Ver->Fbk]: fetch_field() length multiplied by 3 in mysqlnd

From: Date: Mon, 07 Jan 2013 13:04:19 +0000
Subject: Doc #60333 [Ver->Fbk]: fetch_field() length multiplied by 3 in mysqlnd
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9362@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60333&edit=1 ID: 60333 Updated by: andrey@php.net Reported by: danielc at analysisandsolutions dot com Summary: fetch_field() length multiplied by 3 in mysqlnd -Status: Verified +Status: Feedback Type: Documentation Problem Package: MySQLi related Operating System: linux PHP Version: 5.4SVN-2011-11-19 (SVN) Block user comment: N Private report: N New Comment: Hi, during handshake the server states its server charset. mysqlnd uses it, libmysql doesn't. libmysql does use the charset set at build time or some ini setting from my.cnf / my.ini. I suppose your server runs with UTF8 as charset thus mysqlnd uses it as connection charset and so reports 3x values. Is this your case? Previous Comments: ------------------------------------------------------------------------ [2012-01-28 01:09:45] danielc at analysisandsolutions dot com It happens with libmysql under certain circumstances too. I am working to get a straight answer out of the Johannes and Ulf about a related issue and will post back when that becomes available. ------------------------------------------------------------------------ [2012-01-28 00:29:55] frozenfire@php.net Does this issue only arise when using mysqlnd? ------------------------------------------------------------------------ [2012-01-23 20:59:51] johannes@php.net The behavior is correct. We report the same data as we retrieve from the server. The MySQL documentation has more details on this: http://dev.mysql.com/doc/refman/5.5/en/c-api-data-structures.html The key part here is that the data is returned in bytes. On a connection using UTF-8 these are 3 bytes per character. The PHP documentation should be made more clear on this. ------------------------------------------------------------------------ [2012-01-13 18:09:05] danielc at analysisandsolutions dot com Can this please be fixed before PHP 5.4 goes out the door? ------------------------------------------------------------------------ [2011-11-21 18:04:38] danielc at analysisandsolutions dot com That may be the case, but having UTF-8 fields is legit and the answers from libmysql and mysqlnd should be the same. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=60333 -- Edit this bug report at https://bugs.php.net/bug.php?id=60333&edit=1

« previous php.doc.bugs (#9362) next »