in reply to Mysql smallint out of range. How to fetch warning?

My considered reaction to this inquiry ... is one of the two following responses:

  1. If the data could possibly (legitimately...) exceed the domain of a smallint column, then you are “quite in error” to have chosen that data-type for that column.
  2. If, on the other hand, the data could not possibly (legitimately...) exceed the domain of a smallint column, then you are, once again, “quite in error” to expect or to rely upon mySQL to do the dirty-work for you!   If the data that you have been presented does not conform to the rules that you know ought to apply to it ... then it is your responsibility to ensure that such data is not presented to the database-engine in the first place.

And, please, do understand that this reaction is absolutely not “off-the-cuff.”   It is carefully-considered and very serious.

Behaviors such as the one that you describe are, if you will, “an attempt (by the database engine in question ...) to make a dollar out of ninety-nine cents a sack of pure garbage (that ... ahem... you just forced upon it).   The implementors are basically telling you what their code will do in a fundamentally erroneous situation.   But you, as an application designer, have (what is to me...) an undeniable duty to make certain that their database engine never encounters that (fundamentally erroneous...) situation.

Although my stance on this matter is, “ahem... quite forceful,” I trust that you take it in proper context, and that you perceive the (I think...) very-necessary reason for it...