Files
impala/tests/hs2
Henry Robinson b9034ea0d5 IMPALA-4580: Fix crash with FETCH_FIRST when #rows < result cache size
The following sequence can lead to a crash:

  1. Client sets result cache size to N
  2. Client issues query with #results < N
  3. Client fetches all results, triggering eos and tearing down
     Coordinator::root_sink_.
  4. Client restarts query with FETCH_FIRST.
  5. Client reads all results again. After cache is exhausted,
     Coordinator::GetNext() is called to detect eos condition again.
  6. GetNext() hits DCHECK(root_sink_ != nullptr).

This patch makes GetNext() a no-op if called after it sets *eos,
avoiding the crash..

Testing:
  Regression test that triggered the bug before this fix.

Change-Id: I454cd8a6cf438bdd0c49fd27c2725d8f6c43bb1d
Reviewed-on: http://gerrit.cloudera.org:8080/5335
Reviewed-by: Henry Robinson <henry@cloudera.com>
Reviewed-by: Dan Hecht <dhecht@cloudera.com>
Tested-by: Internal Jenkins
2016-12-03 11:07:04 +00:00
..