Bug #4646 mysqld crashes on CREATE TABLE in a database with corrupted db.opt file.
Submitted: 20 Jul 2004 14:47 Modified: 23 Jul 2004 15:20
Reporter: Alexander Barkov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.x OS:Any (any)
Assigned to: Alexander Barkov CPU Architecture:Any

[20 Jul 2004 14:47] Alexander Barkov
Description:
Guilhem wrote:
I am able to make mysqld crash; my database has this db.opt (probably very old):
[guilhem@gbichot2 2]$  cat test3/db.opt
default-character-set=latin1_swedish_ci
(no collation line).

I get
040720 14:34:19  Error while loading database options: './test/db.opt':
040720 14:34:19  Unknown character set: 'latin1_swedish_ci'
mysqld: sql_table.cc:516: int mysql_prepare_table(THD*, HA_CREATE_INFO*, List<create_field>&, List<Key>&, bool, uint&, handler*, KEY*&, uint*, int): Assertion `sql_field->charset' failed.
If I ALTER DATABASE (to make a new-format db.opt) it does not crash anymore.
It should be fixed not to crash, by using the default collation of the specified charset, I guess.

How to repeat:
Put this db.opt in a database, then USE that database.
Then, create a table in it.