STATUS
------
Accepted pending fixing comment [1].
DETAILS
-------
Chuck Bell wrote:
> #At file:///Users/cbell/source/bzr/mysql-6.0-bug-41898/ based on
> revid:charles.bell@stripped
>
> 2862 Chuck Bell 2009-08-20
> BUG#41898 : Totalbytes in backup history log has same size for
> compressed/uncompressed data
>
> This bug and BUG#39780 which is a duplicate reports the problem that the
> 'total_bytes' column of the backup_history log reports and incorrect and
> unrealistic value.
>
> This patch corrects the problem by making the 'total_bytes' column store
> the number of bytes read or written. This means this column is now the
> same as the backup image file size.
...
> === modified file 'sql/backup/stream.cc'
> --- a/sql/backup/stream.cc 2009-08-11 11:09:31 +0000
> +++ b/sql/backup/stream.cc 2009-08-20 14:09:29 +0000
> @@ -414,7 +414,7 @@ bool Output_stream::init()
> return FALSE;
> }
>
> - bytes= 0;
> + bytes= len;
>
> /*
> The backup stream library uses unsigned long type for storing block size.
> @@ -537,6 +537,11 @@ int Output_stream::close()
> } while (zerr != Z_STREAM_END);
> if ((zerr= deflateEnd(&zstream)) != Z_OK)
> m_log.report_error(ER_GET_ERRMSG, zerr, zstream.msg, "deflateEnd");
> + /*
> + If this is a compressed image, store bytes read from the
> + zstream total.
> + */
[1] Correct to "... store bytes written to the ..."
> + bytes= zstream.total_out;
> my_free(zbuf, MYF(0));
> if (zerr != Z_OK)
> ret= BSTREAM_ERROR;
> @@ -640,7 +645,7 @@ bool Input_stream::init()
> return FALSE;
> }
>
> - bytes= 0;
> + bytes= len;
>
> if (BSTREAM_OK != bstream_open_rd(this, len))
> {
> @@ -745,6 +750,11 @@ int Input_stream::close()
> int zerr;
> if ((zerr= inflateEnd(&zstream)) != Z_OK)
> m_log.report_error(ER_GET_ERRMSG, zerr, zstream.msg, "inflateEnd");
> + /*
> + If this is a compressed image, store bytes read from the
> + zstream total.
> + */
> + bytes= zstream.total_in;
> my_free(zbuf, (MYF(0)));
> if (zerr)
> ret = BSTREAM_ERROR;
>
Rafal