| 8648 | */ |
| 8649 | |
| 8650 | int handler::update_first_row(const uchar *new_data) |
| 8651 | { |
| 8652 | int error; |
| 8653 | if (likely(!(error= ha_rnd_init(1)))) |
| 8654 | { |
| 8655 | int end_error; |
| 8656 | if (likely(!(error= ha_rnd_next(table->record[1])))) |
| 8657 | { |
| 8658 | /* |
| 8659 | We have to do the memcmp as otherwise we may get error 169 from InnoDB |
| 8660 | */ |
| 8661 | if (memcmp(new_data, table->record[1], table->s->reclength)) |
| 8662 | error= update_row(table->record[1], new_data); |
| 8663 | } |
| 8664 | end_error= ha_rnd_end(); |
| 8665 | if (likely(!error)) |
| 8666 | error= end_error; |
| 8667 | /* Logging would be wrong if update_row works but ha_rnd_end fails */ |
| 8668 | DBUG_ASSERT(!end_error || error != 0); |
| 8669 | } |
| 8670 | return error; |
| 8671 | } |
| 8672 | |
| 8673 | |
| 8674 | int handler::ha_delete_row(const uchar *buf) |