aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-09-26 08:57:06 +0200
committerprovokateurin <kate@provokateurin.de>2024-09-26 08:57:06 +0200
commit35dfc639b34d3b4296860eb6ee1e36a995bf2d2c (patch)
tree757a47c8f17062f8bd43244f2699b91851cbddbe /lib
parent9a220989dd1cd3a5792b8fc385ee1d7b1bcc7fb8 (diff)
downloadnextcloud-server-35dfc639b34d3b4296860eb6ee1e36a995bf2d2c.tar.gz
nextcloud-server-35dfc639b34d3b4296860eb6ee1e36a995bf2d2c.zip
fix(QueryBuilder): Restrict identifier length to 30 characters due to Oracle limitationsfix/querybuilder/oracle-indentifier-length
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/DB/QueryBuilder/QueryBuilder.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php
index 3ee41773330..b42b380e3d0 100644
--- a/lib/private/DB/QueryBuilder/QueryBuilder.php
+++ b/lib/private/DB/QueryBuilder/QueryBuilder.php
@@ -206,6 +206,23 @@ class QueryBuilder implements IQueryBuilder {
// }
// }
+ $tooLongOutputColumns = [];
+ foreach ($this->getOutputColumns() as $column) {
+ if (strlen($column) > 30) {
+ $tooLongOutputColumns[] = $column;
+ }
+ }
+
+ if (!empty($tooLongOutputColumns)) {
+ $exception = new QueryException('More than 30 characters for an output column name are not allowed on Oracle.');
+ $this->logger->error($exception->getMessage(), [
+ 'query' => $this->getSQL(),
+ 'columns' => $tooLongOutputColumns,
+ 'app' => 'core',
+ 'exception' => $exception,
+ ]);
+ }
+
$numberOfParameters = 0;
$hasTooLargeArrayParameter = false;
foreach ($this->getParameters() as $parameter) {