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-02-28 20:55:36+01:00, rafal@quant.(none) +6 -0
WL#3327: Fixes aiming at removing compilation errors on various platforms used by pushbuild.
sql/backup_alg.cc@stripped, 2007-02-28 20:55:33+01:00, rafal@quant.(none) +7 -1
- add possibility that a driver ends transfer directly after INIT phase (e.g. no data to backup).
- fix state updating code in Backup_pump::poll().
sql/backup_private.h@stripped, 2007-02-28 20:55:33+01:00, rafal@quant.(none) +1 -1
- removed spurious namespace qualification.
sql/backup_prototype.cc@stripped, 2007-02-28 20:55:33+01:00, rafal@quant.(none) +24 -0
- moved static stream instances out of open_* functions since it caused compilation problems
(thread-safe initialization of static variables).
sql/backup_stream.h@stripped, 2007-02-28 20:55:33+01:00, rafal@quant.(none) +16 -27
- moved explicit template instances out of backup namespace.
- introduced struct stream_instances to contain static stream instances.
sql/backup_util.cc@stripped, 2007-02-28 20:55:33+01:00, rafal@quant.(none) +10 -6
- experimenting with StringDom::null declaration to avoid wierd compilation error on nocona
platform (invalid const_cast from type `const String&' to type `String&').
- replacing ambiguous cast key8::operator bool() with explicit predicate key8::is_valid().
sql/backup_util.h@stripped, 2007-02-28 20:55:33+01:00, rafal@quant.(none) +7 -5
- experimenting with StringDom::null declaration to avoid wierd compilation error on nocona
platform (invalid const_cast from type `const String&' to type `String&').
- replacing ambiguous cast key8::operator bool() with explicit predicate key8::is_valid().
# 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
--- 1.1/sql/backup_alg.cc 2007-02-28 20:55:42 +01:00
+++ 1.2/sql/backup_alg.cc 2007-02-28 20:55:42 +01:00
@@ -188,7 +188,10 @@
while ( p.state == backup_state::INIT )
p.poll(); // poll the initial data
-
+
+ if (p.state == backup_state::DONE )
+ goto done;
+
DBUG_ASSERT( p.state == backup_state::WAITING || p.state == backup_state::READY );
p.prepare(); // ask driver to prepare for VP creation
@@ -206,6 +209,8 @@
while ( p.state == backup_state::FINISHING )
p.poll(); // poll the final data
+ done:
+
CHECK_STATE(p,backup_state::DONE);
//DBUG_ASSERT( p.state == backup_state::DONE );
@@ -262,6 +267,7 @@
case READY:
//if( state == backup_state::WAITING || state == backup_state::INIT )
+ if (res == READY)
state= backup_state::READY;
case OK:
--- 1.2/sql/backup_private.h 2007-02-28 20:55:42 +01:00
+++ 1.3/sql/backup_private.h 2007-02-28 20:55:42 +01:00
@@ -92,7 +92,7 @@
namespace prototype {
-stream_result::value prototype::operator<<(OStream&,TABLE&);
+stream_result::value operator<<(OStream&,TABLE&);
int create_table_from_str(THD*,IStream&,const Table_ref&);
} // prototype namespace
--- 1.2/sql/backup_prototype.cc 2007-02-28 20:55:42 +01:00
+++ 1.3/sql/backup_prototype.cc 2007-02-28 20:55:42 +01:00
@@ -22,6 +22,30 @@
}
namespace backup {
+
+// Return instances of IStream/OStream which use the in-memory storage.
+
+struct stream_instances {
+ static IStream istream;
+ static OStream ostream;
+};
+
+IStream stream_instances::istream(prototype::Chunk_storage::m_instance);
+OStream stream_instances::ostream(prototype::Chunk_storage::m_instance);
+
+
+IStream &open_for_read()
+{
+ stream_instances::istream.rewind();
+ return stream_instances::istream;
+}
+
+OStream &open_for_write()
+{
+ stream_instances::ostream.rewind();
+ return stream_instances::ostream;
+}
+
// Show data chunks in a backup stream;
--- 1.1/sql/backup_stream.h 2007-02-28 20:55:42 +01:00
+++ 1.2/sql/backup_stream.h 2007-02-28 20:55:42 +01:00
@@ -29,9 +29,9 @@
NIL= util::stream_result::NIL,
ERROR= util::stream_result::ERROR,
EOS, // end of stream
- EOC, // end of chunk
+ EOC // end of chunk
};
-};
+}
/**
Ad hoc, in-memory storage for byte chunks.
@@ -286,6 +286,16 @@
} // prototype namespace
+typedef prototype::Chunk_storage::IWindow IWindow;
+typedef prototype::Chunk_storage::OWindow OWindow;
+
+} // backup namespace
+
+
+template class util::IStream< backup::IWindow >;
+template class util::OStream< backup::OWindow >;
+
+namespace backup {
/****************************************************
@@ -293,12 +303,6 @@
****************************************************/
-typedef prototype::Chunk_storage::IWindow IWindow;
-typedef prototype::Chunk_storage::OWindow OWindow;
-
-template class util::IStream< IWindow >;
-template class util::OStream< OWindow >;
-
class IStream:
public IWindow,
public util::IStream< IWindow >
@@ -336,7 +340,7 @@
{}
- friend IStream& open_for_read();
+ friend class stream_instances;
};
@@ -362,26 +366,11 @@
Base1(cs), Base2(static_cast<OWindow&>(*this))
{}
- friend OStream& open_for_write();
+ friend class stream_instances;
};
-// Return instances of IStream/OStream which use the in-memory storage.
-
-inline
-IStream &open_for_read()
-{
- static IStream stream(prototype::Chunk_storage::m_instance);
- stream.rewind();
- return stream;
-}
-
-inline
-OStream &open_for_write()
-{
- static OStream stream(prototype::Chunk_storage::m_instance);
- stream.rewind();
- return stream;
-}
+IStream &open_for_read();
+OStream &open_for_write();
// Function for debugging backup stream implementation.
void dump_stream(IStream &);
--- 1.2/sql/backup_util.cc 2007-02-28 20:55:42 +01:00
+++ 1.3/sql/backup_util.cc 2007-02-28 20:55:42 +01:00
@@ -14,9 +14,9 @@
return ns;
}
-const String &StringDom::null= my_null_string;
+String &StringDom::null= const_cast< String& >(my_null_string);
-}
+} // util namespace
// Backup related utilities
@@ -70,19 +70,23 @@
return t;
}
+} // backup namespace
+
// Implementation of Table_list
+namespace backup {
+
int Tables::add(const Table_ref &t)
{
- backup::StringPool::Key k= dbnames.add(t.db().name());
+ StringPool::Key k= dbnames.add(t.db().name());
- if( !k ) return -1;
+ if( !k.is_valid() ) return -1;
return add(k,t.name());
}
-int Tables::add(const backup::StringPool::Key &k, const String &name)
+int Tables::add(const StringPool::Key &k, const String &name)
{
node *n= new node(k,name);
@@ -141,4 +145,4 @@
}
-}
+} // backup namespace
--- 1.1/sql/backup_util.h 2007-02-28 20:55:43 +01:00
+++ 1.2/sql/backup_util.h 2007-02-28 20:55:43 +01:00
@@ -421,6 +421,8 @@
protected:
+ // Use binary search tree for storing entries.
+
struct node {
El *el;
Key bigger,smaller;
@@ -497,11 +499,11 @@
Key &k1 = res>0 ? entries[k].bigger : entries[k].smaller;
- if( k1 )
+ if( K::valid_key(k1) )
return find_el(k1,e);
Key k2;
- if( (k2= find_free_loc()) )
+ if( K::valid_key(k2= find_free_loc()) )
{
k1= k2;
set(k2,e);
@@ -551,8 +553,8 @@
static const unsigned int null= 0xFF;
operator int() const { return val; };
- operator bool() const { return val != 0xFF; };
- static bool valid_key(const Key &k) { return (bool)k; };
+ bool is_valid() const { return key8::valid_key(*this); };
+ static bool valid_key(const Key &k) { return k.val != 0xFF; };
key8(): val(0xFF) {};
key8(unsigned int x) { operator=(x); };
@@ -606,7 +608,7 @@
struct StringDom
{
typedef String Element;
- static const Element &null;
+ static Element &null;
static Element *create(const Element &s);
| Thread |
|---|
| • bk commit into 5.1 tree (rafal:1.2418) | rsomla | 28 Feb |