Skip to content

*: support the statement of "rename database" #2

Merged
bb7133 merged 2 commits intobb7133:4.0-itaifrom
zimulala:rename-db-4.0
Apr 29, 2020
Merged

*: support the statement of "rename database" #2
bb7133 merged 2 commits intobb7133:4.0-itaifrom
zimulala:rename-db-4.0

Conversation

@zimulala
Copy link

What problem does this PR solve?

Support the statement of "rename database".
RENAME {DATABASE | SCHEMA} db_name TO new_db_name;
The related MySQL docs.

What is changed and how it works?

Support the syntax of "rename database".

Check List

Tests

  • Unit test

Code changes

  • Has interface methods change

Copy link

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

Rest LGTM

type RenameDatabaseStmt struct {
ddlNode

OldDB string

Choose a reason for hiding this comment

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

s/string/CIStr

Copy link
Author

Choose a reason for hiding this comment

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

Why do we need to do this?

Choose a reason for hiding this comment

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

@zimulala If not do this, we need convert it to CIStr when use this field in TiDB, e.g.
model.NewCIstr(renameDatabaseStmt.OldDB).
If change to CIStr here, we can use it directly in TiDB.

Copy link
Author

Choose a reason for hiding this comment

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

I think it's OK. "create database" and "drop database" all use string.

@AilinKid
Copy link

Rest LGTM

LGTM

@zimulala
Copy link
Author

PTAL @djshow832

Copy link

@Deardrops Deardrops left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

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

LGTM

@bb7133 bb7133 merged commit 4494e5f into bb7133:4.0-itai Apr 29, 2020
@zimulala zimulala deleted the rename-db-4.0 branch April 29, 2020 03:53
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.

5 participants