subsonic / SubSonic-3.0-Templates

T4 Template Project for the peeps
http://subsonic.github.io/
105 stars 46 forks source link

Feature [ready to pull]: Throw exception on attempted assignment of negative value to unsigned decimal #19

Open TheDistantSea opened 15 years ago

TheDistantSea commented 15 years ago

ANSI SQL and SQL Server don't allow unsigned decimals, but MySQL does. The CLR doesn't have an unsigned decimal type, so such assignments eventually cause MySQL to be asked to store a negative value. Which it happily truncates to zero.

This is clearly a case where I 'd be happy if my DAL didn't allow me to shoot myself in the foot. :-)

Grab the patch from here: http://github.com/defacer/SubSonic-3.0-Templates/commit/a5966e693878a5072931698f85a5402e538745f6