List:Commits« Previous MessageNext Message »
From:Rafal Somla Date:March 9 2009 4:18pm
Subject:bzr commit into mysql-6.0 branch (Rafal.Somla:2789) Bug#42959
View as plain text  
#At file:///ext/mysql/bzr/backup/bug42959/

 2789 Rafal Somla	2009-03-09
      Bug#42959 - Wrong logic in backup stream library when saving object metadata
      
      Changed specifications of bcat_get_item_create_*() functions so that they
      can either report error or signal that there is no data. Updated the logic
      in stream_v1.c accordingly.
modified:
  sql/backup/kernel.cc
  sql/backup/stream_v1.c
  sql/backup/stream_v1_services.h

per-file messages:
  sql/backup/kernel.cc
    We do not use extra metadata in the current backup kernel, thus function 
    bcat_get_item_create_data() should return BSTREAM_EOS, according to the 
    new specifications.
  sql/backup/stream_v1.c
    Uncomment call to bcat_get_create_data() because now it can correctly 
    report that there is no extra metadata.
  sql/backup/stream_v1_services.h
    Change specifications of bcat_get_item_create_{query,data}() functions.
=== modified file 'sql/backup/kernel.cc'
--- a/sql/backup/kernel.cc	2009-03-06 09:49:05 +0000
+++ b/sql/backup/kernel.cc	2009-03-09 16:17:18 +0000
@@ -2231,7 +2231,7 @@ int bcat_get_item_create_data(st_bstream
                             bstream_blob *data)
 {
   /* We don't use any extra data now */
-  return BSTREAM_ERROR;
+  return BSTREAM_EOS;
 }
 
 

=== modified file 'sql/backup/stream_v1.c'
--- a/sql/backup/stream_v1.c	2009-02-11 08:12:45 +0000
+++ b/sql/backup/stream_v1.c	2009-03-09 16:17:18 +0000
@@ -1629,21 +1629,27 @@ int bstream_wr_item_def(backup_stream *s
   data.end= 0;
   query.begin= 0;
   query.end= 0;
+
+  /* 
+    Fetch item's create query and/or extra metadata data. Note that
+    the BSTREAM_EOS reply from bcat_get_item_create_*() functions
+    indicates lack of the corresponding piece of metadata.
+  */
+
   ret= bcat_get_item_create_query(cat,item,&query);
   if (ret == BSTREAM_OK) 
     flags |= BSTREAM_FLAG_HAS_CREATE_STMT;
   else if (ret == BSTREAM_ERROR) 
     goto wr_error;
 
-  /* bcat_get_item_create_data not in use yet. */
-  /*
   ret= bcat_get_item_create_data(cat,item,&data);
   if (ret == BSTREAM_OK)
     flags |= BSTREAM_FLAG_HAS_EXTRA_DATA;
   else if (ret == BSTREAM_ERROR) 
     goto wr_error;
-  */
   
+  /* save the header of metadata entry, containing item coordinates */
+
   ret= bstream_wr_meta_item(s,kind,flags,item);
   if (ret == BSTREAM_ERROR) 
     goto wr_error;

=== modified file 'sql/backup/stream_v1_services.h'
--- a/sql/backup/stream_v1_services.h	2007-11-29 19:58:12 +0000
+++ b/sql/backup/stream_v1_services.h	2009-03-09 16:17:18 +0000
@@ -133,7 +133,8 @@ void  bcat_db_iterator_free(struct st_bs
   part of meta-data.
 
   @retval BSTREAM_OK    blob @c stmt contains the CREATE query
-  @retval BSTREAM_ERROR no CREATE statement for that item
+  @retval BSTREAM_EOS   no CREATE statement for that item
+  @retval BSTREAM_ERROR error when obtaining metadata for the item
 */
 int bcat_get_item_create_query(struct st_bstream_image_header *catalogue,
                                struct st_bstream_item_info *item,
@@ -146,8 +147,9 @@ int bcat_get_item_create_query(struct st
   meta-data. If function returns successfully, the bytes returned become
   part of meta-data.
 
-  @retval BSTREAM_OK    blob @c data contains the meta-data
-  @retval BSTREAM_ERROR no extra meta-data for that item
+  @retval BSTREAM_OK    blob @c data contains the metadata
+  @retval BSTREAM_EOS   no extra metadata for that item
+  @retval BSTREAM_ERROR error when obtaining metadata for the item
 */
 int bcat_get_item_create_data(struct st_bstream_image_header *catalogue,
                               struct st_bstream_item_info *item,

Thread
bzr commit into mysql-6.0 branch (Rafal.Somla:2789) Bug#42959Rafal Somla9 Mar