Merge pull request #48361 from nextcloud/fix/querybuilder/oracle-indentifier-length

fix(QueryBuilder): Restrict identifier length to 30 characters due to Oracle limitations
This commit is contained in:
Joas Schilling 2024-09-26 15:11:46 +02:00 committed by GitHub
commit 771f67f108
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {