diff options
author | bar@mysql.com <> | 2004-07-27 18:43:40 +0500 |
---|---|---|
committer | bar@mysql.com <> | 2004-07-27 18:43:40 +0500 |
commit | 7f58bb793e0e15f45ceee9244f20c1b9a9adf1ed (patch) | |
tree | 2d61709915dca171416f1ad57ba153675fb96ced /sql/sql_db.cc | |
parent | 51fbc5831ceeb3d82203933ac5db9317374ab23b (diff) | |
download | mariadb-git-7f58bb793e0e15f45ceee9244f20c1b9a9adf1ed.tar.gz |
A small fix to understand 4.1.0 format.
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r-- | sql/sql_db.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index ef180b58ee0..82fef3f7c7b 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -320,10 +320,17 @@ bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create) { if (!strncmp(buf,"default-character-set", (pos-buf))) { + /* + Try character set name, and if it fails + try collation name, probably it's an old + 4.1.0 db.opt file, which didn't have + separate default-character-set and + default-collation commands. + */ if (!(create->default_table_charset= - get_charset_by_csname(pos+1, - MY_CS_PRIMARY, - MYF(0)))) + get_charset_by_csname(pos+1, MY_CS_PRIMARY, MYF(0))) && + !(create->default_table_charset= + get_charset_by_name(pos+1, MYF(0)))) { sql_print_error("Error while loading database options: '%s':",path); sql_print_error(ER(ER_UNKNOWN_CHARACTER_SET),pos+1); |