public function estimateRowCount(
$table, $vars = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
) {
- $rows = 0;
$res = $this->select(
$table, [ 'rowcount' => 'COUNT(*)' ], $conds, $fname, $options, $join_conds
);
+ $row = $res ? $this->fetchRow( $res ) : [];
- if ( $res ) {
- $row = $this->fetchRow( $res );
- $rows = ( isset( $row['rowcount'] ) ) ? (int)$row['rowcount'] : 0;
- }
-
- return $rows;
+ return isset( $row['rowcount'] ) ? (int)$row['rowcount'] : 0;
}
public function selectRowCount(
if ( is_array( $table ) ) {
// A parenthesized group
if ( count( $table ) > 1 ) {
- $joinedTable = '('
- . $this->tableNamesWithIndexClauseOrJOIN( $table, $use_index, $ignore_index, $join_conds )
- . ')';
+ $joinedTable = '(' .
+ $this->tableNamesWithIndexClauseOrJOIN(
+ $table, $use_index, $ignore_index, $join_conds ) . ')';
} else {
// Degenerate case
$innerTable = reset( $table );
}
}
- return ' LIKE ' . $this->addQuotes( $s ) . ' ESCAPE ' . $this->addQuotes( $escapeChar ) . ' ';
+ return ' LIKE ' .
+ $this->addQuotes( $s ) . ' ESCAPE ' . $this->addQuotes( $escapeChar ) . ' ';
}
public function anyChar() {
return null;
}
- if ( !( $flags & self::READ_LATEST ) && isset( self::$idCacheByName[$name] ) ) {
+ if ( !( $flags & self::READ_LATEST ) && array_key_exists( $name, self::$idCacheByName ) ) {
return self::$idCacheByName[$name];
}
CREATE TABLE /*_*/imagelinks (
il_from int NOT NULL DEFAULT 0,
il_from_namespace int NOT NULL DEFAULT 0,
- il_to varchar(255) NOT NULL DEFAULT '',
- il_frobniz varchar(255) NOT NULL DEFAULT 'FROB',
+ il_to varchar(127) NOT NULL DEFAULT '',
+ il_frobniz varchar(127) NOT NULL DEFAULT 'FROB',
PRIMARY KEY (il_from,il_to)
) /*$wgDBTableOptions*/;
--- /dev/null
+'use strict';
+const merge = require( 'deepmerge' ),
+ username = 'Selenium user',
+ wdioConf = require( './wdio.conf.js' );
+
+// Overwrite default settings
+exports.config = merge( wdioConf.config, {
+ username: process.env.MEDIAWIKI_USER === undefined ?
+ username :
+ process.env.MEDIAWIKI_USER,
+ password: process.env.MEDIAWIKI_PASSWORD,
+ baseUrl: (
+ process.env.MW_SERVER === undefined ?
+ 'https://en.wikipedia.beta.wmflabs.org:443' :
+ process.env.MW_SERVER
+ ) + (
+ process.env.MW_SCRIPT_PATH === undefined ?
+ '/w' :
+ process.env.MW_SCRIPT_PATH
+ )
+} );