mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
DB->remove (with no subdb) now correctly returns
error codes from unlink. Modified test_db_remove_subdb to check for this. Closes #211 git-svn-id: file:///svn/tokudb@1288 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
605ad57be1
commit
e669f58910
2 changed files with 9 additions and 1 deletions
|
@ -30,6 +30,12 @@ int main (int argc, char *argv[]) {
|
|||
// Note: without DB_INIT_MPOOL the BDB library will fail on db->open().
|
||||
r=env->open(env, DIR, DB_INIT_MPOOL|DB_PRIVATE|DB_CREATE, 0777); assert(r==0);
|
||||
|
||||
r=db_create(&db, env, 0); assert(r==0);
|
||||
r=db->remove(db, "DoesNotExist.db", NULL, 0); assert(r==ENOENT);
|
||||
|
||||
r=db_create(&db, env, 0); assert(r==0);
|
||||
r=db->remove(db, "DoesNotExist.db", "SubDb", 0); assert(r==ENOENT);
|
||||
|
||||
r=db_create(&db, env, 0); assert(r==0);
|
||||
r=db->open(db, NULL, "master.db", "first", DB_BTREE, DB_CREATE, 0666); CKERR(r);
|
||||
data.size = sizeof("first.db");
|
||||
|
|
|
@ -1385,7 +1385,9 @@ cleanup:
|
|||
return r;
|
||||
}
|
||||
r2 = db->close(db, 0);
|
||||
if (r == 0 && r2 == 0) r = unlink(ffull);
|
||||
if (r == 0 && r2 == 0) {
|
||||
if (unlink(ffull) != 0) r = errno;
|
||||
}
|
||||
return r ? r : r2;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue