From ee967e899dfe9d548c6eb1209469143cefda7244 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 20 Sep 2005 01:02:51 +0000 Subject: [PATCH] * (bug 3506) Avoid MySQL error when Listusers returns no results Bug introduced in SpecialListusers.php rev 1.36: http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/SpecialListusers.php?r1=1.35&r2=1.36 --- RELEASE-NOTES | 1 + includes/SpecialListusers.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a8664b1b2a..72bc19d27b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -117,6 +117,7 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 2570) Add 'watch this page' checkbox on uploads, watch uploads by default when 'watchdefault' option is on * Skip update of disused 'rc_cur_time' field (todo: discard the field) +* (bug 3506) Avoid MySQL error when Listusers returns no results === Caveats === diff --git a/includes/SpecialListusers.php b/includes/SpecialListusers.php index dabe6fb1b6..fc664e05a4 100644 --- a/includes/SpecialListusers.php +++ b/includes/SpecialListusers.php @@ -66,7 +66,10 @@ class ListUsersPage extends QueryPage { $batch->execute( $wgLinkCache ); // Back to start for display - $db->dataSeek( $res, 0 ); + if( $db->numRows( $res ) > 0 ) { + // If there are no rows we get an error seeking. + $db->dataSeek( $res, 0 ); + } } /** -- 2.20.1