Home » Database » MDB2_Driver_mssql » Bug #9410
fread() truncates after execute()
Details
| Submitted | 2006-11-21 19:59 UTC |
|---|---|
| From | blair dot chesnut at duke dot edu |
| Assigned | davidc |
| Status | Bogus |
| Package | MDB2_Driver_mssql |
| PHP Version | 5.1.2 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2006-11-21 19:59 UTC] blair dot chesnut at duke dot edu
Description:
------------
After executing $db->excute() with parameterized query, output from fread() is truncated to 8192 bytes.
Works fine with no placeholder/parameter.
MDB2 2.3.0
MDB2_Driver_mssql 1.1.0
Test script:
---------------
<?php
require_once "MDB2.php";
$fh = fopen('bigfile.txt', 'r');
$contents = fread($fh, filesize('bigfile.txt'));
print "Contents = " . strlen($contents) . "\n";
$dsn = "mssql://user:passwd@server/db";
$dbh = MDB2::factory($dsn);
$query = "select * from sysobjects where name like ?";
$sth = $dbh->prepare($query);
$res = $sth->execute('A%');
$fh = fopen('bigfile.txt', 'r');
$contents = fread($fh, filesize('bigfile.txt'));
print "Contents = " . strlen($contents) . "\n";
?>
Expected result:
----------------
Contents = 10000
Contents = 10000
Actual result:
--------------
Contents = 10000
Contents = 8192
[2007-01-03 15:29 UTC] blair dot chesnut at duke dot edu
David, what exactly should I get from cvs? Would you post the cvs commands?
[2007-01-19 15:24 UTC] blair dot chesnut at duke dot edu
Thanks, David. Installed MDB2_Driver_mssql-1.1.2, but still have the same problem.
Perhaps it's FreeTDS. Is there a way to run a placeholder query using PHP's mssql functions?