Below is the list of changes that have just been committed into a local
5.1 repository of rafal. When rafal does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-05-24 21:39:26+02:00, rafal@quant.(none) +3 -0
WL#3327: Minor fixes.
- Move Backup_info::Item_iterator -> Archive_info::Item::Iterator to
avoid access rights problems.
- Remove warnings about signed-unsigned comparisons.
sql/backup/archive.h@stripped, 2007-05-24 21:39:23+02:00, rafal@quant.(none) +55 -0
Class Backup_info::Item_iterator is replaced by
Archive_info::Item::Iterator. Here only constructor for
Backup_info::Item_iterator is defined.
sql/backup/backup_kernel.h@stripped, 2007-05-24 21:39:23+02:00, rafal@quant.(none) +4 -40
Class Backup_info::Item_iterator is replaced by
Archive_info::Item::Iterator.
sql/backup/sql_backup.cc@stripped, 2007-05-24 21:39:23+02:00, rafal@quant.(none) +2 -18
- Remove last_image_no which is now unused.
- Remove warnings about signed-unsigned comparisons.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: rafal
# Host: quant.(none)
# Root: /ext/mysql/bk/backup/prototype-myisam
--- 1.28/sql/backup/sql_backup.cc 2007-05-24 21:39:32 +02:00
+++ 1.29/sql/backup/sql_backup.cc 2007-05-24 21:39:32 +02:00
@@ -262,13 +262,11 @@
#ifndef USE_DEFAULT_BACKUP
- uint last_image_no= images[0]? img_count-1 : img_count;
-
// Point 3: try existing images but not the default one.
- for (int no=0; no < img_count && no < 256 ; ++no)
+ for (uint no=0; no < img_count && no < 256 ; ++no)
{
- if (no == default_image_no)
+ if (default_image_no >= 0 && no == (uint)default_image_no)
continue;
img= images[no];
@@ -629,20 +627,6 @@
// FIXME: complete this
return TRUE;
}
-
-
-/********** meta-item iterator *************/
-
-Backup_info::Item* Backup_info::Item_iterator::operator++(int)
-{
- m_prev= m_curr;
-
- if (m_curr)
- m_curr= m_curr->next;
-
- return m_prev;
-}
-
} // backup namespcae
--- 1.11/sql/backup/archive.h 2007-05-24 21:39:32 +02:00
+++ 1.12/sql/backup/archive.h 2007-05-24 21:39:32 +02:00
@@ -238,6 +238,8 @@
/// Create item from a stream entry.
static Item* create_from_stream(const Archive_info&, IStream&);
+ class Iterator;
+
protected:
Item(const Archive_info &i): m_info(&i), next(NULL)
@@ -250,6 +252,59 @@
friend class Backup_info;
friend class Restore_info;
};
+
+
+/**
+ Used to iterate over meta-data items.
+
+ Usage:
+ <pre>
+ Item *head;
+ for (Item::Iterator it(i); it ; it++)
+ {
+ it->archive_item_method()
+ }
+ </pre>
+ or
+ <pre>
+ Item *head, *p;
+ Item::iterator it(head);
+
+ while ((p=it++))
+ {
+ @<use p here>
+ }
+ </pre>
+ */
+class Archive_info::Item::Iterator
+{
+ Item *m_curr;
+ Item *m_prev;
+
+ public:
+
+ Iterator(Item *const head): m_curr(head), m_prev(NULL)
+ {}
+
+ operator bool() const
+ { return m_curr != NULL; }
+
+ Item* operator++(int)
+ {
+ m_prev= m_curr;
+
+ if (m_curr)
+ m_curr= m_curr->next;
+
+ return m_prev;
+ }
+
+ Item* operator->()
+ { DBUG_ASSERT(m_curr);
+ return m_curr; }
+};
+
+
/**
Specialization of @c Archive_info::Item representing a database.
--- 1.5/sql/backup/backup_kernel.h 2007-05-24 21:39:32 +02:00
+++ 1.6/sql/backup/backup_kernel.h 2007-05-24 21:39:32 +02:00
@@ -152,49 +152,13 @@
Item *m_last_db;
};
-/**
- Used to iterate over meta-data items in a @c Backup_info structure.
-
- Usage:
- <pre>
- Backup_info info;
- for (Backup_info::Item_iterator it(info); it ; it++)
- {
- it->archive_item_method()
- }
- </pre>
- or
- <pre>
- Backup_info info;
- Backup_info::Item_iterator it(info);
- Archive_info::Item *p;
-
- while ((p=it++))
- {
- @<use p here>
- }
- </pre>
- */
-class Backup_info::Item_iterator
+class Backup_info::Item_iterator: public Archive_info::Item::Iterator
{
- Item *m_curr;
- Item *m_prev;
-
public:
-
- Item_iterator(const Backup_info &info): m_prev(NULL)
- { m_curr= info.m_items; }
-
- operator bool() const
- { return m_curr != NULL; }
-
- Item* operator++(int);
-
- Item* operator->()
- { DBUG_ASSERT(m_curr);
- return m_curr; }
+ Item_iterator(const Backup_info &info):
+ Archive_info::Item::Iterator(info.m_items)
+ {}
};
-
/**
Specialization of @c Archive_info which is used to select and restore items
| Thread |
|---|
| • bk commit into 5.1 tree (rafal:1.2530) | rsomla | 24 May |