Rafal,
The patch looks good and is approved. I have one very minor
suggestion you may consider, but it is not a required change:
Requirements:
-------------
None
Suggestions:
-----------
The added ERROR check and handling is written in at three
different ways.
For as_read
+ if (ret == BSTREAM_ERROR)
+ {
+ s->state= ERROR;
+ return BSTREAM_ERROR;
+ }
For as_write
+ if (ret != BSTREAM_OK)
+ {
+ s->state= ERROR;
+ return BSTREAM_ERROR;
+ }
(...)
if (ret != BSTREAM_OK)
+ {
+ s->state= ERROR;
return ret;
+ }
They could all use the pattern used after as_read:
if (ret == BSTREAM_ERROR)
{
s->state= ERROR;
return BSTREAM_ERROR;
}
Rafal Somla wrote:
> #At file:///ext/mysql/bzr/backup/bug37522/
>
> 2691 Rafal Somla 2008-09-04
> BUG#37522 (Backup: stream_v1_transport: Error condition should be checked for
> as_* calls)
>
> This patch adds checks for errors in stream_v1_transport.c where the low level
> I/O
> functions are called.
> modified:
> sql/backup/stream_v1.h
> sql/backup/stream_v1_transport.c
>
> per-file messages:
> sql/backup/stream_v1.h
> Add specifications for the low-level I/O functions implementing abstract stream
> interface.
> sql/backup/stream_v1_transport.c
> - Make sure error is reported and stream state set to ERROR whenever the
> low-level I/O functions report error.
> - Turn append_to_buffer() into void function as it can never error.