protected override DataObject EvaluateBinary(DataObject ob1, DataObject ob2, IEvaluateContext context) { if (ob1.IsNull) { return(ob1); } if (ob2.IsNull) { return(ob2); } char cEscape = '\\'; if (Escape is ConstantExpression) { // TODO: some more checks... var escapeValue = ((ConstantExpression)Escape).Value; cEscape = escapeValue.ToString()[0]; } string val = ob1.CastTo(PrimitiveTypes.String()).ToStringValue(); string pattern = ob2.CastTo(PrimitiveTypes.String()).ToStringValue(); return(DataObject.Boolean(PatternSearch.FullPatternMatch(pattern, val, cEscape))); }
protected override DataObject EvaluateBinary(DataObject ob1, DataObject ob2, IEvaluateContext context) { if (ob1.IsNull) return ob1; if (ob2.IsNull) return ob2; char cEscape = '\\'; if (Escape is ConstantExpression) { // TODO: some more checks... var escapeValue = ((ConstantExpression) Escape).Value; cEscape = escapeValue.ToString()[0]; } string val = ob1.CastTo(PrimitiveTypes.String()).ToStringValue(); string pattern = ob2.CastTo(PrimitiveTypes.String()).ToStringValue(); return DataObject.Boolean(PatternSearch.FullPatternMatch(pattern, val, cEscape)); }
public void SetValue(DataObject value) { if (IsConstant) { throw new InvalidOperationException(); } if (!IsNotNull && value.IsNull) { throw new ArgumentException(); } if (!Type.Equals(value.Type)) { if (!value.Type.CanCastTo(Type)) { throw new ArgumentException(); } value = value.CastTo(Type); } Value = value; }
public static DataObject Cast(DataObject value, DataType destType) { return value.CastTo(destType); }
public static DataObject ToTimeStamp(DataObject obj) { return obj.CastTo(PrimitiveTypes.TimeStamp()); }
public static DataObject ToString(DataObject value) { return value.CastTo(PrimitiveTypes.String()); }
public static DataObject ToNumber(DataObject value) { return value.CastTo(PrimitiveTypes.Numeric()); }
public static DataObject ToBinary(DataObject value) { return(value.CastTo(PrimitiveTypes.Binary())); }
public static DataObject ToNumber(DataObject value) { return(value.CastTo(PrimitiveTypes.Numeric())); }
public static DataObject Cast(DataObject value, SqlType destType) { return(value.CastTo(destType)); }
public static DataObject ToTimeStamp(DataObject obj) { return(obj.CastTo(PrimitiveTypes.TimeStamp())); }
public static DataObject ToDateTime(DataObject obj) { return(obj.CastTo(PrimitiveTypes.DateTime())); }
public override DataObject Evaluate(DataObject ob1, DataObject ob2, IGroupResolver group, IVariableResolver resolver, IQueryContext context) { if (ob1.IsNull) return ob1; if (ob2.IsNull) return ob2; string val = ob1.CastTo(PrimitiveTypes.String()).ToStringValue(); string pattern = ob2.CastTo(PrimitiveTypes.String()).ToStringValue(); // TODO: return DataObject.Boolean(PatternSearch.RegexMatch(context.Context, pattern, val)); throw new NotImplementedException(); }
public override DataObject Evaluate(DataObject ob1, DataObject ob2, IGroupResolver group, IVariableResolver resolver, IQueryContext context) { if (ob1.IsNull) { return ob1; } if (ob2.IsNull) { return ob2; } String val = ob1.CastTo(PrimitiveTypes.String()).ToStringValue(); String pattern = ob2.CastTo(PrimitiveTypes.String()).ToStringValue(); return DataObject.Boolean(PatternSearch.FullPatternMatch(pattern, val, '\\')); }
public static DataObject ToBinary(DataObject value) { return value.CastTo(PrimitiveTypes.Binary()); }
public static DataObject ToDateTime(DataObject obj) { return obj.CastTo(PrimitiveTypes.DateTime()); }
public static DataObject ToString(DataObject value) { return(value.CastTo(PrimitiveTypes.String())); }