-
Notifications
You must be signed in to change notification settings - Fork 801
fix table change (#136 #217) #237
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
Conversation
func (r *River) updateRule(schema, table string) error { | ||
rule, ok := r.rules[ruleKey(schema, table)] | ||
if !ok { | ||
return ErrRuleNotExist |
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.
seem no need to care No Rule error.
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.
yes, it's unnecessary now, but I think that update something should return error when entity not found. so I add this.
I compare both PRs and find that this can pass Go lint, so I will merge this if possible. |
can you add a test for this? |
river/river_test.go
Outdated
testWaitSyncDone(c, s.r) | ||
|
||
r = s.testElasticGet(c, "1000") | ||
c.Assert(r.Found, Equals, true) |
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.
use IsTrue instead of Equals true
river/river_test.go
Outdated
r = s.testElasticGet(c, "1001") | ||
c.Assert(r.Found, Equals, true) | ||
_, ok := r.Source["new"] | ||
c.Assert(ok, Equals, false) |
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.
use IsFalse
I can only add test cases for "ALTER TABLE". make no sense:
cause error and make program exit:
and we can't alter table when program is running mysqldump. because length of table columns will not match with length of data. |
thanks @yaoguais This doesn't cover all cases, we should improve DDL one by one. |
No description provided.