MySQL is weird The weirdest problem happened to a college today.
When creating the database schema during integration tests run, he got “Cannot create table FOO error 105” from MySQL.
There used to be a table named FOO with a VARCHAR primary key. The schema then changed so that the primary key of FOO became BIGINT. There is also a second table in the system (call it BAR) which has a foreign-key into FOO’s primary key. A classic master/details scenario.
However, the table BAR was obsoleted from the schema.
The integration tests runner is dropping all tables and recreating them before running the test suite. It is inferring the schema from the persisted classes using NHibernate’s mapper and the Schema creation feature of NHibernate. Sleeves up We cranked open the mysql console and started to look around:
IdBIGINT) - fail with error 105.
IdVARCHAR) – success !!
IdBIGINT) - fail with error 105 – again
Way can’t MySQL store non-indexed columns in an index?