Merge pull request #23764 from nextcloud/3rdparty/doctrine/dbal/2.12.0

[3rdparty] Bump doctrine/dbal to 2.12.0
This commit is contained in:
Roeland Jago Douma 2020-10-31 08:47:18 +01:00 committed by GitHub
commit 5396e98d2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 31 deletions

@ -1 +1 @@
Subproject commit a3fd9c27151df6b1d8920896a0eaf48dd303be94
Subproject commit a7e8c63bac637bbb5ff469224d09a6acaefecf4d

View File

@ -202,7 +202,7 @@ class Connection extends ReconnectWrapper implements IDBConnection {
* 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.
@ -211,11 +211,15 @@ class Connection extends ReconnectWrapper implements IDBConnection {
*
* @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);
}
/**
@ -224,7 +228,7 @@ class Connection extends ReconnectWrapper implements IDBConnection {
*
* 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.
*
@ -232,11 +236,11 @@ class Connection extends ReconnectWrapper implements IDBConnection {
*
* @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);
}
/**

View File

@ -47,35 +47,35 @@ class OracleConnection extends Connection {
/**
* {@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);
}
/**

View File

@ -366,7 +366,7 @@ class QueryBuilder implements IQueryBuilder {
* 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();

View File

@ -278,7 +278,7 @@ interface IQueryBuilder {
* 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();

View File

@ -77,13 +77,13 @@ interface IDBConnection {
* 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
@ -91,13 +91,29 @@ interface IDBConnection {
*
* 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($query, array $params = [], array $types = []);
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 executeStatement($sql, array $params = [], array $types = []);
/**
* Used to get the id of the just inserted element