From:             
Operating system: linux
PHP version:      5.4SVN-2011-11-19 (SVN)
Package:          MySQLi related
Bug Type:         Bug
Bug description:fetch_field() length multiplied by 3 in mysqlnd

Description:
------------
Running PHP 5.4 compiled from svn earlier today.  The "length" values from
fetch_field() are multiplied by 3 when building mysqli against mysqlnd. 
The values are correct when building against libmysql.

Test script:
---------------
$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,
    chr2 CHAR(2) default 'df' NOT NULL,
    chr10 CHAR(10) 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";
$info = $result->fetch_field();
echo "$info->name $info->length\n";


Expected result:
----------------
txt 65535
chr2 2
chr10 10

Actual result:
--------------
txt 196605
chr2 6
chr10 30

-- 
Edit bug report at https://bugs.php.net/bug.php?id=60333&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=60333&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=60333&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=60333&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=60333&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=60333&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=60333&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=60333&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=60333&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=60333&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=60333&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=60333&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=60333&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=60333&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=60333&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=60333&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=60333&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=60333&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=60333&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=60333&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=60333&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=60333&r=mysqlcfg

Reply via email to