Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-45588

Use of invalid regex in schema validator can prevent upgrade

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • 4.2.2
    • None
    • Querying
    • None
    • ALL
    • Query 2020-01-27, Query 2020-02-10, Query 2020-02-24, Query 2020-03-09

    Description

      Repro:

      // on 4.0 create a validator with an invalid regex.
      db.createCollection("c", {
          validator:
              {email: {$regex: "^*"}}
      })
      // Now start a 4.2 binary using same data files.
      

      The 4.2 binary will fail at startup with something like:

      [initandlisten] exception in
          initAndListen: Location51091: Regular expression is invalid: nothing to repeat,
          terminating
      

      Attachments

        Issue Links

          Activity

            People

              ian.boros@mongodb.com Ian Boros
              ian.boros@mongodb.com Ian Boros
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: