You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by iilyak <gi...@git.apache.org> on 2016/03/31 00:09:08 UTC

[GitHub] couchdb-couch pull request: Fix normalize_dbname to work with slas...

GitHub user iilyak opened a pull request:

    https://github.com/apache/couchdb-couch/pull/158

    Fix normalize_dbname to work with slashes

    We shouldn't rely on dbname being the last part of path. Since database
    name could include slashes.
    normalize_dbname as the name suggests should accept either binary or
    list and return only binary.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cloudant/couchdb-couch fix-normalize_dbname

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-couch/pull/158.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #158
    
----
commit 69e1a2c3bbae34bc2d88740f30e114759d82c4e3
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Date:   2016-03-30T22:02:52Z

    Fix normalize_dbname to work with slashes
    
    We shouldn't rely on dbname being the last part of path. Since database
    name could include slashes.
    normalize_dbname as the name suggests should accept either binary or
    list and return only binary.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Fix normalize_dbname to work with slas...

Posted by davisp <gi...@git.apache.org>.
Github user davisp commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/158#issuecomment-209546028
  
    This looks odd to me. So I have this right, an example:
    
    Path1 == <<"shards/00000000-ffffffff/username/dbname.234234234">>
    mem3:dbname(Path1) == <<"username/dbname">>
    couch_db:normalize_dbname(Path1) == <<"dbname">>
    
    We used the original normalize_dbname (though never by that name) to check if a db was a _replicator or _users db. The missing detail/assumption here was that we never cared if someone named a database like <<"foo/_replicator">> in so much as it'd just get picked up as a _replicator database. This patch and related changes appear to be wanting to avoid that when we've never cared before.
    
    However I'd go about this fairly differently. normalize_dbname used to be this:
    
    lists:last(binary:split(mem3:dbname(Path), <<"/">>, [global])).
    
    I'd just remove the global option so we only split once.    


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Fix normalize_dbname to work with slas...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/couchdb-couch/pull/158


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Fix normalize_dbname to work with slas...

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/158#issuecomment-206995152
  
    hrm, is that right? is normalize_dbname/1 really exactly what mem3:dbname/1 does? (cc @davisp)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Fix normalize_dbname to work with slas...

Posted by eiri <gi...@git.apache.org>.
Github user eiri commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/158#issuecomment-206980612
  
    lgtm


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---