Skip to content
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

Merged
merged 4 commits into from
Jul 5, 2016
Merged

ddl: improve ddl test #1387

merged 4 commits into from
Jul 5, 2016

Conversation

coocood
Copy link
Member

@coocood coocood commented Jul 4, 2016

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.

@coocood
Copy link
Member Author

coocood commented Jul 4, 2016

@shenli @zimulala PTAL


func (s *testColumnChangeSuite) SetUpSuite(c *C) {
s.store = testCreateStore(c, "test_column_change")
log.Errorf("test column change store %s", s.store.UUID())
Copy link
Member

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?

Copy link
Member Author

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{} {
Copy link
Member

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.

Copy link
Member Author

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.

@shenli
Copy link
Member

shenli commented Jul 4, 2016

LGTM

}
err := kv.RunInNewTxn(s.store, true, func(txn kv.Transaction) error {
t := meta.NewMeta(txn)
err1 := errors.Trace(t.CreateDatabase(s.dbInfo))
Copy link
Contributor

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?

@zimulala
Copy link
Contributor

zimulala commented Jul 5, 2016

LGTM

@coocood coocood merged commit 5408833 into master Jul 5, 2016
@coocood coocood deleted the coocood/improve-ddl-test branch July 5, 2016 03:21
3pointer added a commit to 3pointer/tidb that referenced this pull request Aug 6, 2021
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
3pointer added a commit to 3pointer/tidb that referenced this pull request Aug 6, 2021
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
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.

3 participants