[Mondrian] Bug in Util.singleQuoteString: backslashes not being properly escaped

Jason Schlesinger jschlesinger at real.com
Mon May 23 14:18:24 EDT 2011


In Mondrian.olap.Util.singleQuoteString:

The line:
String s0 = replace(val, "'", "''");

Should be replaced with:
String s0 = replace(replace(val, "'", "''"), "\\", "\\\\");
or similar in order to escape backslashes.  Currently backslashes in strings escape the next character in the string, or in the case the backslash is the last character in the string, it escapes the encapsulating quote.

thanks,
Jason




More information about the Mondrian mailing list