You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Ryszard Szopa (JIRA)" <ji...@apache.org> on 2008/06/23 01:55:44 UTC

[jira] Created: (COUCHDB-83) undefined in an array as a key causes an Erlang error

undefined in an array as a key causes an Erlang error
-----------------------------------------------------

                 Key: COUCHDB-83
                 URL: https://issues.apache.org/jira/browse/COUCHDB-83
             Project: CouchDB
          Issue Type: Bug
          Components: JavaScript View Server
    Affects Versions: 0.7.2, 0.8
            Reporter: Ryszard Szopa


Whenever a view emits an array containing undefined as a key an Erlang is thrown:

For example, if there's at least one document in the db without foo being set, the following view

function(doc) {
  emit([doc.foo], doc);
}

triggers

{{nocatch,{bad_value,"Cannot encode 'undefined' value as JSON"}},
 [{couch_query_servers,prompt,2},
  {couch_query_servers,'-map_docs/2-fun-0-',2},
  {lists,map,2},
  {couch_query_servers,map_docs,2},
  {couch_view,view_compute,2},
  {couch_view,update_group,1},
  {couch_view,temp_update_loop,2}]}

OTOH, 

function(doc) {
  emit(doc.foo, doc);
}

causes no problems.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-83) undefined in an array as a key causes an Erlang error

Posted by "Ryszard Szopa (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-83?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryszard Szopa updated COUCHDB-83:
---------------------------------

    Remaining Estimate:     (was: 1h)
     Original Estimate:     (was: 1h)

> undefined in an array as a key causes an Erlang error
> -----------------------------------------------------
>
>                 Key: COUCHDB-83
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-83
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.7.2, 0.8
>            Reporter: Ryszard Szopa
>
> Whenever a view emits an array containing undefined as a key an Erlang is thrown:
> For example, if there's at least one document in the db without foo being set, the following view
> function(doc) {
>   emit([doc.foo], doc);
> }
> triggers
> {{nocatch,{bad_value,"Cannot encode 'undefined' value as JSON"}},
>  [{couch_query_servers,prompt,2},
>   {couch_query_servers,'-map_docs/2-fun-0-',2},
>   {lists,map,2},
>   {couch_query_servers,map_docs,2},
>   {couch_view,view_compute,2},
>   {couch_view,update_group,1},
>   {couch_view,temp_update_loop,2}]}
> OTOH, 
> function(doc) {
>   emit(doc.foo, doc);
> }
> causes no problems.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (COUCHDB-83) undefined in an array as a key causes an Erlang error

Posted by "Christopher Lenz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-83?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher Lenz reassigned COUCHDB-83:
---------------------------------------

    Assignee: Christopher Lenz

> undefined in an array as a key causes an Erlang error
> -----------------------------------------------------
>
>                 Key: COUCHDB-83
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-83
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.7.2, 0.8
>            Reporter: Ryszard Szopa
>            Assignee: Christopher Lenz
>
> Whenever a view emits an array containing undefined as a key an Erlang is thrown:
> For example, if there's at least one document in the db without foo being set, the following view
> function(doc) {
>   emit([doc.foo], doc);
> }
> triggers
> {{nocatch,{bad_value,"Cannot encode 'undefined' value as JSON"}},
>  [{couch_query_servers,prompt,2},
>   {couch_query_servers,'-map_docs/2-fun-0-',2},
>   {lists,map,2},
>   {couch_query_servers,map_docs,2},
>   {couch_view,view_compute,2},
>   {couch_view,update_group,1},
>   {couch_view,temp_update_loop,2}]}
> OTOH, 
> function(doc) {
>   emit(doc.foo, doc);
> }
> causes no problems.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (COUCHDB-83) undefined in an array as a key causes an Erlang error

Posted by "Christopher Lenz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-83?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher Lenz resolved COUCHDB-83.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.8.1

Should be fixed by r670732.

> undefined in an array as a key causes an Erlang error
> -----------------------------------------------------
>
>                 Key: COUCHDB-83
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-83
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.7.2, 0.8
>            Reporter: Ryszard Szopa
>            Assignee: Christopher Lenz
>             Fix For: 0.8.1
>
>
> Whenever a view emits an array containing undefined as a key an Erlang is thrown:
> For example, if there's at least one document in the db without foo being set, the following view
> function(doc) {
>   emit([doc.foo], doc);
> }
> triggers
> {{nocatch,{bad_value,"Cannot encode 'undefined' value as JSON"}},
>  [{couch_query_servers,prompt,2},
>   {couch_query_servers,'-map_docs/2-fun-0-',2},
>   {lists,map,2},
>   {couch_query_servers,map_docs,2},
>   {couch_view,view_compute,2},
>   {couch_view,update_group,1},
>   {couch_view,temp_update_loop,2}]}
> OTOH, 
> function(doc) {
>   emit(doc.foo, doc);
> }
> causes no problems.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-83) undefined in an array as a key causes an Erlang error

Posted by "Christopher Lenz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607370#action_12607370 ] 

Christopher Lenz commented on COUCHDB-83:
-----------------------------------------

Well, together with r670737, at least.

> undefined in an array as a key causes an Erlang error
> -----------------------------------------------------
>
>                 Key: COUCHDB-83
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-83
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 0.7.2, 0.8
>            Reporter: Ryszard Szopa
>            Assignee: Christopher Lenz
>             Fix For: 0.8.1
>
>
> Whenever a view emits an array containing undefined as a key an Erlang is thrown:
> For example, if there's at least one document in the db without foo being set, the following view
> function(doc) {
>   emit([doc.foo], doc);
> }
> triggers
> {{nocatch,{bad_value,"Cannot encode 'undefined' value as JSON"}},
>  [{couch_query_servers,prompt,2},
>   {couch_query_servers,'-map_docs/2-fun-0-',2},
>   {lists,map,2},
>   {couch_query_servers,map_docs,2},
>   {couch_view,view_compute,2},
>   {couch_view,update_group,1},
>   {couch_view,temp_update_loop,2}]}
> OTOH, 
> function(doc) {
>   emit(doc.foo, doc);
> }
> causes no problems.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.