Smallint validating incorrectly

Description

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.

Environment

Lucee 5.3.6.61.
Ubuntu 18.04
mysql-connector-java-8.0.19 (Revision: a0ca826f5cdf51a98356fdfb1bf251eb042f80bf)

Activity

Show:

Pothys - MitrahSoft 9 October 2020 at 16:58

I've checked this ticket and confirmed the issue happened on lucee latest version 5.3.8.76-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

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Created 3 October 2020 at 21:42
Updated 15 March 2021 at 13:11

Flag notifications