Skip to content

Commit

Permalink
LPS-19506 Usage of search method for all users on UserLocalServiceUti…
Browse files Browse the repository at this point in the history
…l with DB2 9.7 failed
  • Loading branch information
zsigmondrab authored and brianchandotcom committed Dec 22, 2011
1 parent 9fbdea1 commit a28b870
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -236,6 +236,13 @@ else if (_vendorOracle) {
}
}

private String _replaceLike(String sql) {
Matcher matcher = _likePattern.matcher(sql);

return matcher.replaceAll(
"LIKE COALESCE(CAST(? AS VARCHAR(32672)),'')");
}

private String _replaceMod(String sql) {
Matcher matcher = _modPattern.matcher(sql);

Expand Down Expand Up @@ -271,7 +278,10 @@ private String _transform(String sql) {
newSQL = _replaceCastText(newSQL);
newSQL = _replaceIntegerDivision(newSQL);

if (_vendorDerby) {
if (_vendorDB2) {
newSQL = _replaceLike(newSQL);
}
else if (_vendorDerby) {
newSQL = _replaceUnion(newSQL);
}
else if (_vendorMySQL) {
Expand Down Expand Up @@ -397,6 +407,8 @@ private String _transformPositionalParams(String queryString) {
"INTEGER_DIV\\((.+?),(.+?)\\)", Pattern.CASE_INSENSITIVE);
private static Pattern _jpqlCountPattern = Pattern.compile(
"SELECT COUNT\\((\\S+)\\) FROM (\\S+) (\\S+)");
private static Pattern _likePattern = Pattern.compile(
"LIKE \\?", Pattern.CASE_INSENSITIVE);
private static Pattern _modPattern = Pattern.compile(
"MOD\\((.+?),(.+?)\\)", Pattern.CASE_INSENSITIVE);
private static Pattern _negativeComparisonPattern = Pattern.compile(
Expand Down

0 comments on commit a28b870

Please sign in to comment.