Hi Jorgen,
I think one should use |= for setting bit flags, not &=. Otherwise good to push.
Rafal
Jorgen Loland wrote:
> #At file:///localhome/jl208045/mysql/mysql-6.0-backup-33120/
>
> 2638 Jorgen Loland 2008-06-18
> Bug#33120 - "Backup image flags are not set correctly."
>
> * Set BSTREAM_FLAG_BIG_ENDIAN bit if and backup image is made
> on a bit endian server.
> * Set BSTREAM_FLAG_BINLOG if the backup image stores a valid
> binlog position.
> modified:
> sql/backup/image_info.cc
> sql/backup/image_info.h
>
> per-file comments:
> sql/backup/image_info.cc
> Set big endian bit in flags bitmap if backup image is created on a big endian
> server.
> sql/backup/image_info.h
> Set binlog bit in flags bitmap if backup image contains a valid binlog position.
> === modified file 'sql/backup/image_info.cc'
> --- a/sql/backup/image_info.cc 2008-04-21 10:45:39 +0000
> +++ b/sql/backup/image_info.cc 2008-06-18 12:50:08 +0000
> @@ -8,7 +8,6 @@
>
> @brief Implements @c Image_info class and friends.
>
> - @todo Store endianess info in the image.
> */
>
> namespace backup {
> @@ -44,7 +43,11 @@ Image_info::Image_info()
> server_version.extra.end= server_version.extra.begin +
> strlen((const char*)server_version.extra.begin);
>
> - flags= 0; // TODO: set BSTREAM_FLAG_BIG_ENDIAN flag accordingly
> + flags= 0;
> +
> +#ifdef WORDS_BIGENDIAN
> + flags&= BSTREAM_FLAG_BIG_ENDIAN;
One should use |= for setting the flag.
> +#endif
>
> bzero(m_snap, sizeof(m_snap));
> }
>
> === modified file 'sql/backup/image_info.h'
> --- a/sql/backup/image_info.h 2008-05-17 16:08:00 +0000
> +++ b/sql/backup/image_info.h 2008-06-18 12:50:08 +0000
> @@ -770,7 +770,9 @@ void Image_info::save_vp_time(const time
> }
>
> /**
> - Store validity point binlog position inside image's header.
> + Store validity point binlog position inside image's header. Also sets
> + BSTREAM_FLAG_BINLOG in @c flags bitmap to indicate that this
> + backup image contains a valid binlog position.
> */
> inline
> void Image_info::save_binlog_pos(const ::LOG_INFO &li)
> @@ -782,6 +784,10 @@ void Image_info::save_binlog_pos(const :
> // store binlog coordinates
> binlog_pos.pos= (unsigned long int)li.pos;
> binlog_pos.file= const_cast<char*>(m_binlog_file.ptr());
> +
> + // make flags bitmap reflect that this backup image contains a valid
> + // binlog position
> + flags&= BSTREAM_FLAG_BINLOG;
One should use |= for setting the flag.
> }
>
> /// Returns an iterator enumerating all databases stored in backup catalogue.
>
>