When the MysqlAdapter attempts to extract the default value for binary and text columns it currently returns an empty string if no default was specified only for mysql but not other databases. If a default is present it raises an error. This produces the unwanted result while generating a schema.rb file:
table.binary :data, :default => , :null => false
table.text :some_description, :default => , :null => false
When this schema.rb is loaded into the test database it then produces the following error:
Mysql::Error: #42000BLOB/TEXT column 'data' can't have a default value
I have submitted this patch so that the default value for text and binary columns is nil (inline with how other database binary columns behave in ActiveRecord). I am not providing any new tests but fixing two existing tests as they were actually asserting invalid results. This patch will verify and generate a valid schema.rb file that outputs:
table.binary :data, :null => false
table.text :some_description, :null => false