From: electron <ele...@mg...> - 2004-02-22 01:08:02
|
To reproduce this bug, fork a cvs version to a clean box and attempt to install. Reproducible on Gentoo, Apache 1.3.23 + Current PHP Version (cli): PHP 4.3.3 (cli) (built: Oct 3 2003 22:39:06) Copyright (c) 1997-2003 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies Current MYSQL Version: /usr/bin/mysql Ver 11.18 Distrib 3.23.56, for pc-linux-gnu (i586) Also Reproducible on Mandrake 9.1, Apache 2.0ish, php 4.3.4 Mysql 4.0.15 If you need $limit, then: Replace: $limit = $limit ? $limit : 1; With: $limit = $limit ? $limit : -1; The previous statement is setting a default of 1 if no limit is passed in $params, the source of the bug. I don't think the limit check is needed before this statement considering the current fetch mode. -Jtp electron schrieb: > This fixes the RecentChanges bug with ADODB. > > Comments out the limit settings lakka used, they are not needed. They are needed. Not now, but with future versions which support paging on which I'm currently working. Cannot you fix the wrong limit value if there's one? I cannot reproduce this bug on ADODB. > Index: lib/WikiDB/backend/ADODB.php > =================================================================== > RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/ADODB.php,v > retrieving revision 1.14 > diff -u -r1.14 ADODB.php > --- lib/WikiDB/backend/ADODB.php 17 Feb 2004 12:17:34 -0000 1.14 > +++ lib/WikiDB/backend/ADODB.php 21 Feb 2004 03:49:14 -0000 > @@ -337,7 +337,7 @@ > > $data['mtime'] = $mtime; > $data['is_minor_edit'] = !empty($minor_edit); > - > + > if (isset($content)) > $data['%content'] = $content; > elseif ($have_content) > @@ -613,7 +613,7 @@ > * Find recent changes. > */ > function most_recent($params) { > - $limit = 0; > + //$limit = 0; > $since = 0; > $include_minor_revisions = false; > $exclude_major_revisions = false; > @@ -626,7 +626,7 @@ > $pick = array(); > if ($since) > $pick[] = "mtime >= $since"; > - > + > > if ($include_all_revisions) { > // Include all revisions of each page. > @@ -662,11 +662,11 @@ > } > } > $order = "DESC"; > - if($limit < 0){ > + /*if($limit < 0){ > $order = "ASC"; > $limit = -$limit; > } > - $limit = $limit ? $limit : 1; > + $limit = $limit ? $limit : 1;*/ > $where_clause = $join_clause; > if ($pick) > $where_clause .= " AND " . join(" AND ", $pick); > @@ -676,8 +676,8 @@ > $result = $dbh->SelectLimit("SELECT $page_tbl.*,$version_tbl.*" > . " FROM $table" > . " WHERE $where_clause" > - . " ORDER BY mtime $order", > - $limit); > + . " ORDER BY mtime $order" > + ); > > return new WikiDB_backend_ADODB_iter($this, $result); > } > > > -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Phpwiki-talk mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phpwiki-talk |