Title:
Bug 85472:(Watson Migration Closure)It looks like the query strips out TABS from the SQL statement and will corrupt the named params
| View in TrackerStatus/Resolution/Reason: Closed/Won't Fix/LowImpact
Reporter/Name(from Bugbase): Raffael Wannenmacher / Raffael Wannenmacher (delijahify)
Created: 12/28/2010
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 251028 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Win All
Vote Count: 0
Problem:
It looks like the query strips out TABS from the SQL statement and will corrupt the named params.
Method:
Works NOT:public void function test() output="false" {local.qLogin = new Query(sql = "SELECT user_id,user_name,user_lastName,user_emailFROM tUsersWHERE user_email = :emailAND user_password = :password");local.qLogin.addParam(name = "email", value = "#request.attributes.userEmail#", cfsqltype = "cf_sql_varchar");local.qLogin.addParam(name = "password", value = "#Hash(request.attributes.userPassword)#", cfsqltype = "cf_sql_varchar");local.qLogin.execute();}Works fine:public void function test() output="false" {local.qLogin = new Query(sql = "SELECT user_id,user_name,user_lastName,user_emailFROM tUsersWHERE user_email = :email -- Extra WhitespaceAND user_password = :password");local.qLogin.addParam(name = "email", value = "#request.attributes.userEmail#", cfsqltype = "cf_sql_varchar");local.qLogin.addParam(name = "password", value = "#Hash(request.attributes.userPassword)#", cfsqltype = "cf_sql_varchar");local.qLogin.execute();}
Result:
Named Sql parameter 'email AND user_password' used in the query not found in the queryparams
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3043005
External Customer Info:
External Company:
External Customer Name: Raffael Wannenmacher
External Customer Email: 0803244F4739A3A0992015B9
External Test Config: 12/28/2010
Attachments:
Comments: