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

Fix GEOHASH / GEOPOS should return nil array instead of error for non-existing key #1573

Merged
merged 5 commits into from
Jul 12, 2023

Conversation

enjoy-binbin
Copy link
Member

@enjoy-binbin enjoy-binbin commented Jul 10, 2023

The current code GETHASH returns an error for a key
that doesn't exist:

127.0.0.1:6666> geohash mykey a b c
(error) ERR NotFound:

In Redis this would return:

127.0.0.1:6379> geohash mykey a b c
1) (nil)
2) (nil)
3) (nil)

GEOPOS alos have the same issue, this PR fixes these
inconsistency in this case.

… key

The current code GETHASH returns an error for a key
that doesn't exist:
```
127.0.0.1:6666> geohash mykey a b c
(error) ERR NotFound:
```

In Redis this would return:
```
127.0.0.1:6379> geohash mykey a b c
1) (nil)
2) (nil)
3) (nil)
```

This PR fixes the inconsistency in this case.
@enjoy-binbin enjoy-binbin changed the title Fix GEOHASH should return nil array instead of error for non-existing key Fix GEOHASH / GEOPOS should return nil array instead of error for non-existing key Jul 10, 2023
@git-hulk git-hulk merged commit 03ceb6e into apache:unstable Jul 12, 2023
24 checks passed
@enjoy-binbin enjoy-binbin deleted the geohash_nil branch July 12, 2023 04:13
git-hulk pushed a commit to git-hulk/kvrocks that referenced this pull request Jul 30, 2023
…-existing key (apache#1573)

The current code GETHASH returns an error for a key
that doesn't exist:
```
127.0.0.1:6666> geohash mykey a b c
(error) ERR NotFound:
```

In Redis, this would return:
```
127.0.0.1:6379> geohash mykey a b c
1) (nil)
2) (nil)
3) (nil)
```

GEOPOS also has the same issue, this PR fixes these inconsistencies in this case.
git-hulk pushed a commit that referenced this pull request Aug 1, 2023
…-existing key (#1573)

The current code GETHASH returns an error for a key
that doesn't exist:
```
127.0.0.1:6666> geohash mykey a b c
(error) ERR NotFound:
```

In Redis, this would return:
```
127.0.0.1:6379> geohash mykey a b c
1) (nil)
2) (nil)
3) (nil)
```

GEOPOS also has the same issue, this PR fixes these inconsistencies in this case.
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.

2 participants