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

mongoshell client crashes in windows when running bad command

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.8, 2.6.3
    • Component/s: Shell
    • None
    • Environment:
      Windows 8 64-bit
    • Fully Compatible
    • Windows
    • Hide

      run this command , purposedly dont have the collection and field, it'll say invalid syntax, and crash:

      K:\thirdparty\mongodb-win32-x86_64-2008plus-2.4.8\bin>mongo 192.168.0.100
      MongoDB shell version: 2.4.8
      connecting to: 192.168.0.100/test
      > use crash
      switched to db crash
      > db.receipts.runCommand('distinct', 'accountPayment')

      Show
      run this command , purposedly dont have the collection and field, it'll say invalid syntax, and crash: K:\thirdparty\mongodb-win32-x86_64-2008plus-2.4.8\bin>mongo 192.168.0.100 MongoDB shell version: 2.4.8 connecting to: 192.168.0.100/test > use crash switched to db crash > db.receipts.runCommand('distinct', 'accountPayment')
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Just run mongo shell in windows, this build. Can use any empty database, bellow I just use 'crash'. Then runCommand on some collection, and it'll crash the shell:

      K:\thirdparty\mongodb-win32-x86_64-2008plus-2.4.8\bin>mongo 192.168.0.100
      MongoDB shell version: 2.4.8
      connecting to: 192.168.0.100/test
      > use crash
      switched to db crash
      > db.receipts.runCommand('distinct', 'accountPayment')
      Sun Jan 12 18:58:06.087 SyntaxError: Unexpected identifier

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            mpermana MICHAEL PERMANA
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: