3 ms·
Which brings us right back to what tdavis said in the first place: "As much as anything else, this is another great example of MySQL letting you shoot yourself
by msbarnett 14y ago
Which brings us right back to what tdavis said in the first place: "As much as anything else, this is another great example of MySQL letting you shoot yourself in the face by default."
- ars 14y agoYou are aware that this whole thing is theoretical since he set the field to bin (i.e. binary)? No database at all would have prevented this. MySQL chose to coerce fields to fit the type. You don't like that choice, but other people find it useful. And MySQL gives you a choice to change it if you wish. Judging by how popular and successful they are I think those chose correctly.
- brlewis 14y agoThis article is a success story for MySQL because maciej is using MySQL. This article is a failure story for maciej. MySQL may have chosen correctly for its own popularity (although that's debatable; this choice might not be a success factor) but it did not choose correctly for the success of its users, with this article being a clear example.
- drivebyacct2 14y agoIt's not theoretical. MySQL by default allowed type coercion out-of-box that is nonsensical. Sure, type coercion can be nice, but I'd prefer none over if it not failing and coercing bin('y') to 0. Attributing their success to their choice of DB is insulting at best.
- ars 14y agoMySQL chose correctly, not maciej. The coercing bin('y') to 0 makes no sense though - I agree with you there.
- drivebyacct2 14y agoThose two statements conflict with each other and I don't see how you reconcile those without placing blame on MySQL.
- ars 14y agoEvery product has bugs. The philosophy of attempting to work when possible (coercion and other things) is good. They clearly messed up here, but it doesn't mean they should never try to coerce values. Even the warning when you try it makes no sense (what double?): 1292: Truncated incorrect DOUBLE value: 'y ' It's clearly a bug, and not something fundamental to MySQL.
- drivebyacct2 14y agoSure, I think we agree. I agree it's a mistake here and should be corrected, I wasn't advocating removing type coercion by any means, nor do I think that this one-off (?) incident is worthy of making broad statements about MySQL.