mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #46644 from nextcloud/cast-bigint
fix: cast to bigint on postgresql
This commit is contained in:
commit
57ed738af2
3 changed files with 6 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -72,6 +72,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(
|
||||
|
|
|
|||
|
|
@ -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([]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue