@@ -0,0 +1,2317 @@
+/**%0A * Copyright (C) 2011 Akiban Technologies Inc.%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License, version 3,%0A * as published by the Free Software Foundation.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with this program.  If not, see http://www.gnu.org/licenses.%0A */%0A%0Apackage com.akiban.server.expression.std;%0A%0Aimport com.akiban.server.expression.Expression;%0Aimport com.akiban.server.expression.ExpressionEvaluation;%0Aimport com.akiban.server.types.AkType;%0Aimport com.akiban.server.types.NullValueSource;%0Aimport com.akiban.server.types.ValueSource;%0Aimport com.akiban.server.types.conversion.Converters;%0Aimport com.akiban.server.types.util.ValueHolder;%0A%0Apublic class CastExpression extends AbstractUnaryExpression%0A%7B%0A    private static final class InnerEvaluation extends AbstractUnaryExpressionEvaluation %7B%0A        public InnerEvaluation(AkType type, ExpressionEvaluation ev) %7B%0A            super(ev);%0A            this.type = type;%0A        %7D%0A%0A        @Override%0A        public ValueSource eval() %7B%0A            ValueSource operandSource = operand();%0A            if (operandSource.isNull())%0A                return NullValueSource.only();%0A            if (type.equals(operandSource.getConversionType()))%0A                return operandSource;%0A            return Converters.convert(operandSource, holder());%0A        %7D%0A%0A        private ValueHolder holder() %7B%0A            if (holder == null) %7B%0A                holder = new ValueHolder();%0A                holder.expectType(type);%0A            %7D%0A            return holder;%0A        %7D%0A%0A        private final AkType type;%0A        private ValueHolder holder;%0A    %7D%0A     %0A    public CastExpression(AkType type, Expression operand) %7B%0A        super(type, operand);%0A    %7D%0A%0A    @Override%0A    protected String name() %7B%0A        return %22CAST_%22 + valueType();%0A    %7D%0A%0A    @Override%0A    public ExpressionEvaluation evaluation() %7B%0A        return new InnerEvaluation(valueType(), operandEvaluation());%0A    %7D%0A%7D%0A

Add a real Cast expression.