- if(!knfc)
- fatal(0, "%s: cannot convert key to NFC: %.*s", name,
- (int)k->size, (const char *)k->data);
+ if(!knfc) {
+ switch(badkey) {
+ case BADKEY_WARN:
+ error(0, "%s: invalid key: %.*s", name,
+ (int)k->size, (const char *)k->data);
+ break;
+ case BADKEY_DELETE:
+ error(0, "%s: deleting invalid key: %.*s", name,
+ (int)k->size, (const char *)k->data);
+ if((err = c->c_del(c, 0))) {
+ if(err != DB_LOCK_DEADLOCK)
+ fatal(0, "%s: error removing denormalized key: %s",
+ name, db_strerror(err));
+ return err;
+ }
+ break;
+ case BADKEY_FAIL:
+ fatal(0, "%s: invalid key: %.*s", name,
+ (int)k->size, (const char *)k->data);
+ }
+ return 0;
+ }