-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
ddl: improve ddl test #1387
ddl: improve ddl test #1387
Conversation
|
||
func (s *testColumnChangeSuite) SetUpSuite(c *C) { | ||
s.store = testCreateStore(c, "test_column_change") | ||
log.Errorf("test column change store %s", s.store.UUID()) |
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.
Why use error for this?
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'll remove it.
|
||
// RowsWithSep is a convenient function to wrap args to a slice of []interface. | ||
// The arg represents a row, split by sep. | ||
func RowsWithSep(sep string, args ...string) [][]interface{} { |
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.
This is a function with the same name and the same behavior in util/testkit/testkit.go.
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 move this from testkit to testutil to avoid dependency cycle.
LGTM |
} | ||
err := kv.RunInNewTxn(s.store, true, func(txn kv.Transaction) error { | ||
t := meta.NewMeta(txn) | ||
err1 := errors.Trace(t.CreateDatabase(s.dbInfo)) |
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.
Why not return the error directly?
LGTM |
1b0e54c2f lightning: check and restore pd scheduler even if our task failed (pingcap#1336) 073d3596c lightning: fix the bug that calculate unfinished ranges may miss some range (pingcap#1413) 82ff927df backup: refine backup log for tracing backup tasks (pingcap#1335) e907562e8 lightning: make create table ddl compatible with clustered index (pingcap#1364) b6cab4b27 lightning: auto configure for parallel import (pingcap#1387) git-subtree-dir: br git-subtree-split: 1b0e54c2f2dca87bd0ad46201cbf27121e681b62
3b1308e89 lightning: evaluate all generated columns even if they are virtual (pingcap#1407) 1b0e54c2f lightning: check and restore pd scheduler even if our task failed (pingcap#1336) 073d3596c lightning: fix the bug that calculate unfinished ranges may miss some range (pingcap#1413) 82ff927df backup: refine backup log for tracing backup tasks (pingcap#1335) e907562e8 lightning: make create table ddl compatible with clustered index (pingcap#1364) b6cab4b27 lightning: auto configure for parallel import (pingcap#1387) git-subtree-dir: br git-subtree-split: 3b1308e89de39325c3f0aa8931aebdf56db663f2
Added
column_change_test.go
which can operate schemas in different state at a given time to verify correctness.Set lease to a much smaller time so
skip_ddl
flag can be removed.Following PR will add better index change test in the same way.