[ 
https://issues.apache.org/jira/browse/COUCHDB-2900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15213023#comment-15213023
 ] 

ASF subversion and git services commented on COUCHDB-2900:
----------------------------------------------------------

Commit 3ac6fe38b021122dedb2cc67a6f888ac9bd21529 in couchdb's branch 
refs/heads/master from [~rnewson]
[ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=3ac6fe3 ]

Support raw collation

COUCHDB-2900


> CouchDB 2.0: raw collation order is not respected when a database has 
> multiple shards
> -------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-2900
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2900
>             Project: CouchDB
>          Issue Type: Bug
>          Components: View Server Support
>            Reporter: Will Holley
>            Priority: Blocker
>              Labels: regression
>             Fix For: 2.0.0
>
>
> In CouchDB 1.X, specifying raw collation in a view definition changes the 
> result order:
> {code}
> $ curl http://localhost:5984/nullsort -XPUT
> {"ok":true}
> $ curl http://localhost:5984/nullsort/_bulk_docs -XPOST 
> -H'Content-Type:application/json' -d '{"docs":[{"test":1},{"test":null}]}'
> [{"ok":true,"id":"a9f86d3c33d25c15de6eca8578001d98","rev":"1-ea7a185b492abc69a6c8e0358d244a98"},{"ok":true,"id":"a9f86d3c33d25c15de6eca8578002c25","rev":"1-9b2a5b981a9dd0ad1b3a3e826498e9bb"}]
> $ curl http://localhost:5984/nullsort -XPOST 
> -H'Content-Type:application/json' -d '{"_id": 
> "_design/test","views":{"nullsort":{"map": "function (doc) {emit(doc.test, 
> 1);}","options":{"collation": "raw"}}}}'
> {"ok":true,"id":"_design/test","rev":"1-2df3ab52426a7138b6898791024595d0"}
> $ curl http://localhost:5984/nullsort/_design/test/_view/nullsort
> {"total_rows":2,"offset":0,"rows":[
> {"id":"a9f86d3c33d25c15de6eca8578001d98","key":1,"value":1},
> {"id":"a9f86d3c33d25c15de6eca8578002c25","key":null,"value":1}
> ]}
> {code}
> In CouchDB 2.0, with n=1, q=4:
> {code}
> $ curl http://localhost:15984/nullsort -XPUT
> {"ok":true}
> $ curl http://localhost:15984/nullsort/_bulk_docs -XPOST 
> -H'Content-Type:application/json' -d '{"docs":[{"test":1},{"test":null}]}'
> [{"ok":true,"id":"51cf4c5a56f86f524b0e36f52800029d","rev":"1-ea7a185b492abc69a6c8e0358d244a98"},{"ok":true,"id":"51cf4c5a56f86f524b0e36f528000d9c","rev":"1-9b2a5b981a9dd0ad1b3a3e826498e9bb"}]
> $ curl http://localhost:15984/nullsort -XPOST 
> -H'Content-Type:application/json' -d '{"_id": 
> "_design/test","views":{"nullsort":{"map": "function (doc) {emit(doc.test, 
> 1);}","options":{"collation": "raw"}}}}'
> {"ok":true,"id":"_design/test","rev":"1-2df3ab52426a7138b6898791024595d0"}
> $ curl http://localhost:15984/nullsort/_design/test/_view/nullsort
> {"total_rows":2,"offset":0,"rows":[
> {"id":"51cf4c5a56f86f524b0e36f528000d9c","key":null,"value":1},
> {"id":"51cf4c5a56f86f524b0e36f52800029d","key":1,"value":1}
> ]}
> {code}
> Note that null is returned before 1.
> If q=1, the ordering matches CouchDB 1.X



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to