Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-4941

Add accessor functions for WT_CONFIG_ITEM fields.

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

      It's relatively easy to incorrectly use the WT_CONFIG_ITEM fields, for example, this code from WT-4939:

      WT_RET(__wt_config_gets(session, cfg, "name", &cval));
      if (cval.val != 0)
              return (0);
      

      which is retrieving a value for a string configuration, but testing an integer configuration and so always returns. The correct test would have been:

      WT_RET(__wt_config_gets(session, cfg, "name", &cval));
      if (cval.len != 0)
              return (0);
      

      It might be reasonable to add WT_CONFIG_ITEM accessor functions that use the WT_CONFIG_ITEM.type field to avoid making the wrong test.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: