couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nolan Lawson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-1494) %00 document _id.
Date Fri, 18 Apr 2014 18:19:16 GMT

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

Nolan Lawson commented on COUCHDB-1494:
---------------------------------------

Slightly off-topic, but there's [a bug in Chrome|https://code.google.com/p/chromium/issues/detail?can=2&q=null%20characters%20url&colspec=ID%20Pri%20M%20Iteration%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified&id=356924&thanks=356924&ts=1395877710]
where URLs containing %00 are not considered valid.

> %00 document _id.
> -----------------
>
>                 Key: COUCHDB-1494
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1494
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 1.3
>            Reporter: Alexander Shorin
>
> There is possible to create document with null byte _id:
> curl -X PUT http://localhost:5984/invis/%00 -H "Content-Type: application/json" -d '{"I
am":"invincible man!"}'
> Every thing is ok with such document: you could access to him by %00 name, process him
in views and ever replicate without problem.
> Fun begins when such document receives first update:
> curl -X PUT http://localhost:5984/invis/%00 -H "Content-Type: application/json" -d '{"I
am":"invincible man!", "_rev": "1-41c7e2af5d2154c4f33de3f76451417e"}'
> Now replicator tells that he done his job right:
> {
> "session_id":"eb01826560247c82dff704388793a505",
> "start_time":"Thu, 07 Jun 2012 23:01:30 GMT",
> "end_time":"Thu, 07 Jun 2012 23:01:30 GMT",
> "start_last_seq":0,
> "end_last_seq":1,
> "recorded_seq":1,
> "missing_checked":1,
> "missing_found":1,
> "docs_read":1,
> "docs_written":1,
> "doc_write_failures":0
> }
> But actually he didn't:
> curl -X GET http://localhost:5984/invis2/_all_docs
> {
> "total_rows":1,
> "offset":0,
> "rows":[
>   {
>     "id":"_design/_replicator",
>     "key":"_design/_replicator",
>     "value":{"rev":"1-5bfa2c99eefe2b2eb4962db50aa3cfd4"}
>   }
> ]}
> And document does not ever exists:
> curl -X GET http://localhost:5984/invis2/%00
> {"error":"not_found","reason":"missing"}
> Attempt to recreate him now fails with weird explanation:
> curl -X PUT http://localhost:5984/invis2/%00 -H "Content-Type: application/json" -d '{"foo":"bar"}'
> {"error":"forbidden","reason":"The `source' property must exist and be either a string
or an object."}
> This issue is similar to COUCHDB-1493, but mostly focused on invalid doc _id case and
related operations.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message