Last modified: 2014-10-16 11:11:48 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 T70874, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68874 - ORA-00936: PHP Warning: strpos() expects parameter 1 to be string, object given in DatabaseOracle.php
ORA-00936: PHP Warning: strpos() expects parameter 1 to be string, object giv...
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.24rc
All All
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
https://www.mediawiki.org/wiki/Thread...
:
: 68877 71251 (view as bug list)
Depends on:
Blocks: oracle
  Show dependency treegraph
 
Reported: 2014-07-30 19:35 UTC by Jesús Martínez Novo (Ciencia Al Poder)
Modified: 2014-10-16 11:11 UTC (History)
4 users (show)

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


Attachments

Description Jesús Martínez Novo (Ciencia Al Poder) 2014-07-30 19:35:35 UTC
There are 2 reports now on Project:Support desk for MediaWiki 1.23 [1] and 1.22 [2] about the same error message in Oracle:

MediaWiki 1.23:

> PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1308
> PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1304

MediaWiki 1.22:

> PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1146
> PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1142

Both lines correspond in both versions to removeIdentifierQuotes and isQuotedIdentifier methods of class DatabaseOracle

With those 2 reports of different people and versions I doubt this is just a coincidence or configuration issue.

----

[1] https://www.mediawiki.org/wiki/Thread:Project:Support_desk/Syntax_errors_after_installation_when_accessing_the_mainpage._Database:_Oracle 
[2] https://www.mediawiki.org/wiki/Thread:Project:Support_desk/Upload_File_not_working_with_Oracle
Comment 1 Jesús Martínez Novo (Ciencia Al Poder) 2014-07-30 19:52:20 UTC
From the first thread, there's a stack trace of the error:

Caught exception DBQueryError: A database error has occurred. Did you forget to run maintenance/update.php after upgrading?  See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: INSERT INTO /*Q*/L10N_CACHE (lc_lang,lc_key,lc_value) VALUES (:lc_lang, :lc_key, )
Function: DatabaseOracle::insertOneRow
Error: 936 ORA-00936: missing expression

> #0 /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php(709): DatabaseOracle->reportQueryError('ORA-00936: miss...', 936, 'INSERT INTO /*Q...', 'DatabaseOracle:...')
> #1 /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php(576): DatabaseOracle->insertOneRow('l10n_cache', Array, 'LCStoreDB::set')
> #2 /var/www/html/devinsample/mediawiki-1.23.1/includes/cache/LocalisationCache.php(1229): DatabaseOracle->insert('l10n_cache', Array, 'LCStoreDB::set')
> #3 /var/www/html/devinsample/mediawiki-1.23.1/includes/cache/LocalisationCache.php(963): LCStoreDB->set('messages:nov', 'nov')
> #4 /var/www/html/devinsample/mediawiki-1.23.1/includes/cache/LocalisationCache.php(452): LocalisationCache->recache('da')
> #5 /var/www/html/devinsample/mediawiki-1.23.1/includes/cache/LocalisationCache.php(326): LocalisationCache->initLanguage('da')
> #6 /var/www/html/devinsample/mediawiki-1.23.1/includes/cache/LocalisationCache.php(260): LocalisationCache->loadItem('da', 'fallback')
> #7 /var/www/html/devinsample/mediawiki-1.23.1/languages/Language.php(4146): LocalisationCache->getItem('da', 'fallback')
> #8 /var/www/html/devinsample/mediawiki-1.23.1/languages/Language.php(237): Language::getFallbacksFor('da')
> #9 /var/www/html/devinsample/mediawiki-1.23.1/languages/Language.php(196): Language::newFromCode('da')
> #10 /var/www/html/devinsample/mediawiki-1.23.1/maintenance/eval.php(81) : eval()'d code(1): Language::factory('da')
> #11 /var/www/html/devinsample/mediawiki-1.23.1/maintenance/eval.php(81): eval()
> #12 {main}

In LocalisationCache.php it does:

> $this->batch[] = array(
> 	'lc_lang' => $this->currentLang,
> 	'lc_key' => $key,
> 	'lc_value' => $this->dbw->encodeBlob( serialize( $value ) ) );
> 
> if ( count( $this->batch ) >= 100 ) {
> 	$this->dbw->insert( 'l10n_cache', $this->batch, __METHOD__ );
> 	$this->batch = array();
> }

DatabaseOracle.php has:

> function encodeBlob( $b ) {
> 	return new Blob( $b );
> }

So it returns an object (Database.php returns just the same $b untouched)

insertOneRow has the call to $this->isQuotedIdentifier( $val ), which has the call to strpos() of that value, which is a Blob() object
Comment 2 db [inactive,noenotif] 2014-07-31 07:23:28 UTC

*** This bug has been marked as a duplicate of bug 64970 ***
Comment 3 db [inactive,noenotif] 2014-07-31 19:31:10 UTC
Seems that the patch from the other bug doesn't address comment 1 and so does not fix this bug.

Reopening
Comment 4 db [inactive,noenotif] 2014-07-31 19:32:23 UTC
*** Bug 68877 has been marked as a duplicate of this bug. ***
Comment 5 Andre Klapper 2014-10-16 11:11:48 UTC
*** Bug 71251 has been marked as a duplicate of this bug. ***

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


Navigation
Links