Database error due to broken query in RestoreBackgroundImageColor
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
{
"reqId": "SM9jXzWB5PaQ7Lz9GkRO",
"level": 3,
"time": "2025-09-19T06:25:07+00:00",
"remoteAddr": "",
"user": "--",
"app": "core",
"method": "",
"url": "--",
"message": "Error while running background job OCA\\Theming\\Jobs\\RestoreBackgroundImageColor (id: 10584862, arguments: {\"stage\":\"prepare\"})",
"userAgent": "--",
"version": "33.0.0.0",
"exception": {
"Exception": "OC\\DB\\Exceptions\\DbalException",
"Message": "An exception occurred while executing a query: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near \"\" FROM \"\"\nLINE 1: ...\"oc_preferences\" \"a\" LEFT JOIN \"oc_(SELECT \"userid\" FROM \"oc...\n ^",
"Code": 7,
"Trace": [
{
"file": "/var/www/html/lib/private/DB/ConnectionAdapter.php",
"line": 53,
"function": "wrap",
"class": "OC\\DB\\Exceptions\\DbalException",
"type": "::",
"args": [
{
"__class__": "Doctrine\\DBAL\\Exception\\SyntaxErrorException"
},
"",
"SELECT DISTINCT `a`.`userid` FROM `*PREFIX*preferences` `a` LEFT JOIN `*PREFIX*(SELECT `userid` FROM `*PREFIX*preferences` WHERE `configkey` = :dcValue1)` `b` ON a.userid = b.userid WHERE (`a`.`configkey` = :dcValue2) AND (`a`.`configvalue` <> :dcValue3) AND (`b`.`userid` IS NULL)"
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 291,
"function": "executeQuery",
"class": "OC\\DB\\ConnectionAdapter",
"type": "->",
"args": [
"SELECT DISTINCT `a`.`userid` FROM `*PREFIX*preferences` `a` LEFT JOIN `*PREFIX*(SELECT `userid` FROM `*PREFIX*preferences` WHERE `configkey` = :dcValue1)` `b` ON a.userid = b.userid WHERE (`a`.`configkey` = :dcValue2) AND (`a`.`configvalue` <> :dcValue3) AND (`b`.`userid` IS NULL)",
{
"dcValue1": "background_color",
"dcValue2": "background_image",
"dcValue3": "default"
},
{
"dcValue1": 2,
"dcValue2": 2,
"dcValue3": 2
}
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/ExtendedQueryBuilder.php",
"line": 285,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->",
"args": [
{
"__class__": "OC\\DB\\ConnectionAdapter"
}
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/Sharded/ShardedQueryBuilder.php",
"line": 361,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\ExtendedQueryBuilder",
"type": "->",
"args": [
null
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/Partitioned/PartitionedQueryBuilder.php",
"line": 424,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\Sharded\\ShardedQueryBuilder",
"type": "->",
"args": [
null
]
},
{
"file": "/var/www/html/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php",
"line": 76,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\Partitioned\\PartitionedQueryBuilder",
"type": "->",
"args": []
},
{
"file": "/var/www/html/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php",
"line": 50,
"function": "runPreparation",
"class": "OCA\\Theming\\Jobs\\RestoreBackgroundImageColor",
"type": "->",
"args": []
},
{
"file": "/var/www/html/lib/public/BackgroundJob/Job.php",
"line": 49,
"function": "run",
"class": "OCA\\Theming\\Jobs\\RestoreBackgroundImageColor",
"type": "->",
"args": [
{
"stage": "prepare"
}
]
},
{
"file": "/var/www/html/lib/public/BackgroundJob/QueuedJob.php",
"line": 30,
"function": "start",
"class": "OCP\\BackgroundJob\\Job",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
}
]
},
{
"file": "/var/www/html/cron.php",
"line": 174,
"function": "start",
"class": "OCP\\BackgroundJob\\QueuedJob",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
}
]
}
],
"File": "/var/www/html/lib/private/DB/Exceptions/DbalException.php",
"Line": 56,
"Previous": {
"Exception": "Doctrine\\DBAL\\Exception\\SyntaxErrorException",
"Message": "An exception occurred while executing a query: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near \"\" FROM \"\"\nLINE 1: ...\"oc_preferences\" \"a\" LEFT JOIN \"oc_(SELECT \"userid\" FROM \"oc...\n ^",
"Code": 7,
"Trace": [
{
"file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1976,
"function": "convert",
"class": "Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter",
"type": "->",
"args": [
{
"__class__": "Doctrine\\DBAL\\Driver\\PDO\\Exception"
},
{
"__class__": "Doctrine\\DBAL\\Query"
}
]
},
{
"file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1918,
"function": "handleDriverException",
"class": "Doctrine\\DBAL\\Connection",
"type": "->",
"args": [
{
"__class__": "Doctrine\\DBAL\\Driver\\PDO\\Exception"
},
{
"__class__": "Doctrine\\DBAL\\Query"
}
]
},
{
"file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1111,
"function": "convertExceptionDuringQuery",
"class": "Doctrine\\DBAL\\Connection",
"type": "->",
"args": [
{
"__class__": "Doctrine\\DBAL\\Driver\\PDO\\Exception"
},
"SELECT DISTINCT \"a\".\"userid\" FROM \"oc_preferences\" \"a\" LEFT JOIN \"oc_(SELECT \"userid\" FROM \"oc_preferences\" WHERE \"configkey\" = :dcValue1)\" \"b\" ON a.userid = b.userid WHERE (\"a\".\"configkey\" = ?) AND (\"a\".\"configvalue\" <> ?) AND (\"b\".\"userid\" IS NULL)",
[
"background_image",
"default"
],
[
2,
2
]
]
},
{
"file": "/var/www/html/lib/private/DB/Connection.php",
"line": 420,
"function": "executeQuery",
"class": "Doctrine\\DBAL\\Connection",
"type": "->",
"args": [
"SELECT DISTINCT \"a\".\"userid\" FROM \"oc_preferences\" \"a\" LEFT JOIN \"oc_(SELECT \"userid\" FROM \"oc_preferences\" WHERE \"configkey\" = :dcValue1)\" \"b\" ON a.userid = b.userid WHERE (\"a\".\"configkey\" = ?) AND (\"a\".\"configvalue\" <> ?) AND (\"b\".\"userid\" IS NULL)",
[
"background_image",
"default"
],
[
2,
2
],
null
]
},
{
"file": "/var/www/html/lib/private/DB/ConnectionAdapter.php",
"line": 50,
"function": "executeQuery",
"class": "OC\\DB\\Connection",
"type": "->",
"args": [
"SELECT DISTINCT \"a\".\"userid\" FROM \"oc_preferences\" \"a\" LEFT JOIN \"oc_(SELECT \"userid\" FROM \"oc_preferences\" WHERE \"configkey\" = :dcValue1)\" \"b\" ON a.userid = b.userid WHERE (\"a\".\"configkey\" = :dcValue2) AND (\"a\".\"configvalue\" <> :dcValue3) AND (\"b\".\"userid\" IS NULL)",
{
"dcValue1": "background_color",
"dcValue2": "background_image",
"dcValue3": "default"
},
{
"dcValue1": 2,
"dcValue2": 2,
"dcValue3": 2
}
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 291,
"function": "executeQuery",
"class": "OC\\DB\\ConnectionAdapter",
"type": "->",
"args": [
"SELECT DISTINCT `a`.`userid` FROM `*PREFIX*preferences` `a` LEFT JOIN `*PREFIX*(SELECT `userid` FROM `*PREFIX*preferences` WHERE `configkey` = :dcValue1)` `b` ON a.userid = b.userid WHERE (`a`.`configkey` = :dcValue2) AND (`a`.`configvalue` <> :dcValue3) AND (`b`.`userid` IS NULL)",
{
"dcValue1": "background_color",
"dcValue2": "background_image",
"dcValue3": "default"
},
{
"dcValue1": 2,
"dcValue2": 2,
"dcValue3": 2
}
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/ExtendedQueryBuilder.php",
"line": 285,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->",
"args": [
{
"__class__": "OC\\DB\\ConnectionAdapter"
}
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/Sharded/ShardedQueryBuilder.php",
"line": 361,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\ExtendedQueryBuilder",
"type": "->",
"args": [
null
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/Partitioned/PartitionedQueryBuilder.php",
"line": 424,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\Sharded\\ShardedQueryBuilder",
"type": "->",
"args": [
null
]
},
{
"file": "/var/www/html/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php",
"line": 76,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\Partitioned\\PartitionedQueryBuilder",
"type": "->",
"args": []
},
{
"file": "/var/www/html/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php",
"line": 50,
"function": "runPreparation",
"class": "OCA\\Theming\\Jobs\\RestoreBackgroundImageColor",
"type": "->",
"args": []
},
{
"file": "/var/www/html/lib/public/BackgroundJob/Job.php",
"line": 49,
"function": "run",
"class": "OCA\\Theming\\Jobs\\RestoreBackgroundImageColor",
"type": "->",
"args": [
{
"stage": "prepare"
}
]
},
{
"file": "/var/www/html/lib/public/BackgroundJob/QueuedJob.php",
"line": 30,
"function": "start",
"class": "OCP\\BackgroundJob\\Job",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
}
]
},
{
"file": "/var/www/html/cron.php",
"line": 174,
"function": "start",
"class": "OCP\\BackgroundJob\\QueuedJob",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
}
]
}
],
"File": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php",
"Line": 62,
"Previous": {
"Exception": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
"Message": "SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near \"\" FROM \"\"\nLINE 1: ...\"oc_preferences\" \"a\" LEFT JOIN \"oc_(SELECT \"userid\" FROM \"oc...\n ^",
"Code": 7,
"Trace": [
{
"file": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
"line": 132,
"function": "new",
"class": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
"type": "::",
"args": [
{
"__class__": "PDOException",
"errorInfo": [
"42601",
7,
"ERROR: syntax error at or near \"\" FROM \"\"\nLINE 1: ...\"oc_preferences\" \"a\" LEFT JOIN \"oc_(SELECT \"userid\" FROM \"oc...\n ^"
]
}
]
},
{
"file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1104,
"function": "execute",
"class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
"type": "->",
"args": []
},
{
"file": "/var/www/html/lib/private/DB/Connection.php",
"line": 420,
"function": "executeQuery",
"class": "Doctrine\\DBAL\\Connection",
"type": "->",
"args": [
"SELECT DISTINCT \"a\".\"userid\" FROM \"oc_preferences\" \"a\" LEFT JOIN \"oc_(SELECT \"userid\" FROM \"oc_preferences\" WHERE \"configkey\" = :dcValue1)\" \"b\" ON a.userid = b.userid WHERE (\"a\".\"configkey\" = ?) AND (\"a\".\"configvalue\" <> ?) AND (\"b\".\"userid\" IS NULL)",
[
"background_image",
"default"
],
[
2,
2
],
null
]
},
{
"file": "/var/www/html/lib/private/DB/ConnectionAdapter.php",
"line": 50,
"function": "executeQuery",
"class": "OC\\DB\\Connection",
"type": "->",
"args": [
"SELECT DISTINCT \"a\".\"userid\" FROM \"oc_preferences\" \"a\" LEFT JOIN \"oc_(SELECT \"userid\" FROM \"oc_preferences\" WHERE \"configkey\" = :dcValue1)\" \"b\" ON a.userid = b.userid WHERE (\"a\".\"configkey\" = :dcValue2) AND (\"a\".\"configvalue\" <> :dcValue3) AND (\"b\".\"userid\" IS NULL)",
{
"dcValue1": "background_color",
"dcValue2": "background_image",
"dcValue3": "default"
},
{
"dcValue1": 2,
"dcValue2": 2,
"dcValue3": 2
}
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 291,
"function": "executeQuery",
"class": "OC\\DB\\ConnectionAdapter",
"type": "->",
"args": [
"SELECT DISTINCT `a`.`userid` FROM `*PREFIX*preferences` `a` LEFT JOIN `*PREFIX*(SELECT `userid` FROM `*PREFIX*preferences` WHERE `configkey` = :dcValue1)` `b` ON a.userid = b.userid WHERE (`a`.`configkey` = :dcValue2) AND (`a`.`configvalue` <> :dcValue3) AND (`b`.`userid` IS NULL)",
{
"dcValue1": "background_color",
"dcValue2": "background_image",
"dcValue3": "default"
},
{
"dcValue1": 2,
"dcValue2": 2,
"dcValue3": 2
}
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/ExtendedQueryBuilder.php",
"line": 285,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->",
"args": [
{
"__class__": "OC\\DB\\ConnectionAdapter"
}
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/Sharded/ShardedQueryBuilder.php",
"line": 361,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\ExtendedQueryBuilder",
"type": "->",
"args": [
null
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/Partitioned/PartitionedQueryBuilder.php",
"line": 424,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\Sharded\\ShardedQueryBuilder",
"type": "->",
"args": [
null
]
},
{
"file": "/var/www/html/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php",
"line": 76,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\Partitioned\\PartitionedQueryBuilder",
"type": "->",
"args": []
},
{
"file": "/var/www/html/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php",
"line": 50,
"function": "runPreparation",
"class": "OCA\\Theming\\Jobs\\RestoreBackgroundImageColor",
"type": "->",
"args": []
},
{
"file": "/var/www/html/lib/public/BackgroundJob/Job.php",
"line": 49,
"function": "run",
"class": "OCA\\Theming\\Jobs\\RestoreBackgroundImageColor",
"type": "->",
"args": [
{
"stage": "prepare"
}
]
},
{
"file": "/var/www/html/lib/public/BackgroundJob/QueuedJob.php",
"line": 30,
"function": "start",
"class": "OCP\\BackgroundJob\\Job",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
}
]
},
{
"file": "/var/www/html/cron.php",
"line": 174,
"function": "start",
"class": "OCP\\BackgroundJob\\QueuedJob",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
}
]
}
],
"File": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php",
"Line": 24,
"Previous": {
"Exception": "PDOException",
"Message": "SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near \"\" FROM \"\"\nLINE 1: ...\"oc_preferences\" \"a\" LEFT JOIN \"oc_(SELECT \"userid\" FROM \"oc...\n ^",
"Code": "42601",
"Trace": [
{
"file": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
"line": 130,
"function": "execute",
"class": "PDOStatement",
"type": "->",
"args": [
null
]
},
{
"file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1104,
"function": "execute",
"class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
"type": "->",
"args": []
},
{
"file": "/var/www/html/lib/private/DB/Connection.php",
"line": 420,
"function": "executeQuery",
"class": "Doctrine\\DBAL\\Connection",
"type": "->",
"args": [
"SELECT DISTINCT \"a\".\"userid\" FROM \"oc_preferences\" \"a\" LEFT JOIN \"oc_(SELECT \"userid\" FROM \"oc_preferences\" WHERE \"configkey\" = :dcValue1)\" \"b\" ON a.userid = b.userid WHERE (\"a\".\"configkey\" = ?) AND (\"a\".\"configvalue\" <> ?) AND (\"b\".\"userid\" IS NULL)",
[
"background_image",
"default"
],
[
2,
2
],
null
]
},
{
"file": "/var/www/html/lib/private/DB/ConnectionAdapter.php",
"line": 50,
"function": "executeQuery",
"class": "OC\\DB\\Connection",
"type": "->",
"args": [
"SELECT DISTINCT \"a\".\"userid\" FROM \"oc_preferences\" \"a\" LEFT JOIN \"oc_(SELECT \"userid\" FROM \"oc_preferences\" WHERE \"configkey\" = :dcValue1)\" \"b\" ON a.userid = b.userid WHERE (\"a\".\"configkey\" = :dcValue2) AND (\"a\".\"configvalue\" <> :dcValue3) AND (\"b\".\"userid\" IS NULL)",
{
"dcValue1": "background_color",
"dcValue2": "background_image",
"dcValue3": "default"
},
{
"dcValue1": 2,
"dcValue2": 2,
"dcValue3": 2
}
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 291,
"function": "executeQuery",
"class": "OC\\DB\\ConnectionAdapter",
"type": "->",
"args": [
"SELECT DISTINCT `a`.`userid` FROM `*PREFIX*preferences` `a` LEFT JOIN `*PREFIX*(SELECT `userid` FROM `*PREFIX*preferences` WHERE `configkey` = :dcValue1)` `b` ON a.userid = b.userid WHERE (`a`.`configkey` = :dcValue2) AND (`a`.`configvalue` <> :dcValue3) AND (`b`.`userid` IS NULL)",
{
"dcValue1": "background_color",
"dcValue2": "background_image",
"dcValue3": "default"
},
{
"dcValue1": 2,
"dcValue2": 2,
"dcValue3": 2
}
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/ExtendedQueryBuilder.php",
"line": 285,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->",
"args": [
{
"__class__": "OC\\DB\\ConnectionAdapter"
}
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/Sharded/ShardedQueryBuilder.php",
"line": 361,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\ExtendedQueryBuilder",
"type": "->",
"args": [
null
]
},
{
"file": "/var/www/html/lib/private/DB/QueryBuilder/Partitioned/PartitionedQueryBuilder.php",
"line": 424,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\Sharded\\ShardedQueryBuilder",
"type": "->",
"args": [
null
]
},
{
"file": "/var/www/html/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php",
"line": 76,
"function": "executeQuery",
"class": "OC\\DB\\QueryBuilder\\Partitioned\\PartitionedQueryBuilder",
"type": "->",
"args": []
},
{
"file": "/var/www/html/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php",
"line": 50,
"function": "runPreparation",
"class": "OCA\\Theming\\Jobs\\RestoreBackgroundImageColor",
"type": "->",
"args": []
},
{
"file": "/var/www/html/lib/public/BackgroundJob/Job.php",
"line": 49,
"function": "run",
"class": "OCA\\Theming\\Jobs\\RestoreBackgroundImageColor",
"type": "->",
"args": [
{
"stage": "prepare"
}
]
},
{
"file": "/var/www/html/lib/public/BackgroundJob/QueuedJob.php",
"line": 30,
"function": "start",
"class": "OCP\\BackgroundJob\\Job",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
}
]
},
{
"file": "/var/www/html/cron.php",
"line": 174,
"function": "start",
"class": "OCP\\BackgroundJob\\QueuedJob",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
}
]
}
],
"File": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
"Line": 130
}
}
},
"message": "Error while running background job OCA\\Theming\\Jobs\\RestoreBackgroundImageColor (id: 10584862, arguments: {\"stage\":\"prepare\"})",
"exception": {
"query": "SELECT DISTINCT `a`.`userid` FROM `*PREFIX*preferences` `a` LEFT JOIN `*PREFIX*(SELECT `userid` FROM `*PREFIX*preferences` WHERE `configkey` = :dcValue1)` `b` ON a.userid = b.userid WHERE (`a`.`configkey` = :dcValue2) AND (`a`.`configvalue` <> :dcValue3) AND (`b`.`userid` IS NULL)"
},
"CustomMessage": "Error while running background job OCA\\Theming\\Jobs\\RestoreBackgroundImageColor (id: 10584862, arguments: {\"stage\":\"prepare\"})"
},
"id": "68ccf7f981523"
}
At least with postgres it errors, but looking at the query in line 29 already shows it's can't work anywhere if executed like this.
The problem seems to origin from https://github.com/nextcloud/server/blob/5981b7eb512aa411f51cad541d01c5c6e93476f0/lib/private/DB/QueryBuilder/Partitioned/PartitionedQueryBuilder.php#L207-L209 which casts the $join to a string and then query builders exceptional handling for IQueryFunctions does not work anymore:
https://github.com/nextcloud/server/blob/5ecd3c4b495f3fdd959b2e2f8569a402b5d84af0/lib/private/DB/QueryBuilder/QueryBuilder.php#L1333-L1335
2 confusing things here:
- It seems the cast was done to allow sub queries while it breaks them: https://github.com/nextcloud/server/commit/027fc052e78cb8401b3805c26a349c859ba7f275
- The change was only done for left joins, while inner, right and normal join are unchanged.
cc @icewind1991 @susnux
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/theming/lib/Jobs/RestoreBackgroundImageColor.php around lines 72-76, where runPreparation executes the query shown in the report. Inspect how the query is assembled and verify it against PostgreSQL. Done means the RestoreBackgroundImageColor background job no longer produces the reported SQL syntax error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, postgresql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100