You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Date: 2010-03-23 08:47:17 +0100
From: Stephen Benz <>
To: clients devs <>
Version: -- development
Last updated: 2010-07-09 13:49:53 +0200
Comment 13149
Date: 2010-03-23 20:47:17 +0100
From: Stephen Benz <>
mapi_read in the native php socket client assumes socket_read is going to actually return the chunk size that's requested. While this does happen in many cases, when there's a large result set or network latency only a portion of that read may happen. This causes a limited number of rows to be returned, and other weird behavior.
Environment:
Linux, CentOS 5
PHP 5.1.6
MonetDB Nov 2009 (but verified the php code hasn't been fixed in Feb 2010)
Reproduction steps:
$res = monetdb_query("select * from largeTable;"); // where largeTable is a table with 500k+ rows, in our case
Notice the result doesn't contain all the rows... the number is variable based on the connection to the db server (we run monetdb on another server, not localhost)
Fix:
in php_mapi.inc (function mapi_read()):
$data = socket_read($socket, $chunk_size);
// can't assume the read is going to give you the actual size you expect
while(strlen($data) < $chunk_size)
{
$data .= socket_read($socket, $chunk_size - strlen($data));
}
Thanks for the report and the fix.
I checked in a variant of your fix. This should make it into the next release.
Can you check whether my version works?
Comment 13151
Date: 2010-04-15 16:44:15 +0200
From: Stephen Benz <>
Yup! Just tested the new version from CVS and it fixes the issue. Thanks!
Comment 13152
Date: 2010-05-04 09:32:09 +0200
From: Pseudo user for Sourceforge import <>
Date: 2010-03-23 08:47:17 +0100
From: Stephen Benz <>
To: clients devs <>
Version: -- development
Last updated: 2010-07-09 13:49:53 +0200
Comment 13149
Date: 2010-03-23 20:47:17 +0100
From: Stephen Benz <>
mapi_read in the native php socket client assumes socket_read is going to actually return the chunk size that's requested. While this does happen in many cases, when there's a large result set or network latency only a portion of that read may happen. This causes a limited number of rows to be returned, and other weird behavior.
Environment:
Linux, CentOS 5
PHP 5.1.6
MonetDB Nov 2009 (but verified the php code hasn't been fixed in Feb 2010)
Reproduction steps:
Fix:
in php_mapi.inc (function mapi_read()):
$data = socket_read($socket, $chunk_size);
// can't assume the read is going to give you the actual size you expect
while(strlen($data) < $chunk_size)
{
$data .= socket_read($socket, $chunk_size - strlen($data));
}
and a few lines later:
Comment 13150
Date: 2010-04-15 15:04:37 +0200
From: @sjoerdmullender
Thanks for the report and the fix.
I checked in a variant of your fix. This should make it into the next release.
Can you check whether my version works?
Comment 13151
Date: 2010-04-15 16:44:15 +0200
From: Stephen Benz <>
Yup! Just tested the new version from CVS and it fixes the issue. Thanks!
Comment 13152
Date: 2010-05-04 09:32:09 +0200
From: Pseudo user for Sourceforge import <>
This bug was previously known as tracker item 2975433 at http://sourceforge.net/support/tracker.php?aid=2975433
Comment 14313
Date: 2010-07-09 13:49:53 +0200
From: @sjoerdmullender
Not adding a test since it requires a larg(ish) database and a slow connection, neither of which is practical in the testweb setting.
The text was updated successfully, but these errors were encountered: