Fix issue #16669 When check the untouched index, we should also check the memory-buffer in the session too.