* @param mixed $conds Array or string, condition(s) for WHERE
* @param string $fname Calling function name (use __METHOD__) for logs/profiling
* @param array $options Associative array of options (e.g.
- * array('GROUP BY' => 'page_title')), see Database::makeSelectOptions
+ * [ 'GROUP BY' => 'page_title' ]), see Database::makeSelectOptions
* code for list of supported stuff
* @param array $join_conds Associative array of table join conditions
- * (optional) (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') )
+ * (optional) (e.g. [ 'page' => [ 'LEFT JOIN','page_latest=rev_id' ] ]
* @return mixed Database result resource (feed to Database::fetchObject
* or whatever), or false on failure
* @throws DBQueryError
* @param mixed $vars Array or string, field name(s) to be retrieved
* @param mixed $conds Array or string, condition(s) for WHERE
* @param string $fname Calling function name (use __METHOD__) for logs/profiling
- * @param array $options Associative array of options (e.g. array('GROUP BY' => 'page_title')),
+ * @param array $options Associative array of options (e.g. [ 'GROUP BY' => 'page_title' ]),
* see Database::makeSelectOptions code for list of supported stuff
* @param array $join_conds Associative array of table join conditions (optional)
- * (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') )
+ * (e.g. [ 'page' => [ 'LEFT JOIN','page_latest=rev_id' ] ]
* @return string The SQL text
*/
public function selectSQLText( $table, $vars, $conds = '', $fname = __METHOD__,
/**
* INSERT SELECT wrapper
- * $varMap must be an associative array of the form array( 'dest1' => 'source1', ...)
+ * $varMap must be an associative array of the form [ 'dest1' => 'source1', ... ]
* Source items may be literals rather than field names, but strings should
* be quoted with Database::addQuotes().
* @param string $destTable
* @return null|ResultWrapper
* @throws Exception
*/
- public function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = __METHOD__,
+ public function nativeInsertSelect( $destTable, $srcTable, $varMap, $conds, $fname = __METHOD__,
$insertOptions = [], $selectOptions = []
) {
$this->mScrollableCursor = false;
try {
- $ret = parent::insertSelect(
+ $ret = parent::nativeInsertSelect(
$destTable,
$srcTable,
$varMap,
*/
private function escapeIdentifier( $identifier ) {
if ( strlen( $identifier ) == 0 ) {
- throw new MWException( "An identifier must not be empty" );
+ throw new InvalidArgumentException( "An identifier must not be empty" );
}
if ( strlen( $identifier ) > 128 ) {
- throw new MWException( "The identifier '$identifier' is too long (max. 128)" );
+ throw new InvalidArgumentException( "The identifier '$identifier' is too long (max. 128)" );
}
if ( ( strpos( $identifier, '[' ) !== false )
|| ( strpos( $identifier, ']' ) !== false )
) {
// It may be allowed if you quoted with double quotation marks, but
// that would break if QUOTED_IDENTIFIER is OFF
- throw new MWException( "Square brackets are not allowed in '$identifier'" );
+ throw new InvalidArgumentException( "Square brackets are not allowed in '$identifier'" );
}
return "[$identifier]";
}
// we want this to be compatible with the output of parent::makeSelectOptions()
- return [ $startOpts, '', $tailOpts, '' ];
+ return [ $startOpts, '', $tailOpts, '', '' ];
}
/**