diff options
author | provokateurin <kate@provokateurin.de> | 2024-09-26 08:57:06 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-09-26 13:14:35 +0000 |
commit | 72cdf08455b59d5126785155dea5e3d83713c67f (patch) | |
tree | 71330eba589567a3e20ed2a9e36ba7b6b80c2af9 | |
parent | 56a734b47f974f7ce078853122ddc2f911b23dbe (diff) | |
download | nextcloud-server-backport/48361/stable29.tar.gz nextcloud-server-backport/48361/stable29.zip |
fix(QueryBuilder): Restrict identifier length to 30 characters due to Oracle limitationsbackport/48361/stable29
Signed-off-by: provokateurin <kate@provokateurin.de>
-rw-r--r-- | lib/private/DB/QueryBuilder/QueryBuilder.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index d78cf50e319..baf1b0fd341 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -249,6 +249,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) { |