mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
fix: gdb unsupport aliyun hologres link (#3150)
This commit is contained in:
@ -378,7 +378,7 @@ const (
|
||||
ctxKeyInternalProducedSQL gctx.StrKey = `CtxKeyInternalProducedSQL`
|
||||
|
||||
// type:[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...¶mN=valueN]
|
||||
linkPattern = `(\w+):([\w\-]*):(.*?)@(\w+?)\((.+?)\)/{0,1}([^\?]*)\?{0,1}(.*)`
|
||||
linkPattern = `(\w+):([\w\-\$]*):(.*?)@(\w+?)\((.+?)\)/{0,1}([^\?]*)\?{0,1}(.*)`
|
||||
)
|
||||
|
||||
type queryType int
|
||||
|
||||
@ -222,6 +222,22 @@ func Test_parseConfigNodeLink_WithType(t *testing.T) {
|
||||
t.Assert(newNode.Charset, defaultCharset)
|
||||
t.Assert(newNode.Protocol, `file`)
|
||||
})
|
||||
// #3146
|
||||
gtest.C(t, func(t *gtest.T) {
|
||||
node := &ConfigNode{
|
||||
Link: `pgsql:BASIC$xxxx:123456@tcp(xxxx.hologres.aliyuncs.com:80)/xxx`,
|
||||
}
|
||||
newNode := parseConfigNodeLink(node)
|
||||
t.Assert(newNode.Type, `pgsql`)
|
||||
t.Assert(newNode.User, `BASIC$xxxx`)
|
||||
t.Assert(newNode.Pass, `123456`)
|
||||
t.Assert(newNode.Host, `xxxx.hologres.aliyuncs.com`)
|
||||
t.Assert(newNode.Port, `80`)
|
||||
t.Assert(newNode.Name, `xxx`)
|
||||
t.Assert(newNode.Extra, ``)
|
||||
t.Assert(newNode.Charset, defaultCharset)
|
||||
t.Assert(newNode.Protocol, `tcp`)
|
||||
})
|
||||
}
|
||||
|
||||
func Test_Func_doQuoteWord(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user