Package com.akiban.sql

Examples of com.akiban.sql.StandardException


      break;
    case RETURNS:
      jj_consume_token(RETURNS);
      jj_consume_token(NULL);
        if (isProcedure)
            {if (true) throw new StandardException("Not allowed for procedure RETURNS NULL ON NULL INPUT");}
        calledOnNull = Boolean.FALSE;
      break;
    default:
      jj_la1[304] = jj_gen;
      jj_consume_token(-1);
View Full Code Here


        /* Parameters not allowed in create view */
        HasNodeVisitor visitor = new HasNodeVisitor(ParameterNode.class);
        queryExpression.accept(visitor);
        if (visitor.hasNode()) {
            {if (true) throw new StandardException("Parameters not allowed in CREATE VIEW");}
        }

        {if (true) return (StatementNode)nodeFactory.getNode(NodeTypes.CREATE_VIEW_NODE,
                                                  tableName,
                                                  resultColumns,
View Full Code Here

        actionEnd = getToken(0).endOffset;
        actionBegin = tokenHolder[0].beginOffset;

        // No DML in action node for BEFORE triggers.
        if (isBefore.booleanValue() && (actionNode instanceof DMLModStatementNode)) {
            {if (true) throw new StandardException("DML not allowed in BEFORE trigger");}
        }

        // No params in trigger action.
        HasNodeVisitor visitor = new HasNodeVisitor(ParameterNode.class);
        actionNode.accept(visitor);
        if (visitor.hasNode()) {
            {if (true) throw new StandardException("Parameters not allowed in trigger action");}
        }

        {if (true) return (StatementNode)nodeFactory.getNode(NodeTypes.CREATE_TRIGGER_NODE,
                                                  triggerName,
                                                  tableName,
View Full Code Here

        // which can be either the 2nd token (w/ normal function name)
        // or the 4th token (w/ qualified function name)), then
        // it's not valid.  Catch it here and throw an "invalid
        // default" error (42894) instead of letting it go as
        // a syntax error (this matches DB2 UDB behavior).
        {if (true) throw new StandardException("Invalid default for " + columnName);}
        } else if (jj_2_88(1)) {
          value = datetimeValueFunction();
        {if (true) return value;}
        } else if (jj_2_89(1)) {
          // Only (valid) thing left is literals (i.e. actual constants).
View Full Code Here

    tok = jj_consume_token(EXACT_NUMERIC);
        try {
            {if (true) return getNumericNode(getNumericString(tok, sign), true);}
        }
        catch (NumberFormatException e) {
            {if (true) throw new StandardException("Integer literal expected", e);}
        }
    throw new Error("Missing return statement in function");
  }
View Full Code Here

            ePosn = doubleString.indexOf('e');
        assert (ePosn != -1) : "no E or e in approximate numeric";

        // there is a limit on the length of a floatingpoint literal in DB2
        if (doubleString.length() > MAX_FLOATINGPOINT_LITERAL_LENGTH)
            {if (true) throw new StandardException("Floating point literal too long");}
        // if there is no '.' before the e, put one in
        dotPosn = doubleString.substring(0,ePosn).indexOf('.');
        if (dotPosn == -1) {
            doubleImage.insert(ePosn,'.');
            doubleString = doubleImage.toString();
            ePosn++;
        }

        try
        {
            doubleValue = Double.valueOf(doubleString);

        }
        catch (NumberFormatException nfe)
        {
            {if (true) throw new StandardException("Invalid double", nfe);}
        }

        double dv = doubleValue.doubleValue();

        // When the value is 0 it's possible rounded, try to detect it by checking if the mantissa is 0.0
        //   "proof of correctness": any nonzero value (mantissa) with less than 30 characters will not be
        //                                                   rounded to 0.0 by a float/real. This correctly detects the case when
        //                                                   the radix/exponent being "too small" (1e-900) giving a value rounded to zero.
        if ( (dv == 0.0d) && (Double.parseDouble(doubleString.substring(0, ePosn-1)) != 0.0d) )
        {
            {if (true) throw new StandardException("Floating point exponent underflow");}
        }

        if (Double.isNaN(dv) || Double.isInfinite(dv))
            {if (true) throw new StandardException("Floating point exponent overflow");}

        {if (true) return (ValueNode)nodeFactory.getNode(NodeTypes.DOUBLE_CONSTANT_NODE,
                                              doubleValue,
                                              parserContext);}
      break;
View Full Code Here

    tok = jj_consume_token(HEX_STRING);
        String hexLiteral = tok.image;

        //there is a maximum limit on the length of the hex constant
        if (hexLiteral.length()-3 > 65535*2)
            {if (true) throw new StandardException("Hex literal too long");}
        if ((hexLiteral.length()-3)%2 == 1)
            {if (true) throw new StandardException("Hex literal invalid");}

        int bitLength = ((hexLiteral.length() - 3) / 2);
        {if (true) return (ValueNode)
                nodeFactory.getNode(NodeTypes.VARBIT_CONSTANT_NODE,
                                    hexLiteral.substring(2, hexLiteral.length() - 1), bitLength,
View Full Code Here

    jj_consume_token(COLUMN);
    oldColumnReference = columnReference();
    jj_consume_token(TO);
    newColumnName = identifier();
        if ((tableName = oldColumnReference.getTableNameNode()) == null)
            {if (true) throw new StandardException("Table name missing in RENAME COLUMN");}

        tableElementList = (TableElementList)nodeFactory
                    .getNode(NodeTypes.TABLE_ELEMENT_LIST, parserContext);

        tableElementList.addTableElement((TableElementNode)nodeFactory
View Full Code Here

        jj_la1[391] = jj_gen;
        ;
      }
      jj_consume_token(NULL);
        if ( dataTypeDescriptor[0] == null ) {
            {if (true) throw new StandardException("[NOT] NULL requires a data type");}
        }
        dataTypeDescriptor[0] = dataTypeDescriptor[0].getNullabilityType(notNull == null);
        {if (true) return null;}
      break;
    case PRIMARY:
View Full Code Here

        jj_consume_token(-1);
        throw new ParseException();
      }
        if (hasAutoIncrement)
            //bug 5724 - auto increment columns not allowed in ALTER TABLE statement
            {if (true) throw new StandardException("Auto increment column not allowed in ALTER TABLE");}

        changeType[0] = DDLStatementNode.ADD_TYPE;
      break;
    case ALTER:
      jj_consume_token(ALTER);
View Full Code Here

TOP

Related Classes of com.akiban.sql.StandardException

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.