Re: [Sqlrelay-discussion] phppeardb returning only 100 rows
Brought to you by:
mused
|
From: David M. <dav...@fi...> - 2008-04-09 18:39:07
|
Hmm, that should fetch all rows. I'll have to look into it. I'm pretty
sure this has to do with the result set buffer size though. A
workaround would be to edit src/api/phppeardb/sqlrelay.php and comment
out these lines:
sqlrcur_setResultSetBufferSize($cursor,100);
which should be around lines 171 and 230. And then reinstall.
The side effect is that the entire result set will be cached on the
client side, rather than just the first 100 rows, which could consume a
lot of memory, depending on how much data is in each row.
I'll fix this for the next release.
Dave
dav...@fi...
On Tue, 2008-04-08 at 22:37 -0300, Felipe Ceglia - PY1NB wrote:
> Hello,
>
> Can anyone help me on this issue?
>
> I am using sqlrelay-0.39.4 and postgresql 8.3.1.
>
> When I run this code from phppeardb, it only returns me 100 rows:
>
> $query = "SELECT id, name FROM ct_contest ORDER BY name ASC;";
> $db->setFetchMode(DB_FETCHMODE_ASSOC);
> $result = $db->query($query);
> while ($line = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
> print ("\t<option value=\"$line[id]\"
> $selected>$line[name]</option>\n");
> print "$line[name]\n";
> }
> $result->free();
>
> ###########################################################
>
> However, if I run it on sqlrsh:
> Rows Returned : 293
> Fields Returned : 586
> System time : 0
>
> ###########################################################
>
>
> print_r($result); says:
>
> DB_result Object
> (
> [autofree] =>
> [dbh] => DB_sqlrelay Object
> (
> [connection] => Resource id #14
> [identity] =>
> [bindformat] =>
> [phptype] => sqlrelay
> [dbsyntax] => sqlrelay
> [autocommit] =>
> [fetchmode] => 2
> [affectedrows] => 0
> [prepare_types] => Array
> (
> )
>
> [is_select] => Array
> (
> )
>
> [features] => Array
> (
> [prepare] => 1
> [pconnect] => 1
> [transactions] => 1
> [limit] => emulate
> )
>
> [fetchmode_object_class] => stdClass
> [was_connected] =>
> [last_query] =>
> [options] => Array
> (
> [result_buffering] => 500
> [persistent] =>
> [ssl] =>
> [debug] => 0
> [seqname_format] => %s_seq
> [autofree] =>
> [portability] => 0
> [optimize] => performance
> )
>
> [last_parameters] => Array
> (
> )
>
> [prepare_tokens] => Array
> (
> )
>
> [prepared_queries] => Array
> (
> )
>
> [_last_query_manip] =>
> [_next_query_manip] =>
> [_debug] =>
> [_default_error_mode] =>
> [_default_error_options] =>
> [_default_error_handler] =>
> [_error_class] => DB_Error
> [_expected_errors] => Array
> (
> )
>
> [dsn] => Array
> (
> [phptype] => sqlrelay
> [dbsyntax] => sqlrelay
> [username] => postgres
> [password] => password
> [protocol] => unix
> [hostspec] =>
> [port] => 9000
> [socket] => /tmp/clx_db.socket
> [database] => clx_db
> )
>
> )
>
> [fetchmode] => 2
> [fetchmode_object_class] => stdClass
> [limit_count] =>
> [limit_from] =>
> [parameters] => Array
> (
> )
>
> [query] =>
> [result] => DB_sqlrelay_cursor Object
> (
> [cursor] => Resource id #18
> [connection] => Resource id #14
> [rownum] => 100
> [rownun] => 0
> )
>
> [row_counter] =>
> [statement] =>
>
>
>
> Thank you,
>
> Felipe
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Sqlrelay-discussion mailing list
> Sql...@li...
> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion
>
>
> __________________________________________________
> D O T E A S Y - "Join the web hosting revolution!"
> http://www.doteasy.com
__________________________________________________
D O T E A S Y - "Join the web hosting revolution!"
http://www.doteasy.com
|