~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to storage/falcon/WalkDeferred.cpp

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2008 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#include "Engine.h"
 
17
#include "WalkDeferred.h"
 
18
 
 
19
WalkDeferred::WalkDeferred(DeferredIndex *deferredIndex, Transaction *transaction, int flags, IndexKey *lower, IndexKey *upper) 
 
20
        : IndexWalker(deferredIndex->index, transaction, flags)
 
21
{
 
22
        walker.initialize(deferredIndex, lower, flags);
 
23
        node = NULL;
 
24
}
 
25
 
 
26
WalkDeferred::~WalkDeferred(void)
 
27
{
 
28
}
 
29
 
 
30
Record* WalkDeferred::getNext(bool lockForUpdate)
 
31
{
 
32
        for (;;)
 
33
                {
 
34
                node = walker.next();
 
35
                
 
36
                if (!node)
 
37
                        {
 
38
                        currentRecord = NULL;
 
39
                        return NULL;
 
40
                        }
 
41
 
 
42
                key = node->key;
 
43
                keyLength = node->keyLength;
 
44
                recordNumber = node->recordNumber;
 
45
                
 
46
                if ( (currentRecord = getValidatedRecord(recordNumber, lockForUpdate)) )
 
47
                        return currentRecord;
 
48
                }
 
49
}