Last modified: 2014-02-12 23:32:49 UTC
It is possible to work your way through the web installer, but that's where the story ends. Just about anything you do will result in: A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden) from within function "DatabaseOracle::doQuery". Database returned error "904: ORA-00904: "ARRAY": invalid identifier". Reproduced on: MediaWiki 1.20.2 PHP 5.3.14 (apache2handler) Oracle 11.2.0.2.0
There was another report (with the same error) on the Support Desk a few days ago: http://www.mediawiki.org/wiki/Thread:Project:Support_desk/mediawiki_+_oracle_invalid_identifier
Problem does not exist in 1.19.3, I have not tried the previous 1.20.x releases.
ARRAY??? where exactly are ARRAYs used?
Apparently on line 1168 of htdocs/includes/db/DatabaseOracle.php
?? in 1.19 that points to useIndexClause call whuch should ge DatabaseBase's return ''; function ... what's in your 1168 line of DatabaseOracle.php?
In 1.20.2 it's if ( isset( $options['GROUP BY'] ) ) { $preLimitTail .= " GROUP BY {$options['GROUP BY']}"; } if ( isset( $options['ORDER BY'] ) ) { $preLimitTail .= " ORDER BY {$options['ORDER BY']}"; } This code appears unchanged from 1.9.3, so I suppose the notice about array to string conversion (from the support desk report) must be unrelated to the actual problem.
I tried a few different installations and was able to reproduce the problem in * 1.20.0 * 1.20.1 * 1.20.2 Problem does not exist in: * 1.19.3 and prior
Actually, it looks like $preLimitTail is concatinated with "Array" after the conversion resulting in "ORDER BY Array" or "GROUP BY Array" in the final SQL. I'm sure this is supposed to be replaced by the actual column name?
Confirmed. Commenting out lines 1165 and 1168 works around the problem. // $preLimitTail .= " GROUP BY {$options['GROUP BY']}"; I suppose there is another array inside $options['GROUP BY'] that should be imploded?
yes i noticed ... somone changed the function in base and like usual 0FWG about the overloads. I'm fixing it ATM.
Allright, here we go. I stole some code from includes/db/DatabasePostgres.php to implode the array before setting $preLimitTail. [roy@lonora02 db]# diff DatabaseOracle.php DatabaseOracle.php.orig 1165,1167d1164 < $ob = is_array( $options['GROUP BY'] ) < ? implode( ',', $options['GROUP BY'] ) < : $options['GROUP BY']; 1171,1173d1167 < $ob = is_array( $options['ORDER BY'] ) < ? implode( ',', $options['ORDER BY'] ) < : $options['ORDER BY'];
seems like this method overload is obsolete ... running phpunit test with it removed now.
Oh, I missed a spot, $ob must be returned instead of $options['ORDER BY']: [roy@lonora02 db]# diff DatabaseOracle.php DatabaseOracle.php.orig 1165,1168c1165 < $ob = is_array( $options['GROUP BY'] ) < ? implode( ',', $options['GROUP BY'] ) < : $options['GROUP BY']; < $preLimitTail .= " GROUP BY {$ob}"; --- > $preLimitTail .= " GROUP BY {$options['GROUP BY']}"; 1171,1174c1168 < $ob = is_array( $options['ORDER BY'] ) < ? implode( ',', $options['ORDER BY'] ) < : $options['ORDER BY']; < $preLimitTail .= " ORDER BY {$ob}"; --- > $preLimitTail .= " ORDER BY {$options['ORDER BY']}"; I don't know the first thing about coding in php, but this worked for me :)
current fixed in https://gerrit.wikimedia.org/r/#/c/41575/ has to be backported or you can just use the patch Roy suggested
The array maybe cames from Gerrit change #7521 and/or Gerrit change #22208
no the array is from before that ... but i'm not always up to date with such changes as i just don't notice them, until something breaks ... liiiike now. I'm assigning this bug to myself until i get the time to backport it to at least 1.20
(In reply to comment #15) > The array maybe cames from Gerrit change #7521 and/or Gerrit change #22208 Added array support for GROUP BY with HAVING and ORDER BY for all dbms with Gerrit change #45799