summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-10-31 08:47:18 +0100
committerGitHub <noreply@github.com>2020-10-31 08:47:18 +0100
commit5396e98d2d9499f14a1c5abeb71e904642f90c26 (patch)
tree7f4de3c7d3c873f318252eb03817eedfdc7f109c /lib
parente8f0eb42e2334c8e2f6a4dfe6697221be002894f (diff)
parentfe46149560ede7a071557e4f6b2b32a9d286327a (diff)
downloadnextcloud-server-5396e98d2d9499f14a1c5abeb71e904642f90c26.tar.gz
nextcloud-server-5396e98d2d9499f14a1c5abeb71e904642f90c26.zip
Merge pull request #23764 from nextcloud/3rdparty/doctrine/dbal/2.12.0
[3rdparty] Bump doctrine/dbal to 2.12.0
Diffstat (limited to 'lib')
-rw-r--r--lib/private/DB/Connection.php24
-rw-r--r--lib/private/DB/OracleConnection.php28
-rw-r--r--lib/private/DB/QueryBuilder/QueryBuilder.php2
-rw-r--r--lib/public/DB/QueryBuilder/IQueryBuilder.php2
-rw-r--r--lib/public/IDBConnection.php24
5 files changed, 50 insertions, 30 deletions
diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php
index 0386a8c5493..24b241b78fd 100644
--- a/lib/private/DB/Connection.php
+++ b/lib/private/DB/Connection.php
@@ -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);
}
/**
diff --git a/lib/private/DB/OracleConnection.php b/lib/private/DB/OracleConnection.php
index 9dd7620a546..76f0c9faa7d 100644
--- a/lib/private/DB/OracleConnection.php
+++ b/lib/private/DB/OracleConnection.php
@@ -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);
}
/**
diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php
index 0e3f6f7daec..7fdeed12130 100644
--- a/lib/private/DB/QueryBuilder/QueryBuilder.php
+++ b/lib/private/DB/QueryBuilder/QueryBuilder.php
@@ -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();
diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php
index 174ab1cc90c..1cffaafaf96 100644
--- a/lib/public/DB/QueryBuilder/IQueryBuilder.php
+++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php
@@ -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();
diff --git a/lib/public/IDBConnection.php b/lib/public/IDBConnection.php
index 68d0048433c..8e20b5503ba 100644
--- a/lib/public/IDBConnection.php
+++ b/lib/public/IDBConnection.php
@@ -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($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