Skip to content

Commit

Permalink
Merge pull request #23764 from nextcloud/3rdparty/doctrine/dbal/2.12.0
Browse files Browse the repository at this point in the history
[3rdparty] Bump doctrine/dbal to 2.12.0
  • Loading branch information
rullzer authored Oct 31, 2020
2 parents e8f0eb4 + fe46149 commit 5396e98
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 31 deletions.
2 changes: 1 addition & 1 deletion 3rdparty
Submodule 3rdparty updated 265 files
24 changes: 14 additions & 10 deletions lib/private/DB/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function prepare($statement, $limit = null, $offset = null) {
* If the query is parametrized, a prepared statement is used.
* If an SQLLogger is configured, the execution is logged.
*
* @param string $query The SQL query to execute.
* @param string $sql The SQL query to execute.
* @param array $params The parameters to bind to the query, if any.
* @param array $types The types the previous parameters are in.
* @param \Doctrine\DBAL\Cache\QueryCacheProfile|null $qcp The query cache profile, optional.
Expand All @@ -211,11 +211,15 @@ public function prepare($statement, $limit = null, $offset = null) {
*
* @throws \Doctrine\DBAL\DBALException
*/
public function executeQuery($query, array $params = [], $types = [], QueryCacheProfile $qcp = null) {
$query = $this->replaceTablePrefix($query);
$query = $this->adapter->fixupStatement($query);
public function executeQuery($sql, array $params = [], $types = [], QueryCacheProfile $qcp = null) {
$sql = $this->replaceTablePrefix($sql);
$sql = $this->adapter->fixupStatement($sql);
$this->queriesExecuted++;
return parent::executeQuery($query, $params, $types, $qcp);
return parent::executeQuery($sql, $params, $types, $qcp);
}

public function executeUpdate($sql, array $params = [], array $types = []) {
return parent::executeUpdate($sql, $params, $types);
}

/**
Expand All @@ -224,19 +228,19 @@ public function executeQuery($query, array $params = [], $types = [], QueryCache
*
* This method supports PDO binding types as well as DBAL mapping types.
*
* @param string $query The SQL query.
* @param string $sql 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
*/
public function executeUpdate($query, array $params = [], array $types = []) {
$query = $this->replaceTablePrefix($query);
$query = $this->adapter->fixupStatement($query);
public function executeStatement($sql, array $params = [], array $types = []) {
$sql = $this->replaceTablePrefix($sql);
$sql = $this->adapter->fixupStatement($sql);
$this->queriesExecuted++;
return parent::executeUpdate($query, $params, $types);
return parent::executeStatement($sql, $params, $types);
}

/**
Expand Down
28 changes: 14 additions & 14 deletions lib/private/DB/OracleConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,35 @@ private function quoteKeys(array $data) {
/**
* {@inheritDoc}
*/
public function insert($tableExpression, array $data, array $types = []) {
if ($tableExpression[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
$tableExpression = $this->quoteIdentifier($tableExpression);
public function insert($table, array $data, array $types = []) {
if ($table[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
$table = $this->quoteIdentifier($table);
}
$data = $this->quoteKeys($data);
return parent::insert($tableExpression, $data, $types);
return parent::insert($table, $data, $types);
}

/**
* {@inheritDoc}
*/
public function update($tableExpression, array $data, array $identifier, array $types = []) {
if ($tableExpression[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
$tableExpression = $this->quoteIdentifier($tableExpression);
public function update($table, array $data, array $criteria, array $types = []) {
if ($table[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
$table = $this->quoteIdentifier($table);
}
$data = $this->quoteKeys($data);
$identifier = $this->quoteKeys($identifier);
return parent::update($tableExpression, $data, $identifier, $types);
$criteria = $this->quoteKeys($criteria);
return parent::update($table, $data, $criteria, $types);
}

/**
* {@inheritDoc}
*/
public function delete($tableExpression, array $identifier, array $types = []) {
if ($tableExpression[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
$tableExpression = $this->quoteIdentifier($tableExpression);
public function delete($table, array $criteria, array $types = []) {
if ($table[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
$table = $this->quoteIdentifier($table);
}
$identifier = $this->quoteKeys($identifier);
return parent::delete($tableExpression, $identifier);
$criteria = $this->quoteKeys($criteria);
return parent::delete($table, $criteria);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/private/DB/QueryBuilder/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public function setMaxResults($maxResults) {
* Gets the maximum number of results the query object was set to retrieve (the "limit").
* Returns NULL if {@link setMaxResults} was not applied to this query builder.
*
* @return integer The maximum number of results.
* @return int|null The maximum number of results.
*/
public function getMaxResults() {
return $this->queryBuilder->getMaxResults();
Expand Down
2 changes: 1 addition & 1 deletion lib/public/DB/QueryBuilder/IQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public function setMaxResults($maxResults);
* Gets the maximum number of results the query object was set to retrieve (the "limit").
* Returns NULL if {@link setMaxResults} was not applied to this query builder.
*
* @return integer The maximum number of results.
* @return int|null The maximum number of results.
* @since 8.2.0
*/
public function getMaxResults();
Expand Down
24 changes: 20 additions & 4 deletions lib/public/IDBConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,43 @@ public function prepare($sql, $limit = null, $offset = null);
* If the query is parameterized, a prepared statement is used.
* If an SQLLogger is configured, the execution is logged.
*
* @param string $query The SQL query to execute.
* @param string $sql The SQL query to execute.
* @param string[] $params The parameters to bind to the query, if any.
* @param array $types The types the previous parameters are in.
* @return \Doctrine\DBAL\Driver\Statement The executed statement.
* @since 8.0.0
*/
public function executeQuery($query, array $params = [], $types = []);
public function executeQuery($sql, array $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 string $sql The SQL query.
* @param array $params The query parameters.
* @param array $types The parameter types.
* @return integer The number of affected rows.
* @since 8.0.0
*
* @deprecated 21.0.0 use executeStatement
*/
public function executeUpdate($sql, 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 $sql The SQL query.
* @param array $params The query parameters.
* @param array $types The parameter types.
* @return integer The number of affected rows.
* @since 21.0.0
*/
public function executeUpdate($query, array $params = [], array $types = []);
public function executeStatement($sql, array $params = [], array $types = []);

/**
* Used to get the id of the just inserted element
Expand Down

0 comments on commit 5396e98

Please sign in to comment.