Skip to content

Conversation

@robotism
Copy link
Contributor

@robotism robotism commented Dec 18, 2024


tidb cloud link is like

tidb:2hcmRccccxxx9Fizz.root:wP3xxxxPIDc@tcp(xxxx.tidbcloud.com:4000)/db_name?tls=true

username has a dot 2hcmRccccxxx9Fizz.root

so need update the pattern to (\w+):([^:]*):(.*?)@(\w+?)\((.+?)\)/{0,1}([^\?]*)\?{0,1}(.*)


the origin pattern is
linkPattern = (\w+):([\w\-\$]*):(.*?)@(\w+?)\((.+?)\)/{0,1}([^\?]*)\?{0,1}(.*)
it is uncompitable with tidb cloud link;

of cause, i can use

- type: "tidb"
  host: "xxxxx
  port: "4000"
  user: "2hcmRccccxxx9Fizz.root"
  pass: "wP3xxxxPIDc"
  name: "db_name"

to instead of the link parameter, it works;

ctxKeyInternalProducedSQL gctx.StrKey = `CtxKeyInternalProducedSQL`

linkPattern = `(\w+):([\w\-\$]*):(.*?)@(\w+?)\((.+?)\)/{0,1}([^\?]*)\?{0,1}(.*)`
linkPattern = `(\w+):([^:]*):(.*?)@(\w+?)\((.+?)\)/{0,1}([^\?]*)\?{0,1}(.*)`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i open a new pr #4064

@gqcn gqcn changed the title fix(database/gdb): fixed linkPattern compitable with tidbcloud fix(database/gdb): fixed regular expression pattern to be compitable with tidbcloud Dec 18, 2024
@gqcn gqcn changed the title fix(database/gdb): fixed regular expression pattern to be compitable with tidbcloud fix(database/gdb): fix regular expression pattern for link configuration to be compitable with tidbcloud Dec 18, 2024
@gqcn gqcn changed the title fix(database/gdb): fix regular expression pattern for link configuration to be compitable with tidbcloud fix(database/gdb): regular expression pattern for link configuration to be compitable with tidbcloud Dec 18, 2024
@robotism robotism closed this Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants