Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-5697

Deprecate bson_string_t

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.29.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • C Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Scope

      Deprecate the bson_string_t type.

      Do not deprecate other functions in bson-string.h.

      Background & Motivation

      bson_string_t has been the source of bug reports: CDRIVER-5628 and CDRIVER-5669. The struct definition is public and is limited to a uint32_t length. Functions that grow the string do not have a way to return error, and instead abort if the resulting length would exceed UINT32_MAX.

      bson_string_t is not used in any of the other public API functions (i.e. it is not a return type, or a parameter type). libmongocrypt only uses bson_string_t in test code. The only non-internal use of bson_string_new I found with GitHub code search was in postgresbson using the private function _bson_iso8601_date_format. I expect this can be updated without significant effort.

      Other functions declared in bson-string.h may have more expected use.  bson_strfreev is expected to be used for return of mongoc_client_get_database_names. libmongocrypt uses bson_strdup, bson_strdup_printf, bson_strdupv_printf, bson_strndup, bson_strncpy, bson_snprintf, bson_strcasecmp

       

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: