[SERVER-25136] Unable to create 2d index on collection with non-simple default collation Created: 18/Jul/16  Updated: 13/Aug/16  Resolved: 20/Jul/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 3.3.8
Fix Version/s: 3.3.11

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-23945 Index builds lacking a collation must... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

db.mycoll.drop();
assert.commandWorked(db.runCommand({create: "mycoll", collation: {locale: "en"}}));
assert.commandWorked(db.mycoll.createIndex({a: "2d"}, {collation: {locale: "simple"}}));

Output

{
  "ok" : 0,
  "errmsg" : "\"collation\" not supported for index type 2d",
  "code" : 67
}

Sprint: Query 18 (08/05/16)
Participants:

 Description   

This affects all other index types that don't support non-simple collations. The issue is that the index build request inherits the collection's default collation, but IndexCatalog::_isSpecOk() prevents the index type from having a "collation" element specified, even if its locale is "simple".



 Comments   
Comment by Githook User [ 20/Jul/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-25136 allow index types which do not support collation on a collection with a non-simple default collation

The application must use

{locale: "simple"}

to override the
default in this case.
Branch: master
https://github.com/mongodb/mongo/commit/60379c1daaaf50d90d240a0ae5b4c6fdad7b4c36

Generated at Thu Feb 08 04:08:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.