Ticket #421 (closed defect: fixed)
DROP DEFAULT on MySQL 5.1
| Reported by: | waikurosu@… | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 0.7.1 |
| Component: | migrations | Version: | 0.7 |
| Keywords: | mysql | Cc: | waikurosu@… |
Description
I'm on MySQL 5.1.14, and I've observed the following behaviour:
SQL query:
ALTER TABLE crm_contact ALTER COLUMN notes DROP DEFAULT;
MySQL said:
1101 - BLOB/TEXT column 'notes' can't have a default value
Unfortunately, this also causes my South migrations to blow up with the same error, because South will (needlessly) execute the DROP DEFAULTS for all the columns mentioned in the migration.
Attachments
Change History
comment:2 Changed 3 years ago by andrew
- Status changed from new to assigned
- Milestone set to 0.7.1
I haven't seen this before either with the DROP statement - I'll try and replicate it next time I have a round of MySQL testing.
comment:3 Changed 3 years ago by waikurosu@…
Okay, tested on Ubuntu now with MySQL version 5.1.41-3ubuntu12, same issue. I guess it was just a case of never actually hitting it before.
comment:4 Changed 3 years ago by waikurosu@…
Was getting kind of annoying, and kind of need this to work, so I fixed it. I _didn't_ touch the tests at this point, but I might have a look at writing a test later.
comment:5 Changed 3 years ago by andrew
- Status changed from assigned to infoneeded
I've committed this in [763a49dc4aec], although I still can't replicate it. If you could confirm it's fixed, I'll close the ticket.

So, I've downgraded to 5.0 and it's still doing it. I've tried messing with sql-mode to see if it was strict mode that was causing it - didn't seem to make a difference.
I _am_ on Windows, I've never seen such behavior in the past on OSX or Linux.