Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9099

Multiple failures when creating a collection using international character sets

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.3
    • Component/s: None
    • None
    • OS X
    • Hide

      See description.

      Show
      See description.

      Creating a collection with Japanese characters in the name causes a few different odd failures to occur. Below are are my results from MongoDB 2.2.3 using the mongo shell to illustrate the issue.

      In the first attempt, mongo will raise an invalid namespace exception:

      (mongod-2.2.3) test2> db.createCollection('すでに存在してい')
      {
        "errmsg": "exception: invalid ns: test2.すでに存在してい.$_id_",
        "code": 10094,
        "ok": 0
      }
      

      On the second attempt, mongo shows an error stating that the collection already exists even though it wasn't created successfully in the previous attempt:

      (mongod-2.2.3) test2> db.createCollection('すでに存在してい')
      {
        "errmsg": "collection already exists",
        "ok": 0
      }
      (mongod-2.2.3) test2> show collections
      system.indexes
      

      However, Japanese characters proceeded by letters or numbers works fine:

      (mongod-2.2.3) test> db.createCollection('THIS_WORKS_すでに存在してい')
      {
        "ok": 1
      }
      (mongod-2.2.3) test> db.createCollection('999_SO_DOES_THISすでに存在してい')
      {
        "ok": 1
      }
      

      I've validated that the same behavior exists on 2.4.0 as well. In addition to the shell examples from above, this behavior is the same when interacting with MongoDB through the Ruby driver and the Python driver.

      Even if this isn't something we support for a valid reason, it seems like we're not handling it correctly given the error messages being shown.

            Assignee:
            Unassigned Unassigned
            Reporter:
            brandon.black@10gen.com Brandon Black
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: