-
Type: Improvement
-
Resolution: Unresolved
-
Priority: 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.