-
Notifications
You must be signed in to change notification settings - Fork 397
Expand file tree
/
Copy pathCnosDBGlobalState.java
More file actions
28 lines (24 loc) · 923 Bytes
/
CnosDBGlobalState.java
File metadata and controls
28 lines (24 loc) · 923 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
package sqlancer.cnosdb;
import sqlancer.ExecutionTimer;
import sqlancer.GlobalState;
import sqlancer.cnosdb.client.CnosDBConnection;
import sqlancer.common.query.Query;
public class CnosDBGlobalState extends GlobalState<CnosDBOptions, CnosDBSchema, CnosDBConnection> {
@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();
}
}
@Override
public CnosDBSchema readSchema() throws Exception {
return CnosDBSchema.fromConnection(getConnection());
}
}