[SERVER-6822] Inconsistent error messages when database name is too long Created: 22/Aug/12 Updated: 14/Apr/16 Resolved: 16/Mar/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Usability |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Mark van Cuijk | Assignee: | Samantha Ritter (Inactive) |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Participants: |
| Description |
|
When trying to access a database with a name longer than allowed, error messages are inconsistent depending on the exact length of the database name. A database name that is shorter than 64 characters is handled correctly. > use AVeryLongDatabaseNameThatIsAVeryLongDatabaseNameWithExact64Chars > use AVeryLongDatabaseNameThatIsAVeryLongDatabaseNameWithEven1MoreChar Looking at the source code, it seems that the checks at /src/mongo/db/database.cpp:71 and /src/mongo/db/namespacestring.h:99 are inconsistent in handling database names of exactly 64 characters. I'd say the preferred message in both error cases is the 10032 (db name too long) message, since it's more descriptive. |
| Comments |
| Comment by Samantha Ritter (Inactive) [ 12/Aug/13 ] |
|
I could not reproduce this bug in 2.5.2... as far as I can tell, for any name up to and including 64 characters, the operation goes through fine. For names longer than 64 characters, I get the following error: Error: [AVeryLongDatabaseNameThatIsAVeryLongDatabaseNameWithEven1MoreChar] is not a valid database name at src/mongo/shell/mongo.js:40 |