[SERVER-5002] Change prohibited character sets in database names Created: 17/Feb/12 Updated: 17/Jan/23 Resolved: 21/Sep/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin, Storage |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Randolph Tan | Assignee: | Backlog - Storage Execution Team |
| Resolution: | Won't Do | Votes: | 5 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||
| Assigned Teams: |
Storage Execution
|
||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
We just had this discussion while doing a review on |
| Comments |
| Comment by Jeremy Mikola [ 30/Jul/19 ] | |||||||||||||||||||||
|
Cross-referencing with a PHP ticket where the customer was surprised that the server was accepting newline characters in a database and collection name. It lead to a question about whether the server would allow other control characters, to which I believe the answer is "yes" (anything not explicitly listed in naming restrictions). | |||||||||||||||||||||
| Comment by Sara Williamson [ 18/Dec/18 ] | |||||||||||||||||||||
|
Our new proposal is to escape the current prohibited database name characters. | |||||||||||||||||||||
| Comment by Federico Grillini [ 15/Oct/15 ] | |||||||||||||||||||||
|
Whitespace shouldn't be accepted in collections names, expecially leading and trailing whitespace that can make debugging harder. | |||||||||||||||||||||
| Comment by Thomas Rueckstiess [ 26/Apr/13 ] | |||||||||||||||||||||
|
It's possible to create a database containing a $ sign. But trying to insert into it fails:
This is because DataFileMgr::insert() checks for any $ sign in the namespace with NamespaceString::normal(). The behavior should be consistent, either allowing $ in db names or not. Turning on profiling in such a db fails as well:
| |||||||||||||||||||||
| Comment by Daniel Pasette (Inactive) [ 17/Apr/13 ] | |||||||||||||||||||||
|
current restrictions, as of 2.2 are as follows (http://docs.mongodb.org/manual/reference/limits/#naming-restrictions):
| |||||||||||||||||||||
| Comment by Eliot Horowitz (Inactive) [ 18/Feb/12 ] | |||||||||||||||||||||
|
we should and do limit db names a bit - could do more | |||||||||||||||||||||
| Comment by Greg Studer [ 17/Feb/12 ] | |||||||||||||||||||||
|
Mathias's comment was that b/c database names are actually used in data files, they should be more restricted than collection names. In particular, what happens when database names contain invalid file name characters on particular OSes is an issue. |