diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-02-07 16:07:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-07 16:07:38 +0100 |
commit | fd96473fbb99c099574b57d2be7904f2edd7ce04 (patch) | |
tree | 44ae1181222e14a2a1bc2c1c0cd9a6e1cde0af0f | |
parent | 371bd563c1e3325504907d031cb0581e49bc2d9f (diff) | |
parent | 9df31d7195544527a66b365e4c8d9801c1e81c1d (diff) | |
download | nextcloud-server-fd96473fbb99c099574b57d2be7904f2edd7ce04.tar.gz nextcloud-server-fd96473fbb99c099574b57d2be7904f2edd7ce04.zip |
Merge pull request #36456 from nextcloud/backport/36453/stable25
[stable25] Fix MigrateBackgroundImages on oracle
-rw-r--r-- | apps/theming/lib/Jobs/MigrateBackgroundImages.php | 3 | ||||
-rw-r--r-- | tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php | 18 |
2 files changed, 20 insertions, 1 deletions
diff --git a/apps/theming/lib/Jobs/MigrateBackgroundImages.php b/apps/theming/lib/Jobs/MigrateBackgroundImages.php index 39731ef556f..7ee2b7977d6 100644 --- a/apps/theming/lib/Jobs/MigrateBackgroundImages.php +++ b/apps/theming/lib/Jobs/MigrateBackgroundImages.php @@ -30,6 +30,7 @@ use OCA\Theming\AppInfo\Application; 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 @@ class MigrateBackgroundImages extends QueuedJob { ->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 4a168cb0143..35d8b4faa34 100644 --- a/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php +++ b/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php @@ -132,6 +132,24 @@ class ExpressionBuilderDBTest extends TestCase { $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') |