Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

use restore feature to refine codes releated ddl #54

Merged
merged 23 commits into from
Mar 8, 2019
Merged

use restore feature to refine codes releated ddl #54

merged 23 commits into from
Mar 8, 2019

Conversation

IANTHEREAL
Copy link
Collaborator

What problem does this PR solve?

use restore feature to refine codes releated ddl

What is changed and how it works?

use restore feature to implement rename and split ddl

Check List

Tests

  • Unit test

@IANTHEREAL IANTHEREAL added status/WIP This PR is still work in progress type/enhancement Performance improvement or refactoring labels Feb 20, 2019
@IANTHEREAL
Copy link
Collaborator Author

/run-all-tests

@IANTHEREAL
Copy link
Collaborator Author

/run-all-tests

@IANTHEREAL IANTHEREAL added status/PTAL This PR is ready for review. Add this label back after committing new changes and removed status/WIP This PR is still work in progress labels Feb 21, 2019
@csuzhangxc
Copy link
Member

@GregoryIan resolve the conflict.

@IANTHEREAL
Copy link
Collaborator Author

I would do it after #50 merged

@IANTHEREAL
Copy link
Collaborator Author

@csuzhangxc @amyangfei PTAL

c.Assert(err, IsNil)

c.Assert(len(sqls), Equals, 1)
getSQL := sqls[0]
c.Assert(getSQL, Equals, tc.expected)

ast2, err := parser.ParseOneStmt(getSQL, "", "")
c.Assert(err, IsNil)
// FIXME: remove me after implement generated function in restore
Copy link
Contributor

Choose a reason for hiding this comment

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

latest parser has fixed this bug, we can remove these comments now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's useless, because of some very tricky code, I decide remove these code

test.go Outdated
@@ -0,0 +1,119 @@
package main
Copy link
Contributor

Choose a reason for hiding this comment

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

is this file used for testing only, can remove now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep

@@ -128,7 +110,7 @@ func (s *Syncer) skipQuery(tables []*filter.Table, stmt ast.StmtNode, sql string

if len(tables) > 0 {
tbs := s.bwList.ApplyOn(tables)
if len(tbs) == 0 {
if len(tbs) != len(tables) {
Copy link
Contributor

@amyangfei amyangfei Mar 1, 2019

Choose a reason for hiding this comment

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

suppose we rename a table from name old to name new, table old is in do-tables and new is new ignore-tables.
should we filter this rename DDL?

Copy link
Collaborator Author

@IANTHEREAL IANTHEREAL Mar 4, 2019

Choose a reason for hiding this comment

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

yep, it's a open problem, we can ignore it or throw an error, it depends its definition

Copy link
Contributor

@amyangfei amyangfei left a comment

Choose a reason for hiding this comment

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

LGTM

@amyangfei amyangfei added status/LGT1 One reviewer already commented LGTM and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Mar 4, 2019
@IANTHEREAL
Copy link
Collaborator Author

@csuzhangxc @july2993 PTAL

pkg/parser/common.go Outdated Show resolved Hide resolved
pkg/parser/common.go Outdated Show resolved Hide resolved
pkg/parser/common.go Outdated Show resolved Hide resolved
pkg/parser/common.go Outdated Show resolved Hide resolved
pkg/parser/common.go Show resolved Hide resolved
pkg/parser/common.go Show resolved Hide resolved
pkg/parser/common.go Outdated Show resolved Hide resolved
Copy link
Member

@csuzhangxc csuzhangxc left a comment

Choose a reason for hiding this comment

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

LGTM

@csuzhangxc csuzhangxc added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels Mar 7, 2019
@IANTHEREAL IANTHEREAL merged commit d244a29 into pingcap:master Mar 8, 2019
@IANTHEREAL IANTHEREAL deleted the ian/refine-ddl branch March 8, 2019 07:21
lichunzhu pushed a commit to lichunzhu/dm that referenced this pull request Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/LGT2 Two reviewers already commented LGTM, ready for merge type/enhancement Performance improvement or refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants