Open maksimlikharev opened 5 years ago
With the change - (env) anuj@anuj-VirtualBox:~/work/dynomite$ redis-cli -h 127.0.1.1 -p 8102 127.0.1.1:8102> SELECT 0 <<<<<<<< works now OK 127.0.1.1:8102> SELECT 1 Error: Server closed the connection 127.0.1.1:8102> SELECT 2 Error: Server closed the connection 127.0.1.1:8102> SELECT 200000 Error: Server closed the connection 127.0.1.1:8102>
Without the change it rejected "SELECT 0" (env) anuj@anuj-VirtualBox:~/work/dynomite$ redis-cli -h 127.0.1.1 -p 8102 127.0.1.1:8102> SELECT 0 Error: Server closed the connection 127.0.1.1:8102> SELECT 1 Error: Server closed the connection 127.0.1.1:8102> SELECT 3 Error: Server closed the connection 127.0.1.1:8102> quit; Error: Server closed the connection 127.0.1.1:8102> quit
The code change looks fine to me. @smukil - Can you take a final look at this change?
In some cases Redis clients do SELECT 0, even if no db explicitly specified.
Purpose of this PR to support SELECT 0 and return error if other value is provided.