First, the string '50261111111s11'
is implicitly coerced to 50261111111
1.
Then it is capped at 2147483647
2, which is the maximum value for an INT field in MySQL.
(Unless an Order ID is a constrained integer, such an auto-increment key, maybe it should be a CHAR/VARCHAR column?)
1 See the INSERT statement:
This might involve [an implicit] type conversion if the type of the expression does not match the type of the column, and conversion of a given value can result in different inserted values depending on the data type.
(MySQL might implement a direct conversion/truncation to INT, but consider the case where the value supplied was CONVERT("50261111111s11", SIGNED INTEGER)
- the result is 50261111111, not 0.)
2 From 11.2.6 Out-of-Range and Overflow Handling:
If strict SQL mode is enabled, MySQL rejects the out-of-range value with an error, and the insert fails, in accordance with the SQL standard.
If no restrictive modes are enabled, MySQL clips the value to the appropriate endpoint of the range and stores the resulting value instead.