MySQL Forums
Forum List  »  Newbie

Insert to field accepted although adjusted
Posted by: John Peter Paredes
Date: December 02, 2017 02:52AM

I have a table TEST and a field name TESTFIELD. i am running some tests on various data types. I have made my research on the INTEGER data types in mysql and saw that TINYINT is -128 up to 127 by default (SIGNED) and 0-256 when (UNSIGNED) i set the TESTFIELD to TINYINT (UNSIGNED by default) and ran a few insert calls

INSERT INTO TEST (TESTFIELD) VALUES(-130)

The problem that i have encountered is that MYSQL will give me a warning for this but will accept the change although adjusting -130 to -128. This would be a problem if created an Application where i can just type in numbers in there and it will update the table in MYSQL because i dont see any messagebox or prompt letting me know that the value i typed in would be adjusted. i had SWITCH OFF the STRICT MODE in mysql. is this why its doing that ?

Many thanks for any help that you can provide

Options: ReplyQuote


Subject
Written By
Posted
Insert to field accepted although adjusted
December 02, 2017 02:52AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.