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

MongoDB should behave identically when installed on any locale OS.

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Query Execution

      I found that for all practical purposes MongoDB can be installed on a unix server of any locale (English, Spanish, Chinese, whatever) without changing behaviour. Except for the following two points:

      1. There are 3 case-related aggregation functions that use the (g)libc `tolower`, `toupper`, `strcasecmp` functions.
      2. strerr() output from (g)libc that is reprinted in error responses or in the log will be in the OS locale.

      #2 is no big deal, it doesn't affect the correctness of the DB in any way.

      But #1, by itself, ruins our ability to say "MongoDB can be installed on a server with any locale". I was originally pleasantly surprised to figure out how little effect locale could have on a mongod process, but I found that the user was just hearing "broken", "broken", "broken" when I explained there was this one exception.

      I suggest that $strcasecmp, $toUpper and $toLower be changed to use the ICU equivalents instead of the libc functions, using simple case mapping / folding per http://userguide.icu-project.org/transforms/casemappings.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            akira.kurogane Akira Kurogane
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: