dannote / mod-ndb

Automatically exported from code.google.com/p/mod-ndb
0 stars 0 forks source link

Scanning deletes #37

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Implement scans that delete rows.

You prepare a scan delete like this:
scanop->readTuples(NdbOperation::LM_Exclusive)

Then you execute no-commit.  

Then you loop over using nextResult() and delete rows:
while((check = myScanOp->nextResult(true)) == 0) {
   do   {
    if (myScanOp->deleteCurrentTuple() != 0) { error handler ... }
   } while((check = myScanOp->nextResult(false)) == 0);
}

Multi-row (scan) deletes are needed for the test suite to be idempotent.  In 
testing auto-
increment columns, when you insert a row with an auto-inc primary key, you 
can't be entirely 
sure what the primary key is, and therefore you can't delete using  the primary 
key.

Original issue reported on code.google.com by john.david.duncan on 4 Sep 2007 at 4:57

GoogleCodeExporter commented 9 years ago
Actually, one-row unique index deletes can be used to to solve the problem with 
the test suite.

Original comment by john.david.duncan on 4 Sep 2007 at 5:22

GoogleCodeExporter commented 9 years ago

Original comment by john.david.duncan on 28 Dec 2007 at 5:29