Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56415 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51369 invoked from network); 18 Nov 2011 21:06:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2011 21:06:25 -0000 Authentication-Results: pb1.pair.com header.from=danielc@analysisandsolutions.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danielc@analysisandsolutions.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain analysisandsolutions.com from 166.84.1.89 cause and error) X-PHP-List-Original-Sender: danielc@analysisandsolutions.com X-Host-Fingerprint: 166.84.1.89 mailbackend.panix.com Solaris 10 (beta) Received: from [166.84.1.89] ([166.84.1.89:45167] helo=mailbackend.panix.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BE/39-06569-0D8C6CE4 for ; Fri, 18 Nov 2011 16:06:24 -0500 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mailbackend.panix.com (Postfix) with ESMTP id E4E0628152 for ; Fri, 18 Nov 2011 16:06:19 -0500 (EST) Received: by panix5.panix.com (Postfix, from userid 14662) id A4B4F24246; Fri, 18 Nov 2011 16:06:19 -0500 (EST) Date: Fri, 18 Nov 2011 16:06:19 -0500 To: PHP Internals List Message-ID: <20111118210619.GA13490@panix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Subject: mysqli_fetch_field() mysqlnd & libmysql differences From: danielc@analysisandsolutions.com (Daniel Convissor) Hi Folks: The output of mysqli_fetch_field() produces different results when running against mysqlnd than it does against libmysql. I've mentioned issues along these lines a couple times on the list in the midst of other threads relating to MySQL handling, but nobody has really addressed it directly. 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? Below is a test script that produce those results. Thanks, --Dan query("CREATE TEMPORARY TABLE phptest_fk ( txt TEXT NULL, chr CHAR(2) default 'df' NOT NULL)"); if (!$result) { echo "OOPS: $db->error\n"; exit(1); } $result = $db->query("INSERT INTO phptest_fk VALUES ('One', 'c1')"); $result = $db->query("SELECT * FROM phptest_fk"); $info = $result->fetch_field(); echo "$info->name $info->length\n"; $info = $result->fetch_field(); echo "$info->name $info->length\n"; ?> -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409