Skip to content

migrater: handle tables based on the vschema info#5315

Merged
sougou merged 3 commits intovitessio:masterfrom
planetscale:ss-vrepl-handle-ref
Oct 19, 2019
Merged

migrater: handle tables based on the vschema info#5315
sougou merged 3 commits intovitessio:masterfrom
planetscale:ss-vrepl-handle-ref

Conversation

@sougou
Copy link
Contributor

@sougou sougou commented Oct 16, 2019

The previous method of identifying reference tables was not completely reliable: it used the absence of a keyrange constraint in the filtering rules. However, this may not be the case if a target keyspace is being converted from unsharded to sharded.

The new way to identify reference tables is by looking at the vschema. This is a more unambiguous way of identifying such tables.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
@sougou sougou requested a review from deepthi October 16, 2019 22:54
Copy link
Collaborator

@deepthi deepthi left a comment

Choose a reason for hiding this comment

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

LGTM

Exprs: sqlparser.SelectExprs{
&sqlparser.AliasedExpr{Expr: &sqlparser.ColName{Name: vtable.ColumnVindexes[0].Columns[0]}},
&sqlparser.AliasedExpr{Expr: sqlparser.NewStrVal([]byte(vtable.ColumnVindexes[0].Type))},
&sqlparser.AliasedExpr{Expr: sqlparser.NewStrVal([]byte("{{.}}"))},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add some comments about the use of {{.}}?

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
@sougou sougou merged commit 590a06f into vitessio:master Oct 19, 2019
@sougou sougou deleted the ss-vrepl-handle-ref branch October 19, 2019 21:05
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