-
Notifications
You must be signed in to change notification settings - Fork 188
*: support generated column in loader and binlog replication #42
Conversation
/run-all-tests |
/run-all-tests |
PTAL @GregoryIan @csuzhangxc |
/run-all-tests |
3 similar comments
/run-all-tests |
/run-all-tests |
/run-all-tests |
deal with the ci coverage decline @amyangfei |
/run-all-tests |
I find the instability of coverage rate relates to some cleanup staff, for example we can compare difference between https://coveralls.io/builds/21662660/source?filename=syncer/db.go#L280 and https://coveralls.io/builds/21662523/source?filename=syncer/db.go#L280 . |
/run-all-tests |
2 similar comments
/run-all-tests |
/run-all-tests |
loader/convert_data_test.go
Outdated
}, | ||
} | ||
|
||
for i, r := range rules { |
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.
rules
only contains one rule,but expected
contains two case
insert into t1 (uid, name, info) values (10005, 'Buenos Aires', '{"age": 100}'); | ||
insert into t2 (uid, name, info) values (20007, 'Buenos Aires', '{"age": 200}'); | ||
alter table t1 add key multi_col_idx(uid, id_gen); | ||
alter table t2 add key multi_col_idx(uid, id_gen); |
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.
Can it work if no primary key, but only multi_col_idx including generated column?
/run-all-tests |
1 similar comment
/run-all-tests |
PTAL @GregoryIan @csuzhangxc |
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 |
3 similar comments
/run-all-tests |
/run-all-tests |
/run-all-tests |
@@ -456,3 +459,7 @@ func getBinaryLogs(db *sql.DB) ([]binlogSize, error) { | |||
} | |||
return files, nil | |||
} | |||
|
|||
func (c *column) isGeneratedColumn() bool { | |||
return strings.Contains(c.extra, "VIRTUAL GENERATED") || strings.Contains(c.extra, "STORED GENERATED") |
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.
must extra
be uppercase? should we use == strings.TrimSpace(xxx)
rather than strings.Contains
?
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.
according to MySQL doc, VIRTUAL GENERATED
and STORED GENERATED
in Extra
field are always uppercase
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.
strings.Contains
is used because there may exist other data in Extra
?
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'm afraid some comment options are in it
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.
https://dev.mysql.com/doc/refman/5.7/en/show-columns.html
In MySQL doc, there are only four Extra fields: auto_increment
, on update CURRENT_TIMESTAMP
, VIRTUAL GENERATED
or VIRTUAL STORED
Rest LGTM |
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.
LGTM
What problem does this PR solve?
support synchronization data with generated column
What is changed and how it works?
Check List
Tests
need to upgrade test MySQL to 5.7
Side effects
Related changes