Yeah, I ended up slightly too much beer last night to contemplate looking into this properly. But I've done so now.
I've written up my findings here (because it effects ColdFusion as well as Railo):
http://adamcameroncoldfusion.blogspot.co.uk/2012/09/not-obvious-bug-in-querycfc.html.
It is definitely a problem with the parameter parsing process in both CF and Railo.
Steps to reproduce:
<cfprocessingdirective pageencoding="UTF-8">
<cfscript>
q1 = queryNew("");
queryAddColumn(q1, "id", [1,2,3,4,5,6,7]);
queryAddColumn(q1, "daysofWeek", ["Rāhina","Rātū","Rāapa","Rāpare","Rāmere","Rāhoroi","Rātapu"]);
queryAddColumn(q1, "ts", [now(),now(),now(),now(),now(),now(),now()]);
o = new Query(
dbtype = "query",
sql = "
SELECT *
FROM q1
WHERE ts = '#now()#'
"
);
o.setAttributes(q1=q1);
o.execute();
q2 = o.getResult();
writeDump(variables);
</cfscript>
I've raised
https://issues.jboss.org/browse/RAILO-2059.
Cheers.
--
Adam