You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Russell Branca (JIRA)" <ji...@apache.org> on 2014/11/18 21:02:34 UTC

[jira] [Commented] (COUCHDB-2422) Cassim and underscored databases

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

Russell Branca commented on COUCHDB-2422:
-----------------------------------------

A simple fix here is to just prepend a string like "db/" to the front of the id [1]. This would solve the problem but I think we should also do this to better represent that the document corresponds to settings for a database. This would make it easier to distinguish between database specific docs and global docs.


[1] https://github.com/apache/couchdb-cassim/blob/master/src/cassim_metadata_cache.erl#L73

> Cassim and underscored databases
> --------------------------------
>
>                 Key: COUCHDB-2422
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2422
>             Project: CouchDB
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Database Core
>            Reporter: Alexander Shorin
>
> 1. Run dev cluster
> 2. Create {{_users}} database
> {code}
> http PUT http://localhost:15984/_users
> HTTP/1.1 201 Created
> Cache-Control: must-revalidate
> Content-Length: 12
> Content-Type: text/plain; charset=utf-8
> Date: Fri, 31 Oct 2014 10:36:19 GMT
> Location: http://localhost:15984/_users
> Server: CouchDB/9938fac (Erlang OTP/17)
> X-Couch-Request-ID: f273be89
> X-CouchDB-Body-Time: 0
> {"ok":true}
> {code}
> 3. Create cassim database
> {code}
> http PUT http://localhost:15984/cassim
> HTTP/1.1 201 Created
> Cache-Control: must-revalidate
> Content-Length: 12
> Content-Type: text/plain; charset=utf-8
> Date: Fri, 31 Oct 2014 10:37:06 GMT
> Location: http://localhost:15984/cassim
> Server: CouchDB/9938fac (Erlang OTP/17)
> X-Couch-Request-ID: 8bdcc974
> X-CouchDB-Body-Time: 0
> {"ok":true}
> {code}
> 4. Try to access {{_users}} database:
> {code}
> http http://localhost:15984/_users
> HTTP/1.1 400 Bad Request
> Cache-Control: must-revalidate
> Content-Length: 89
> Content-Type: text/plain; charset=utf-8
> Date: Fri, 31 Oct 2014 10:34:22 GMT
> Server: CouchDB/9938fac (Erlang OTP/17)
> X-Couch-Request-ID: e9f4a5b3
> X-CouchDB-Body-Time: 0
> {"error":"bad_request","reason":"Only reserved document ids may start with underscore."}
> {code}
> Oh wait...? This is because cassim creates documents with database name as the prefix and for {{_users}} and {{_replicator}} it clashes with restrictions about document names.



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