On 1/17/07, Cory Bennett <[EMAIL PROTECTED]> wrote: >> This is arguably a bug in DBD::mysql, but as far as RDBO is concerned, > > For what it is worth, I dont think it is strictly DBD::mysql's fault, it is > Mysql itself. > > http://dev.mysql.com/doc/refman/5.0/en/data-type-defaults.html > > It might be fixed with mysql 5.0.2, but I do not have that version around to > test with. > > Unfortunately I ran into this problem this weekend, and hunted around until I > found the doc above.
When testing on my system (MySQL 5.0.22, DBD::mysql 3.0007) I saw that DBD::mysql returned a COLUMN_DEF of empty string, but "describe mytable" showed a default value of "NULL" for the VARCHAR(10) NOT NULL column. So it seemed to me that MySQL knew that it should be not be an empty string default value, but that DBD::mysql had decided to make COLUMN_DEF an empty string anyway. But now that I look further, it appears that it's the "describe mytable" output that's incorrect (or at least misleading). When I insert a row without specifying a value for that VARCHAR(10) NOT NULL column, it ends up with an empty string as its value, which matches what DBD::mysql said. -John ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object