Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311745

Change subject: Improve tableExists() for MySQL
......................................................................

Improve tableExists() for MySQL

Use SHOW TABLES to avoid log spam when the table does not exist.
This should make the CLI jenkins log a bit more readable.

Change-Id: I027a9d0af0e42959e9f03cebb295218068a263d3
---
M includes/libs/rdbms/database/DatabaseMysqlBase.php
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/45/311745/1

diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php 
b/includes/libs/rdbms/database/DatabaseMysqlBase.php
index 2d19081..52427f8 100644
--- a/includes/libs/rdbms/database/DatabaseMysqlBase.php
+++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php
@@ -518,6 +518,12 @@
                return (int)$rows;
        }
 
+       function tableExists( $table, $fname = __METHOD__ ) {
+               $encLike = $this->buildLike( $table );
+
+               return $this->query( "SHOW TABLES $encLike", $fname 
)->numRows();
+       }
+
        /**
         * @param string $table
         * @param string $field

-- 
To view, visit https://gerrit.wikimedia.org/r/311745
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I027a9d0af0e42959e9f03cebb295218068a263d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to