Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
sijms committed Feb 14, 2024
2 parents 6df85f4 + 5b9b7c7 commit b1de80a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions v2/connection_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"os"
"os/user"
"path"
"path/filepath"
"runtime"
"strconv"
"strings"
Expand Down Expand Up @@ -633,6 +634,8 @@ func newConnectionStringFromUrl(databaseUrl string) (*ConnectionString, error) {
if err != nil {
return nil, err
}
case "PROGRAM":
ret.connOption.ClientInfo.ProgramName = val[0]
default:
return nil, fmt.Errorf("unknown URL option: %s", key)
//else if tempVal == "IMPLICIT" || tempVal == "AUTO" {
Expand Down Expand Up @@ -828,13 +831,11 @@ func (connStr *ConnectionString) validate() error {
}
}
connStr.connOption.HostName, _ = os.Hostname()
idx = strings.LastIndex(os.Args[0], "/")
idx++
if idx < 0 {
idx = 0
}

connStr.connOption.ProgramPath = os.Args[0]
connStr.connOption.ProgramName = os.Args[0][idx:]
if connStr.connOption.ProgramName == "" {
connStr.connOption.ProgramName = filepath.Base(os.Args[0])
}
connStr.connOption.DriverName = "OracleClientGo"
connStr.connOption.PID = os.Getpid()
return nil
Expand Down

0 comments on commit b1de80a

Please sign in to comment.