[
https://issues.apache.org/jira/browse/GEODE-8668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17223130#comment-17223130
]
ASF GitHub Bot commented on GEODE-8668:
---------------------------------------
sabbey37 commented on a change in pull request #5682:
URL: https://github.com/apache/geode/pull/5682#discussion_r514479205
##########
File path:
geode-redis/src/main/java/org/apache/geode/redis/internal/executor/connection/SelectExecutor.java
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express
+ * or implied. See the License for the specific language governing permissions
and limitations under
+ * the License.
+ *
+ */
+package org.apache.geode.redis.internal.executor.connection;
+
+import static org.apache.geode.redis.internal.RedisConstants.ERROR_SELECT;
+
+import org.apache.geode.redis.internal.executor.AbstractExecutor;
+import org.apache.geode.redis.internal.executor.RedisResponse;
+import org.apache.geode.redis.internal.netty.Command;
+import org.apache.geode.redis.internal.netty.ExecutionHandlerContext;
+
+public class SelectExecutor extends AbstractExecutor {
+
+ @Override
+ public RedisResponse executeCommand(Command command, ExecutionHandlerContext
context) {
+ String dbIndexString = command.getStringKey();
+
+ if (!dbIndexString.equals("0")) {
+ return RedisResponse.error(ERROR_SELECT);
+ }
+
+ return RedisResponse.ok();
Review comment:
I changed this so we are no longer parsing the long and just comparing
the string value. Let me know if you think this is the right approach.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Implement Redis SELECT command
> ------------------------------
>
> Key: GEODE-8668
> URL: https://issues.apache.org/jira/browse/GEODE-8668
> Project: Geode
> Issue Type: Improvement
> Components: redis
> Reporter: Sarah Abbey
> Assignee: Sarah Abbey
> Priority: Major
> Labels: pull-request-available
>
> We are implementing [SELECT|https://redis.io/commands/select] because some
> Redis analysis tools (like Redis Insight) require the {{SELECT}} command in
> order to function properly. {{SELECT}} returns {{ERR Only DB 0 supported}}
> if anything other than 0 is passed in as a DB index argument.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)