RE: Bug #13569 Updated: ibase_fetch_row doesn't null terminate al l strings?
| From: | Erik LaBianca | Date: | Sun, 07 Oct 2001 23:09:58 +0000 |
| Subject: | RE: Bug #13569 Updated: ibase_fetch_row doesn't null terminate al l strings? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-67507@lists.php.net to get a copy of this message | ||
Can do. I'll do it tomorrow and let you know what's up.
--erik
-----Original Message-----
From: Bug Database [mailto:php-dev@lists.php.net]
Sent: Friday, October 05, 2001 10:03 PM
To: erik@totalcirculation.com
Subject: Bug #13569 Updated: ibase_fetch_row doesn't null terminate all
strings?
ID: 13569
Updated by: rasmus
Reported By: erik@totalcirculation.com
Old Status: Open
Status: Feedback
Bug Type: InterBase related
Operating System:
PHP Version: 4.0.4pl1
New Comment:
Any chance you could test agains the current code? Grab the latest php4
snapshot tarball from http://snaps.php.net
Some fixes were applied to the interbase extension to fix this a while ago,
but they are not in the released 4.0.6 version.
Previous Comments:
------------------------------------------------------------------------
[2001-10-05 16:37:03] erik@totalcirculation.com
<pre>
The summary says it all, I guess.
$indexed = array();
$assoc = array();
$nullassoc = array();
while($row = ibase_fetch_row($sth)) {
array_push($indexed, $row[0]);
$assoc[$row[0]] = $row[1];
$nullassoc["${row[0]}\0"] = $row[1];
}
foreach($indexed as $key=>$val) {
echo "indexed key: '$key' val: '$val'<br>\n";
}
foreach($assoc as $key=>$val) {
echo "assoc key: '$key' val: '$val'<br>\n";
}
foreach($nullassoc as $key=>$val) {
echo "nullassoc key: '$key' val: '$val'<br>\n";
}
If you run this code with a select statement such as
select varcharcol, varcharcol2 from table, you should see the problem. You
may need to run it a couple times to actually see it happen.
The problem could also be in the routine that handles
$array[$key] = $val, as evidenced by the first runthrough,
where the values appear to be correctly null terminated.
Feel free to contact me with any questions or if this doesn't make sense!
Thanks
</pre>
------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at
http://bugs.php.net/?id=13569&edit=2