void assignToRangeVariables() {

        for (int i = 0; i < rangeVariables.length; i++) {
            boolean isOuter = rangeVariables[i].isLeftJoin
                              || rangeVariables[i].isRightJoin;

            if (isOuter) {
                assignToRangeVariable(rangeVariables[i], i,
                                      joinExpressions[i], true);
                assignToRangeVariable(rangeVariables[i], i,
                                      whereExpressions[i], false);
            } else {
                joinExpressions[i].addAll(whereExpressions[i]);
                assignToRangeVariable(rangeVariables[i], i,
                                      joinExpressions[i], true);
            }

            // A VoltDB extension to disable
            // Turn off some weird rewriting of in expressions based on index support for the query.
            // This makes it simpler to parse on the VoltDB side,
            // at the expense of HSQL performance.
            // Also fixed an apparent join/where confusion?
            if (inExpressions[i] != null) {
                if (!flags[i] && isOuter) {
                    rangeVariables[i].addJoinCondition(inExpressions[i]);
                } else {
                    rangeVariables[i].addWhereCondition(inExpressions[i]);
                }
            /* disable 7 lines ...
            if (rangeVariables[i].hasIndexCondition()
                    && inExpressions[i] != null) {
                if (!flags[i] && isOuter) {
                    rangeVariables[i].addWhereCondition(inExpressions[i]);
                } else {
                    rangeVariables[i].addJoinCondition(inExpressions[i]);
                }
            ... disabled 7 lines */
            // End of VoltDB extension

                inExpressions[i] = null;

                inExpressionCount--;
            }
        }

        if (inExpressionCount != 0) {
            // A VoltDB extension to disable
            // This will never be called because of the change made to the block above
            assert(false);
            // End of VoltDB extension
            setInConditionsAsTables();
        }
    }
void assignToRangeVariables ( ) { for ( int i = 0 ; i < rangeVariables . length ; i ++ ) { boolean isOuter = rangeVariables [ i ] . isLeftJoin || rangeVariables [ i ] . isRightJoin ; if ( isOuter ) { assignToRangeVariable ( rangeVariables [ i ] , i , joinExpressions [ i ] , true ) ; assignToRangeVariable ( rangeVariables [ i ] , i , whereExpressions [ i ] , false ) ; } else { joinExpressions [ i ] . addAll ( whereExpressions [ i ] ) ; assignToRangeVariable ( rangeVariables [ i ] , i , joinExpressions [ i ] , true ) ; } if ( inExpressions [ i ] != null ) { if ( ! flags [ i ] && isOuter ) { rangeVariables [ i ] . addJoinCondition ( inExpressions [ i ] ) ; } else { rangeVariables [ i ] . addWhereCondition ( inExpressions [ i ] ) ; } inExpressions [ i ] = null ; inExpressionCount -- ; } } if ( inExpressionCount != 0 ) { assert ( false ) ; setInConditionsAsTables ( ) ; } }
Assigns conditions to range variables and converts suitable IN conditions
to table lookup.