Details
-
Bug
-
Resolution: Fixed
-
Major
-
2.0
-
Security Level: Public
-
None
-
latest cluster run
Description
Steps to reproduce:
1. Install beer-sample database
2. Go to view 'brewery_beers' and while doing view query change the skip to -2(a negative number).
Attached page is displayed which shows webpage is unavailable. We can change it to something similar when limit is negative e.g.
negative LIMIT Query
bash> curl -v -s 'http://127.0.0.1:9500/beer-sample/_design/beer/_view/brewery_beers?connection_timeout=60000&skip=2&limit=-10'
- About to connect() to 127.0.0.1 port 9500 (#0)
- Trying 127.0.0.1... connected
- Connected to 127.0.0.1 (127.0.0.1) port 9500 (#0)
> GET /beer-sample/_design/beer/_view/brewery_beers?connection_timeout=60000&skip=2&limit=-10 HTTP/1.1
> User-Agent: curl/7.21.4 (x86_64-unknown-linux-gnu) libcurl/7.21.4 OpenSSL/1.0.1 zlib/1.2.3.4
> Host: 127.0.0.1:9500
> Accept: /
>
< HTTP/1.1 400 Bad Request
< Server: MochiWeb/1.0 (Any of you quaids got a smint?)
< Date: Wed, 07 Nov 2012 10:04:14 GMT
< Content-Type: text/plain;charset=utf-8
< Content-Length: 95
< Cache-Control: must-revalidate
< {"error":"query_parse_error","reason":"Invalid value for positive integer parameter: \"-10\""} - Connection #0 to host 127.0.0.1 left intact
- Closing connection #0
negative SKIP Query
bash> curl -v -s 'http://127.0.0.1:9500/beer-sample/_design/beer/_view/brewery_beers?connection_timeout=60000&skip=-2&limit=10'
- About to connect() to 127.0.0.1 port 9500 (#0)
- Trying 127.0.0.1... connected
- Connected to 127.0.0.1 (127.0.0.1) port 9500 (#0)
> GET /beer-sample/_design/beer/_view/brewery_beers?connection_timeout=60000&skip=-2&limit=10 HTTP/1.1
> User-Agent: curl/7.21.4 (x86_64-unknown-linux-gnu) libcurl/7.21.4 OpenSSL/1.0.1 zlib/1.2.3.4
> Host: 127.0.0.1:9500
> Accept: /
>
< HTTP/1.1 200 OK
< Transfer-Encoding: chunked
< Server: MochiWeb/1.0 (Any of you quaids got a smint?)
< Date: Wed, 07 Nov 2012 10:03:58 GMT
< Content-Type: text/plain;charset=utf-8
< Cache-Control: must-revalidate
< - Received problem 2 in the chunky parser
- Closing connection #0
Attachments
For Gerrit Dashboard: MB-7117 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
22336,2 | MB-7117 Fix validation of skip parameter (must be non-negative) | master | couchdb | Status: MERGED | +2 | +1 |