Package com.akiban.sql.types

Examples of com.akiban.sql.types.DataTypeDescriptor


        if (parameterList != null && parameterList.size() > 0) {
            // Can also be prepared with ? argument, cf. SET SCHEMA.
            // set the type of parameter node, it should be a varchar
            // max Limits.MAX_IDENTIFIER_LENGTH - non nullable
            ParameterNode p = parameterList.get(0);
            p.setType(new DataTypeDescriptor(TypeId.getBuiltInTypeId(Types.VARCHAR), false,
                                             128));
        }
        {if (true) return role;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here


    }
    setSchema = setSchemaValues();
        if (parameterList != null && parameterList.size() > 0) {
            // Set the type of parameter node, it should be a VARCHAR.
            ParameterNode p = parameterList.get(0);
            p.setType(new DataTypeDescriptor(TypeId.getBuiltInTypeId(Types.VARCHAR), false,
                                             128));
        }
        {if (true) return setSchema;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here

  }

  final public void alterTableAction(TableElementList tableElementList, int[] changeType, int[] behavior) throws ParseException, StandardException {
    TableElementNode tableElement;
    boolean hasAutoIncrement = false;
    DataTypeDescriptor  typeDescriptor;
    Token tok = null;
    String name;
    String newCName;
    TableName newName;
    long[] autoIncrementInfo = new long[4];
View Full Code Here

  final public TableElementNode columnAlterClause(String columnName) throws ParseException, StandardException {
    ValueNode    defaultNode;
    long[] autoIncrementInfo = new long[4];
    long autoIncrementIncrement = 1;
    long autoIncrementRestartWith = 1;
    DataTypeDescriptor typeDescriptor = null;
    if (getToken(2).kind == DATA) {
      jj_consume_token(SET);
      jj_consume_token(DATA);
      jj_consume_token(TYPE);
      typeDescriptor = dataTypeDDL();
View Full Code Here

    throw new Error("Missing return statement in function");
  }

  final public List<DataTypeDescriptor> parameterTypeList() throws ParseException, StandardException {
    List<DataTypeDescriptor> list = new ArrayList<DataTypeDescriptor>();
    DataTypeDescriptor type;
    if (jj_2_107(1)) {
      type = catalogType();
            list.add(type);
      label_52:
      while (true) {
View Full Code Here

        if (rightTypeId.isDateTimeTimeStampTypeId()) {
            if (operator.equals(TypeCompiler.MINUS_OP)) {
                switch (rightTypeId.getTypeFormatId()) {
                case TypeId.FormatIds.DATE_TYPE_ID:
                    // DATE - DATE is INTERVAL DAY
                    return new DataTypeDescriptor(TypeId.INTERVAL_DAY_ID, nullable);
                default:
                    // DATE - other datetime is INTERVAL DAY TO SECOND
                    return new DataTypeDescriptor(TypeId.INTERVAL_DAY_SECOND_ID, nullable);
                }
            }
        }
        else if (rightTypeId.isIntervalTypeId()) {
            if (operator.equals(TypeCompiler.PLUS_OP) ||
                operator.equals(TypeCompiler.MINUS_OP)) {
                switch (rightTypeId.getTypeFormatId()) {
                case TypeId.FormatIds.INTERVAL_YEAR_MONTH_ID:
                    // DATE +/- month year interval is DATE
                    return leftType.getNullabilityType(nullable);
                case TypeId.FormatIds.INTERVAL_DAY_SECOND_ID:
                    if (rightTypeId == TypeId.INTERVAL_DAY_ID)
                        // DATE +/- INTERVAL DAY is DATE
                        return leftType.getNullabilityType(nullable);
                }
                // DATE +/- other interval is TIMESTAMP
                return new DataTypeDescriptor(TypeId.TIMESTAMP_ID, nullable);
            }
        }

        // Unsupported
        return super.resolveArithmeticOperation(leftType, rightType, operator);
View Full Code Here

        TypeId rightTypeId = rightType.getTypeId();
        boolean nullable = leftType.isNullable() || rightType.isNullable();
        if (rightTypeId.isDateTimeTimeStampTypeId()) {
            if (operator.equals(TypeCompiler.MINUS_OP)) {
                // TIMESTAMP - other datetime is INTERVAL DAY TO SECOND
                return new DataTypeDescriptor(TypeId.INTERVAL_DAY_SECOND_ID, nullable);
            }
        }
        else if (rightTypeId.isIntervalTypeId()) {
            if (operator.equals(TypeCompiler.PLUS_OP) ||
                operator.equals(TypeCompiler.MINUS_OP)) {
View Full Code Here

                OrNode newOr = (OrNode)nodeFactory.getNode(NodeTypes.OR_NODE,
                                                           leftBCO,
                                                           rightBCO,
                                                           parserContext);
                /* Work out types (only nullability). */
                DataTypeDescriptor leftType = leftOperand.getType();
                DataTypeDescriptor right0Type = rightOperandList.get(0).getType();
                DataTypeDescriptor right1Type = rightOperandList.get(1).getType();
                boolean orNullable = false;
                if ((leftType != null) && (right0Type != null)) {
                    boolean nullable = leftType.isNullable() || right0Type.isNullable();
                    DataTypeDescriptor leftBCType = new DataTypeDescriptor(TypeId.BOOLEAN_ID,
                                                                           nullable);
                    leftBCO.setType(leftBCType);
                    orNullable = nullable;
                }
                if ((leftType != null) && (right1Type != null)) {
                    boolean nullable = leftType.isNullable() || right1Type.isNullable();
                    DataTypeDescriptor rightBCType = new DataTypeDescriptor(TypeId.BOOLEAN_ID,
                                                                            nullable);
                    rightBCO.setType(rightBCType);
                    orNullable |= nullable;
                }
                if ((leftType != null) && (right0Type != null) && (right1Type != null))
                    newOr.setType(new DataTypeDescriptor(TypeId.BOOLEAN_ID, orNullable));
                return newOr;
            }
            break;
        case NodeTypes.IN_LIST_OPERATOR_NODE:
                /* We want to convert the IN List into = OR = ... as * described below. */
 
View Full Code Here

            (node.getType().getTypeId().isBooleanTypeId()))
            return node;
        return (ValueNode)
            nodeFactory.getNode(NodeTypes.CAST_NODE,
                                node,
                                new DataTypeDescriptor(TypeId.BOOLEAN_ID,
                                                       node.getType().isNullable()),
                                parserContext);
    }
View Full Code Here

            nodeFactory.getNode(NodeTypes.BINARY_EQUALS_OPERATOR_NODE,
                                node, trueNode,
                                parserContext);
        if (node.getType() != null) {
            boolean nullableResult = node.getType().isNullable();
            equalsNode.setType(new DataTypeDescriptor(TypeId.BOOLEAN_ID,
                                                      nullableResult));
        }
        return equalsNode;
    }
View Full Code Here

TOP

Related Classes of com.akiban.sql.types.DataTypeDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.