#At file:///Users/cbell/source/bzr/mysql-6.0-bug-47956/ based on revid:ritheesh.vedire@stripped
2889 Chuck Bell 2009-11-16
BUG#47956 : backup history log columns show diff values when logged in
FILE and TABLE mode
The backup log files are not writing the enumerated values to the file.
Instead, they are writing the numeric representation for the columns.
This affects the backup_history log file and columns 'backup_state'
and 'operation'.
This patch changes the log writing method to use the enumerated
values (strings) instead of the numeric values.
@ sql/log.cc
Write string equivalent for each of the two enumerated columns.
@ sql/si_logs.h
Corrected enumeration for the operation and backup_state columns.
modified:
sql/log.cc
sql/si_logs.h
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2009-10-26 14:02:26 +0000
+++ b/sql/log.cc 2009-11-16 18:37:18 +0000
@@ -3936,10 +3936,73 @@ bool MYSQL_BACKUP_LOG::write(THD *thd, s
goto err;
if (write_str(history_data->binlog_file))
goto err;
- if (write_int(history_data->state))
+
+ /*
+ Print the enumerated values to match the columns in the
+ table.
+ */
+ switch (history_data->state) {
+ case BUP_COMPLETE:
+ {
+ if (write_str("complete"))
+ goto err;
+ break;
+ }
+ case BUP_STARTING:
+ {
+ if (write_str("starting"))
+ goto err;
+ break;
+ }
+ case BUP_VALIDITY_POINT:
+ {
+ if (write_str("validity point"))
+ goto err;
+ break;
+ }
+ case BUP_RUNNING:
+ {
+ if (write_str("running"))
+ goto err;
+ break;
+ }
+ case BUP_ERRORS:
+ {
+ if (write_str("error"))
+ goto err;
+ break;
+ }
+ case BUP_CANCEL:
+ {
+ if (write_str("cancel"))
+ goto err;
+ break;
+ }
+ default: // Should be no other values.
goto err;
- if (write_int(history_data->operation))
+ }
+
+ /*
+ Print the enumerated values to match the columns in the
+ table.
+ */
+ switch (history_data->operation) {
+ case OP_BACKUP:
+ {
+ if (write_str("backup"))
+ goto err;
+ break;
+ }
+ case OP_RESTORE:
+ {
+ if (write_str("restore"))
+ goto err;
+ break;
+ }
+ default: // Should be no other values.
goto err;
+ }
+
if (write_int(history_data->error_num))
goto err;
if (write_int(history_data->num_objects))
=== modified file 'sql/si_logs.h'
--- a/sql/si_logs.h 2009-05-21 13:17:37 +0000
+++ b/sql/si_logs.h 2009-11-16 18:37:18 +0000
@@ -10,27 +10,30 @@
/**
List of operations for backup history log.
+
+ @note These must match the definition for the column 'operation'
+ in the backup_history and backup_progress tables.
*/
enum enum_backup_operation
{
OP_BACKUP = 1,
- OP_RESTORE,
- OP_SHOW,
- OP_OTHER
+ OP_RESTORE = 2
};
/**
List of states for backup logs.
+
+ @note These must match the definition for the column 'backup_state'
+ in the backup_history table.
*/
enum enum_backup_state
{
- BUP_UNKNOWN = 0,
- BUP_COMPLETE,
- BUP_STARTING,
- BUP_VALIDITY_POINT,
- BUP_RUNNING,
- BUP_ERRORS,
- BUP_CANCEL
+ BUP_COMPLETE = 1,
+ BUP_STARTING = 2,
+ BUP_VALIDITY_POINT = 3,
+ BUP_RUNNING = 4,
+ BUP_ERRORS = 5,
+ BUP_CANCEL = 6
};
/**
Attachment: [text/bzr-bundle] bzr/charles.bell@sun.com-20091116183718-v0rooe9klth816xy.bundle
| Thread |
|---|
| • bzr commit into mysql-6.0-backup branch (charles.bell:2889) Bug#47956 | Chuck Bell | 16 Nov |