From 95a2489c108c204fd4eb78498007bc62f7c1b2a4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 23 Sep 2026 11:39:26 +0200 Subject: [PATCH] Resolver: Hash alias using xxh3 if it's longer than 63chars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This nowhere near final. There are still open questions: - Is a counter going up feasible as well? (r1, r2, …) - Is there a way to establish an adapter dependent limit? The reason this came up at all, was a rare case with Icinga Dependencies Web when using the map's group by function. But this may also be fixed by using custom aliases, so… --- src/Resolver.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Resolver.php b/src/Resolver.php index 17c492a..ac0fef7 100644 --- a/src/Resolver.php +++ b/src/Resolver.php @@ -208,7 +208,13 @@ public function getAlias(Model $model): string )); } - return $this->aliasPrefix . $this->aliases[$model]; + $alias = ($this->aliasPrefix ?? '') . $this->aliases[$model]; + + if (strlen($alias) > 63) { + $alias = $this->query->getDb()->getAdapter()->quoteIdentifier('x' . hash('xxh3', $alias)); + } + + return $alias; } /**