Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynomite, Support REDIS SELECT 0 command #670

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

maksimlikharev
Copy link

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.

@anujphadke
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants