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

*: fix "create or replace view" infoschema is inconsistent (#14832) #14867

Merged
merged 2 commits into from
Feb 20, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Feb 20, 2020

cherry-pick #14832 to release-3.0


What problem does this PR solve?

create table t(a int, b int);
create view v as select * from t;
create or replace view v  as select * from t2;
create table t1(a int, b int, c int);
create or replace view v  as select * from t1;
select count(*) from information_schema.views where table_name ='v';

Before this PR

+---------------+--------------+------------+-------------------------------------------------------------------------+--------------+--------------+----------------+---------------+----------------------+----------------------+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | VIEW_DEFINITION                                                         | CHECK_OPTION | IS_UPDATABLE | DEFINER        | SECURITY_TYPE | CHARACTER_SET_CLIENT | COLLATION_CONNECTION |
+---------------+--------------+------------+-------------------------------------------------------------------------+--------------+--------------+----------------+---------------+----------------------+----------------------+
| def           | test         | v          | SELECT `test`.`t`.`a`,`test`.`t`.`b` FROM `test`.`t`                    | CASCADED     | NO           | root@127.0.0.1 | DEFINER       | utf8                 | utf8_general_ci      |
| def           | test         | v          | SELECT `test`.`t1`.`a`,`test`.`t1`.`b`,`test`.`t1`.`c` FROM `test`.`t1` | CASCADED     | NO           | root@127.0.0.1 | DEFINER       | utf8                 | utf8_general_ci      |
+---------------+--------------+------------+-------------------------------------------------------------------------+--------------+--------------+----------------+---------------+----------------------+----------------------+

After this PR

+---------------+--------------+------------+-------------------------------------------------------------------------+--------------+--------------+----------------+---------------+----------------------+----------------------+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | VIEW_DEFINITION                                                         | CHECK_OPTION | IS_UPDATABLE | DEFINER        | SECURITY_TYPE | CHARACTER_SET_CLIENT | COLLATION_CONNECTION |
+---------------+--------------+------------+-------------------------------------------------------------------------+--------------+--------------+----------------+---------------+----------------------+----------------------+
| def           | test         | v          | SELECT `test`.`t1`.`a`,`test`.`t1`.`b`,`test`.`t1`.`c` FROM `test`.`t1` | CASCADED     | NO           | root@127.0.0.1 | DEFINER       | utf8                 | utf8_general_ci      |
+---------------+--------------+------------+-------------------------------------------------------------------------+--------------+--------------+----------------+---------------+----------------------+----------------------+

What is changed and how it works?

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Fix "create or replace view" infoschema is inconsistent.

@sre-bot
Copy link
Contributor Author

sre-bot commented Feb 20, 2020

/run-all-tests

Copy link
Contributor

@XuHuaiyu XuHuaiyu 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
Contributor

@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.

LGTM

@zimulala zimulala added the status/can-merge Indicates a PR has been approved by a committer. label Feb 20, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Feb 20, 2020

/run-all-tests

@sre-bot sre-bot merged commit 013c453 into pingcap:release-3.0 Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants