Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 59699C8EF for ; Thu, 7 Jun 2012 23:17:24 +0000 (UTC) Received: (qmail 27891 invoked by uid 500); 7 Jun 2012 23:17:23 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 27817 invoked by uid 500); 7 Jun 2012 23:17:23 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 27790 invoked by uid 99); 7 Jun 2012 23:17:23 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jun 2012 23:17:23 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 80ED1140BEF for ; Thu, 7 Jun 2012 23:17:23 +0000 (UTC) Date: Thu, 7 Jun 2012 23:17:23 +0000 (UTC) From: "Alexander Shorin (JIRA)" To: dev@couchdb.apache.org Message-ID: <748458321.50425.1339111043531.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Created] (COUCHDB-1494) %00 document _id. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Alexander Shorin created COUCHDB-1494: ----------------------------------------- Summary: %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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira