Skip to content

Chinese column names become garbled in mysql2^1.0.0 #422

Closed
@NijiharaTsubasa

Description

@NijiharaTsubasa

We have some pretty old tables with some Chinese column names like this:

CREATE TABLE `商城` (
 `商品类型` varchar(255) NOT NULL,
 `商品说明` varchar(255) NOT NULL,
 `价格` int(11) NOT NULL,
 `剩余` int(11) NOT NULL,
 PRIMARY KEY (`商品类型`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

We used to be using mysql2 1.0.0-rc.11 and everything is OK:
qq 20161003224851

Today I was migrating the app to another server and npm install'd version 1.1.0 and everything is broken:
qq 20161003225318

I also tested version 1.0.0 and no luck, the column names are still garbled, and I have to roll back to 1.0.0-rc.11

Some details:
Only varchar columns was good, name of other columns (like the int ones) all become garbled.
The charset of my database, table and varchar columns are all utf8.
The js file being executed is also utf8.
The charset of the connection is also utf8. ("set names utf8")

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions