diff --git a/apps/theming/lib/Jobs/MigrateBackgroundImages.php b/apps/theming/lib/Jobs/MigrateBackgroundImages.php index 97665d1179fde..62179e46a4ba1 100644 --- a/apps/theming/lib/Jobs/MigrateBackgroundImages.php +++ b/apps/theming/lib/Jobs/MigrateBackgroundImages.php @@ -30,6 +30,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJobList; use OCP\BackgroundJob\QueuedJob; +use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Files\AppData\IAppDataFactory; use OCP\Files\IAppData; use OCP\Files\NotFoundException; @@ -92,7 +93,7 @@ protected function runPreparation(): void { ->from('preferences') ->where($selector->expr()->eq('appid', $selector->createNamedParameter('theming'))) ->andWhere($selector->expr()->eq('configkey', $selector->createNamedParameter('background'))) - ->andWhere($selector->expr()->eq('configvalue', $selector->createNamedParameter('custom'))) + ->andWhere($selector->expr()->eq('configvalue', $selector->createNamedParameter('custom', IQueryBuilder::PARAM_STR), IQueryBuilder::PARAM_STR)) ->executeQuery(); $userIds = $result->fetchAll(\PDO::FETCH_COLUMN); diff --git a/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php b/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php index 4a168cb014350..35d8b4faa343a 100644 --- a/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php +++ b/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php @@ -132,6 +132,24 @@ public function testCastColumn(): void { $this->assertEquals(1, $result); } + public function testLongText(): void { + $appId = $this->getUniqueID('testing'); + $this->createConfig($appId, 'mykey', 'myvalue'); + + $query = $this->connection->getQueryBuilder(); + $query->select('*') + ->from('appconfig') + ->where($query->expr()->eq('appid', $query->createNamedParameter($appId))) + ->andWhere($query->expr()->eq('configkey', $query->createNamedParameter('mykey'))) + ->andWhere($query->expr()->eq('configvalue', $query->createNamedParameter('myvalue', IQueryBuilder::PARAM_STR), IQueryBuilder::PARAM_STR)); + + $result = $query->executeQuery(); + $entries = $result->fetchAll(); + $result->closeCursor(); + self::assertCount(1, $entries); + self::assertEquals('myvalue', $entries[0]['configvalue']); + } + protected function createConfig($appId, $key, $value) { $query = $this->connection->getQueryBuilder(); $query->insert('appconfig')