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

<?php
$db = new mysqli(null, $_ENV['MYSQL_TEST_USER'],
    $_ENV['MYSQL_TEST_PASSWD'], $_ENV['MYSQL_TEST_DB'],
    null, $_ENV['MYSQL_TEST_SOCKET']);

$result = $db->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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to