diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-06-03 12:42:36 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-06-03 12:42:36 +0400 |
commit | b003b0c934cf6b59358e31144c4f69cf34622fb8 (patch) | |
tree | fdd9ba33e52558859dab4fc4c1672c56ed11dbb0 /sql/table.cc | |
parent | 5a19908b955a6aeeeb09fb2ce7744d1c52b65a3b (diff) | |
download | mariadb-git-b003b0c934cf6b59358e31144c4f69cf34622fb8.tar.gz |
MDEV-19675 Wrong charset is chosen when opening a pre-4.1 table
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/table.cc b/sql/table.cc index 55b505a0cc0..12b23304acd 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1104,8 +1104,9 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, } if (!share->table_charset) { + const CHARSET_INFO *cs= thd->variables.collation_database; /* unknown charset in frm_image[38] or pre-3.23 frm */ - if (use_mb(default_charset_info)) + if (use_mb(cs)) { /* Warn that we may be changing the size of character columns */ sql_print_warning("'%s' had no or invalid character set, " @@ -1113,7 +1114,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, "so character column sizes may have changed", share->path.str); } - share->table_charset= default_charset_info; + share->table_charset= cs; } share->db_record_offset= 1; |