Skip to content

Conversation

yaoguais
Copy link
Contributor

@yaoguais yaoguais commented Apr 4, 2018

No description provided.

@siddontang
Copy link
Collaborator

Hi @yaoguais

Seem this PR does the same thing with #236

func (r *River) updateRule(schema, table string) error {
rule, ok := r.rules[ruleKey(schema, table)]
if !ok {
return ErrRuleNotExist
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@yaoguais yaoguais closed this Apr 4, 2018
@siddontang
Copy link
Collaborator

siddontang commented Apr 4, 2018

@yaoguais

I compare both PRs and find that this can pass Go lint, so I will merge this if possible.

@siddontang siddontang reopened this Apr 4, 2018
@siddontang
Copy link
Collaborator

can you add a test for this?

testWaitSyncDone(c, s.r)

r = s.testElasticGet(c, "1000")
c.Assert(r.Found, Equals, true)
Copy link
Collaborator

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

r = s.testElasticGet(c, "1001")
c.Assert(r.Found, Equals, true)
_, ok := r.Source["new"]
c.Assert(ok, Equals, false)
Copy link
Collaborator

Choose a reason for hiding this comment

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

use IsFalse

@yaoguais
Copy link
Contributor Author

yaoguais commented Apr 4, 2018

I can only add test cases for "ALTER TABLE".

make no sense:

  • CREATE TABLE

cause error and make program exit:

  • RENAME TABLE
  • DROP TABLE

and we can't alter table when program is running mysqldump. because length of table columns will not match with length of data.

@siddontang
Copy link
Collaborator

thanks @yaoguais

This doesn't cover all cases, we should improve DDL one by one.

@siddontang siddontang merged commit 9ecc109 into go-mysql-org:master Apr 4, 2018
@yaoguais yaoguais deleted the fix-table-change branch April 4, 2018 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants