-
Notifications
You must be signed in to change notification settings - Fork 131
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
*: make drainer translator's SQL_MODE configurable #511
Conversation
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
/run-all-tests |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- when the downstream is mysql, we need to set sql_mode in
drainer/executor/mysql.go
too, or will fail to execute at the downstream mysql or tidb? - this means later we must support set sql_mode for
reparo
too, but it's ok to just do the drainer part now at this pr.
/run-all-tests |
pkg/sql/sql.go
Outdated
dbDSN := fmt.Sprintf("%s:%s@tcp(%s:%d)/?charset=utf8mb4,utf8&multiStatements=true", username, password, host, port) | ||
if len(sqlMode) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's not possible to set an empty SQL mode (which is different from the "default SQL mode" which includes STRICT_TRANS_TABLE and stuff)?
except adding some new arguments into functions, LGTM. I think we can put sql mode into |
if downstream is MySQL, put it into DBConfig is fine, but if the downstream is pb, we still need another config item to hold it, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
What problem does this PR solve?
relate issue:https://internal.pingcap.net/jira/browse/TOOL-1039
Drainer translator should keep SQL_MODE compatible with upstream.
What is changed and how it works?
Add a config item
sql-mode
to make SQL_MODE configurable.Check List
Tests
Code changes
Side effects
N/A
Related changes