public List<Expression> validate(List<Expression> children, StatementContext context) throws SQLException { BuiltInFunctionInfo info = this.getInfo(); BuiltInFunctionArgInfo[] args = info.getArgs(); if (args.length < children.size() || info.getRequiredArgCount() > children.size()) { throw new FunctionNotFoundException(this.name); for (int i = children.size(); i < info.getArgs().length; i++) { moreChildren.add(LiteralExpression.newConstant(null, args[i].allowedTypes.length == 0 ? null : PDataTypeFactory.getInstance().instanceFromClass(args[i].allowedTypes[0]), Determinism.ALWAYS));
public static void validateFunctionArguement(BuiltInFunctionInfo info, int childIndex, Expression child) throws ArgumentTypeMismatchException, ValueRangeExcpetion { BuiltInFunctionArgInfo arg = info.getArgs()[childIndex]; if (arg.getAllowedTypes().length > 0) { boolean isCoercible = false;
public List<Expression> validate(List<Expression> children, StatementContext context) throws SQLException { BuiltInFunctionInfo info = this.getInfo(); BuiltInFunctionArgInfo[] args = info.getArgs(); if (args.length < children.size() || info.getRequiredArgCount() > children.size()) { throw new FunctionNotFoundException(this.name); for (int i = children.size(); i < info.getArgs().length; i++) { moreChildren.add(LiteralExpression.newConstant(null, args[i].allowedTypes.length == 0 ? null : PDataTypeFactory.getInstance().instanceFromClass(args[i].allowedTypes[0]), Determinism.ALWAYS));
public List<Expression> validate(List<Expression> children, StatementContext context) throws SQLException { BuiltInFunctionInfo info = this.getInfo(); BuiltInFunctionArgInfo[] args = info.getArgs(); if (args.length < children.size() || info.getRequiredArgCount() > children.size()) { throw new FunctionNotFoundException(this.name); for (int i = children.size(); i < info.getArgs().length; i++) { moreChildren.add(LiteralExpression.newConstant(null, args[i].allowedTypes.length == 0 ? null : PDataTypeFactory.getInstance().instanceFromClass(args[i].allowedTypes[0]), Determinism.ALWAYS));
public static void validateFunctionArguement(BuiltInFunctionInfo info, int childIndex, Expression child) throws ArgumentTypeMismatchException, ValueRangeExcpetion { BuiltInFunctionArgInfo arg = info.getArgs()[childIndex]; if (arg.getAllowedTypes().length > 0) { boolean isCoercible = false;
public static void validateFunctionArguement(BuiltInFunctionInfo info, int childIndex, Expression child) throws ArgumentTypeMismatchException, ValueRangeExcpetion { BuiltInFunctionArgInfo arg = info.getArgs()[childIndex]; if (arg.getAllowedTypes().length > 0) { boolean isCoercible = false;
@Test public void testConstruct_WithMultipleDefaultArgs() { BuiltInFunctionInfo funcInfo = getBuiltInFunctionInfo(WithMultipleDefaultArgs.class); assertEquals(3, funcInfo.getArgs().length); assertEquals(1, funcInfo.getRequiredArgCount()); assertEquals("WITH_MULTIPLE_DEFAULT_ARGS", funcInfo.getName()); }
@Test public void testConstruct_WithOneDefaultArg() { BuiltInFunctionInfo funcInfo = getBuiltInFunctionInfo(WithOneDefaultArg.class); assertEquals(3, funcInfo.getArgs().length); assertEquals(2, funcInfo.getRequiredArgCount()); assertEquals("WITH_ONE_DEFAULT_ARG", funcInfo.getName()); }
@Test public void testConstruct_NoDefaultArgs() { BuiltInFunctionInfo funcInfo = getBuiltInFunctionInfo(NoDefaultArgsFunction.class); assertEquals(2, funcInfo.getArgs().length); assertEquals(2, funcInfo.getRequiredArgCount()); assertEquals("NO_DEFAULT_ARGS", funcInfo.getName()); }