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

'force'd drop of non-existent index returns error

    • Type: Icon: Task Task
    • Resolution: Done
    • WT2.5.0
    • Affects Version/s: None
    • Component/s: None
    • None

      Hi!

      I found that even if I specify 'force' flag to WT_SESSION::drop() I got ENOENT error for non-existent index.

      Small test:

      #include <stdio.h>
      #include <stdlib.h>
      #include <string.h>
      
      #include <wiredtiger.h>
      
      #define WT_CALL(call) \
          do { \
              const int __rc = call; \
              if (__rc != 0) { \
                  fprintf(stderr, # call " at (%s:%d) failed: %s [%d]\n", __FILE__, __LINE__, wiredtiger_strerror(__rc), __rc); \
                  exit(EXIT_FAILURE); \
              } \
          } while (0)
      
      int
      main(void)
      {
              WT_CONNECTION *conn;
              WT_SESSION *session;
      
              WT_CALL(wiredtiger_open(NULL, NULL, "create", &conn));
              WT_CALL(conn->open_session(conn, NULL, NULL, &session));
      
              WT_CALL(session->drop(session, "table:non-existent", "force")); // ok
      
              WT_CALL(session->create(session, "table:access", NULL));
      
              WT_CALL(session->drop(session, "index:access:non-existent", "force")); // fails
      
              WT_CALL(conn->close(conn, NULL));
      
              return 0;
      }
      

            Assignee:
            donald.anderson@mongodb.com Donald Anderson
            Reporter:
            dmitri-shubin Dmitri Shubin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: