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

Have IDL command constructor to init its database name field with DatabaseName object

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc2, 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • Server Serverless 2022-09-19

      For IDL commands which have command parameter NamespaceString of NamespaceStringOrUUID, the IDL generated constructor should init its _dbName with DatabaseName object instead of db name string of the nss or nssOrUUID parameter. 

      For example, for the find command in find_command.idl, the generated constructor is

      FindCommandRequest::FindCommandRequest(const NamespaceStringOrUUID nssOrUUID) : _nssOrUUID(std::move(nssOrUUID)), _dbName(nssOrUUID.uuid() ? nssOrUUID.dbname() : nssOrUUID.nss()->db().toString()), _hasDbName(true) 

      We should change the IDL compiler to generate the following constructor:

      FindCommandRequest::FindCommandRequest(const NamespaceStringOrUUID nssOrUUID) : _nssOrUUID(std::move(nssOrUUID)), _dbName(nssOrUUID.uuid() ? nssOrUUID.dbName() : nssOrUUID.nss()->dbName()), _hasDbName(true) 

            Assignee:
            sophia.tan@mongodb.com Sophia Tan
            Reporter:
            sophia.tan@mongodb.com Sophia Tan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: