[SERVER-38592] A malformed createIndex doesn't generate an error message and gets executed in the foreground Created: 13/Dec/18 Updated: 06/Dec/22 Resolved: 17/Dec/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying, Shell |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Miguel Angel Nieto | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
The following createIndex is incorrect:
Instead of receiving an error, it gets executed in the foreground. Tested in 3.6 and 4.0. |
| Comments |
| Comment by Asya Kamsky [ 17/Dec/18 ] | |||
|
Closing as duplicate, please make comments on | |||
| Comment by Asya Kamsky [ 17/Dec/18 ] | |||
|
Identical to Also similar to SERVER-13440 and SERVER-28397 and | |||
| Comment by James Wahlin [ 17/Dec/18 ] | |||
|
The db.collections.createIndex() shell function is defined as follows and takes 2 arguments:
The invocation provided here passes {background: true} as a third argument which is ignored and not sent to the server as part of the createIndexes command. In general mongo shell helpers do not validate whether too many arguments have been passed to them. We could consider whether we would like to add validation for this. | |||
| Comment by Kelsey Schubert [ 13/Dec/18 ] | |||
|
dup of |