[fix](function) fix unexpected be core in string search function (#31312)
Fix be core in multi_match_any/multi_search_all_positions functions.
This commit is contained in:
@ -84,6 +84,9 @@ public class FunctionCallExpr extends Expr {
|
||||
String.CASE_INSENSITIVE_ORDER)
|
||||
.add("round").add("round_bankers").add("ceil").add("floor")
|
||||
.add("truncate").add("dround").add("dceil").add("dfloor").build();
|
||||
public static final ImmutableSet<String> STRING_SEARCH_FUNCTION_SET = new ImmutableSortedSet.Builder(
|
||||
String.CASE_INSENSITIVE_ORDER)
|
||||
.add("multi_search_all_positions").add("multi_match_any").build();
|
||||
|
||||
private final AtomicBoolean addOnce = new AtomicBoolean(false);
|
||||
|
||||
|
||||
@ -495,6 +495,12 @@ public class FunctionSet<T> {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (FunctionCallExpr.STRING_SEARCH_FUNCTION_SET.contains(desc.functionName())) {
|
||||
if (descArgTypes[1].isStringType() && candicateArgTypes[1].isArrayType()) {
|
||||
// The needles arg of search functions should not be allowed to cast from string.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// If set `roundPreciseDecimalV2Value`, only use decimalv3 as target type to execute round function
|
||||
if (ConnectContext.get() != null
|
||||
&& ConnectContext.get().getSessionVariable().roundPreciseDecimalV2Value
|
||||
|
||||
Reference in New Issue
Block a user