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

 2784 Rafal Somla	2009-03-04
      Bug#42959 - Wrong logic in backup stream library when saving object metadata
      
      Changed specification of bcat_get_item_create_*() function 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 reurn BSTREAM_EOS, accodrding to the new
    specifications.
  sql/backup/stream_v1.c
    Distinguish the situtation when error is reported from the one where 
    "no data" is reported. Thus now bcat_get_create_data() can be handled
    correctly.
  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-02-27 11:16:44 +0000
+++ b/sql/backup/kernel.cc	2009-03-04 09:46:06 +0000
@@ -2212,7 +2212,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-04 09:46:06 +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_ERROR)
+    goto wr_error;
   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_ERROR)
+    goto wr_error;
   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-04 09:46:06 +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-backup branch (Rafal.Somla:2784) Bug#42959Rafal Somla4 Mar
  • Re: bzr commit into mysql-6.0-backup branch (Rafal.Somla:2784)Bug#42959Jørgen Løland4 Mar
  • Re: bzr commit into mysql-6.0-backup branch (Rafal.Somla:2784)Bug#42959Chuck Bell4 Mar
    • Re: bzr commit into mysql-6.0-backup branch (Rafal.Somla:2784)Bug#42959Rafal Somla5 Mar