Last modified: 2014-10-01 01:31:37 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 T56120, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54120 - Fatal error when $wgDebugDBTransactions is enabled with SQLite: Object of class PDO could not be converted to string in /includes/db/Database.php:3850
Fatal error when $wgDebugDBTransactions is enabled with SQLite: Object of cla...
Status: UNCONFIRMED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.22.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: sqlite
  Show dependency treegraph
 
Reported: 2013-09-14 11:21 UTC by Jackmcbarn
Modified: 2014-10-01 01:31 UTC (History)
5 users (show)

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


Attachments

Description Jackmcbarn 2013-09-14 11:21:27 UTC
If SQLite is used, setting $wgDebugDBTransactions = true in LocalSettings.php causes "Catchable fatal error: Object of class PDO could not be converted to string in <path to MediaWiki installation>/includes/db/Database.php on line 3850"
Comment 1 Andre Klapper 2013-09-16 14:19:46 UTC
Thanks for taking the time to report this!

Setting https://www.mediawiki.org/wiki/Manual:$wgShowExceptionDetails and pasting more information here is welcome.
Comment 2 Jackmcbarn 2013-09-16 14:24:18 UTC
That doesn't yield any additional information.
Comment 3 Dereckson 2013-12-23 00:33:30 UTC
I can't reproduce this bug on an up-to-date MediaWiki installation using SQLite.

I added $wgDebugDBTransactions = true in the configuration.
What do you do to get the error? You have to go to a specific page or do a specific action?
Comment 4 Andre Klapper 2014-01-03 10:38:34 UTC
Jackmcbarn: What do you do to get the error? You have to go to a specific page or do a specific action?
Comment 5 Jackmcbarn 2014-01-03 17:33:26 UTC
Viewing any page causes the error for me. This still happens with latest git, except the error is on line 4096 now (which is still "return (string)$this->mConn;"). This happens with PHP 5.4.22 (with XAMPP 1.8.2) in case that helps.
Comment 6 Alexey Demakov 2014-01-16 22:16:51 UTC
I've faced the same issue. The problem starts in debug message:

includes/objectcache/SqlBagOStuff.php:147:

if ( $wgDebugDBTransactions ) {
    wfDebug( sprintf( "Connection %s will be used for SqlBagOStuff\n", $db ) );
}

that calls __toString method for $db:

includes/db/Database.php:

public function __toString() {
    return (string)$this->mConn;
}

I use MySQL database and in my case $this->mConn is an object of type mysqli that can't be converted to String.

To print type of connection I've changed return expression to $this->getType() but not sure what behaviour was intended.

My config:
MediaWiki 	1.22.0 (80d6477)

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


Navigation
Links