Skip to content

Commit

Permalink
fix(QueryBuilder): Restrict identifier length to 30 characters due to…
Browse files Browse the repository at this point in the history
… Oracle limitations

Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin authored and backportbot[bot] committed Sep 26, 2024
1 parent 56a734b commit 72cdf08
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/private/DB/QueryBuilder/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,23 @@ public function execute() {
}
}

$tooLongOutputColumns = [];
foreach ($this->getOutputColumns() as $column) {

Check failure

Code scanning / Psalm

UndefinedMethod Error

Method OC\DB\QueryBuilder\QueryBuilder::getOutputColumns does not exist

Check failure on line 253 in lib/private/DB/QueryBuilder/QueryBuilder.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

UndefinedMethod

lib/private/DB/QueryBuilder/QueryBuilder.php:253:19: UndefinedMethod: Method OC\DB\QueryBuilder\QueryBuilder::getOutputColumns does not exist (see https://psalm.dev/022)
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) {
Expand Down

0 comments on commit 72cdf08

Please sign in to comment.