All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sqlancer.SQLGlobalState Maven / Gradle / Ivy

Go to download

SQLancer finds logic bugs in Database Management Systems through automatic testing

There is a newer version: 2.0.0
Show newest version
package sqlancer;

import sqlancer.common.query.Query;
import sqlancer.common.schema.AbstractSchema;

/**
 * Represents a global state that is valid for a testing session on a given database.
 *
 * @param 
 *            the option parameter
 * @param 
 *            the schema parameter
 */
public abstract class SQLGlobalState, S extends AbstractSchema>
        extends GlobalState {

    @Override
    protected void executeEpilogue(Query q, boolean success, ExecutionTimer timer) throws Exception {
        boolean logExecutionTime = getOptions().logExecutionTime();
        if (success && getOptions().printSucceedingStatements()) {
            System.out.println(q.getQueryString());
        }
        if (logExecutionTime) {
            getLogger().writeCurrent(" -- " + timer.end().asString());
        }
        if (q.couldAffectSchema()) {
            updateSchema();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy