diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2006-02-02 10:56:04 +0100 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2006-02-02 10:56:04 +0100 |
commit | f4c3c356604923e60e7140c4232cfa94308b8163 (patch) | |
tree | 158a7e8d18b647254dd1345a0bed8d6fe638a446 | |
parent | e319fb893b6954d4af61c11a0347d887e0179712 (diff) | |
download | mariadb-git-f4c3c356604923e60e7140c4232cfa94308b8163.tar.gz |
Bug #16753 DD: mysqldump does not support Cluster Disk Data backups
-rw-r--r-- | client/mysqldump.c | 83 | ||||
-rw-r--r-- | mysql-test/r/ndb_dd_dump.result | 33 | ||||
-rw-r--r-- | mysql-test/t/ndb_dd_dump.test | 16 |
3 files changed, 82 insertions, 50 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index 6b4860f840e..9c495a70ea9 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2489,14 +2489,15 @@ static int dump_all_tablespaces() int first; if (mysql_query_with_error_report(sock, &tableres, - "SELECT DISTINCT " - "LOGFILE_GROUP_NAME," - "FILE_NAME," - "INITIAL_SIZE," - "ENGINE " - "FROM INFORMATION_SCHEMA.FILES " - "WHERE FILE_TYPE = \"UNDO LOG\" " - "ORDER BY LOGFILE_GROUP_NAME")) + "SELECT DISTINCT" + " LOGFILE_GROUP_NAME," + " FILE_NAME," + " TOTAL_EXTENTS," + " INITIAL_SIZE," + " ENGINE" + " FROM INFORMATION_SCHEMA.FILES" + " WHERE FILE_TYPE = \"UNDO LOG\"" + " ORDER BY LOGFILE_GROUP_NAME")) return 1; buf[0]= 0; @@ -2506,14 +2507,12 @@ static int dump_all_tablespaces() first= 1; if (first) { - first= 0; if (!opt_xml && opt_comments) { fprintf(md_result_file,"\n--\n-- Logfile group: %s\n--\n", row[0]); check_io(md_result_file); } fprintf(md_result_file, "\nCREATE"); - strxmov(buf, row[0], NullS); } else { @@ -2521,27 +2520,39 @@ static int dump_all_tablespaces() } fprintf(md_result_file, " LOGFILE GROUP %s\n" - " ADD UNDOFILE '%s'\n" + " ADD UNDOFILE '%s'\n", + row[0], + row[1]); + if (first) + { + fprintf(md_result_file, + " UNDO_BUFFER_SIZE %s\n", + row[2]); + } + fprintf(md_result_file, " INITIAL_SIZE %s\n" " ENGINE=%s;\n", - row[0], - row[1], - row[2], - row[3] - ); + row[3], + row[4]); check_io(md_result_file); + if (first) + { + first= 0; + strxmov(buf, row[0], NullS); + } } if (mysql_query_with_error_report(sock, &tableres, - "SELECT DISTINCT " - "TABLESPACE_NAME," - "LOGFILE_GROUP_NAME," - "FILE_NAME," - "INITIAL_SIZE," - "ENGINE " - "FROM INFORMATION_SCHEMA.FILES " - "WHERE FILE_TYPE = \"DATAFILE\" " - "ORDER BY TABLESPACE_NAME, LOGFILE_GROUP_NAME")) + "SELECT DISTINCT" + " TABLESPACE_NAME," + " FILE_NAME," + " LOGFILE_GROUP_NAME," + " EXTENT_SIZE," + " INITIAL_SIZE," + " ENGINE" + " FROM INFORMATION_SCHEMA.FILES" + " WHERE FILE_TYPE = \"DATAFILE\"" + " ORDER BY TABLESPACE_NAME, LOGFILE_GROUP_NAME")) return 1; buf[0]= 0; @@ -2557,7 +2568,6 @@ static int dump_all_tablespaces() check_io(md_result_file); } fprintf(md_result_file, "\nCREATE"); - strxmov(buf, row[0], NullS); } else { @@ -2567,23 +2577,26 @@ static int dump_all_tablespaces() " TABLESPACE %s\n" " ADD DATAFILE '%s'\n", row[0], - row[2] - ); + row[1]); if (first) { - first= 0; fprintf(md_result_file, - " USE LOGFILE GROUP %s\n", - row[1] - ); + " USE LOGFILE GROUP %s\n" + " EXTENT_SIZE %s\n", + row[2], + row[3]); } fprintf(md_result_file, " INITIAL_SIZE %s\n" " ENGINE=%s;\n", - row[3], - row[4] - ); + row[4], + row[5]); check_io(md_result_file); + if (first) + { + first= 0; + strxmov(buf, row[0], NullS); + } } return 0; } diff --git a/mysql-test/r/ndb_dd_dump.result b/mysql-test/r/ndb_dd_dump.result index 2e2d7291711..d3c1cba8d5e 100644 --- a/mysql-test/r/ndb_dd_dump.result +++ b/mysql-test/r/ndb_dd_dump.result @@ -10,8 +10,8 @@ INITIAL_SIZE = 4M ENGINE NDB; CREATE LOGFILE GROUP lg2 ADD UNDOFILE 'undofile_lg2_01.dat' -INITIAL_SIZE 2M UNDO_BUFFER_SIZE = 1M +INITIAL_SIZE 2M ENGINE NDB; ALTER LOGFILE GROUP lg2 ADD UNDOFILE 'undofile_lg2_02.dat' @@ -20,6 +20,7 @@ ENGINE NDB; CREATE TABLESPACE ts1 ADD DATAFILE 'datafile_ts1_01.dat' USE LOGFILE GROUP lg1 +EXTENT_SIZE 1M INITIAL_SIZE 2M ENGINE NDB; ALTER TABLESPACE ts1 @@ -174,22 +175,30 @@ DROP TABLESPACE ts3 ENGINE = NDB; DROP LOGFILE GROUP lg1 ENGINE = NDB; DROP LOGFILE GROUP lg2 ENGINE = NDB; SELECT DISTINCT +LOGFILE_GROUP_NAME, +FILE_NAME, +TOTAL_EXTENTS, +INITIAL_SIZE, +ENGINE +FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="UNDO LOG" ORDER BY FILE_NAME; +LOGFILE_GROUP_NAME FILE_NAME TOTAL_EXTENTS INITIAL_SIZE ENGINE +lg1 undofile_lg1_01.dat 1048576 2097152 ndbcluster +lg1 undofile_lg1_02.dat 1048576 4194304 ndbcluster +lg2 undofile_lg2_01.dat 1048576 2097152 ndbcluster +lg2 undofile_lg2_02.dat 1048576 4194304 ndbcluster +SELECT DISTINCT TABLESPACE_NAME, LOGFILE_GROUP_NAME, -FILE_TYPE, FILE_NAME, +EXTENT_SIZE, INITIAL_SIZE, ENGINE -FROM INFORMATION_SCHEMA.FILES ORDER BY FILE_NAME; -TABLESPACE_NAME LOGFILE_GROUP_NAME FILE_TYPE FILE_NAME INITIAL_SIZE ENGINE -ts1 lg1 DATAFILE datafile_ts1_01.dat 2097152 ndbcluster -ts1 lg1 DATAFILE datafile_ts1_02.dat 1048576 ndbcluster -ts2 lg1 DATAFILE datafile_ts2_01.dat 2097152 ndbcluster -ts3 lg2 DATAFILE datafile_ts3_01.dat 4194304 ndbcluster -ts3 lg1 UNDO LOG undofile_lg1_01.dat 2097152 ndbcluster -ts3 lg1 UNDO LOG undofile_lg1_02.dat 4194304 ndbcluster -ts3 lg2 UNDO LOG undofile_lg2_01.dat 2097152 ndbcluster -ts3 lg2 UNDO LOG undofile_lg2_02.dat 4194304 ndbcluster +FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="DATAFILE" ORDER BY FILE_NAME; +TABLESPACE_NAME LOGFILE_GROUP_NAME FILE_NAME EXTENT_SIZE INITIAL_SIZE ENGINE +ts1 lg1 datafile_ts1_01.dat 1048576 2097152 ndbcluster +ts1 lg1 datafile_ts1_02.dat 1048576 1048576 ndbcluster +ts2 lg1 datafile_ts2_01.dat 1048576 2097152 ndbcluster +ts3 lg2 datafile_ts3_01.dat 1048576 4194304 ndbcluster SELECT COUNT(*) FROM t1; COUNT(*) 500 diff --git a/mysql-test/t/ndb_dd_dump.test b/mysql-test/t/ndb_dd_dump.test index 89739a3525e..e44822e83c4 100644 --- a/mysql-test/t/ndb_dd_dump.test +++ b/mysql-test/t/ndb_dd_dump.test @@ -17,8 +17,8 @@ ENGINE NDB; CREATE LOGFILE GROUP lg2 ADD UNDOFILE 'undofile_lg2_01.dat' -INITIAL_SIZE 2M UNDO_BUFFER_SIZE = 1M +INITIAL_SIZE 2M ENGINE NDB; ALTER LOGFILE GROUP lg2 @@ -29,6 +29,7 @@ ENGINE NDB; CREATE TABLESPACE ts1 ADD DATAFILE 'datafile_ts1_01.dat' USE LOGFILE GROUP lg1 +EXTENT_SIZE 1M INITIAL_SIZE 2M ENGINE NDB; @@ -208,13 +209,22 @@ DROP LOGFILE GROUP lg2 ENGINE = NDB; --exec $MYSQL test < var/tmp/ndb_dd_dump.sql SELECT DISTINCT + LOGFILE_GROUP_NAME, + FILE_NAME, + TOTAL_EXTENTS, + INITIAL_SIZE, + ENGINE +FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="UNDO LOG" ORDER BY FILE_NAME; + +SELECT DISTINCT TABLESPACE_NAME, LOGFILE_GROUP_NAME, - FILE_TYPE, FILE_NAME, + EXTENT_SIZE, INITIAL_SIZE, ENGINE -FROM INFORMATION_SCHEMA.FILES ORDER BY FILE_NAME; +FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="DATAFILE" ORDER BY FILE_NAME; + SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t2; SELECT COUNT(*) FROM t3; |