Package org.lealone.engine

Examples of org.lealone.engine.Database.update()


        for (int j = 0; j < columns.length; j++) {
            int selectivity = result.currentRow()[j].getInt();
            columns[j].setSelectivity(selectivity);
        }
        if (manual) {
            db.update(session, table);
        } else {
            Session s = db.getSystemSession();
            if (s != session) {
                // if the current session is the system session
                // (which is the case if we are within a trigger)
View Full Code Here


            if (s != session) {
                // if the current session is the system session
                // (which is the case if we are within a trigger)
                // then we can't update the statistics because
                // that would unlock all locked objects
                db.update(s, table);
                s.commit(true);
            }
        }
    }
View Full Code Here

                // no change
                break;
            }
            checkNoNullValues();
            oldColumn.setNullable(false);
            db.update(session, table);
            break;
        }
        case CommandInterface.ALTER_TABLE_ALTER_COLUMN_NULL: {
            if (oldColumn.isNullable()) {
                // no change
View Full Code Here

                // no change
                break;
            }
            checkNullable();
            oldColumn.setNullable(true);
            db.update(session, table);
            break;
        }
        case CommandInterface.ALTER_TABLE_ALTER_COLUMN_DEFAULT: {
            checkDefaultReferencesTable(defaultExpression);
            oldColumn.setSequence(null);
View Full Code Here

        case CommandInterface.ALTER_TABLE_ALTER_COLUMN_DEFAULT: {
            checkDefaultReferencesTable(defaultExpression);
            oldColumn.setSequence(null);
            oldColumn.setDefaultExpression(session, defaultExpression);
            removeSequence(sequence);
            db.update(session, table);
            break;
        }
        case CommandInterface.ALTER_TABLE_ALTER_COLUMN_CHANGE_TYPE: {
            // if the change is only increasing the precision, then we don't
            // need to copy the table because the length is only a constraint,
View Full Code Here

            // need to copy the table because the length is only a constraint,
            // and does not affect the storage structure.
            if (oldColumn.isWideningConversion(newColumn)) {
                convertAutoIncrementColumn(newColumn);
                oldColumn.copy(newColumn);
                db.update(session, table);
            } else {
                if (table.supportsAlterColumnWithCopyData()) { //TODO
                    oldColumn.setSequence(null);
                    oldColumn.setDefaultExpression(session, null);
                    oldColumn.setConvertNullToDefault(false);
View Full Code Here

            if (table.supportsAlterColumnWithCopyData()) { //TODO
                copyData();
            } else {
                for (Column c : columnsToAdd)
                    table.addColumn(c);
                db.update(session, table);
            }
            break;
        }
        case CommandInterface.ALTER_TABLE_DROP_COLUMN: {
            if (table.getColumns().length == 1) {
View Full Code Here

            table.dropSingleColumnConstraintsAndIndexes(session, oldColumn);
            if (table.supportsAlterColumnWithCopyData()) { //TODO
                copyData();
            } else {
                table.dropColumn(oldColumn);
                db.update(session, table);
            }
            break;
        }
        case CommandInterface.ALTER_TABLE_ALTER_COLUMN_SELECTIVITY: {
            int value = newSelectivity.optimize(session).getValue(session).getInt();
View Full Code Here

            break;
        }
        case CommandInterface.ALTER_TABLE_ALTER_COLUMN_SELECTIVITY: {
            int value = newSelectivity.optimize(session).getValue(session).getInt();
            oldColumn.setSelectivity(value);
            db.update(session, table);
            break;
        }
        default:
            DbException.throwInternalError("type=" + type);
        }
View Full Code Here

            Database db = session.getDatabase();
            if (newRight == 0) {
                db.removeDatabaseObject(session, right);
            } else {
                right.setRightMask(newRight);
                db.update(session, right);
            }
        }
    }

    private void revokeRole(Role grantedRole) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.