mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
Addresses #123
DB->del deletes silently anything out of date. If DB->del deletes everything silently (doesn't find anything that was not out of date), it returns DB_NOTFOUND git-svn-id: file:///svn/tokudb@973 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
9a7cf6a1e9
commit
215d94f8fa
1 changed files with 5 additions and 3 deletions
|
@ -811,6 +811,7 @@ static int toku_db_del(DB * db, DB_TXN * txn, DBT * key, u_int32_t flags) {
|
|||
if ((brtflags & TOKU_DB_DUPSORT) || (brtflags & TOKU_DB_DUP)) {
|
||||
int r2;
|
||||
DBC *dbc;
|
||||
BOOL found = FALSE;
|
||||
|
||||
/* If we are deleting all copies from a secondary with duplicates,
|
||||
* We have to make certain we cascade all the deletes. */
|
||||
|
@ -823,11 +824,12 @@ static int toku_db_del(DB * db, DB_TXN * txn, DBT * key, u_int32_t flags) {
|
|||
|
||||
while (r==0) {
|
||||
r = dbc->c_del(dbc, 0);
|
||||
if (r!=0) goto cleanup;
|
||||
if (r==0) found = TRUE;
|
||||
if (r!=0 && r!=DB_KEYEMPTY) goto cleanup;
|
||||
r = toku_c_get_noassociate(dbc, key, &data, DB_NEXT_DUP);
|
||||
if (r == DB_NOTFOUND) {
|
||||
//Already deleted at least one. Quit out.
|
||||
r = 0;
|
||||
//If we deleted at least one we're happy. Quit out.
|
||||
if (found) r = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue