Bug #17719 Updated: Code Garbage in Longtext results

From: Date: Fri, 14 Jun 2002 20:40:35 +0000
Subject: Bug #17719 Updated: Code Garbage in Longtext results
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-10477@lists.php.net to get a copy of this message
ID: 17719 Updated by: php@remove.gustl.net Reported By: php@remove.gustl.net -Status: Feedback +Status: Open Bug Type: ODBC related Operating System: W98,W2K PHP Version: 4.2.1 New Comment: here is my sample script: <?PHP echo "big db test<br>"; $max = 10000; $db = odbc_connect ($DB, $DBAppUser, $DBAppPass) or die ("no connect"); $res = odbc_exec ($db, "SET TEXTSIZE ".(2 * $max)); $res = odbc_exec ($db, "DROP TABLE Test"); $res = odbc_exec ( $db, "CREATE TABLE test ( TEST_ID int NOT NULL IDENTITY PRIMARY KEY, TEST_TEXT ntext NULL )"); $text = ""; for ($i = 0; strlen ($text) < $max; $i++) $text .= "$i\n"; echo strlen ($text)." chars written<br>"; $res = odbc_exec ($db, "INSERT INTO Test (TEST_TEXT) VALUES ('$text')"); $res = odbc_exec ($db, "SELECT TEST_TEXT FROM Test WHERE TEST_ID = 1"); odbc_longreadlen ($res, $max); $text = odbc_result ($res, "TEST_TEXT"); echo strlen ($text)." chars received<br>"; echo "<listing>".htmlentities($text)."</listing>"; echo "done"; ?> with PHP 4.2.1 I get following response: big db test 10000 chars written 15904 chars received 0 1 2 <.. all ok until > 1039 1040 1± È<66 1767 1768 <.. all ok until > 2220 2221 ')' @²> tz0É$€t ×ô?< ôÈlÉ#€|Éèx€B$ 0É ¡ TEST_TEXT<> (¢!>0 1 2 <.. not ok double values starting again from 1> 1039 1040 1± È< done with PHP 4.1.1 I get: big db test 10000 chars written 10000 chars received 0 1 2 <.. all values ok> 2220 2221 done maybe I make a mistake when switching PHP versions: I just rename the directories and copy the corrsponding php4ts.dll into the windows system dir (c:\windows\system on win98; c:\winnt\system32 on w2k)? Just the zlib extension is loaded. Previous Comments: ------------------------------------------------------------------------ [2002-06-14 13:27:53] kalowsky@php.net can you please provide a sample script and schema to reproduce this problem? ------------------------------------------------------------------------ [2002-06-12 19:31:34] php@remove.gustl.net Yes, problem persists with W2K and V4.2.1, Gustav Graf ------------------------------------------------------------------------ [2002-06-12 01:33:03] mfischer@php.net Can you test this on W2k ? We've a bad rate at fixing w98 because it mostly turns out it's a bug in the OS. ------------------------------------------------------------------------ [2002-06-11 20:00:36] php@remove.gustl.net I'm connecting to a MSSQL database via ODBC (due to the PHP-MSSQL umlaut problem), with new version 4.2.1 I am getting code garbage from php in long text results, this doesnt happen with 4version .1.1, Gustav Graf here is part of the garbage, maybe it helps: tschechischen Diskurs begegnen. Diese Beständigkeit und vor allem der h<---garbage start --> 4Tðdeð PdðTŠá4 Ð"è#è T(èÈ&è¬Gè °hð,àLLE, ART_ABSTRACT, ART_STATION, ART_PDF, ART_OK FROM Artikel WHERE ART_ID = 239;tfð¦ð4èÀgðŽ,gð0.390s: SELECT ART_TITEL, ART_AUTOR, ART_QUELLE, ART_ABSTRACT, ART_STATION, ART_PDF, ART_OK FROM Artikel WHERE ART_ID = 239;¨fðö 4è.èÛ<PRE>0.313s: CONNECT TO dzmsq OPEN dzmsq 0.382s: SELECT TOP 1 * FROM Artikel 0.390s: SELECT ART_TITEL, ART_AUTOR, ART_QUELLE, ART_ABSTRACT, ART_STATION, ART_PDF, ART_OK FROM Artikel WHERE ART_ID = 239; <ày <à¨fð°hðfðDlðô3èN<PRE>0.313s: CONNECT TO dzmsq OPEN dzmsq 0.382s: SELECT TOP 1 * FROM Artikel°hð& ô3èPjð<jðœŠá< ,jðŒjð#€<àljð¤&è6è7èigh< PjðÈjð(œjðØ$èØ$èˆ6èx‘íc < Œjðkð(pGèpGèèÀíc $ Èjð(kð (è< kðdkð(€‹Ñš Dkð$èp*èô*èhigh/è< (kð kð'€÷x|€kðô¡á°ères\ dkð\Ýë@œkð$ Ì/è lð€÷ywGƒÎA" + $ ükðDlð(è< lðô3è(€= `lð &èp*èstop< +èLè#€œlð)èTlðthis$ Ìnðàlð€T+è< ¼lðD+è(€¬nðQë ülðì5è¤"èthis$ D+è@mðtmð $ mðdmð €Pmðnvarchar$ @mðˆmð ŽáART_AUTORD dmðÌmð0€ù])H ¤mðt)èÜmð€è nðART_SUBTITELD ˆmðnð-€:œ èmð 7ä nð˜mðŒ4èÐ4èART_AUTORmeD ÌmðPè.€M7ù ,nð0è`èÜmð˜mðèART_QUELLEecww< ¸è¨aè(T(èT(è¬Gèˆfðc < 8oðÌnð(ÈèÈèÜ0èà"èc $ nð¼lð €nvarchar“Sww$ Žáoðdnð$ ðnð8oð €nvarchar< oðnð#€Toð¢áèthisÆ >ðÆ© <-- garbage end -->Transit - ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17719&edit=1

« previous php.bugs (#10477) next »