Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-2381

Connection String spec requires equals sign after keys to permit empty input values

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Component/s: Connection String
    • None
    • Needed
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-4424 Blocked
      CXX-2542 Blocked
      CSHARP-4249 Blocked
      GODRIVER-2486 Blocked
      JAVA-4675 Blocked
      NODE-4403 Blocked
      MOTOR-991 Duplicate
      PYTHON-3350 Blocked
      PHPLIB-908 Blocked
      RUBY-3048 Blocked
      RUST-1404 Blocked
      SWIFT-1598 Won't Do
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-4424 Blocked CXX-2542 Blocked CSHARP-4249 Blocked GODRIVER-2486 Blocked JAVA-4675 Blocked NODE-4403 Blocked MOTOR-991 Duplicate PYTHON-3350 Blocked PHPLIB-908 Blocked RUBY-3048 Blocked RUST-1404 Blocked SWIFT-1598 Won't Do

      Summary

      The Connection String spec states here that: The key is everything up to the first equals sign ("=") and the value is everything afterwards. However, there is no test to verify that equal sign terminated keys with no value are successfully parsed. There is a test here that confirms non-equals terminated strings are errored on.

      The ask
      • Implement a test to confirm that equals terminated keys with no value are parsed without error.
      • Consider permitting drivers to disallow empty values in a major version
        • Permitting empty values have risk of being silently accepted when the intention was to pass something (ex. environment variables left undefined are empty strings).
        • If there is a desire for a way to configure "nothing" as a value an indicator of some kind should be considered as it is a clear choice of omission.

      Motivation

      Who is the affected end user?

      • At least C# and the Node.js driver have confirmed divergence where they do not accept empty values for keys.
      • Users wanting to specify an empty value for a readPreferenceTags: NODE-4354

      How does this affect the end user?

      How likely is it that this problem or use case will occur?

      • Could be frequent depending on the usage of connection string. Node.js has maintained this behavior since at least July of 2021.

      If the problem does occur, what are the consequences and how severe are they?

      • On drivers that don't permit empty values you get an error at start up so an early warning that would prevent you from proceeding.

      Is this issue urgent?

      No.

      Is this ticket required by a downstream team?

      n/a

      Is this ticket only for tests?

      • No.

            Assignee:
            Unassigned Unassigned
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: