anchor.diff:  %%%===================================================================
   %%% Internal functions
   %%%===================================================================
  +
  +handle_req(_, State = #state{status = accumulating}) ->
  +    {prev_query_unfinished, [], State};
  +
   handle_req({execute, {QId, Qry}}, State) ->
       %% TODO make this run with multiple sub-queries
       %% TODO fix this up properly
       {ok, DDL} = get_ddl_FIXUP(),
       Queries = riak_kv_qry_compiler:compile(DDL, Qry),
       SEs = [{run_sub_query, {qry, X}, {qid, QId}} || X <- Queries],
  -    {ok, SEs, State};
  +    {ok, SEs, State#state{qid = QId,
  +                          status = accumulating,
  +                          result = []}};
  +
  +handle_req({fetch, QId}, State = #state{qid = QId2})
  +  when QId =/= QId2 ->
  +    {bad_query_id, [], State};
  +handle_req({fetch, QId}, State = #state{qid = QId,
  +                                        status = accumulating}) ->
  +    {in_progress, [], State};
  +handle_req({fetch, QId}, State = #state{qid = QId,
  +                                        result = Result}) ->
  +    {decode_results(Result), [], State#state{qid = undefined,
  +                                             status = accumulating,
  +                                             result = []}};
  +
   handle_req(_Request, State) ->
       {ok, ?NO_SIDEEFFECTS, State}.
   
  
positive.code: 	"PRIMARY KEY((quantum(time, 15, s)), time, user))", 
      Lexed = riak_ql_lexer:get_tokens(SQL),
      {ok, _DDL} = riak_ql_parser:parse(Lexed).
  
  %%%===================================================================
  %%% Unit tests
  
negative.code: %%                                   {stop, Reason, State}
  %% @end
  %%--------------------------------------------------------------------
  handle_info({QId, done},
              State = #state{qid = QId,
                             status = QStatus})
    when QStatus =/= complete ->
      {noreply, State#state{status = complete}};
  
  handle_info({QId, {results, [Chunk]}},
              State = #state{qid = QId,
                             status = QStatus,
                             result = Accumulated})
    when QStatus =:= void; QStatus =:= accumulating ->
      {noreply, State#state{status = accumulating,
                            result = [Chunk | Accumulated]}};
  
  %% what if some late chunks arrive?
  handle_info({QId, {results, _}},
              State = #state{qid = QId,
                             status = complete}) ->
      lager:warn("Discarding late chunk on qid ~p", [QId]),
      {noreply, State};
  
  %% other error conditions
  handle_info({QId1, _}, State = #state{qid = QId2}) ->
      lager:warn("Bad query id ~p (expected ~p)", [QId1, QId2]),
      {noreply, State}.
  
  
  %%--------------------------------------------------------------------
  %% @private
  