Merge "Fix IDatabase::affectedRows() documentation"
[lhc/web/wiklou.git] / includes / libs / rdbms / database / IDatabase.php
index e480530..8768213 100644 (file)
@@ -89,9 +89,9 @@ interface IDatabase {
 
        /** @var int Enable debug logging of all SQL queries */
        const DBO_DEBUG = 1;
-       /** @var int Disable query buffering (only one result set can be iterated at a time) */
+       /** @var int Unused since 1.34 */
        const DBO_NOBUFFER = 2;
-       /** @var int Ignore query errors (internal use only!) */
+       /** @var int Unused since 1.31 */
        const DBO_IGNORE = 4;
        /** @var int Automatically start a transaction before running a query if none is active */
        const DBO_TRX = 8;
@@ -138,28 +138,6 @@ interface IDatabase {
         */
        public function getServerInfo();
 
-       /**
-        * Turns buffering of SQL result sets on (true) or off (false). Default is "on".
-        *
-        * Unbuffered queries are very troublesome in MySQL:
-        *
-        *   - If another query is executed while the first query is being read
-        *     out, the first query is killed. This means you can't call normal
-        *     Database functions while you are reading an unbuffered query result
-        *     from a normal Database connection.
-        *
-        *   - Unbuffered queries cause the MySQL server to use large amounts of
-        *     memory and to hold broad locks which block other queries.
-        *
-        * If you want to limit client-side memory, it's almost always better to
-        * split up queries into batches using a LIMIT clause than to switch off
-        * buffering.
-        *
-        * @param null|bool $buffer
-        * @return null|bool The previous value of the flag
-        */
-       public function bufferResults( $buffer = null );
-
        /**
         * Gets the current transaction level.
         *
@@ -319,7 +297,7 @@ interface IDatabase {
        /**
         * Set a flag for this connection
         *
-        * @param int $flag IDatabase::DBO_DEBUG, IDatabase::DBO_NOBUFFER, or IDatabase::DBO_TRX
+        * @param int $flag One of (IDatabase::DBO_DEBUG, IDatabase::DBO_TRX)
         * @param string $remember IDatabase::REMEMBER_* constant [default: REMEMBER_NOTHING]
         */
        public function setFlag( $flag, $remember = self::REMEMBER_NOTHING );
@@ -327,7 +305,7 @@ interface IDatabase {
        /**
         * Clear a flag for this connection
         *
-        * @param int $flag IDatabase::DBO_DEBUG, IDatabase::DBO_NOBUFFER, or IDatabase::DBO_TRX
+        * @param int $flag One of (IDatabase::DBO_DEBUG, IDatabase::DBO_TRX)
         * @param string $remember IDatabase::REMEMBER_* constant [default: REMEMBER_NOTHING]
         */
        public function clearFlag( $flag, $remember = self::REMEMBER_NOTHING );
@@ -452,8 +430,10 @@ interface IDatabase {
        public function lastError();
 
        /**
-        * Get the number of rows affected by the last write query
-        * @see https://www.php.net/mysql_affected_rows
+        * Get the number of rows affected by the last write query.
+        * Similar to https://www.php.net/mysql_affected_rows but includes rows matched
+        * but not changed (ie. an UPDATE which sets all fields to the same value they already have).
+        * To get the old mysql_affected_rows behavior, include non-equality of the fields in WHERE.
         *
         * @return int
         */
@@ -716,8 +696,6 @@ interface IDatabase {
         *    - SQL_BUFFER_RESULT
         *    - SQL_SMALL_RESULT
         *    - SQL_CALC_FOUND_ROWS
-        *    - SQL_CACHE
-        *    - SQL_NO_CACHE
         *
         * @param string|array $join_conds Join conditions
         *