Last modified: 2014-05-31 12:50:04 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
Change 134591 had a related patch set uploaded by Physikerwelt: WIP: Fix: numFields wrong for sqlite https://gerrit.wikimedia.org/r/134591
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...
I'm done with working on that and waiting for code review
Change 134591 merged by jenkins-bot: Fix: numFields wrong for sqlite https://gerrit.wikimedia.org/r/134591