Support NumberLong less than 2^31 in formatAsJsonLogLine

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Old regex for NumberLong in formatAsJsonLogLine assumed that the number will be in quotes: NumberLong("123") and it crashes when trying to format NumberLong(X) when |X| < 2^31 - a limit when NumberLong.toString() starts adding quotes: https://github.com/mongodb/mongo/blob/0821fec802924bb44db7697235d4e749048cb887/src/mongo/scripting/mozjs/common/types/numberlong.cpp#L112

      We didn't hit this issue because in all cases where we hit NumberLong in jstests is cursorId and they are random 64-bit integers, so the probability of them being less than 2^31 is very small.

      I hit this bug when I had cursorId == 0.

            Assignee:
            Ivan Fefer
            Reporter:
            Ivan Fefer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: