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

infoschema: Fix is.schemata to show correct charset/collation #7751

Merged
merged 1 commit into from
Sep 20, 2018
Merged

infoschema: Fix is.schemata to show correct charset/collation #7751

merged 1 commit into from
Sep 20, 2018

Conversation

morgo
Copy link
Contributor

@morgo morgo commented Sep 20, 2018

What problem does this PR solve?

Fixes #7748

What is changed and how it works?

Prior to this fix, is.schemata used the global default charset, rather than the db specific default.

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)

Code changes

  • Has exported function/method change

Side effects

Unlikely

Related changes

None

@morgo
Copy link
Contributor Author

morgo commented Sep 20, 2018

/run-all-tests

@morgo morgo changed the title Fix is.schemata to show correct charset/collation infoschema: Fix is.schemata to show correct charset/collation Sep 20, 2018
Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

mysql.DefaultCollationName, // DEFAULT_COLLATION_NAME
catalogVal, // CATALOG_NAME
schema.Name.O, // SCHEMA_NAME
charset, // DEFAULT_CHARACTER_SET_NAME
Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to update the comment to remove the DEFAULT prefix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I understand, the comment refers to the structure of is.schemata. It remains correct with this patch:

mysql> SHOW CREATE TABLE schemata\G
*************************** 1. row ***************************
       Table: SCHEMATA
Create Table: CREATE TABLE `SCHEMATA` (
  `CATALOG_NAME` varchar(512) DEFAULT NULL,
  `SCHEMA_NAME` varchar(64) DEFAULT NULL,
  `DEFAULT_CHARACTER_SET_NAME` varchar(64) DEFAULT NULL,
  `DEFAULT_COLLATION_NAME` varchar(32) DEFAULT NULL,
  `SQL_PATH` varchar(512) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
1 row in set (0.01 sec)

Copy link
Contributor

@alivxxx alivxxx left a comment

Choose a reason for hiding this comment

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

LGTM

@alivxxx alivxxx merged commit 268ace8 into pingcap:master Sep 20, 2018
@alivxxx alivxxx added type/compatibility status/LGT2 Indicates that a PR has LGTM 2. labels Sep 20, 2018
@morgo morgo deleted the is-fix branch September 20, 2018 02:52
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. status/LGT2 Indicates that a PR has LGTM 2. type/compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

information schema does not show default charset from CREATE DATABASE
4 participants