Bug #74021 [Com]: fetch_array broken data. Data more then MEDIUMBLOB
| From: | andrew dot nester dot dev at gmail dot com | Date: | Wed, 01 Feb 2017 07:46:39 +0000 |
| Subject: | Bug #74021 [Com]: fetch_array broken data. Data more then MEDIUMBLOB | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207083@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74021&edit=1
ID: 74021
Comment by: andrew dot nester dot dev at gmail dot com
Reported by: mavgust at radaris dot com
Summary: fetch_array broken data. Data more then MEDIUMBLOB
Status: Open
Type: Bug
Package: MySQLi related
Operating System: Linux(Centos)
PHP Version: 7.1.1
Block user comment: N
Private report: N
New Comment:
I was unable to reproduce this on latest PHP version.
what is you MySQL configuration, for example, max_allowed_packet?
Previous Comments:
------------------------------------------------------------------------
[2017-01-31 11:00:22] mavgust at radaris dot com
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 this bug report at https://bugs.php.net/bug.php?id=74021&edit=1