Exemplo n.º 1
0
        /// <summary>
        ///     Translate Exists(X) into Exists(select 1 from X)
        /// </summary>
        public override Node Visit(ExistsOp op, Node n)
        {
            VisitChildren(n);

            // Build up a dummy project node over the input
            n.Child0 = BuildDummyProjectForExists(n.Child0);

            return n;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Translate Exists(X) into Exists(select 1 from X)
        /// </summary>
        /// <param name="op"></param>
        /// <param name="n"></param>
        /// <returns></returns>
        public override Node Visit(ExistsOp op, Node n)
        {
            VisitChildren(n);

            // Build up a dummy project node over the input
            n.Child0 = BuildDummyProjectForExists(n.Child0);

            return(n);
        }
        /// <summary>
        ///     ExistsOp
        ///     The child must be a ProjectOp - with exactly 1 var. Mark it as referenced
        /// </summary>
        /// <param name="op"> the ExistsOp </param>
        /// <param name="n"> the input node </param>
        /// <returns> </returns>
        public override Node Visit(ExistsOp op, Node n)
        {
            // Ensure that the child is a projectOp, and has exactly one var. Mark
            // that var as referenced always
            var projectOp = (ProjectOp)n.Child0.Op;

            //It is enougth to reference the first output, this usually is a simple constant
            AddReference(projectOp.Outputs.First);

            VisitChildren(n);
            return(n);
        }
Exemplo n.º 4
0
        public override Node Visit(ExistsOp op, Node n)
        {
            var inputVar = ((ProjectOp)n.Child0.Op).Outputs.First;
            VisitChildren(n);

            var newOutputs = ((ProjectOp)n.Child0.Op).Outputs;
            if (newOutputs.Count > 1)
            {
                PlanCompiler.Assert(
                    newOutputs.IsSet(inputVar), "The constant var is not present after NestPull up over the input of ExistsOp.");
                newOutputs.Clear();
                newOutputs.Set(inputVar);
            }
            return n;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Mark Normalization as needed
 /// </summary>
 /// <param name="op"></param>
 /// <param name="n"></param>
 /// <returns></returns>
 public override Node Visit(ExistsOp op, Node n)
 {
     m_compilerState.MarkPhaseAsNeeded(PlanCompilerPhase.Normalization);
     return base.Visit(op, n);
 }
Exemplo n.º 6
0
 public override void Visit(ExistsOp op, Node n)
 {
     VisitScalarOpDefault(op, n);
     AssertRelOp(n.Child0.Op);
     AssertBooleanOp(op);
 }
Exemplo n.º 7
0
 public override System.Data.Entity.Core.Query.InternalTrees.Node Visit(ExistsOp op, System.Data.Entity.Core.Query.InternalTrees.Node n)
 {
     this.AddReference(((ProjectOp)n.Child0.Op).Outputs.First);
     this.VisitChildren(n);
     return(n);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Clone an ExistsOp
 /// </summary>
 /// <param name="op">The Op to Copy</param>
 /// <param name="n">The Node that references the Op</param>
 /// <returns>A copy of the original Node that references a copy of the original Op</returns>
 public override Node Visit(ExistsOp op, Node n)
 {
     return(CopyDefault(m_destCmd.CreateExistsOp(), n));
 }
 /// <summary>
 ///     Visitor pattern method for ExistsOp
 /// </summary>
 /// <param name="op"> The ExistsOp being visited </param>
 /// <param name="n"> The Node that references the Op </param>
 public virtual void Visit(ExistsOp op, Node n)
 {
     VisitScalarOpDefault(op, n);
 }
Exemplo n.º 10
0
 // <summary>
 // Clone an ExistsOp
 // </summary>
 // <param name="op"> The Op to Copy </param>
 // <param name="n"> The Node that references the Op </param>
 // <returns> A copy of the original Node that references a copy of the original Op </returns>
 public override Node Visit(ExistsOp op, Node n)
 {
     return CopyDefault(m_destCmd.CreateExistsOp(), n);
 }
Exemplo n.º 11
0
 public override void Visit(ExistsOp op, Node n)
 {
     VisitScalarOpDefault(op, n);
     AssertRelOp(n.Child0.Op);
     AssertBooleanOp(op);
 }
Exemplo n.º 12
0
 public override Node Visit(ExistsOp op, Node n)
 {
     this.VisitChildren(n);
     n.Child0 = this.BuildDummyProjectForExists(n.Child0);
     return(n);
 }