Exemplo n.º 1
0
 private static bool VisitDerivedTableReference(DerivedTableReference node1, DerivedTableReference node2)
 {
     return(node2 != null &&
            node1.CorrelationName == node2.CorrelationName &&
            node1.DerivedTableBinding == node2.DerivedTableBinding &&
            Visit(node1.Query, node2.Query));
 }
Exemplo n.º 2
0
        public override TableReference VisitDerivedTableReference(DerivedTableReference node)
        {
            AlgebraNode algebrizedQuery = Convert(node.Query);

            List <ComputedValueDefinition> definedValues = new List <ComputedValueDefinition>();

            for (int i = 0; i < node.DerivedTableBinding.ColumnRefs.Length; i++)
            {
                RowBufferEntry targetRowBufferEntry = node.DerivedTableBinding.ColumnRefs[i].ValueDefinition.Target;
                RowBufferEntry sourceRowBufferEntry = algebrizedQuery.OutputList[i];

                ComputedValueDefinition definedValue = new ComputedValueDefinition();
                definedValue.Target     = targetRowBufferEntry;
                definedValue.Expression = new RowBufferEntryExpression(sourceRowBufferEntry);
                definedValues.Add(definedValue);
            }

            ComputeScalarAlgebraNode computeScalarAlgebraNode = new ComputeScalarAlgebraNode();

            computeScalarAlgebraNode.Input         = algebrizedQuery;
            computeScalarAlgebraNode.DefinedValues = definedValues.ToArray();
            SetLastAlgebraNode(computeScalarAlgebraNode);

            return(node);
        }
Exemplo n.º 3
0
		public override AstElement Clone(Dictionary<AstElement, AstElement> alreadyClonedElements)
		{
			DerivedTableReference result = new DerivedTableReference();
			result.Query = (QueryNode)_query.Clone(alreadyClonedElements);
			result.CorrelationName = _correlationName;
			result.CorrelationNameSourceRange = _correlationNameSourceRange;
			return result;
		}
Exemplo n.º 4
0
        public override AstElement Clone(Dictionary <AstElement, AstElement> alreadyClonedElements)
        {
            DerivedTableReference result = new DerivedTableReference();

            result.Query                      = (QueryNode)_query.Clone(alreadyClonedElements);
            result.CorrelationName            = _correlationName;
            result.CorrelationNameSourceRange = _correlationNameSourceRange;
            return(result);
        }
Exemplo n.º 5
0
        public override TableReference VisitDerivedTableReference(DerivedTableReference node)
        {
            _xmlWriter.WriteStartElement("queryTableReference");
            _xmlWriter.WriteAttributeString("correlationName", node.CorrelationName.ToSource());
            WriteAstNode("query", node.Query);

            _xmlWriter.WriteEndElement();

            return(node);
        }
Exemplo n.º 6
0
        public override TableReference VisitDerivedTableReference(DerivedTableReference node)
        {
            _writer.Write("(");
            _writer.WriteLine();
            _writer.Indent += 2;
            Visit(node.Query);
            _writer.Indent -= 2;
            _writer.WriteLine();
            _writer.Write(") AS ");
            _writer.Write(node.CorrelationName.ToString());

            return(node);
        }
Exemplo n.º 7
0
        private DerivedTableReference ParseDerivedTableReference()
        {
            Match(TokenId.LeftParentheses);

            DerivedTableReference result = new DerivedTableReference();

            result.Query = ParseQuery();

            Match(TokenId.RightParentheses);

            if (_token.Id == TokenId.AS)
            {
                NextToken();
            }

            _rangeRecorder.Begin();
            Identifier  correlationName            = ParseIdentifier();
            SourceRange correlationNameSourceRange = _rangeRecorder.End();

            result.CorrelationName            = correlationName;
            result.CorrelationNameSourceRange = correlationNameSourceRange;
            return(result);
        }
Exemplo n.º 8
0
 public virtual TableReference VisitDerivedTableReference(DerivedTableReference node)
 {
     node.Query = VisitQuery(node.Query);
     return(node);
 }
Exemplo n.º 9
0
		public virtual TableReference VisitDerivedTableReference(DerivedTableReference node)
		{
			node.Query = VisitQuery(node.Query);
			return node;
		}
Exemplo n.º 10
0
 // NOTE: Since we are only interetested in table references of the root query
 //       we don't visit nested queries.
 public override TableReference VisitDerivedTableReference(DerivedTableReference node)
 {
     _tableRefBindingList.Add(node.DerivedTableBinding);
     return node;
 }
Exemplo n.º 11
0
 public override TableReference VisitDerivedTableReference(DerivedTableReference node)
 {
     _derivedTableReferenceList.Add(node);
     return node;
 }
Exemplo n.º 12
0
 public override TableReference VisitDerivedTableReference(DerivedTableReference node)
 {
     base.VisitDerivedTableReference(node);
     EnsureQueryHasNoOrderByUnlessTopSpecified(node.Query);
     return(node);
 }
Exemplo n.º 13
0
 public override TableReference VisitDerivedTableReference(DerivedTableReference node)
 {
     base.VisitDerivedTableReference(node);
     EnsureQueryHasNoOrderByUnlessTopSpecified(node.Query);
     return node;
 }
Exemplo n.º 14
0
		public override TableReference VisitDerivedTableReference(DerivedTableReference node)
		{
			AlgebraNode algebrizedQuery = Convert(node.Query);

			List<ComputedValueDefinition> definedValues = new List<ComputedValueDefinition>();
			for (int i = 0; i < node.DerivedTableBinding.ColumnRefs.Length; i++)
			{
				RowBufferEntry targetRowBufferEntry = node.DerivedTableBinding.ColumnRefs[i].ValueDefinition.Target;
				RowBufferEntry sourceRowBufferEntry = algebrizedQuery.OutputList[i];

				ComputedValueDefinition definedValue = new ComputedValueDefinition();
				definedValue.Target = targetRowBufferEntry;
				definedValue.Expression = new RowBufferEntryExpression(sourceRowBufferEntry);
				definedValues.Add(definedValue);
			}

			ComputeScalarAlgebraNode computeScalarAlgebraNode = new ComputeScalarAlgebraNode();
			computeScalarAlgebraNode.Input = algebrizedQuery;
			computeScalarAlgebraNode.DefinedValues = definedValues.ToArray();
			SetLastAlgebraNode(computeScalarAlgebraNode);

			return node;
		}
Exemplo n.º 15
0
		public override TableReference VisitDerivedTableReference(DerivedTableReference node)
		{
			_xmlWriter.WriteStartElement("queryTableReference");
			_xmlWriter.WriteAttributeString("correlationName", node.CorrelationName.ToSource());
			WriteAstNode("query", node.Query);

			_xmlWriter.WriteEndElement();

			return node;
		}
Exemplo n.º 16
0
        private DerivedTableReference ParseDerivedTableReference()
        {
            Match(TokenId.LeftParentheses);

            DerivedTableReference result = new DerivedTableReference();
            result.Query = ParseQuery();

            Match(TokenId.RightParentheses);

            if (_token.Id == TokenId.AS)
                NextToken();

            _rangeRecorder.Begin();
            Identifier correlationName = ParseIdentifier();
            SourceRange correlationNameSourceRange = _rangeRecorder.End();

            result.CorrelationName = correlationName;
            result.CorrelationNameSourceRange = correlationNameSourceRange;
            return result;
        }
Exemplo n.º 17
0
		public override TableReference VisitDerivedTableReference(DerivedTableReference node)
		{
			_writer.Write("(");
			_writer.WriteLine();
			_writer.Indent += 2;
			Visit(node.Query);
			_writer.Indent -= 2;
			_writer.WriteLine();
			_writer.Write(") AS ");
			_writer.Write(node.CorrelationName.ToString());

			return node;
		}
Exemplo n.º 18
0
 public override TableReference VisitDerivedTableReference(DerivedTableReference node)
 {
     // Don't visit the query since we have visited it in VisitSelectQuery() already.
     return node;
 }
Exemplo n.º 19
0
		private static bool VisitDerivedTableReference(DerivedTableReference node1, DerivedTableReference node2)
		{
			return node2 != null &&
			       node1.CorrelationName == node2.CorrelationName &&
			       node1.DerivedTableBinding == node2.DerivedTableBinding &&
			       Visit(node1.Query, node2.Query);
		}
        // NOTE: Since we are only interetested in table references of the root query
        //       we don't visit nested queries.

        public override TableReference VisitDerivedTableReference(DerivedTableReference node)
        {
            return(node);
        }
 // NOTE: Since we are only interetested in table references of the root query
 //       we don't visit nested queries.
 public override TableReference VisitDerivedTableReference(DerivedTableReference node)
 {
     return node;
 }
Exemplo n.º 22
0
        // NOTE: Since we are only interetested in table references of the root query
        //       we don't visit nested queries.

        public override TableReference VisitDerivedTableReference(DerivedTableReference node)
        {
            _tableRefBindingList.Add(node.DerivedTableBinding);
            return(node);
        }