Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump doctrine/dbal from 2.10.4 to 2.13.1 #38647

Merged
merged 2 commits into from
May 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions changelog/unreleased/38647
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Change: Bump doctrine/dbal from 2.10.4 to 2.13.1

Implemented the new method executeStatement in our DB Connection class
as Doctrine calls this method now instead of the deprecated executeUpdate.

https://github.com/owncloud/core/pull/38647
https://github.com/owncloud/core/issues/38681
77 changes: 57 additions & 20 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions lib/private/AppFramework/Db/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ public function executeUpdate($query, array $params = [], array $types = []) {
return $this->connection->executeUpdate($query, $params, $types);
}

/**
* @inheritdoc
*/
public function executeStatement($query, array $params = [], array $types = []) {
return $this->connection->executeStatement($query, $params, $types);
}

/**
* @inheritdoc
*/
Expand Down
27 changes: 27 additions & 0 deletions lib/private/DB/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ public function executeQuery($query, array $params = [], $types = [], QueryCache
}

/**
* NOTE: Use executeStatement() instead as the underlying Doctrine
* class deprecated the usage of executeUpdate().
*
* Executes an SQL INSERT/UPDATE/DELETE query with the given parameters
* and returns the number of affected rows.
*
Expand All @@ -200,13 +203,37 @@ public function executeQuery($query, array $params = [], $types = [], QueryCache
* @return integer The number of affected rows.
*
* @throws \Doctrine\DBAL\DBALException
*
* @deprecated since 10.8.0
*/
public function executeUpdate($query, array $params = [], array $types = []) {
$query = $this->replaceTablePrefix($query);
$query = $this->adapter->fixupStatement($query);
return parent::executeUpdate($query, $params, $types);
}

/**
* Executes an SQL INSERT/UPDATE/DELETE query with the given parameters
* and returns the number of affected rows.
*
* This method supports PDO binding types as well as DBAL mapping types.
*
* @param string $query The SQL query.
* @param array $params The query parameters.
* @param array $types The parameter types.
*
* @return integer The number of affected rows.
*
* @throws \Doctrine\DBAL\DBALException
*
* @since 10.8.0
*/
public function executeStatement($query, array $params = [], array $types = []) {
$query = $this->replaceTablePrefix($query);
$query = $this->adapter->fixupStatement($query);
return parent::executeStatement($query, $params, $types);
}

/**
* Returns the ID of the last inserted row, or the last value from a sequence object,
* depending on the underlying driver.
Expand Down
18 changes: 18 additions & 0 deletions lib/public/IDBConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public function prepare($sql, $limit=null, $offset=null);
public function executeQuery($query, array $params = [], $types = []);

/**
* NOTE: Use executeStatement() instead as the underlying Doctrine
* class deprecated the usage of executeUpdate().
*
* Executes an SQL INSERT/UPDATE/DELETE query with the given parameters
* and returns the number of affected rows.
*
Expand All @@ -87,9 +90,24 @@ public function executeQuery($query, array $params = [], $types = []);
* @param array $types The parameter types.
* @return integer The number of affected rows.
* @since 8.0.0
* @deprecated since 10.8.0
*/
public function executeUpdate($query, array $params = [], array $types = []);

/**
* Executes an SQL INSERT/UPDATE/DELETE query with the given parameters
* and returns the number of affected rows.
*
* This method supports PDO binding types as well as DBAL mapping types.
*
* @param string $query The SQL query.
* @param array $params The query parameters.
* @param array $types The parameter types.
* @return integer The number of affected rows.
* @since 10.8.0
*/
public function executeStatement($query, array $params = [], array $types = []);

/**
* Used to get the id of the just inserted element
* Note: On postgres platform, this will return the last sequence id which
Expand Down
1 change: 0 additions & 1 deletion tests/lib/DB/QueryBuilder/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ protected function deleteTestingRows($appId = 'testFirstResult') {

public function dataFirstResult() {
return [
[null, [99, 98, 97, 96, 95, 94, 93, 92, 91]],
[0, [99, 98, 97, 96, 95, 94, 93, 92, 91]],
[1, [98, 97, 96, 95, 94, 93, 92, 91]],
[5, [94, 93, 92, 91]],
Expand Down