diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-07-24 20:39:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-24 20:39:04 +0200 |
commit | 57ed738af27d0346c1b20b9d188079f3eda0b094 (patch) | |
tree | 3992c7b09d37e1b4113069f1cf55a0423e090b37 | |
parent | 2ddfbf3e7975283a31558fe764d7067aa363207d (diff) | |
parent | 5ea972922bcb03007728b3a2e24dce18cd9cebf0 (diff) | |
download | nextcloud-server-57ed738af27d0346c1b20b9d188079f3eda0b094.tar.gz nextcloud-server-57ed738af27d0346c1b20b9d188079f3eda0b094.zip |
Merge pull request #46644 from nextcloud/cast-bigint
fix: cast to bigint on postgresql
-rw-r--r-- | lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php | 2 | ||||
-rw-r--r-- | lib/private/Preview/BackgroundCleanupJob.php | 2 | ||||
-rw-r--r-- | tests/lib/Preview/BackgroundCleanupJobTest.php | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php b/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php index 1a162f04a49..53a566a7eb6 100644 --- a/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php +++ b/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php @@ -23,7 +23,7 @@ class PgSqlExpressionBuilder extends ExpressionBuilder { public function castColumn($column, $type): IQueryFunction { switch ($type) { case IQueryBuilder::PARAM_INT: - return new QueryFunction('CAST(' . $this->helper->quoteColumnName($column) . ' AS INT)'); + return new QueryFunction('CAST(' . $this->helper->quoteColumnName($column) . ' AS BIGINT)'); case IQueryBuilder::PARAM_STR: return new QueryFunction('CAST(' . $this->helper->quoteColumnName($column) . ' AS TEXT)'); default: diff --git a/lib/private/Preview/BackgroundCleanupJob.php b/lib/private/Preview/BackgroundCleanupJob.php index 49ff01486a3..deadcd007b1 100644 --- a/lib/private/Preview/BackgroundCleanupJob.php +++ b/lib/private/Preview/BackgroundCleanupJob.php @@ -73,6 +73,8 @@ class BackgroundCleanupJob extends TimedJob { ->where( $qb->expr()->isNull('b.fileid') )->andWhere( + $qb->expr()->eq('a.storage', $qb->createNamedParameter($this->previewFolder->getStorageId())) + )->andWhere( $qb->expr()->eq('a.parent', $qb->createNamedParameter($this->previewFolder->getId())) )->andWhere( $qb->expr()->like('a.name', $qb->createNamedParameter('__%')) diff --git a/tests/lib/Preview/BackgroundCleanupJobTest.php b/tests/lib/Preview/BackgroundCleanupJobTest.php index a221829b712..c07ec42b36b 100644 --- a/tests/lib/Preview/BackgroundCleanupJobTest.php +++ b/tests/lib/Preview/BackgroundCleanupJobTest.php @@ -180,9 +180,11 @@ class BackgroundCleanupJobTest extends \Test\TestCase { $f1->newFile('foo.jpg', 'foo'); $f2 = $appdata->newFolder('123456782'); $f2->newFile('foo.jpg', 'foo'); + $f2 = $appdata->newFolder((string)PHP_INT_MAX - 1); + $f2->newFile('foo.jpg', 'foo'); $appdata = \OC::$server->getAppDataDir('preview'); - $this->assertSame(2, count($appdata->getDirectoryListing())); + $this->assertSame(3, count($appdata->getDirectoryListing())); $job = new BackgroundCleanupJob($this->timeFactory, $this->connection, $this->getRoot(), $this->mimeTypeLoader, true); $job->run([]); |