-
Notifications
You must be signed in to change notification settings - Fork 397
Expand file tree
/
Copy pathSQLGlobalState.java
More file actions
30 lines (27 loc) · 964 Bytes
/
SQLGlobalState.java
File metadata and controls
30 lines (27 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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 <O>
* the option parameter
* @param <S>
* the schema parameter
*/
public abstract class SQLGlobalState<O extends DBMSSpecificOptions<?>, S extends AbstractSchema<?, ?>>
extends GlobalState<O, S, SQLConnection> {
@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();
}
}
}