-
Type: Bug
-
Resolution: Done
-
Priority: Blocker - P1
-
Affects Version/s: 1.9.1
-
Component/s: Index Maintenance
-
None
-
ALL
Base64 of 33byte string created like this in python:
In [7]: ('x'*33).encode('base64')
Out[7]: 'eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4\n'
> db.foo.drop()
true
> b = new BinData(0,'eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4')
BinData(0,"eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4")
> db.foo.insert(
)
> db.foo.count(
)
1
> db.foo.ensureIndex(
,
{v:1})
> db.foo.count(
)
0
> db.foo.dropIndex(
)
{ "nIndexesWas" : 2, "ok" : 1 }> db.foo.ensureIndex(
{b:1},
{v:0})
> db.foo.count(
)
1
The problem is in KeyV1Owned constructor. We need to check if len <= 32 before this line https://github.com/mongodb/mongo/blob/master/db/key.cpp#L267