Lucee redefines query types when setting invalid data instead of throwing exception

Description

Consider the following code example:

https://www.trycf.com/gist/0ed8c07fc9a657419c880fed00a6c631/lucee5?theme=monokai

Adobe ColdFusion will throw an exception when you try to store "sdfsdfsdf" in a "date" column.

However, Lucee simply changes the type of the column to be a "varchar". As a developer who types my columns, I would like Lucee to not change those types on me so I can have a reasonable expectation they are what I set them to

Activity

Michael Offner 21 May 2024 at 19:34

Pothys - MitrahSoft 19 May 2021 at 09:53

I've checked this ticket and confirmed the issue happened on lucee latest version 5.3.8.178-SNAPSHOT also. In Query of query, the column type is redefining when the value is different column type. Seems ACF throws error like Invalid data test for CFSQLTYPE CF_SQL_DATE.

https://github.com/lucee/Lucee/blob/6.0/core/src/main/java/lucee/runtime/type/QueryImpl.java#L1047
https://github.com/lucee/Lucee/blob/6.0/core/src/main/java/lucee/runtime/type/QueryColumnImpl.java#L446
https://github.com/lucee/Lucee/blob/6.0/core/src/main/java/lucee/runtime/type/QueryColumnUtil.java#L38

Unresolved

Details

Assignee

Reporter

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

Priority

Created 18 May 2021 at 16:41
Updated 21 May 2024 at 19:35