Bug #74021 [NEW]: fetch_array broken data. Data more then MEDIUMBLOB
| From: | mavgust at radaris dot com | Date: | Tue, 31 Jan 2017 11:00:25 +0000 |
| Subject: | Bug #74021 [NEW]: fetch_array broken data. Data more then MEDIUMBLOB | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-207065@lists.php.net to get a copy of this message | ||
From: mavgust at radaris dot com
Operating system: Linux(Centos)
PHP version: 7.1.1
Package: MySQLi related
Bug Type: Bug
Bug description:fetch_array broken data. Data more then MEDIUMBLOB
Description:
------------
IF size of all reading fields from mysql table >MEDIUMBLOB (16777215),
last field broken
In php version 7.1.0 all right
Test script:
---------------
$table = 'test';
$m = mysqli_connect("lacalhost", "user", "pwd", "db");
$m->query("CREATE TABLE
".$table." ( id tinyint(4) NOT
NULL,
first mediumblob NOT NULL,
second mediumblob NOT NULL,
third mediumblob NOT NULL, PRIMARY KEY (id))
ENGINE=MyISAM");
$sm = $m->prepare("INSERT INTO ".$table." (id,first, second, third)
VALUES (?,?,?,?)");
$sm->bind_param("isss",$id,$d,$d,$d);
$id = 1;
$d = str_pad("1", 6000000, "1");
$sm->execute();
$sm->close();
$res = $m->query("select first,second,third from ".$table." where
id=1");
$r=$res->fetch_array();
echo "\n\nFirst: ".md5($r['first']). "\nSecond:
".md5($r['second']).
"\nThird: ".md5($r['third']);
$res = $m->query("select third,first,second from ".$table." where
id=1");
$r=$res->fetch_array();
echo "\n\nFirst: ".md5($r['first']). "\nSecond:
".md5($r['second']).
"\nThird: ".md5($r['third']);
$res = $m->query("select second,third,first from ".$table." where
id=1");
$r=$res->fetch_array();
echo "\n\nFirst: ".md5($r['first']). "\nSecond:
".md5($r['second']).
"\nThird: ".md5($r['third']);
Expected result:
----------------
First: 0ee40b4246130ee135b58c07382e69f6
Second: 0ee40b4246130ee135b58c07382e69f6
Third: 0ee40b4246130ee135b58c07382e69f6
Actual result:
--------------
First: 0ee40b4246130ee135b58c07382e69f6
Second: 0ee40b4246130ee135b58c07382e69f6
Third: c7090cb3ccbc696b3c6cc1e6c4c2fb29
First: 0ee40b4246130ee135b58c07382e69f6
Second: c7090cb3ccbc696b3c6cc1e6c4c2fb29
Third: 0ee40b4246130ee135b58c07382e69f6
First: c7090cb3ccbc696b3c6cc1e6c4c2fb29
Second: 0ee40b4246130ee135b58c07382e69f6
Third: 0ee40b4246130ee135b58c07382e69f6
--
Edit bug report at https://bugs.php.net/bug.php?id=74021&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74021&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74021&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74021&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74021&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74021&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74021&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74021&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74021&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74021&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74021&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74021&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74021&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74021&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74021&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74021&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74021&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74021&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74021&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74021&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74021&r=mysqlcfg