mirror of
https://github.com/nextcloud/server.git
synced 2026-03-12 21:52:19 -04:00
Merge pull request #36453 from nextcloud/bugfix/noid/oci-longtext
Fix MigrateBackgroundImages on oracle
This commit is contained in:
commit
ca3f53ab88
2 changed files with 20 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in a new issue