Page MenuHomePhabricator

If Special:Watchlist has nothing to show to user, some warnings appear
Closed, ResolvedPublic

Description

This happens on a 1.23 installation, when using the mysql (and not the mysqli) driver. mysqli is not affected. Not sure about other drivers.

Backtrace:

#0 DatabaseMysql->mysqlDataSeek() called at […/mediawiki-1.23.0/includes/db/DatabaseMysqlBase.php:377]
#1 DatabaseMysqlBase->dataSeek() called at […/mediawiki-1.23.0/includes/specials/SpecialWatchlist.php:320]
#2 SpecialWatchlist->outputChangesList() called at […/mediawiki-1.23.0/includes/specialpage/ChangesListSpecialPage.php:332]
#3 ChangesListSpecialPage->webOutput() called at […/mediawiki-1.23.0/includes/specialpage/ChangesListSpecialPage.php:70]
#4 ChangesListSpecialPage->execute() called at […/mediawiki-1.23.0/includes/specials/SpecialWatchlist.php:79]
#5 SpecialWatchlist->execute() called at […/mediawiki-1.23.0/includes/specialpage/SpecialPage.php:379]
#6 SpecialPage->run() called at […/mediawiki-1.23.0/includes/specialpage/SpecialPageFactory.php:503]
#7 SpecialPageFactory::executePath() called at […/mediawiki-1.23.0/includes/Wiki.php:285]
#8 MediaWiki->performRequest() called at […/mediawiki-1.23.0/includes/Wiki.php:588]
#9 MediaWiki->main() called at […/mediawiki-1.23.0/includes/Wiki.php:447]
#10 MediaWiki->run() called at […/mediawiki-1.23.0/index.php:46]
<br />
<b>Warning</b>: mysql_data_seek() [<a href='function.mysql-data-seek'>function.mysql-data-seek</a>]: Offset 0 is invalid for MySQL result index 135 (or the query data is unbuffered) in <b>…/mediawiki-1.23.0/includes/db/DatabaseMysql.php</b> on line <b>186</b><br />
#0 DatabaseMysql->mysqlDataSeek() called at […/mediawiki-1.23.0/includes/db/DatabaseMysqlBase.php:377]
#1 DatabaseMysqlBase->dataSeek() called at […/mediawiki-1.23.0/includes/specials/SpecialWatchlist.php:325]
#2 SpecialWatchlist->outputChangesList() called at […/mediawiki-1.23.0/includes/specialpage/ChangesListSpecialPage.php:332]
#3 ChangesListSpecialPage->webOutput() called at […/mediawiki-1.23.0/includes/specialpage/ChangesListSpecialPage.php:70]
#4 ChangesListSpecialPage->execute() called at […/mediawiki-1.23.0/includes/specials/SpecialWatchlist.php:79]
#5 SpecialWatchlist->execute() called at […/mediawiki-1.23.0/includes/specialpage/SpecialPage.php:379]
#6 SpecialPage->run() called at […/mediawiki-1.23.0/includes/specialpage/SpecialPageFactory.php:503]
#7 SpecialPageFactory::executePath() called at […/mediawiki-1.23.0/includes/Wiki.php:285]
#8 MediaWiki->performRequest() called at […/mediawiki-1.23.0/includes/Wiki.php:588]
#9 MediaWiki->main() called at […/mediawiki-1.23.0/includes/Wiki.php:447]
#10 MediaWiki->run() called at […/mediawiki-1.23.0/index.php:46]
<br />
<b>Warning</b>: mysql_data_seek() [<a href='function.mysql-data-seek'>function.mysql-data-seek</a>]: Offset 0 is invalid for MySQL result index 135 (or the query data is unbuffered) in <b>…/mediawiki-1.23.0/includes/db/DatabaseMysql.php</b> on line <b>186</b><br />

Apparently, dataSeek is being used only on this special page. Should we check for rows before calling it, or implement this check inside the function itself?

$> find . -type f -exec grep -nH dataSeek {} \;
./specials/SpecialWatchlist.php:320: $dbr->dataSeek( $rows, 0 );
./specials/SpecialWatchlist.php:325: $dbr->dataSeek( $rows, 0 );
./db/DatabasePostgres.php:649: function dataSeek( $res, $row ) {
./db/Database.php:126: function dataSeek( $res, $row );
./db/DatabaseOracle.php:510: function dataSeek( $res, $row ) {
./db/DatabaseSqlite.php:405: function dataSeek( $res, $row ) {
./db/DatabaseMssql.php:321: public function dataSeek( $res, $row ) {
./db/DatabaseMysqlBase.php:372: function dataSeek( $res, $row ) {
./db/DatabaseUtility.php:177: $this->db->dataSeek( $this, $row );
./db/DatabaseUtility.php:188: $this->db->dataSeek( $this, 0 );

I've tested it myself on a local installation.


Version: 1.24rc
Severity: normal
URL: https://www.mediawiki.org/wiki/Thread:Project:Support_desk/watchlist_page_mysql_data_seek_warnings

Details

Reference
bz67025

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 3:35 AM
bzimport set Reference to bz67025.

The error doesn't happen on 1.22

Seems to be caused by gerrit change 94677

There were checks for if ( $numRows == 0 ) { before that change.

Change 141713 had a related patch set uploaded by Florianschmidtwelzow:
Check first, if there are rows to render

https://gerrit.wikimedia.org/r/141713

Change 141723 had a related patch set uploaded by Florianschmidtwelzow:
Special:Watchlist: Don't try to render empty row

https://gerrit.wikimedia.org/r/141723

Change 141713 merged by jenkins-bot:
Special:Watchlist: Don't try to render empty row

https://gerrit.wikimedia.org/r/141713

Change 141723 merged by jenkins-bot:
Special:Watchlist: Don't try to render empty row

https://gerrit.wikimedia.org/r/141723

Sorry :( Thank you for the fix!