X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FIDatabase.php;h=9375efc2538e1003f7a1e59ae140426de8a04a00;hb=21948ec459cbb99167c09b59b7296b7f5d502aa0;hp=7c6413cb3ec9aa3f2ce659d6f6d2deb5815d841c;hpb=3cecf7e6f1b6b30e86c3b08372ecf200bd5a9018;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/database/IDatabase.php b/includes/libs/rdbms/database/IDatabase.php index 7c6413cb3e..9375efc253 100644 --- a/includes/libs/rdbms/database/IDatabase.php +++ b/includes/libs/rdbms/database/IDatabase.php @@ -277,7 +277,7 @@ interface IDatabase { /** * Get the number of affected rows from pending write queries * - * @return integer + * @return int * @since 1.30 */ public function pendingWriteRowsAffected(); @@ -1252,7 +1252,7 @@ interface IDatabase { * @param array $selectJoinConds Join conditions for the SELECT part of the query, see * IDatabase::select() for details. * - * @return IResultWrapper + * @return bool */ public function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = __METHOD__, @@ -1276,6 +1276,37 @@ interface IDatabase { */ public function unionQueries( $sqls, $all ); + /** + * Construct a UNION query for permutations of conditions + * + * Databases sometimes have trouble with queries that have multiple values + * for multiple condition parameters combined with limits and ordering. + * This method constructs queries for the Cartesian product of the + * conditions and unions them all together. + * + * @see IDatabase::select() + * @since 1.30 + * @param string|array $table Table name + * @param string|array $vars Field names + * @param array $permute_conds Conditions for the Cartesian product. Keys + * are field names, values are arrays of the possible values for that + * field. + * @param string|array $extra_conds Additional conditions to include in the + * query. + * @param string $fname Caller function name + * @param string|array $options Query options. In addition to the options + * recognized by IDatabase::select(), the following may be used: + * - NOTALL: Set to use UNION instead of UNION ALL. + * - INNER ORDER BY: If specified and supported, subqueries will use this + * instead of ORDER BY. + * @param string|array $join_conds Join conditions + * @return string SQL query string. + */ + public function unionConditionPermutations( + $table, $vars, array $permute_conds, $extra_conds = '', $fname = __METHOD__, + $options = [], $join_conds = [] + ); + /** * Returns an SQL expression for a simple conditional. This doesn't need * to be overridden unless CASE isn't supported in your DBMS.