sqlancer.SQLGlobalState Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sqlancer Show documentation
Show all versions of sqlancer Show documentation
SQLancer finds logic bugs in Database Management Systems through automatic testing
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();
}
}
}