node-mysql2: Bad logic to decode the column name

  1. Create a table with the following definition

CREATE TABLE `test-encoding2` ( `平仮名` varchar(100) CHARACTER SET tis620 NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=tis620

  1. Insert data

INSERT INTO `test-encoding2` VALUES ('กขค');

  1. Set the result charset to null SET chracter_set_results=NULL;

  2. select data

select * from `test-encoding2`;

  1. it will decode the column name as 'ๅนณไปฎๅ��' instead of 平仮名 as expected

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 16 (16 by maintainers)

Commits related to this issue

Most upvoted comments

@sidorares although the fix is not ready yet as I’m adding more tests, feel free to take a look at the diff.

test-track-encoding test had a couple problems

  1. it relied on connection.option.charSet rather than tracking the session change from resultset_header.js
  2. it used utf8 to encode the query instead of koi8r as the code expected