package postgres.ast;

import postgres.PostgresSchema.PostgresDataType;

public class PostgresConcatOperation extends PostgresExpression {

	private final PostgresExpression left;
	private final PostgresExpression right;

	public PostgresConcatOperation(PostgresExpression left, PostgresExpression right) {
		this.left = left;
		this.right = right;
	}

	@Override
	public PostgresDataType getExpressionType() {
		return PostgresDataType.TEXT;
	}

	@Override
	public PostgresConstant getExpectedValue() {
		String leftStr = left.getExpectedValue().cast(PostgresDataType.TEXT).getTextRepresentation();
		String rightStr = right.getExpectedValue().cast(PostgresDataType.TEXT).getTextRepresentation();
		return PostgresConstant.createTextConstant(leftStr + rightStr);
	}
	
	public PostgresExpression getLeft() {
		return left;
	}
	
	public PostgresExpression getRight() {
		return right;
	}
	
	
}

@@ -497,16 +497,148 @@
 lue() %7B%0A
+%09%09if (left.getExpectedValue().isNull() %7C%7C right.getExpectedValue().isNull()) %7B%0A%09%09%09return PostgresConstant.createNullConstant();%0A%09%09%7D%0A
 %09%09String
@@ -695,32 +695,40 @@
 taType.TEXT).get
+Unquoted
 TextRepresentati
@@ -809,16 +809,24 @@
 EXT).get
+Unquoted
 TextRepr

Fix the concat implementation