Bug #52761 Redundancy in backup stream library data types.
Submitted: 12 Apr 2010 9:09
Reporter: Rafal Somla Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:mysql-next-mr-backup OS:Any
Assigned to: CPU Architecture:Any
Tags: teamtree
Triage: Triaged: D3 (Medium)

[12 Apr 2010 9:09] Rafal Somla
Description:
The hierarchical structure of datatypes for representing various objects inside backup image (st_bstream_*_info structures) has been polluted by introducing members duplicating information stored elsewhere.

For example, take the st_bstream_table_info structure, which includes st_bstream_db_item_info one and additional filed snap_num. The same snap_num filed has been added to st_bstream_db_item_info structure, duplicating the information already stored in st_bstream_table_info. Similar, field pos has been added to st_bstream_dbitem_info despite the fact that pos is already present in the st_bstream_item_info structure which is part of st_bstream_dbitem_info.

These redundancies have been introduced by this patch: revid:charles.bell@sun.com-20091221193743-8047vccz3jsxqghs. For example the patch contains this change:

> -/**
> -  Describes item which sits inside a database.
> -*/ 
>  struct st_bstream_dbitem_info
>  {
> -  struct st_bstream_item_info  base; /**< data common to all items */
> -  struct st_bstream_db_info    *db;  /**< database to which this item belongs */
> +  struct st_bstream_item_info  base;/**< Data common to all items. */
> +  struct st_bstream_db_info    *db; /**< Database to which this item belongs. */
> +  unsigned short int  snap_num;     /**< Snapshot where table data is stored. */
> +  unsigned long int   pos;          /**< Table position within the snapshot. */
>  };
>  

How to repeat:
Code inspection (sql/backup/stream_v1.h).

Suggested fix:
Either make the type hierarchy flat or remove redundant members.