Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-2992

MongoDB: Offset clause causes MongoDB to crash

    XMLWordPrintable

Details

    Description

      MongoDB(version < 2.5.2) will crash when offset clause is used in SQL query.

      Althought the bug[1] is in MongoDB (Adding big number into $limit causes Mongodb to shutdown), it is also caused by teiid because it adds max integer into $limit which seems to be unnecessary.

      Sample query:

      SELECT INTKEY FROM bqt1.smalla ORDER BY INTKEY OFFSET 45 ROWS
      

      Generated mongo command:

      { aggregate: "smalla", pipeline: [ { $project: { c_0: "$INTKEY" } }, { $sort: { c_0: 1 } }, { $skip: 45 }, { $limit: 2147483647 } ] }
      

      [1] https://jira.mongodb.org/browse/SERVER-10136

      Attachments

        Activity

          People

            rhn-engineering-rareddy Ramesh Reddy
            felias_jira Filip Elias (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: