Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(database/gdb): regular expression pattern for link configuration to be compitable with tidbcloud #4059

Closed
wants to merge 0 commits into from

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;

@@ -708,7 +708,7 @@ const (
ctxKeyCatchSQL gctx.StrKey = `CtxKeyCatchSQL`
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