public void reset() {
    scopes.clear();
    // Make sure we use the most up to date authorizer in CQs.
    methodInvocationAuthorizer = queryConfigurationService.getMethodAuthorizer();
  }
Added to reset the state from the last execution. This is added for CQs only.
geode-core/src/main/java/org/apache/geode/cache/query/internal/ExecutionContext.java