#22860 [Fbk->Opn]: odbc_longreadlen() corruption problem
| From: | truth at ichaos dot com | Date: | Tue, 08 Apr 2003 06:00:42 +0000 |
| Subject: | #22860 [Fbk->Opn]: odbc_longreadlen() corruption problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-37332@lists.php.net to get a copy of this message | ||
ID: 22860
User updated by: truth at ichaos dot com
Reported By: truth at ichaos dot com
-Status: Feedback
+Status: Open
Bug Type: ODBC related
Operating System: SuSE 8.0
PHP Version: 4.3.2-RC
New Comment:
How do I do that?
Previous Comments:
------------------------------------------------------------------------
[2003-04-08 00:30:30] kalowsky@php.net
Can you try doing something random like changing the CURSOR type to
SQL_CURSOR_FORWARD_ONLY?
DB2 doesn't like the DYNAMIC CURSOR used by PHP for some reason, and I
wonder if thats the case. I'm unable to reproduce this behavior here
locally though, so it might just be a DB2 specific problem.
------------------------------------------------------------------------
[2003-03-25 00:07:46] truth at ichaos dot com
Actually I tried this with a string that was 28968 chars long, and this
it was actually 16388 chars long instead of 2000000. The characters
beyond 4096 were corrupted.
Sorry for the exagerated numbers.
------------------------------------------------------------------------
[2003-03-24 23:52:36] truth at ichaos dot com
All right, this snapshot didn't work. It's hard to write a script but
here is a good try:
First, a table in my IBM DB2 is created
CREATE TABLE test (
ID INT,
DATA CLOB(1M));
Put a string in the CLOB that is greater than 5K, and and ID = 1 or
so.
All right, now the script
<?
$linkid = odbc_connect("DBNAME", "USER", "PASSWORD");
$result = odbc_exec($linkid, "SELECT data FROM test WHERE id = 1");
odbc_longreadlen($result, 2000000);
odbc_binmode($result, ODBC_BINMODE_PASSTHRU);
$result = odbc_result($this->result, 1)
echo strlen($result);
?>
This should return the length of your string. If the odbc.defaultlrl is
set to 4096, the string is 2000000 chars long. If odbc.defaultlrl is
set to 2000000, the string is the correct length.
------------------------------------------------------------------------
[2003-03-24 23:20:19] kalowsky@php.net
And can you provide a script sample, and sample schema for me to use in
testing?
------------------------------------------------------------------------
[2003-03-24 17:31:15] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/22860
--
Edit this bug report at http://bugs.php.net/?id=22860&edit=1