Matt Stancliff 14cedd4279 Fix key extraction for SORT
We only want to use the last STORE key, but we have to record
we actually found a STORE key so we can increment the final return
key count.

Test added to prevent further regression.

Closes #1883, #1645, #1647
2014-08-26 10:41:01 +02:00
..
2014-08-26 10:41:01 +02:00
2014-02-27 15:52:43 +01:00
2012-04-18 11:34:18 +02:00
2014-07-18 12:20:56 +02:00
2010-10-15 12:54:53 +02:00
2013-11-05 15:19:44 +01:00
2014-08-26 10:41:01 +02:00