$type with invalid integer type code fails with unhelpful message and leaks memory

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • Hide
      db.c.drop();
      db.c.ensureIndex({a: 1});
      db.c.find({a: { $type: -100663046}}).hint({a: 1}).itcount();
      
      Show
      db.c.drop(); db.c.ensureIndex({a: 1}); db.c.find({a: { $type: -100663046}}).hint({a: 1}).itcount();
    • Query 10 (02/22/16)
    • 0
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The $type MatchExpression parsing code fails to validate that the numerical type code is valid. This leads to an unexpected exception being thrown inside the query planner, which in turn leaks memory.

              Assignee:
              David Storch
              Reporter:
              David Storch
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: