alhena Posted December 14, 2009 Share Posted December 14, 2009 I have several columns in my table (int and decimal) that are restricted to a specific range (for example from 0 to 99.99). With a previous version of MySQL, I used to run a single query that would update these fields without checking what the actual number was, in order to minimize the amount of queries needed. If something was at 99.99 for example, and the query wanted to add 1, it stayed at 99.99, while the rest of the query would still get updated. Now I have MySQL 5.0.51a, and I'm getting an "out of range" error for the same queries. If one of the values is lower or higher than the allowed range, it will abort the entire query. Is there a way to tell MySQL to ignore the "out of range" and work as it previously did? Or do I have to pull all the data from the table first, have all the values checked, and selectively only update those that allow updating? Or is there another easier workaround? Quote Link to comment https://forums.phpfreaks.com/topic/185087-out-of-range/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 14, 2009 Share Posted December 14, 2009 The behavior is controlled by the strict mode settings - http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html Quote Link to comment https://forums.phpfreaks.com/topic/185087-out-of-range/#findComment-977037 Share on other sites More sharing options...
alhena Posted December 15, 2009 Author Share Posted December 15, 2009 Aaaah, that was it. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/185087-out-of-range/#findComment-977621 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.