本文整理汇总了C#中Expr.FunctionUsesThisSrc方法的典型用法代码示例。如果您正苦于以下问题:C# Expr.FunctionUsesThisSrc方法的具体用法?C# Expr.FunctionUsesThisSrc怎么用?C# Expr.FunctionUsesThisSrc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Expr
的用法示例。
在下文中一共展示了Expr.FunctionUsesThisSrc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResolveExprStep
//.........这里部分代码省略.........
string id = expr.u.Token; // The function name.
int idLength = id.Length; // Number of characters in function name
FuncDef def = Callback.FindFunction(parse.Ctx, id, idLength, n, encode, false); // Information about the function
if (def == null)
{
def = Callback.FindFunction(parse.Ctx, id, idLength, -2, encode, false);
if (def == null)
noSuchFunc = true;
else
wrongNumArgs = true;
}
else
isAgg = (def.Func == null);
#if !OMIT_AUTHORIZATION
if (def != null)
{
ARC auth = Auth.Check(parse, AUTH.FUNCTION, null, def.Name, null); // Authorization to use the function
if (auth != ARC.OK)
{
if (auth == ARC.DENY)
{
parse.ErrorMsg("not authorized to use function: %s", def.Name);
nc.Errs++;
}
expr.OP = TK.NULL;
return WRC.Prune;
}
}
#endif
if (isAgg && (nc.NCFlags & NC.AllowAgg) == 0)
{
parse.ErrorMsg("misuse of aggregate function %.*s()", idLength, id);
nc.Errs++;
isAgg = false;
}
else if (noSuchFunc && !ctx.Init.Busy)
{
parse.ErrorMsg("no such function: %.*s", idLength, id);
nc.Errs++;
}
else if (wrongNumArgs)
{
parse.ErrorMsg("wrong number of arguments to function %.*s()", idLength, id);
nc.Errs++;
}
if (isAgg) nc.NCFlags &= ~NC.AllowAgg;
walker.WalkExprList(list);
if (isAgg)
{
NameContext nc2 = nc;
expr.OP = TK.AGG_FUNCTION;
expr.OP2 = 0;
while (nc2 != null && !expr.FunctionUsesThisSrc(nc2.SrcList))
{
expr.OP2++;
nc2 = nc2.Next;
}
if (nc2 != null) nc2.NCFlags |= NC.HasAgg;
nc.NCFlags |= NC.AllowAgg;
}
// FIX ME: Compute pExpr->affinity based on the expected return type of the function
return WRC.Prune;
}
#if !OMIT_SUBQUERY
case TK.SELECT:
case TK.EXISTS:
{
C.ASSERTCOVERAGE(expr.OP == TK.EXISTS);
goto case TK.IN;
}
#endif
case TK.IN:
{
C.ASSERTCOVERAGE(expr.OP == TK.IN);
if (E.ExprHasProperty(expr, EP.xIsSelect))
{
int refs = nc.Refs;
#if !OMIT_CHECK
if ((nc.NCFlags & NC.IsCheck) != 0)
parse.ErrorMsg("subqueries prohibited in CHECK constraints");
#endif
walker.WalkSelect(expr.x.Select);
Debug.Assert(nc.Refs >= refs);
if (refs != nc.Refs)
E.ExprSetProperty(expr, EP.VarSelect);
}
break;
}
#if !OMIT_CHECK
case TK.VARIABLE:
{
if ((nc.NCFlags & NC.IsCheck) != 0)
parse.ErrorMsg("parameters prohibited in CHECK constraints");
break;
}
#endif
}
return (parse.Errs != 0 || parse.Ctx.MallocFailed ? WRC.Abort : WRC.Continue);
}