Add a new test to the query buffer

for problem uncovered by MTT. Just wanted to show that the correct processing produces the correct results (with comments).