Package com.akiban.sql

Examples of com.akiban.sql.StandardException


        if (leftRSN == null)
            {if (true) return newRSN;}

        if (leftRSN.getResultColumns().size() !=
            newRSN.getResultColumns().size()) {
            {if (true) throw new StandardException("Row value size is different");}
        }

        RowsResultSetNode rows;
        if (leftRSN instanceof RowsResultSetNode)
            rows = (RowsResultSetNode)leftRSN;
View Full Code Here


                                                                  null, parserContext),
                                              parserContext));
        break;
      default:
        jj_la1[214] = jj_gen;
        {if (true) throw new StandardException("VALUES is empty");}
      }
    }
  }
View Full Code Here

        /* Figure out whether an ON or USING clause was used */
        onClause = (ValueNode)onOrUsingClause[JOIN_ON];
        usingClause = (ResultColumnList)onOrUsingClause[JOIN_USING];

        if (onClause == null && usingClause == null) {
            {if (true) throw new StandardException("Missing JOIN specification");}
        }

        ton = newJoinNode(leftRSN, rightRSN, onClause, usingClause, joinType);

        /* Mark whether or not we are nested within parens */
 
View Full Code Here

    List<ValueNode> paramList= new ArrayList<ValueNode>();
    colsList(paramList);
        switch(paramList.size())
        {
            case 0:
                {if (true) throw new StandardException("GROUP_CONCAT must have at least one argument");}
            case 1:
                {if (true) return paramList.get(0);}
            default:
                newNode = nodeFactory.getNode(NodeTypes.NEW_INVOCATION_NODE,
                                              "concat",
View Full Code Here

    columnExpression = additiveExpression();
        /* Aggregates not allowed in group by */
        HasNodeVisitor visitor = new HasNodeVisitor(AggregateNode.class);
        columnExpression.accept(visitor);
        if (visitor.hasNode()) {
            {if (true) throw new StandardException("Aggregate values not allowed in GROUP BY");}
        }

        if (columnExpression.isParameterNode()) {
            {if (true) throw new StandardException("Parameters not allowed in GROUP BY");}
        }
        groupingCols.addGroupByColumn(
            (GroupByColumn)nodeFactory.getNode(NodeTypes.GROUP_BY_COLUMN,
                                               columnExpression,
                                               parserContext));
View Full Code Here

        }
      }
    }
        if (optionIndex != -1) {
            if (optionalClauses[optionIndex] != null) {
                {if (true) throw new StandardException("Repeated SEQUENCE clause");}
            }
            optionalClauses[ optionIndex ] = option;
        }
  }
View Full Code Here

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

        StatementNode result = (StatementNode)nodeFactory.getNode(NodeTypes.CREATE_TABLE_NODE,
                                                                  tableName,
                                                                  resultColumns,
View Full Code Here

        while (commaSeparatedProperties.hasMoreTokens()) {
            //Now verify that tokens delimited by ,s follow propertyName=value pattern
            String currentProperty = commaSeparatedProperties.nextToken();
            equalOperatorSeparatedProperty = new StringTokenizer(currentProperty,"=", true);
            if (equalOperatorSeparatedProperty.countTokens() != 3)
                {if (true) throw new StandardException("Invalid properties syntax");}
            else {
                String key = equalOperatorSeparatedProperty.nextToken().trim();
                if (!equalOperatorSeparatedProperty.nextToken().equals("="))
                    {if (true) throw new StandardException("Invalid properties syntax");}
                String value = equalOperatorSeparatedProperty.nextToken().trim();
                parserContext.checkStringLiteralLengthLimit(value);
                /* Trim off the leading and trailing ', and compress all '' to ' */
                if (value.startsWith("'") && value.endsWith("'"))
                    value = trimAndCompressQuotes(value, SINGLEQUOTES, false);
                /* Trim off the leading and trailing ", and compress all "" to " */
                else if (value.startsWith("\u005c"") && value.endsWith("\u005c""))
                    value = trimAndCompressQuotes(value, DOUBLEQUOTES, false);
                else
                    value = value.toUpperCase();
                // Do not allow user to specify multiple values for the same key
                if (properties.put(key, value) != null) {
                    {if (true) throw new StandardException("Duplicate property: " + key);}
                }
            }
        }
        //if this property override is supported in internal mode only, then do that verification here.
        if (!propertiesUseAllowed) {
View Full Code Here

        }
        else {
            /* schema name specified for both */
            if (! (indexName.getSchemaName().equals(
                        tableName.getSchemaName()))) {
                {if (true) throw new StandardException("Specified schemas do not match: " +
                                            indexName + ", " + tableName);}
            }
        }
        {if (true) return (StatementNode)nodeFactory.getNode(NodeTypes.CREATE_INDEX_NODE,
                                                  unique,
View Full Code Here

    switch (jj_nt.kind) {
    case SPECIFIC:
      jj_consume_token(SPECIFIC);
      clauseValue = qualifiedName();
        clausePosition = CreateAliasNode.TABLE_NAME;
        {if (true) throw new StandardException("Not implemented SPECIFIC identifier");}
      break;
    case DYNAMIC:
    case RESULT:
      switch (jj_nt.kind) {
      case DYNAMIC:
        jj_consume_token(DYNAMIC);
        break;
      default:
        jj_la1[301] = jj_gen;
        ;
      }
      jj_consume_token(RESULT);
      jj_consume_token(SETS);
      drs = uint_value();
        if (!isProcedure)
            {if (true) throw new StandardException("Only allowed on procedure: RESULT SETS");}
        clauseValue = drs;
        clausePosition = CreateAliasNode.DYNAMIC_RESULT_SET_COUNT;
      break;
    case LANGUAGE:
      jj_consume_token(LANGUAGE);
      clauseValue = routineLanguage();
                                                 clausePosition = CreateAliasNode.LANGUAGE;
      break;
    case DETERMINISTIC:
      jj_consume_token(DETERMINISTIC);
        clauseValue = Boolean.TRUE;
        clausePosition = CreateAliasNode.DETERMINISTIC;
      break;
    case NOT:
      jj_consume_token(NOT);
      jj_consume_token(DETERMINISTIC);
        clauseValue = Boolean.FALSE;
        clausePosition = CreateAliasNode.DETERMINISTIC;
      break;
    case EXTERNAL:
      jj_consume_token(EXTERNAL);
      switch (jj_nt.kind) {
      case NAME:
        jj_consume_token(NAME);
        clauseValue = string();
      clausePosition = CreateAliasNode.EXTERNAL_NAME;
        break;
      case SECURITY:
        jj_consume_token(SECURITY);
        clauseValue = new Boolean(routineSecurityClause());
        clausePosition = CreateAliasNode.ROUTINE_SECURITY_DEFINER;
        break;
      default:
        jj_la1[302] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      break;
    case PARAMETER:
      jj_consume_token(PARAMETER);
      jj_consume_token(STYLE);
      clauseValue = parameterStyle();
        clausePosition = CreateAliasNode.PARAMETER_STYLE;
      break;
    case AS:
      jj_consume_token(AS);
      clauseValue = string();
        clausePosition = CreateAliasNode.INLINE_DEFINITION;
      break;
    case NO:
      jj_consume_token(NO);
      jj_consume_token(SQL);
        clauseValue = RoutineAliasInfo.SQLAllowed.NO_SQL;
        clausePosition = CreateAliasNode.SQL_CONTROL;
      break;
    case CONTAINS:
      jj_consume_token(CONTAINS);
      jj_consume_token(SQL);
        clauseValue = RoutineAliasInfo.SQLAllowed.CONTAINS_SQL;
        clausePosition = CreateAliasNode.SQL_CONTROL;
      break;
    case READS:
      jj_consume_token(READS);
      jj_consume_token(SQL);
      jj_consume_token(DATA);
        clauseValue = RoutineAliasInfo.SQLAllowed.READS_SQL_DATA;
        clausePosition = CreateAliasNode.SQL_CONTROL;
      break;
    case MODIFIES:
      jj_consume_token(MODIFIES);
      jj_consume_token(SQL);
      jj_consume_token(DATA);
        if (!isProcedure)
            {if (true) throw new StandardException("Only allowed on procedure: MODIFIES SQL DATA");}
        clauseValue = RoutineAliasInfo.SQLAllowed.MODIFIES_SQL_DATA;
        clausePosition = CreateAliasNode.SQL_CONTROL;
      break;
    case CALLED:
    case RETURNS:
      clauseValue = calledOnNullInput(isProcedure);
                                                   clausePosition = CreateAliasNode.NULL_ON_NULL_INPUT;
      break;
    default:
      jj_la1[303] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
        if (clausePosition != -1) {
            // check for repeated clause
            if (routineElements[clausePosition] != null) {

                String which = ROUTINE_CLAUSE_NAMES[clausePosition];
                {if (true) throw new StandardException("Repeated " + which + " clause");}
            }

            routineElements[clausePosition] = clauseValue;
        }
  }
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.