X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Fdatabase%2FIDatabase.php;h=e25b4d29f7d6b3d80498a8c644353a4f0ca6ec1d;hp=6f58cc66a3adc0e21d911e4fa0cf5d320f818022;hb=a38af7ba26579bb3004f673e44d39710887763aa;hpb=e5110cdbeabc214f2507f1ce0adb2bb6babb5c87 diff --git a/includes/libs/rdbms/database/IDatabase.php b/includes/libs/rdbms/database/IDatabase.php index 6f58cc66a3..e25b4d29f7 100644 --- a/includes/libs/rdbms/database/IDatabase.php +++ b/includes/libs/rdbms/database/IDatabase.php @@ -106,6 +106,21 @@ interface IDatabase { /** @var int Enable compression in connection protocol */ const DBO_COMPRESS = 512; + /** @var int Ignore query errors and return false when they happen */ + const QUERY_SILENCE_ERRORS = 1; // b/c for 1.32 query() argument; note that (int)true = 1 + /** + * @var int Treat the TEMPORARY table from the given CREATE query as if it is + * permanent as far as write tracking is concerned. This is useful for testing. + */ + const QUERY_PSEUDO_PERMANENT = 2; + /** @var int Enforce that a query does not make effective writes */ + const QUERY_REPLICA_ROLE = 4; + + /** @var bool Parameter to unionQueries() for UNION ALL */ + const UNION_ALL = true; + /** @var bool Parameter to unionQueries() for UNION DISTINCT */ + const UNION_DISTINCT = false; + /** * A string describing the current software version, and possibly * other details in a user-friendly way. Will be listed on Special:Version, etc. @@ -527,13 +542,13 @@ interface IDatabase { * @param string $sql SQL query * @param string $fname Name of the calling function, for profiling/SHOW PROCESSLIST * comment (you can use __METHOD__ or add some extra info) - * @param bool $tempIgnore Whether to avoid throwing an exception on errors... - * maybe best to catch the exception instead? + * @param int $flags Bitfield of IDatabase::QUERY_* constants. Note that suppression + * of errors is best handled by try/catch rather than using one of these flags. * @return bool|IResultWrapper True for a successful write query, IResultWrapper object - * for a successful read query, or false on failure if $tempIgnore set + * for a successful read query, or false on failure if QUERY_SILENCE_ERRORS is set. * @throws DBError */ - public function query( $sql, $fname = __METHOD__, $tempIgnore = false ); + public function query( $sql, $fname = __METHOD__, $flags = 0 ); /** * Free a result object returned by query() or select(). It's usually not @@ -998,6 +1013,7 @@ interface IDatabase { * @param string $valuename * * @return string + * @deprecated Since 1.33 */ public function aggregateValue( $valuedata, $valuename = 'value' ); @@ -1376,7 +1392,7 @@ interface IDatabase { * This is used for providing overload point for other DB abstractions * not compatible with the MySQL syntax. * @param array $sqls SQL statements to combine - * @param bool $all Use UNION ALL + * @param bool $all Either IDatabase::UNION_ALL or IDatabase::UNION_DISTINCT * @return string SQL fragment */ public function unionQueries( $sqls, $all ); @@ -1541,7 +1557,6 @@ interface IDatabase { * * @param callable $callback * @param string $fname Caller name - * @return mixed * @since 1.28 */ public function onTransactionResolution( callable $callback, $fname = __METHOD__ ); @@ -1585,7 +1600,6 @@ interface IDatabase { * * @param callable $callback * @param string $fname - * @return mixed * @since 1.20 * @deprecated Since 1.32 */ @@ -1631,7 +1645,6 @@ interface IDatabase { * * @param string $name Callback name * @param callable|null $callback Use null to unset a listener - * @return mixed * @since 1.28 */ public function setTransactionListener( $name, callable $callback = null ); @@ -2159,7 +2172,6 @@ interface IDatabase { * the aliases can be removed, and then the old X-named indexes dropped. * * @param string[] $aliases - * @return mixed * @since 1.31 */ public function setIndexAliases( array $aliases );