]> git.sur5r.net Git - openldap/commitdiff
Debug helper for index
authorHoward Chu <hyc@openldap.org>
Mon, 5 Sep 2011 22:23:08 +0000 (15:23 -0700)
committerHoward Chu <hyc@openldap.org>
Mon, 5 Sep 2011 22:23:08 +0000 (15:23 -0700)
servers/slapd/back-mdb/index.c

index 78429622a12d94c8cc530dc8d24980fd1f0e3fd4..b4f7d56d16ae8062329d0a59d5f4dd62748bc9e8 100644 (file)
@@ -176,9 +176,11 @@ static int indexer(
        struct berval *keys;
        MDB_cursor *mc;
        mdb_idl_keyfunc *keyfunc;
+       char *err;
 
        assert( mask != 0 );
 
+       err = "c_open";
        rc = mdb_cursor_open( txn, dbi, &mc );
        if ( rc ) goto done;
 
@@ -190,6 +192,7 @@ static int indexer(
        if( IS_SLAP_INDEX( mask, SLAP_INDEX_PRESENT ) ) {
                rc = keyfunc( mc, (MDB_val *)presence_key, id );
                if( rc ) {
+                       err = "presence";
                        goto done;
                }
        }
@@ -206,6 +209,7 @@ static int indexer(
                        rc = keyfunc( mc, (MDB_val *)keys, id );
                        ber_bvarray_free_x( keys, op->o_tmpmemctx );
                        if ( rc ) {
+                               err = "equality";
                                goto done;
                        }
                }
@@ -224,6 +228,7 @@ static int indexer(
                        rc = keyfunc( mc, (MDB_val *)keys, id );
                        ber_bvarray_free_x( keys, op->o_tmpmemctx );
                        if ( rc ) {
+                               err = "approx";
                                goto done;
                        }
                }
@@ -243,6 +248,7 @@ static int indexer(
                        rc = keyfunc( mc, (MDB_val *)keys, id );
                        ber_bvarray_free_x( keys, op->o_tmpmemctx );
                        if( rc ) {
+                               err = "substr";
                                goto done;
                        }
                }