diff --git a/3rdparty b/3rdparty index a3fd9c2715..a7e8c63bac 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit a3fd9c27151df6b1d8920896a0eaf48dd303be94 +Subproject commit a7e8c63bac637bbb5ff469224d09a6acaefecf4d diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index 0386a8c549..24b241b78f 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 9dd7620a54..76f0c9faa7 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 0e3f6f7dae..7fdeed1213 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 174ab1cc90..1cffaafaf9 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 68d0048433..8e20b5503b 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($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