This is also a difference between ACF and Lucee, as I just moved this site over from ACF two days ago and this error started popping up:
Out of range value for column 'prid' at row 1
This is a smallint column. The value in this case was 60674, which is below the max for smallint unsigned (65535). But it also triggered with a value somewhere in the 30k mark the other day.
At first I thought I had buggered up my db import, but after testing this evening it's the addition of "sqltype="smallint"" inside <cfqueryparam> that is triggering this. I then ran a test and found that it's rejecting any value higher than the SIGNED max, which is 32767. So 32766 is ok, 32768 triggers an exception. Removing sqltype='smallint' lets it through.
Obviously in this case I'm already pushing the upper limits of smallint here anyway, so will make the swap to mediumint, but figure this is actually worthwhile mentioning here.
mysql-connector-java-8.0.19 (Revision: a0ca826f5cdf51a98356fdfb1bf251eb042f80bf)
I've checked this ticket and confirmed the issue happened on lucee latest version 188.8.131.52-SNAPSHOT also. cfsqltype=cf_sql_smallint works incorrectly with range of values. And added a test case too.
Pull Request: https://github.com/lucee/Lucee/pull/1061