tracker issue : CF-3581895

select a category, or use search below
(searches all categories and all time range)
Title:

Coldfusion CFScript Query with MySQL Assignment Operator

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Peter Williamson / Peter Williamson (Peter Williamson)

Created: 06/20/2013

Components: Database

Versions: 10.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: 9.0.1 / 286630

Priority/Frequency: Critical / All users will encounter

Locale/System: English / Windows 7

Vote Count: 0

Problem Description:
MySQL queries in CFScript using the Query object fail when the Assignment Operator is used, :=

Steps to Reproduce:
Create a Query object with an SQL statement like the following (change column and table to match an existing column and table in your DB:

    SELECT column, @rownum := @rownum +1 AS  `rownumber` 
    FROM table, ( SELECT @rownum :=0 )
    LIMIT 10

Actual Result:

Coldfusion throws a database error

    Parameter '=' not found in the list of parameters specified  
    SQL: SELECT column, @rownum := @rownum + 1 AS `rownumber` FROM table, ( SELECT @rownum    :=0 ) LIMIT 10

Expected Result:
The result set should be 10 values from table.column, with the integer 1 - 10 as the second value in the results, which mimics the #currentrow#

Any Workarounds:
The query runs fine using a <cfquery> tag, alternatively table.column could be selected on it's own, then the results looped over and a new column added to store the #currentrow#

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3581895

External Customer Info:
External Company:  
External Customer Name: PeteComcar
External Customer Email:  
External Test Config: My Hardware and Environment details:



Ubuntu 12.0.4 LTS on VirtualBox, running on Windows 7

Coldfusion 9,0,2,282541  

Mysql 5.1.37-1ubuntu5.5-log

Attachments:

  1. June 20, 2013 00:00:00: 1_query-bug.cfm

Comments:

This will be fixed via another function in the next major release of ColdFusion
Comment by Vamseekrishna N.
15157 | December 04, 2013 02:55:08 AM GMT
This is now possible with QueryExecute. We will not support query.cfc any more.
Comment by Himavanth R.
15158 | June 27, 2014 08:23:24 AM GMT