nono opened a new issue #3773:
URL: https://github.com/apache/couchdb/issues/3773


   ## Description
   
   I have two documents with the same value for the field `name`, but not 
encoded in the same way. On our production cluster, when I request the view 
with this name and one encoding, I got no response.
   
   ## Steps to Reproduce
   
   ```sh
   #!/bin/sh
   COUCH_URL="http://localhost:5984";
   
   curl -s -X DELETE "$COUCH_URL/debug"
   sleep 1
   curl -s -X PUT "$COUCH_URL/debug"
   sleep 1
   curl -s -X PUT "$COUCH_URL/debug/_design/by-type-name" -d '{ "views": { 
"by-type-name": { "map": "function (doc) { emit([doc.type, doc.name]) }", 
"reduce": "_count" } } }'
   curl -s -X PUT "$COUCH_URL/debug/doc1" -H "Content-Type: application/json" 
-d '{ "type": "file", "name": "chaîne" }'
   curl -s -X PUT "$COUCH_URL/debug/doc2" -H "Content-Type: application/json" 
-d '{ "type": "file", "name": "chaîne" }'
   
   echo 'We can see that "chaîne" is encoded one time as 69cc82, and one time 
as c3ae'
   curl -s "$COUCH_URL/debug/_all_docs?include_docs=true" | xxd
   
   echo 'See what is in the view'
   curl -s 
"$COUCH_URL/debug/_design/by-type-name/_view/by-type-name?group=true" | xxd
   
   echo 'Request the view, one time for each encoding'
   curl -s 
"$COUCH_URL/debug/_design/by-type-name/_view/by-type-name?group=true" -H 
"Content-Type: application/json" -d '{"keys": [["file", "chaîne"]]}' | xxd
   curl -s 
"$COUCH_URL/debug/_design/by-type-name/_view/by-type-name?group=true" -H 
"Content-Type: application/json" -d '{"keys": [["file", "chaîne"]]}' | xxd
   echo 'Expected: 1 row in each response, but I got 2 rows in first response 
and 0 on the second'
   ```
   
   ## Expected Behaviour
   
   I don't really know if I expect the two results to be merged or not. I would 
accept that both requests return 1 row (with the same key byte per byte). I 
would also accept that both requests return 2 rows (same string with unicode 
normalization).
   
   But at least, I know that returning 0 rows in one response when we have a 
document with the exact byte per byte string looks wrong to me.
   
   ## Your Environment
   
   * CouchDB version used: 
`{"couchdb":"Welcome","version":"2.3.0","git_sha":"07ea0c7","uuid":"c479fe2120631815755a0e4106dfcea0","features":["pluggable-storage-engines","scheduler"],"vendor":{"name":"The
 Apache Software Foundation"}}`
   * Operating system and version: Debian stable
   
   ## Additional Context
   
   I don't reproduce this issue on my computer when taking the same 2.3.0 
version of CouchDB via the official docker image.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to