-
Notifications
You must be signed in to change notification settings - Fork 188
Conversation
@@ -612,18 +614,17 @@ func (s *Syncer) getTable(origSchema, origTable, renamedSchema, renamedTable str | |||
func (s *Syncer) trackTableInfoFromDownstream(origSchema, origTable, renamedSchema, renamedTable string) error { | |||
// TODO: Switch to use the HTTP interface to retrieve the TableInfo directly |
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.
going to fix this TODO in another PR (though fix this TODO will make GetParserForConn
unued, we might left GetParserForConn
there in case of future using)
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.
Now, we have TLS support, if switching to HTTP API, do we need to handle it, right?
/run-all-tests |
This comment has been minimized.
This comment has been minimized.
pkg/utils/db.go
Outdated
// GetSQLMode returns sql_mode. | ||
func GetSQLMode(db *sql.DB) (tmysql.SQLMode, error) { | ||
// GetParser gets a parser for sql.DB which maybe enabled `ANSI_QUOTES` sql_mode | ||
func GetParser(db *sql.DB) (*parser.Parser, error) { | ||
sqlMode, err := GetGlobalVariable(db, "sql_mode") |
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.
Session here ditto or use func of tidb-tools.
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.
changed in 104f5df
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.
Have not change?
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.
want to explain that (*UpStreamConn).getParser
will use GetParserForConn
, which further uses session variables so could reflect variables set though DSN. And (*UpStreamConn).getParser
is used in most unit, in fact GetParser
is only used in relay unit and tests 😿
will change it later
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.
dumpling's |
pkg/binlog/reader/util.go
Outdated
ansiQuotes = false | ||
} | ||
if ansiQuotes { | ||
parser2.SetSQLMode(tmysql.ModeANSIQuotes) |
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.
I may as well parse all available SQL mode and set here 😂
will check "Full List of SQL Modes" in https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html tomorrow
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 except #889 (comment)
db, err := sql.Open("mysql", m.dumpConfig.GetDSN("")) | ||
if err != nil { | ||
return | ||
} | ||
defer db.Close() | ||
enable, err := utils.HasAnsiQuotesMode(db) | ||
|
||
sqlMode, err := utils.GetGlobalVariable(db, "sql_mode") |
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.
Session here?
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.
dumpling didn't expose it's connection, so in fact we can't see its session variable. and by GetDSN
and config, we can change its session variable different than global ones
waiting pingcap/parser#1008 |
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
PTAL @GMHDBJD |
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
cherry pick to release-2.0 failed |
What problem does this PR solve?
close #878
What is changed and how it works?
still need user specified ANSI_QUOTES:
dump unit, will check if DM could handle thisdependency of tidb-tools, could remove after check, diff: auto discover ansi-quotes tidb-tools#381Check List
Tests
Code changes
Side effects
Related changes