PHP4.0.5RC1 Cannot insert records larger than 8K. [W2K/Apache/Pgsql]

From: Date: Thu, 29 Mar 2001 01:31:55 +0000
Subject: PHP4.0.5RC1 Cannot insert records larger than 8K. [W2K/Apache/Pgsql]
Groups: php.qa 
Request: Send a blank email to php-qa+get-2671@lists.php.net to get a copy of this message
For PHP4.0.5RC1 (Sorry for older RC, but I guess it's the same in RC3) PHP4.0.5RC1(fix) package from www.php4win.de does not work if data size is larger than 8K even if actual table size is 32K. The same code for work well with PHP4.0.4pl1/Apache 1.3.19/Linux. Windows2000 Sever SP1 (Japanese) Apache 1.3.19 PHP4.0.5RC1 (using Apache SAPI) PostgreSQL Server 7.0.3 Following code should insert 10 records to the table, but it only inserts first record and prints warning messages. ====== CODE ===== <html> <head> <title>PostgreSQL Bug Test</title> </head> <body> <h1> PostgreSQL Bug Test </h1> <pre> Database Table: CREATE TABLE pgsql_bug_test ( id serial, data text ) <?php $data = ''; for ($i=0 ; $i < 300; $i++) { $data .= md5(microtime()); } print("Data Size: ".strlen($data)."\n"); // 9600bytes. $db = pg_connect('host=dev dbname=yohgaki user=yohgaki'); for ($i = 0; $i < 10; $i++) { print("Inserting $i\n"); pg_exec($db,"INSERT INTO pgsql_bug_test (data) values ('$data');"); } ?> </pre> </body> </html> ========= END ============ ========= Output ========== **SNIP** Data Size: 9600 Inserting 0 Warning: PostgreSQL query failed: pqReadData() -- read() failed: errno=0 No error <= This warning is for first pg_exec() call. in d:\sites\tmp\bugs\pgsql_bug\large_record.php on line 28 Inserting 1 Warning: PostgreSQL query failed: pqReadData() -- read() failed: errno=0 No error in d:\sites\tmp\bugs\pgsql_bug\large_record.php on line 28 **SNIP** ======= END ========== Someone already mentioned pg_cmdtuples() are not compiled in PHP for Windows. I hope pg_cmdtuples() is fixed in 4.0.5, rather than this problem. -- Yasuo Ohgaki

« previous php.qa (#2671) next »