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, 2006-10-26 11:55:54+00:00, rafal@quant.(none) +5 -0
Further corrections to get it compiled under pushbuild.
BitKeeper/etc/ignore@stripped, 2006-10-26 11:55:53+00:00, rafal@quant.(none) +6 -0
Added .externalToolBuilders/org.eclipse.cdt.make.core.ScannerConfigBuilder.launch
.settings/org.eclipse.cdt.core.prefs .settings/org.eclipse.ltk.core.refactoring.prefs
libmysqld/backup.cc .cdtproject .project to the ignore list
libmysqld/Makefile.am@stripped, 2006-10-26 11:55:53+00:00, rafal@quant.(none) +2 -1
Added backup.cc source file.
sql/backup.cc@stripped, 2006-10-26 11:55:53+00:00, rafal@quant.(none) +28 -27
removing semicolons after groups
sql/backup.h@stripped, 2006-10-26 11:55:53+00:00, rafal@quant.(none) +23 -23
removing semicolons after groups
storage/archive/abackup.cc@stripped, 2006-10-26 11:55:53+00:00, rafal@quant.(none) +35 -30
Removing semicolons after groups, removing static object instance
inside archive_backup_engine() function.
# 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.98/libmysqld/Makefile.am 2006-10-26 11:55:56 +00:00
+++ 1.99/libmysqld/Makefile.am 2006-10-26 11:55:56 +00:00
@@ -71,7 +71,8 @@
event_queue.cc event_db_repository.cc \
rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
sql_tablespace.cc \
- rpl_injector.cc my_user.c partition_info.cc
+ rpl_injector.cc my_user.c partition_info.cc \
+ backup.cc
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
libmysqld_a_SOURCES=
--- 1.1/sql/backup.cc 2006-10-26 11:55:56 +00:00
+++ 1.2/sql/backup.cc 2006-10-26 11:55:56 +00:00
@@ -23,7 +23,7 @@
uint length;
uint decimals;
- Field_data():pool(NULL) {};
+ Field_data():pool(NULL) {}
/*
Field_data(const Field_data &fd):
type(fd.type), length(fd.length), decimals(fd.decimals), pool(fd.pool)
@@ -42,7 +42,7 @@
{
if( pool )
my_free(pool,MYF(0));
- };
+ }
private:
@@ -113,8 +113,8 @@
{
//DBUG_PRINT("backup", ( " adding field %d: %s", i, t->field[i]->field_name )
);
fields[fields_no] = *tbl.field[fields_no];
- };
-};
+ }
+}
void Table_data::free()
{
@@ -195,7 +195,7 @@
return get_schema_table(thd, ::get_schema_table(which));
else
return NULL;
-};
+}
/*
* Read backup image from backup driver and send it to the stream
@@ -334,7 +334,7 @@
my_error(ER_NO,MYF(0),"ala","ala");
DBUG_RETURN(1);
-};
+}
/*
@@ -522,7 +522,7 @@
DBUG_RETURN(0);
-};
+}
/*************************************************
*
@@ -662,7 +662,7 @@
repeats++;
break;
- };
+ }
}; // data sending loop
@@ -687,7 +687,7 @@
my_error(ER_NO,MYF(0),"ala","ala");
DBUG_RETURN(1);
-};
+}
/*
* restore_table() -- creating empty table from data in Table_data structure.
@@ -746,7 +746,7 @@
err= mysql_create_table(thd, "test", td.name, &info, fields, keys, FALSE, 0,
FALSE);
DBUG_PRINT("backup",(" result= %d",err));
-};
+}
@@ -786,14 +786,14 @@
};
return 0;
-};
+}
// Not implemented
int setup_keys(THD *thd, const Table_data &td, List<Key> &keys)
{
return 0;
-};
+}
@@ -840,7 +840,7 @@
thd->lex= saved_lex;
return t;
-};
+}
@@ -870,7 +870,7 @@
NULL, //&charset,
0 ); // fld_geom_type ?
-};
+}
// CHECK: longlong2str
@@ -886,7 +886,7 @@
strcpy(ptr,buf);
return ptr;
-};
+}
// Implementation of Table_map
@@ -901,7 +901,7 @@
ptr= n->next;
delete n;
};
-};
+}
void Table_map::add(const Table_ref &t)
@@ -918,7 +918,7 @@
m_last->next= n;
m_last= n;
};
-};
+}
const Table_ref &Table_map::operator[](uint pos) const
@@ -934,7 +934,7 @@
return ptr->tbl;
else
return m_last->tbl; // can crash if m_last == NULL
-};
+}
// Implementation of Table_ref and Db_ref
@@ -945,7 +945,7 @@
m_db= t.db;
return *this;
-};
+}
const char *Table_ref::path() const
{
@@ -957,31 +957,32 @@
m_name.ptr(),
"", 0 );
return buf;
-};
+}
const String &Db_ref::catalog() const
{
return my_null_string;
-};
+}
// In memory stream implementation
static byte image_data[Backup_stream::DATA_LEN];
-Backup_image::Backup_image(): str(image_data), howmuch(0) {};
+Backup_image::Backup_image(): str(image_data), howmuch(0)
+{}
Backup_image::~Backup_image()
{
while( howmuch )
meta[--howmuch].free();
-};
+}
void Backup_image::add(const Table_data &td)
{
if( howmuch >= 10 ) return;
meta[howmuch++]= td;
-};
+}
Backup_stream &Backup_stream::operator<<(const Buffer &buf)
@@ -1000,7 +1001,7 @@
};
return *this;
-};
+}
Backup_stream &Backup_stream::operator>>(Buffer &buf)
{
@@ -1034,9 +1035,9 @@
pos += hdr.size;
return *this;
-};
+}
-}; // backup namespace
+} // backup namespace
/*
--- 1.2/sql/backup.h 2006-10-26 11:55:56 +00:00
+++ 1.3/sql/backup.h 2006-10-26 11:55:56 +00:00
@@ -16,15 +16,15 @@
public:
- Db_ref(const char *db): m_name(db,system_charset_info) {};
+ Db_ref(const char *db): m_name(db,system_charset_info) {}
Db_ref &operator=(const char *db)
{
m_name.set( STRING_WITH_LEN(db), system_charset_info );
return *this;
- };
+ }
- const String &name() const { return m_name; };
+ const String &name() const { return m_name; }
const String &catalog() const;
};
@@ -39,16 +39,16 @@
Table_ref(const char *db, const char *name):
m_name(name,table_alias_charset),m_db(db)
- {};
+ {}
Table_ref(const TABLE_LIST &t):
m_name(t.table_name,table_alias_charset),
m_db(t.db)
- {};
+ {}
Table_ref &operator=(const TABLE_LIST &t);
- const Db_ref &db() const { return m_db; };
- const String &name() const { return m_name; };
+ const Db_ref &db() const { return m_db; }
+ const String &name() const { return m_name; }
const char *path() const;
@@ -63,13 +63,13 @@
void add(const Table_ref &t);
const Table_ref &operator[](uint pos) const;
- uint count() const { return m_count; };
+ uint count() const { return m_count; }
class iterator;
protected:
- Table_map(const Table_map &) {};
+ Table_map(const Table_map &) {}
private:
@@ -78,7 +78,7 @@
Table_ref tbl;
node *next;
};
-
+
node *m_head,*m_last;
uint m_count;
@@ -95,7 +95,7 @@
{
if( ptr ) { ptr= ptr->next; return TRUE; }
else return FALSE;
- };
+ }
operator bool() const { return ptr != NULL; };
@@ -103,7 +103,7 @@
{
if(ptr) return &(ptr->tbl);
else return NULL;
- };
+ }
private:
Table_map::node *ptr;
@@ -124,7 +124,7 @@
const Table_map &tables, Restore* &eng ) =0;
virtual void free() {};
-};
+};
class Buffer;
@@ -132,7 +132,7 @@
{
public:
- Driver(const Table_map &tables):m_tables(tables) {};
+ Driver(const Table_map &tables):m_tables(tables) {}
virtual size_t buffer_size() =0;
virtual result_t cancel() =0;
@@ -149,7 +149,7 @@
{
public:
- Backup(const Table_map &tables):Driver(tables) {};
+ Backup(const Table_map &tables):Driver(tables) {}
virtual size_t size() =0;
virtual size_t init_size() =0;
@@ -164,7 +164,7 @@
{
public:
- Restore(const Table_map &tables):Driver(tables) {};
+ Restore(const Table_map &tables):Driver(tables) {}
virtual result_t prepare() =0;
virtual result_t send_data(Buffer &buf) =0;
@@ -179,24 +179,24 @@
bool last;
byte *data;
- Buffer():data(NULL),size(0),create_size(0),stream_no(0),last(TRUE) {};
+ Buffer():data(NULL),size(0),create_size(0),stream_no(0),last(TRUE) {}
Buffer(uint size):size(size),create_size(size),stream_no(0),last(TRUE)
{
data= my_malloc(size,MYF(0));
- };
+ }
~Buffer()
{
if(data) my_free(data,MYF(0));
- };
+ }
void reset()
{
size= create_size;
stream_no=0;
last= TRUE;
- };
+ }
void realloc(uint size)
{
@@ -207,12 +207,12 @@
data= NULL;
create_size= data ? size : 0;
reset();
- };
+ }
operator bool() const
{
return data != NULL;
- };
+ }
private:
@@ -225,7 +225,7 @@
int do_restore(THD*);
-};
+}
typedef backup::result_t Backup_result_t;
typedef backup::Engine Backup_engine;
--- 1.1/storage/archive/abackup.cc 2006-10-26 11:55:56 +00:00
+++ 1.2/storage/archive/abackup.cc 2006-10-26 11:55:56 +00:00
@@ -34,7 +34,7 @@
m_path= sql_alloc(len+1);
if( m_path )
strncpy(const_cast<char*>(m_path),tbl.path(),len+1);
-};
+}
int Table::open_data_file(int options)
@@ -44,7 +44,7 @@
file_path.append(".ARZ");
return my_open(file_path.ptr(),options,MYF(0));
-};
+}
int Table::open_meta_file(int options)
{
@@ -53,7 +53,7 @@
file_path.append(".ARM");
return my_open(file_path.ptr(),options,MYF(0));
-};
+}
TABLE_SHARE Table::ts;
@@ -65,7 +65,7 @@
ha->open(path(),0,0);
return ha;
-};
+}
/*******
* Backup engine class
@@ -149,8 +149,7 @@
eng= ptr;
return backup::OK;
-};
-
+}
Backup::Backup(const backup::Table_map &tables):
@@ -158,7 +157,7 @@
{
// show info from handler share for each table
DBUG_PRINT("archive/backup",("Creating backup driver"));
-};
+}
Backup::~Backup()
{
@@ -166,7 +165,7 @@
for( uint n=0 ; n < m_tables.count() ; ++n )
if( images[n] )
delete images[n];
-};
+}
result_t Backup::start_backup()
{
@@ -175,7 +174,7 @@
images= (Table_backup**)sql_alloc(m_tables.count()*sizeof(Table_backup*));
DBUG_RETURN(backup::OK);
-};
+}
result_t Backup::get_data(Buffer &buf)
{
@@ -233,7 +232,7 @@
DBUG_RETURN(ret);
-};
+}
result_t Backup::lock()
@@ -250,13 +249,13 @@
state= DUMPING;
DBUG_RETURN(backup::OK);
-};
+}
result_t Backup::cont()
{
return backup::OK;
-};
+}
/*****
* Backing-up a single table
@@ -273,12 +272,12 @@
state= ERROR;
DBUG_PRINT("archive/backup",(" error when opennig!"));
};
-};
+}
Table_backup::~Table_backup()
{
if( fd >= 0 ) my_close(fd,MYF(0));
-};
+}
void Table_backup::save_current_state()
@@ -334,7 +333,7 @@
state= META;
DBUG_VOID_RETURN;
-};
+}
/*
* Backup image format:
@@ -347,7 +346,7 @@
if( state == START ) return Backup::WAIT;
if( state == DONE || state == ERROR ) return Backup::EOD;
return Backup::YES;
-};
+}
result_t Table_backup::get_data(Buffer &buf)
{
@@ -431,7 +430,7 @@
}; // switch( state )
-}; // Table_backup::get_data
+} // Table_backup::get_data
/**************************************
@@ -492,14 +491,14 @@
eng= ptr;
return backup::OK;
-};
+}
Restore::Restore(const backup::Table_map &tables):
Backup_engine::Restore(tables),stage(START),tables(0),images(NULL)
{
DBUG_PRINT("archive/restore",("Creating restore driver"));
-};
+}
Restore::~Restore()
{
@@ -507,7 +506,7 @@
for( uint n=0 ; n < m_tables.count() ; ++n )
if( images[n] )
delete images[n];
-};
+}
result_t Restore::prepare()
{
@@ -520,7 +519,7 @@
stage= PUMPING;
return backup::OK;
-};
+}
result_t Restore::send_data(Buffer &buf)
{
@@ -557,12 +556,12 @@
return backup::OK;
-};
+}
result_t Restore::cont()
{
return backup::OK;
-};
+}
/*****
* Restoring single table
@@ -571,7 +570,7 @@
Table_restore::Table_restore(const Table_ref &buf):
Table(buf), fd(-1), stage(META)
-{};
+{}
result_t Table_restore::send_data(const Buffer &buf)
{
@@ -626,24 +625,30 @@
return backup::OK;
};
-};
+}
result_t Table_restore::finish()
{
if( fd > 0 ) my_close(fd,MYF(0));
fd= -1;
return backup::OK;
-};
+}
-}; // archive_backup namespace
+} // archive_backup namespace
Backup_result_t archive_backup_engine(Backup_engine* &be)
{
- static archive_backup::Engine engine;
+ static archive_backup::Engine *engine= NULL;
- be= &engine;
+ if( !engine )
+ engine= new archive_backup::Engine();
+
+ if( ! engine )
+ return backup::ERROR;
+
+ be= engine;
return backup::OK;
-};
+}
--- 1.255/BitKeeper/etc/ignore 2006-10-26 11:55:57 +00:00
+++ 1.256/BitKeeper/etc/ignore 2006-10-26 11:55:57 +00:00
@@ -2919,3 +2919,9 @@
win/vs8cache.txt
zlib/*.ds?
zlib/*.vcproj
+.externalToolBuilders/org.eclipse.cdt.make.core.ScannerConfigBuilder.launch
+.settings/org.eclipse.cdt.core.prefs
+.settings/org.eclipse.ltk.core.refactoring.prefs
+libmysqld/backup.cc
+.cdtproject
+.project
| Thread |
|---|
| • bk commit into 5.1 tree (rafal:1.2354) | rsomla | 26 Oct |