MSSQL: Change regex to validate Provider connection string (#40248)

* Change the regex to allow to specified other connection attribute for MSSQL connection like ApplicationIntent property

* Docs update

* docs update

* some tests added

* formatting

* Change the regex to allow to specified other connection attribute for MSSQL connection like ApplicationIntent property

* Docs update

* docs update

* some tests added

* formatting

* docs and formatting

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
This commit is contained in:
Ivan Anselmi
2021-11-30 09:28:48 +01:00
committed by GitHub
co-authored by Zoltán Bedi
parent ce0cf331e0
commit cf3105e5be
3 changed files with 94 additions and 14 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ func ParseURL(u string) (*url.URL, error) {
logger.Debug("Parsing MSSQL URL", "url", u)
// Recognize ODBC connection strings like host\instance:1234
reODBC := regexp.MustCompile(`^[^\\:]+(?:\\[^:]+)?(?::\d+)?$`)
reODBC := regexp.MustCompile(`^[^\\:]+(?:\\[^:]+)?(?::\d+)?(?:;.+)?$`)
var host string
switch {
case reODBC.MatchString(u):