package sqlancer;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;

public abstract class Query {

    public abstract String getQueryString();

    /**
     * Whether the query could affect the schema (i.e., by add/deleting columns or tables).
     *
     * @return
     */
    public abstract boolean couldAffectSchema();

    /**
     *
     * @param con
     *
     * @return true if the query was successful, false otherwise
     *
     * @throws SQLException
     */
    public abstract boolean execute(Connection con) throws SQLException;

    public abstract Collection<String> getExpectedErrors();

    @Override
    public String toString() {
        return getQueryString();
    }

    public ResultSet executeAndGet(Connection con) throws SQLException {
        throw new AssertionError();
    }

}

@@ -868,10 +868,587 @@
 %0A    %7D%0A%0A
+    public boolean executeLogged(GlobalState%3C?%3E globalState) throws SQLException %7B%0A        logQueryString(globalState);%0A        return execute(globalState.getConnection());%0A    %7D%0A%0A    public ResultSet executeAndGetLogged(GlobalState%3C?%3E globalState) throws SQLException %7B%0A        logQueryString(globalState);%0A        return executeAndGet(globalState.getConnection());%0A    %7D%0A%0A    private void logQueryString(GlobalState%3C?%3E globalState) %7B%0A        if (globalState.getOptions().logEachSelect()) %7B%0A            globalState.getLogger().writeCurrent(getQueryString());%0A        %7D%0A    %7D%0A%0A
 %7D%0A

Add executeLogged methods in the Query class