From 11d3c64f67914dc456f6526d36abcb70a29726ec Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Sep 2006 17:07:21 +1000 Subject: [PATCH] BUG#20809 mysqldump does not backup TS and LG information correctly. We were not parsing the EXTRA field to get UNDO_BUFFER_SIZE for the CREATE LOGFILE GROUP statement in the dump. client/mysqldump.c: parse the EXTRA field of INFORMATION_SCHEMA.FILES to determine the UNDO_BUFFER_SIZE --- client/mysqldump.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 83a7d0f335e..445b4043ca6 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2737,6 +2737,12 @@ static int dump_all_tablespaces() MYSQL_RES *tableres; char buf[FN_REFLEN]; int first; + /* + The following are used for parsing the EXTRA field + */ + char extra_format[]= "UNDO_BUFFER_SIZE="; + char *ubs; + char *endsemi; if (mysql_query_with_error_report(mysql, &tableres, "SELECT DISTINCT" @@ -2744,9 +2750,11 @@ static int dump_all_tablespaces() " FILE_NAME," " TOTAL_EXTENTS," " INITIAL_SIZE," - " ENGINE" + " ENGINE," + " EXTRA" " FROM INFORMATION_SCHEMA.FILES" " WHERE FILE_TYPE = \"UNDO LOG\"" + " AND FILE_NAME IS NOT NULL" " ORDER BY LOGFILE_GROUP_NAME")) return 1; @@ -2775,9 +2783,16 @@ static int dump_all_tablespaces() row[1]); if (first) { + ubs= strstr(row[5],extra_format); + if(!ubs) + break; + ubs+= strlen(extra_format); + endsemi= strstr(ubs,";"); + if(endsemi) + endsemi[0]= '\0'; fprintf(md_result_file, " UNDO_BUFFER_SIZE %s\n", - row[2]); + ubs); } fprintf(md_result_file, " INITIAL_SIZE %s\n"