diff --git a/system/Database/OCI8/Builder.php b/system/Database/OCI8/Builder.php index 5b586761e2c0..2e62b3121cbd 100644 --- a/system/Database/OCI8/Builder.php +++ b/system/Database/OCI8/Builder.php @@ -48,16 +48,6 @@ class Builder extends BaseBuilder */ protected $countString = 'SELECT COUNT(1) '; - /** - * Limit used flag - * - * If we use LIMIT, we'll add a field that will - * throw off num_fields later. - * - * @var bool - */ - protected $limitUsed = false; - /** * A reference to the database connection. * @@ -214,28 +204,13 @@ protected function _update(string $table, array $values): string protected function _limit(string $sql, bool $offsetIgnore = false): string { $offset = (int) ($offsetIgnore === false ? $this->QBOffset : 0); - if (version_compare($this->db->getVersion(), '12.1', '>=')) { - // OFFSET-FETCH can be used only with the ORDER BY clause - if (empty($this->QBOrderBy)) { - $sql .= ' ORDER BY 1'; - } - return $sql . ' OFFSET ' . $offset . ' ROWS FETCH NEXT ' . $this->QBLimit . ' ROWS ONLY'; + // OFFSET-FETCH can be used only with the ORDER BY clause + if (empty($this->QBOrderBy)) { + $sql .= ' ORDER BY 1'; } - $this->limitUsed = true; - $limitTemplateQuery = 'SELECT * FROM (SELECT INNER_QUERY.*, ROWNUM RNUM FROM (%s) INNER_QUERY WHERE ROWNUM < %d)' . ($offset !== 0 ? ' WHERE RNUM >= %d' : ''); - - return sprintf($limitTemplateQuery, $sql, $offset + $this->QBLimit + 1, $offset); - } - - /** - * Resets the query builder values. Called by the get() function - */ - protected function resetSelect() - { - $this->limitUsed = false; - parent::resetSelect(); + return $sql . ' OFFSET ' . $offset . ' ROWS FETCH NEXT ' . $this->QBLimit . ' ROWS ONLY'; } /** diff --git a/utils/phpstan-baseline/missingType.return.neon b/utils/phpstan-baseline/missingType.return.neon index baddb8644505..838443fab4f0 100644 --- a/utils/phpstan-baseline/missingType.return.neon +++ b/utils/phpstan-baseline/missingType.return.neon @@ -1,4 +1,4 @@ -# total 201 errors +# total 200 errors parameters: ignoreErrors: @@ -112,11 +112,6 @@ parameters: count: 1 path: ../../system/Database/MigrationRunner.php - - - message: '#^Method CodeIgniter\\Database\\OCI8\\Builder\:\:resetSelect\(\) has no return type specified\.$#' - count: 1 - path: ../../system/Database/OCI8/Builder.php - - message: '#^Method CodeIgniter\\Database\\Postgre\\Connection\:\:buildDSN\(\) has no return type specified\.$#' count: 1