Empty valuecfqueryparam type="list" with SQL IN operator fails

Description

query fails when passing empty valueList() result to
cfqueryparam value type list.

query fails with "list of empty elements" in cfqueryparam

<cfquery name="get_data" datasource="sage" timeout="1">
SELECT
'' as info
UNION ALL
SELECT
'' as info
UNION ALL
SELECT
'' as info
</cfquery>

<cfdump var = "#valueList(get_data.info)#">

<cfquery result="q" datasource="sage" timeout="1">
select 1
WHERE
'1' IN ( <cfqueryparam cfsqltype="cf_sql_varchar" value="#valueList(get_data.info)#" list="true" null="true"> )
</cfquery>

Environment

lucee 5.3.7.43
with mssql jdbc 7.2.1.0

Activity

Show:

Pothys - MitrahSoft 6 January 2021 at 15:08

I've checked this ticket and confirmed the issue happened on lucee latest version 5.3.8.133-SNAPSHOT also. query fails when passing empty valueList() result to cfqueryparam value type list. And I added a test case for this ticket too.

Pull Request: https://github.com/lucee/Lucee/pull/1152

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

Affects versions

Created 4 January 2021 at 13:23
Updated 19 November 2021 at 14:34

Flag notifications