Skip to content

refactor some cdc code - phase 1 #21656

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

Open
wants to merge 62 commits into
base: main
Choose a base branch
from

Conversation

XuPeng-SH
Copy link
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #21017

What this PR does / why we need it:

refactor some cdc code

incrConfig string,
additionalConfigStr string,
) string {
return fmt.Sprintf(
Copy link
Contributor

Choose a reason for hiding this comment

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

All these Sprintf based SQL construction are subject to SQL injection. I wonder if we can make it use param binding -- or even if not possible, values be systematically escaped here.

// compositedUriInfo uri according to the format: mysql://root:[email protected]:6001
// if valid, return true and extracted info
// !!!NOTE!!!
// user and password does not have the special character ( ':' '@' )
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this enforced somehow/somewhere? Otherwise seems to me, the only way is to encode/decode this with &XXX;
Or some better/smarter encode/decode scheme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor Code refactor size/XXL Denotes a PR that changes 2000+ lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants