summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2021-12-13 20:24:16 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2021-12-13 20:24:16 +0000
commitf4991297805021036d9052c45e1571e315a9250b (patch)
tree24a57b4fafd13053ba47028b04812863b0c47538
parent7032a10719a0228eada8c0fc6369ed58f8982b6f (diff)
parent8dca355526f45cfac24f9db88c75bf2a40fe7cdb (diff)
Merge "rdbms: Remove five deprecated methods from IDatabase"
-rw-r--r--RELEASE-NOTES-1.388
-rw-r--r--includes/libs/rdbms/database/DBConnRef.php23
-rw-r--r--includes/libs/rdbms/database/Database.php26
-rw-r--r--includes/libs/rdbms/database/IDatabase.php47
-rw-r--r--tests/phpunit/unit/includes/libs/rdbms/database/DatabaseTest.php1
5 files changed, 7 insertions, 98 deletions
diff --git a/RELEASE-NOTES-1.38 b/RELEASE-NOTES-1.38
index e75fbb797d43..c86dec229de4 100644
--- a/RELEASE-NOTES-1.38
+++ b/RELEASE-NOTES-1.38
@@ -266,7 +266,13 @@ because of Phabricator reports.
- ::preCommitCallbacksPending()
- ::pendingWriteRowsAffected()
- ::getServerUptime()
- - ::aggregateValue()
+* The following deprecated methods have been removed from IDatabase:
+ - ::aggregateValue() soft-deprecated since 1.33
+ - ::getTopologyRootMaster() since 1.37
+ - ::masterPosWait() since 1.37
+ - ::dataSeek() soft-deprecated since 1.37
+ - ::onTransactionIdle() soft-deprecated since 1.32
+ - ::getMasterPos() since 1.37
* …
=== Deprecations in 1.38 ===
diff --git a/includes/libs/rdbms/database/DBConnRef.php b/includes/libs/rdbms/database/DBConnRef.php
index 726f2c9e530c..fb1ed6b4995a 100644
--- a/includes/libs/rdbms/database/DBConnRef.php
+++ b/includes/libs/rdbms/database/DBConnRef.php
@@ -92,11 +92,6 @@ class DBConnRef implements IDatabase {
return $this->__call( __FUNCTION__, func_get_args() );
}
- public function getTopologyRootMaster() {
- wfDeprecated( __METHOD__, '1.37' );
- return $this->__call( __FUNCTION__, func_get_args() );
- }
-
public function trxLevel() {
return $this->__call( __FUNCTION__, func_get_args() );
}
@@ -252,10 +247,6 @@ class DBConnRef implements IDatabase {
return $this->__call( __FUNCTION__, func_get_args() );
}
- public function dataSeek( $res, $row ) {
- return $this->__call( __FUNCTION__, func_get_args() );
- }
-
public function lastErrno() {
return $this->__call( __FUNCTION__, func_get_args() );
}
@@ -583,11 +574,6 @@ class DBConnRef implements IDatabase {
return $this->__call( __FUNCTION__, func_get_args() );
}
- public function masterPosWait( DBPrimaryPos $pos, $timeout ) {
- wfDeprecated( __METHOD__, '1.37' );
- return $this->__call( __FUNCTION__, func_get_args() );
- }
-
public function getReplicaPos() {
return $this->__call( __FUNCTION__, func_get_args() );
}
@@ -596,11 +582,6 @@ class DBConnRef implements IDatabase {
return $this->__call( __FUNCTION__, func_get_args() );
}
- public function getMasterPos() {
- wfDeprecated( __METHOD__, '1.37' );
- return $this->getPrimaryPos();
- }
-
public function serverIsReadOnly() {
return $this->__call( __FUNCTION__, func_get_args() );
}
@@ -615,10 +596,6 @@ class DBConnRef implements IDatabase {
return $this->__call( __FUNCTION__, func_get_args() );
}
- public function onTransactionIdle( callable $callback, $fname = __METHOD__ ) {
- return $this->onTransactionCommitOrIdle( $callback, $fname );
- }
-
public function onTransactionPreCommitOrIdle( callable $callback, $fname = __METHOD__ ) {
// DB_REPLICA role: caller might want to refresh cache after a cache mutex is released
return $this->__call( __FUNCTION__, func_get_args() );
diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php
index ef4b556f0824..5e968182d708 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -591,11 +591,6 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
return $this->topologyRootMaster;
}
- public function getTopologyRootMaster() {
- wfDeprecated( __METHOD__, '1.37' );
- return $this->topologyRootMaster;
- }
-
final public function trxLevel() {
return ( $this->trxId != '' ) ? 1 : 0;
}
@@ -885,10 +880,6 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
return $res->getFieldNames()[$n];
}
- public function dataSeek( IResultWrapper $res, $pos ) {
- $res->seek( $pos );
- }
-
public function freeResult( IResultWrapper $res ) {
$res->free();
}
@@ -4149,14 +4140,6 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
/**
* @inheritDoc
- */
- public function masterPosWait( DBPrimaryPos $pos, $timeout ) {
- wfDeprecated( __METHOD__, '1.37' );
- return $this->primaryPosWait( $pos, $timeout );
- }
-
- /**
- * @inheritDoc
* @stable to override
*/
public function getReplicaPos() {
@@ -4173,11 +4156,6 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
return false;
}
- public function getMasterPos() {
- wfDeprecated( __METHOD__, '1.37' );
- return $this->getPrimaryPos();
- }
-
/**
* @inheritDoc
* @stable to override
@@ -4216,10 +4194,6 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
}
}
- final public function onTransactionIdle( callable $callback, $fname = __METHOD__ ) {
- $this->onTransactionCommitOrIdle( $callback, $fname );
- }
-
final public function onTransactionPreCommitOrIdle( callable $callback, $fname = __METHOD__ ) {
if ( !$this->trxLevel() && $this->getTransactionRoundId() ) {
// This DB handle is set to participate in LoadBalancer transaction rounds and
diff --git a/includes/libs/rdbms/database/IDatabase.php b/includes/libs/rdbms/database/IDatabase.php
index 06a4fcca534d..e19dd7b8b27b 100644
--- a/includes/libs/rdbms/database/IDatabase.php
+++ b/includes/libs/rdbms/database/IDatabase.php
@@ -206,14 +206,6 @@ interface IDatabase {
public function getTopologyRootPrimary();
/**
- * @deprecated since 1.37; use getTopologyRootPrimary() instead.
- * @return string|null Readable server name; null if unknown or if co-primaries are defined
- * @throws DBQueryError
- * @since 1.34
- */
- public function getTopologyRootMaster();
-
- /**
* Gets the current transaction level.
*
* Historically, transactions were allowed to be "nested". This is no
@@ -476,17 +468,6 @@ interface IDatabase {
*/
public function freeResult( IResultWrapper $res );
- /**
- * Change the position of the cursor in a result object
- * @see https://www.php.net/mysql_data_seek
- *
- * @deprecated since 1.37 use IResultWrapper::seek()
- *
- * @param IResultWrapper $res A SQL result
- * @param int $row
- */
- public function dataSeek( IResultWrapper $res, $row );
-
// endregion -- Deprecated IResultWrapper accessors
/***************************************************************************/
@@ -1664,17 +1645,6 @@ interface IDatabase {
public function primaryPosWait( DBPrimaryPos $pos, $timeout );
/**
- * @deprecated since 1.37; use primaryPosWait() instead.
- * @param DBPrimaryPos $pos
- * @param int $timeout The maximum number of seconds to wait for synchronisation
- * @return int|null Zero if the replica DB was past that position already,
- * greater than zero if we waited for some period of time, less than
- * zero if it timed out, and null on error
- * @throws DBError If an error occurs, {@see query}
- */
- public function masterPosWait( DBPrimaryPos $pos, $timeout );
-
- /**
* Get the replication position of this replica DB
*
* @return DBPrimaryPos|bool False if this is not a replica DB
@@ -1692,13 +1662,6 @@ interface IDatabase {
public function getPrimaryPos();
/**
- * @deprecated since 1.37; use getPrimaryPos() instead.
- * @return DBPrimaryPos|bool False if this is not a primary DB
- * @throws DBError If an error occurs, {@see query}
- */
- public function getMasterPos();
-
- /**
* @return bool Whether the DB is marked as read-only server-side
* @throws DBError If an error occurs, {@see query}
* @since 1.28
@@ -1776,16 +1739,6 @@ interface IDatabase {
public function onTransactionCommitOrIdle( callable $callback, $fname = __METHOD__ );
/**
- * Alias for onTransactionCommitOrIdle() for backwards-compatibility
- *
- * @param callable $callback
- * @param string $fname
- * @since 1.20
- * @deprecated Since 1.32
- */
- public function onTransactionIdle( callable $callback, $fname = __METHOD__ );
-
- /**
* Run a callback before the current transaction commits or now if there is none
*
* If there is a transaction and it is rolled back, then the callback is cancelled.
diff --git a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseTest.php b/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseTest.php
index 5e20b1dab966..56fe12a7df96 100644
--- a/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseTest.php
+++ b/tests/phpunit/unit/includes/libs/rdbms/database/DatabaseTest.php
@@ -444,7 +444,6 @@ class DatabaseTest extends PHPUnit\Framework\TestCase {
static $abstractMethods = [
'fetchAffectedRowCount',
'closeConnection',
- 'dataSeek',
'doQuery',
'fetchObject',
'fetchRow',