From 3399854b66bb1fb175b8504c964008e53167ca7b Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 23 Sep 2023 17:23:36 +0200 Subject: [PATCH] tdf#157260: don't add a "port" param if already present in the connection DB url Regression of https://cgit.freedesktop.org/libreoffice/core/commit/?id=afe99617707c92460e66486c0057ef327e8aa017 "tdf#43369: Specific UI for collecting PostgreSQL connection settings" in 2023-04 Change-Id: Id6e9c9a1aa8586cb4081e22988060476183369d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157193 Reviewed-by: Julien Nabet Tested-by: Jenkins --- dbaccess/source/ui/dlg/DbAdminImpl.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 88f95d9832db..94cdee5a9f05 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -539,7 +539,8 @@ OUString ODbDataSourceAdministrationHelper::getConnectionURL() const hostname = "'" + hostname + "'"; rURL += " host=" + hostname; } - if (pPortNumber && pPortNumber->GetValue()) + // tdf#157260: if port is already in the URL, don't add another one + if (pPortNumber && pPortNumber->GetValue() && (rURL.indexOf("port=") == -1)) { OUString port = "'" + OUString::number(pPortNumber->GetValue()) + "'"; rURL += " port=" + port;