[jOOQ/jOOQ#17561] The LIKE and SIMILAR TO predicates should use
DataType.isString() internally to decide whether to auto-cast arguments, not Field.getType() == String.class
This commit is contained in:
parent
303e886441
commit
077ac9001b
@ -178,18 +178,18 @@ implements
|
||||
case SIMILAR_TO:
|
||||
case NOT_LIKE:
|
||||
case NOT_SIMILAR_TO:
|
||||
if (arg1.getType() != String.class && REQUIRES_CAST_ON_LIKE.contains(ctx.dialect()))
|
||||
if (!arg1.getDataType().isString() && REQUIRES_CAST_ON_LIKE.contains(ctx.dialect()))
|
||||
arg1 = castIfNeeded(arg1, String.class);
|
||||
if (arg2.getType() != String.class && REQUIRES_CAST_ON_LIKE.contains(ctx.dialect()))
|
||||
if (!arg2.getDataType().isString() && REQUIRES_CAST_ON_LIKE.contains(ctx.dialect()))
|
||||
arg2 = castIfNeeded(arg2, String.class);
|
||||
|
||||
break;
|
||||
|
||||
case LIKE_IGNORE_CASE:
|
||||
case NOT_LIKE_IGNORE_CASE:
|
||||
if (arg1.getType() != String.class)
|
||||
if (!arg1.getDataType().isString())
|
||||
arg1 = castIfNeeded(arg1, String.class);
|
||||
if (arg2.getType() != String.class)
|
||||
if (!arg2.getDataType().isString())
|
||||
arg2 = castIfNeeded(arg2, String.class);
|
||||
|
||||
break;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user