redict/tests/unit
antirez 36741b2c81 Scripting: Force SORT BY constant determinism inside SORT itself.
SORT is able to return (faster than when ordering) unordered output if
the "BY" clause is used with a constant value. However we try to play
well with scripting requirements of determinism providing always sorted
outputs when SORT (and other similar commands) are called by Lua
scripts.

However we used the general mechanism in place in scripting in order to
reorder SORT output, that is, if the command has the "S" flag set, the
Lua scripting engine will take an additional step when converting a
multi bulk reply to Lua value, calling a Lua sorting function.

This is suboptimal as we can do it faster inside SORT itself.
This is also broken as issue #545 shows us: basically when SORT is used
with a constant BY, and additionally also GET is used, the Lua scripting
engine was trying to order the output as a flat array, while it was
actually a list of key-value pairs.

What we do know is to recognized if the caller of SORT is the Lua client
(since we can check this using the REDIS_LUA_CLIENT flag). If so, and if
a "don't sort" condition is triggered by the BY option with a constant
string, we force the lexicographical sorting.

This commit fixes this bug and improves the performance, and at the same
time simplifies the implementation. This does not mean I'm smart today,
it means I was stupid when I committed the original implementation ;)
2012-09-05 01:17:49 +02:00
..
type Added a new hash fuzzy tester. 2012-06-12 15:21:54 +02:00
aofrw.tcl Tests modified to account for INFO fields renaming. 2012-05-25 15:20:59 +02:00
auth.tcl Fix for issue #132. Now AUTH raises an error if no server password is configured. 2011-10-10 22:21:17 +02:00
basic.tcl more valgrind (and other archs) friendly testing of floating number related features. 2011-11-16 14:40:50 +01:00
bitops.tcl BITOP bug when called against non existing keys fixed. 2012-05-31 21:52:47 +02:00
cas.tcl SORT with STORE removes key if result is empty. This fixes issue #227. 2012-01-30 07:36:49 +01:00
dump.tcl Fixed RESTORE hash failure (Issue #532) 2012-06-02 10:24:27 +02:00
expire.tcl Show problem with 'keys' command with specific command sequence. 2012-05-01 10:51:59 +02:00
introspection.tcl Tests for MONITOR. 2012-04-07 11:26:24 +02:00
limits.tcl More robust maxclients test. 2012-04-18 11:34:18 +02:00
maxmemory.tcl Maxmemory test 2011-07-28 12:32:52 +02:00
obuf-limits.tcl even less false positive on obuf-limits test. 2012-02-22 11:25:30 +01:00
other.tcl false positive in expire tests mitigated with a sleep, but other solutions exist if needed later. 2012-01-26 16:45:08 +01:00
printver.tcl Print version info before running the test 2011-05-20 11:44:54 +02:00
protocol.tcl New time limit for protocol desync test set to 30 seconds to reduce false positives. 2012-04-23 10:57:43 +02:00
pubsub.tcl more pub/sub tests 2010-06-16 11:03:23 +02:00
quit.tcl Add tests for OK on QUIT 2010-10-15 12:54:53 +02:00
scripting.tcl Scripting: Force SORT BY constant determinism inside SORT itself. 2012-09-05 01:17:49 +02:00
slowlog.tcl Limit memory used by big SLOWLOG entries. 2012-04-21 20:34:45 +02:00
sort.tcl Added test for SORT corner case: pattern ending with just "->". 2012-04-17 16:28:59 +02:00