Example #1
0
        public override AlgebraNode VisitAssertAlgebraNode(AssertAlgebraNode node)
        {
            string message;

            switch (node.AssertionType)
            {
            case AssertionType.MaxOneRow:
                message = Resources.SubqueryReturnedMoreThanRow;
                break;

            case AssertionType.BelowRecursionLimit:
                message = Resources.MaximumRecursionLevelExceeded;
                break;

            default:
                throw ExceptionBuilder.UnhandledCaseLabel(node.AssertionType);
            }

            AssertIterator assertIterator = new AssertIterator();

            assertIterator.RowBuffer   = new object[node.OutputList.Length];
            assertIterator.Input       = ConvertAlgebraNode(node.Input);
            assertIterator.InputOutput = GetIteratorOutput(0, node.Input.OutputList, node.OutputList);
            assertIterator.Message     = message;

            BoundRowBufferEntrySet boundRowBufferEntrySet = new BoundRowBufferEntrySet(assertIterator.Input.RowBuffer, node.Input.OutputList);

            assertIterator.Predicate = CreateRuntimeExpression(node.Predicate, boundRowBufferEntrySet);
            SetLastIterator(node, assertIterator);

            return(node);
        }
Example #2
0
		public override AlgebraNode VisitAssertAlgebraNode(AssertAlgebraNode node)
		{
			string message;
			switch(node.AssertionType)
			{
				case AssertionType.MaxOneRow:
					message = Resources.SubqueryReturnedMoreThanRow;
					break;
				case AssertionType.BelowRecursionLimit:
					message = Resources.MaximumRecursionLevelExceeded;
					break;
				default:
					throw ExceptionBuilder.UnhandledCaseLabel(node.AssertionType);
			}

			AssertIterator assertIterator = new AssertIterator();
			assertIterator.RowBuffer = new object[node.OutputList.Length];
			assertIterator.Input = ConvertAlgebraNode(node.Input);
			assertIterator.InputOutput = GetIteratorOutput(0, node.Input.OutputList, node.OutputList);
			assertIterator.Message = message;

			BoundRowBufferEntrySet boundRowBufferEntrySet = new BoundRowBufferEntrySet(assertIterator.Input.RowBuffer, node.Input.OutputList);
			assertIterator.Predicate = CreateRuntimeExpression(node.Predicate, boundRowBufferEntrySet);
			SetLastIterator(node, assertIterator);

			return node;
		}