Last modified: 2014-05-31 12:50:04 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67578, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65578 - wrong result for numFileds in sqlite
wrong result for numFileds in sqlite
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.24rc
All All
: High major (vote)
: 1.24.0 release
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: sqlite 65522
  Show dependency treegraph
 
Reported: 2014-05-21 10:37 UTC by physikerwelt
Modified: 2014-05-31 12:50 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description physikerwelt 2014-05-21 10:37:41 UTC
Sqllite uses the size of the result array to count the number of rows.
"
		$r = $res instanceof ResultWrapper ? $res->result : $res;
		return is_array( $r ) ? count( $r[0] ) : 0;
"
but the size of the result array is the double of the expected result since it contains an array with the row_names->values and row numbers->values
Comment 1 Gerrit Notification Bot 2014-05-21 11:41:42 UTC
Change 134591 had a related patch set uploaded by Physikerwelt:
WIP: Fix: numFields wrong for sqlite

https://gerrit.wikimedia.org/r/134591
Comment 2 physikerwelt 2014-05-21 13:16:19 UTC
There are actually two bugs.
1) if the relation is empty a runtime error occours
2) the number of fields is calculated the wrong way
the patch corrects the calculation if the result is not empty.
I was not capable to return the correct number of fields for empty relations. This would require a major rewrite to be capable of using the schema information from the PDO result set. For such a change I'd need to install sqlite locally in vagrant...
Comment 3 physikerwelt 2014-05-21 15:39:06 UTC
I'm done with working on that and waiting for code review
Comment 4 Gerrit Notification Bot 2014-05-21 17:49:30 UTC
Change 134591 merged by jenkins-bot:
Fix: numFields wrong for sqlite

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links