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

column charset is ignored once it's different from table charset. #156

Closed
jianhaiqing opened this issue Sep 21, 2018 · 1 comment
Closed

Comments

@jianhaiqing
Copy link

  • precondition:
    mydumper 0.9.5, built against MySQL 5.7.21-21
    mysql Ver 14.14 Distrib 5.7.19-17, for Linux (x86_64) using 6.2

  • MySQL character set
    | Variable_name | Value |
    | :-------- | --------:|
    | character_set_client | utf8mb4 |
    | character_set_connection | utf8mb4 |
    | character_set_database | utf8mb4 |
    | character_set_filesystem | binary |
    | character_set_results | utf8mb4 |
    | character_set_server | utf8mb4 |
    | character_set_system | utf8 |
    | character_sets_dir | /usr/local/percona-server-5.7.19-17/share/charsets/ |

  • source data definition structure:

CREATE TABLE `t_charset_test` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exec_info` varchar(512) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  • mydumper-schema
CREATE TABLE `t_charset_test` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exec_info` varchar(512) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4;
@maxbube maxbube added the bug label Nov 22, 2018
@davidducos
Copy link
Member

Hi @jianhaiqing,
I tested with

root@ubuntu-focal:~# mydumper --version
mydumper 0.10.5, built against MySQL 5.7.33-36

And it is working as expected

mysql> use issue_156
mysql> CREATE TABLE `t_charset_test` (   `id` int(11) NOT NULL AUTO_INCREMENT,   `exec_info` varchar(512) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',   PRIMARY KEY (`id`) ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Query OK, 0 rows affected (0.01 sec)

root@ubuntu-focal:~# mydumper -B issue_156 -o issue_156
root@ubuntu-focal:~# cat issue_156/issue_156.t_charset_test-schema.sql
/*!40101 SET NAMES binary*/;
/*!40014 SET FOREIGN_KEY_CHECKS=0*/;

/*!40103 SET TIME_ZONE='+00:00' */;
CREATE TABLE `t_charset_test` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exec_info` varchar(512) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Please, can you check it again?

@davidducos davidducos added invalid and removed bug labels Apr 30, 2021
@davidducos davidducos added this to the Release 0.10.9 milestone Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants