I insert about 1.1 Mb of Data into a Mysql Field of type LONGBLOB. This is far away from the maximum supported length of a LONGBLOB field.
The insert seems to work.
If I do a strlen($data)
before inserting it returns 1059245.
If i do a query after inserting:
SELECT OCTET_LENGTH(`data`)...
It returns 1059245
But if i do
$stmt = $pdo->prepare("SELECT `data` FROM `tbl_mytable` WHERE `id` = :id LIMIT 1");
$stmt->bindValue(":id", $id, PDO::PARAM_INT);
$stmt->execute();
$data = $stmt->fetch(PDO::FETCH_ASSOC);
echo strlen($data['data']);
it returns 1048576
My data seems to be cutten after 1048576 bytes.
Why do I only receive the first 1048576 bytes of my data when doing a query?
Is it a PDO Configuration, something like max_fetch_length?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…