Commit 0f298f02 authored by bar@mysql.com's avatar bar@mysql.com

sql_db.cc:

  mysqld crashes on CREATE TABLE in a database with corrupted db.opt file.
  Bug#4646
parent 9d3edfb6
...@@ -327,6 +327,7 @@ bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create) ...@@ -327,6 +327,7 @@ bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
{ {
sql_print_error("Error while loading database options: '%s':",path); sql_print_error("Error while loading database options: '%s':",path);
sql_print_error(ER(ER_UNKNOWN_CHARACTER_SET),pos+1); sql_print_error(ER(ER_UNKNOWN_CHARACTER_SET),pos+1);
create->default_table_charset= default_charset_info;
} }
} }
else if (!strncmp(buf,"default-collation", (pos-buf))) else if (!strncmp(buf,"default-collation", (pos-buf)))
...@@ -336,6 +337,7 @@ bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create) ...@@ -336,6 +337,7 @@ bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
{ {
sql_print_error("Error while loading database options: '%s':",path); sql_print_error("Error while loading database options: '%s':",path);
sql_print_error(ER(ER_UNKNOWN_COLLATION),pos+1); sql_print_error(ER(ER_UNKNOWN_COLLATION),pos+1);
create->default_table_charset= default_charset_info;
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment