Fix: numFields wrong for sqlite
authorphysikerwelt <wiki@physikerwelt.de>
Wed, 21 May 2014 11:38:56 +0000 (11:38 +0000)
committerphysikerwelt <wiki@physikerwelt.de>
Wed, 21 May 2014 13:09:13 +0000 (13:09 +0000)
commit5048f30f69a0f11e52178cb966f8f8dd4198e642
tree25c00ab191aad487850e199c5071e61904fd4921
parentb2ddfd64b29e2b572cb9bb4d4fb8b493b156794b
Fix: numFields wrong for sqlite

Currently the first row of the result
is used to return the number of fields.
This fix corrects that calculation, which has returned
twice the number of fields before. The reason for that
was that the resulting data array has the following form:
array() {
 [0] => value_0
 ["field_name0"] =>value_0
 [1] => value_1
 ["field_name1"] =>value_1
...
Furthermore the constant 0 (int) is returned if the result
set is empty. This issue should be corrected in the future,
since the number or fields should be answered in a metadata context
independent of the data stored in the relation.

Bug: 65578
Change-Id: I399c7c857dcbd774cc4eb6102bbfe8a8764b07c9
includes/db/DatabaseSqlite.php
tests/phpunit/includes/db/DatabaseSqliteTest.php