Imagine ... I have a field in the database called current_round. It can only be in the range of 0,1,2,3.
Within the application logic, it is impossible to get a number higher than 3 or less than 0 in the database.
Should there be an on-site verification error to find out if the value is distorted (i.e. not in the range 0-3)? Or is it just extra overhead? Is it possible to assume that the values in the database are correctly formatted / changed, etc. (Assuming you sanitize / properly evaluate all user input?)
source
share