[SERVER-7661] Require db argument for getLastErrorDetailed in dbclient Created: 14/Nov/12 Updated: 06/Dec/22 Resolved: 06/Jun/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Client, Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Scott Hernandez (Inactive) | Assignee: | [DO NOT USE] Backlog - Sharding Team |
| Resolution: | Done | Votes: | 0 |
| Labels: | cxxcopy | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Sharding
|
| Participants: |
| Description |
|
Using the admin db by default will not work if using auth (and not auth'd to the admin db explicitly). There are 5 places, in bench.cpp, pipeline_d.cpp, and document_source_out.cpp where getLastErrorDetailed() is called without a db parameter. Each location has a db that makes more sense to use that admin and will already be authenticated against. getLastError() requires being authenticated to the database. These locations should be fixed to provide a db, and we should remove the form of getLastErrorDetailed() that provides a default so that future development does not accidentally make the same mistake. |