jenkins-bot has submitted this change and it was merged. Change subject: Fix __toString method of DatabaseMysqli ......................................................................
Fix __toString method of DatabaseMysqli The superclass was casting mConn to string. For Mysql class this is just the resource number. However for mysqli objects, that is a fatal. thread_id seemed like the most convinenent id-ish number to return instead. Only really noticeable if you have $wgDebugTransactions = true; Change-Id: I014bb7ab81d18c5bd07a267939b66a0a6161eb8d --- M includes/db/DatabaseMysqli.php 1 file changed, 14 insertions(+), 0 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/db/DatabaseMysqli.php b/includes/db/DatabaseMysqli.php index e202f8a..635909c 100644 --- a/includes/db/DatabaseMysqli.php +++ b/includes/db/DatabaseMysqli.php @@ -281,4 +281,18 @@ protected function mysqlPing() { return $this->mConn->ping(); } + + /** + * Give an id for the connection + * + * mysql driver used resource id, but mysqli objects cannot be cast to string. + */ + public function __toString() { + if ( $this->mConn instanceof Mysqli ) { + return (string)$this->mConn->thread_id; + } else { + // mConn might be false or something. + return (string)$this->mConn; + } + } } -- To view, visit https://gerrit.wikimedia.org/r/116217 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I014bb7ab81d18c5bd07a267939b66a0a6161eb8d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Brian Wolff <bawolff...@gmail.com> Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org> Gerrit-Reviewer: Parent5446 <tylerro...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits