alibaba / innodb-java-reader

A library and command-line tool to access MySQL InnoDB data file directly in Java
Apache License 2.0
462 stars 115 forks source link

bug: fix character set and collate bug #23

Closed Werneror closed 3 years ago

Werneror commented 3 years ago

This PR fixes three small bugs related to the character set and collate.

  1. Both COLLATE collation_name and COLLATE = collation_name are valid table option to set collate. Parsing the create table statement in the sql file only takes into account the case where there is no equal sign.

  2. If neither CHARACTER SET nor COLLATE is specified for a column, the CHARACTER SET and COLLATE of the table should be used.

  3. When determining whether a column is a variable-length char, the column's MaxBytesPerChar should be used instead of the table's MaxBytesPerChar.

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

neoremind commented 3 years ago

@Werneror Great catch! Thanks for your contribution!