-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.6.4
-
3
-
Tools and Replicator
-
1,915
-
(copied to CRM)
Although database names are case insensitive on the server side, there are some behaviors that cause problems as we are not always case insensitive.
For example, specifying a database name in the wrong case to mongodump will not dump the database. For example:
$ mongodump --db XYZ $ mongodump --db xyz 2018-04-24T12:11:10.999-0400 writing xyz.xx to 2018-04-24T12:11:11.001-0400 done dumping xyz.xx (1 document)
In the example above, mongodump silently ignores the database when presented with the wrong case sensitive name.
A similar inconsistency can be seen using the MongoDB Shell. For example:
$ mongo mongodb://localhost/xyz MongoDB shell version v3.6.3 connecting to: mongodb://localhost/xyz MongoDB server version: 3.6.3 replset:PRIMARY> db.xx.insert({a:1}) Inserted 1 record(s) in 78ms WriteResult({ "nInserted": 1 }) replset:PRIMARY> exit $ mongo mongodb://localhost/XYZ replset:PRIMARY> show collections replset:PRIMARY> db.xx.insert({a:1}) WriteResult({ "nInserted" : 0, "writeError" : { "code" : 13297, "errmsg" : "db already exists with different case already have: [xyz] trying to create [XYZ]" } })
In the example above, the user is able to connect to the XYZ database. Show collections does not show any collections but an attempt to insert data raises the exception that the database already exists using different case sensitivity.
These problems presumably manifest in other commands as well and this ticket is a request to improve our handling of case insensitivity.
- is related to
-
TOOLS-2625 Catch multiple collections that differ only by capitalization
- Accepted