Revision d3c7a07a

View differences:

src/sql/LogDB.cc
82 82

  
83 83
    LogDBRecord lr;
84 84

  
85

  
86
    if ( get_log_record(0, lr) != 0  || lr.sql.empty() )
85
    if ( get_log_record(0, lr) != 0 )
87 86
    {
88 87
        std::ostringstream oss;
89 88

  
......
166 165
{
167 166
    ostringstream oss;
168 167

  
169
    int prev_index = index - 1;
168
    unsigned int prev_index = index - 1;
170 169

  
171
    if ( prev_index < 0 )
170
    if ( index == 0 )
172 171
    {
173 172
        prev_index = 0;
174 173
    }
175 174

  
175
    lr.index = 0;
176

  
176 177
    oss << "SELECT c.log_index, c.term, c.sqlcmd,"
177 178
        << " c.timestamp, p.log_index, p.term"
178 179
        << " FROM logdb c, logdb p WHERE c.log_index = " << index
......
184 185

  
185 186
    lr.unset_callback();
186 187

  
188
    if ( lr.index != index )
189
    {
190
        rc = -1;
191
    }
192

  
187 193
    return rc;
188 194
}
189 195

  

Also available in: Unified diff