From: Date: June 22 2005 3:43pm Subject: bk commit into 5.0 tree (msvensson:1.1992) BUG#9558 List-Archive: http://lists.mysql.com/internals/26309 X-Bug: 9558 Message-Id: <20050622134355.B78BD25DF7F@blaudden.homeip.net> Below is the list of changes that have just been committed into a local 5.0 repository of msvensson. When msvensson 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 1.1992 05/06/22 15:43:49 msvensson@neptunus.(none) +3 -0 Bug #9558 mysqldump --no-data db t1 t2 format still dumps data - Check the Dflag variable inside of function dump_table to see if data should be dumped or not. - Add test for --xml and --no-data as well Reapplying patch! mysql-test/t/mysqldump.test 1.43 05/06/22 15:43:46 msvensson@neptunus.(none) +2 -0 Add tests for XML and --no-data as well. mysql-test/r/mysqldump.result 1.49 05/06/22 15:43:46 msvensson@neptunus.(none) +22 -0 Update test results add ouput for --xml and --no-data client/mysqldump.c 1.184 05/06/22 15:43:46 msvensson@neptunus.(none) +24 -2 Move the check of --no-data flag and "number of fields" inside of the dump_table 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: msvensson # Host: neptunus.(none) # Root: /home/msvensson/mysql/mysql-5.0 --- 1.183/client/mysqldump.c 2005-06-22 15:29:05 +02:00 +++ 1.184/client/mysqldump.c 2005-06-22 15:43:46 +02:00 @@ -1595,6 +1595,26 @@ const char *table_type; int error= 0; + /* Check --no-data flag */ + if (dFlag) + { + if (verbose) + fprintf(stderr, + "-- Skipping dump data for table '%s', --no-data was used\n", + table); + return; + } + + /* Check that there are any fields in the table */ + if(numFields == 0) + { + if (verbose) + fprintf(stderr, + "-- Skipping dump data for table '%s', it has no fields\n", + table); + return; + } + result_table= quote_name(table,table_buff, 1); opt_quoted_table= quote_name(table, table_buff2, 0); @@ -2204,8 +2224,7 @@ if (include_table(hash_key, end - hash_key)) { numrows = get_table_structure(table, database); - if (!dFlag && numrows > 0) - dump_table(numrows,table); + dump_table(numrows,table); my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); order_by= 0; } @@ -2392,6 +2411,7 @@ } if (opt_xml) print_xml_tag1(md_result_file, "", "database name=", db, "\n"); + /* Dump each selected table */ const char *table_name; for (i= 0; i < dump_tables.records; i++) @@ -2401,6 +2421,8 @@ numrows = get_table_structure(table_name, db); dump_table(numrows, table_name); } + + /* Dump each selected view */ if (was_views) { for(i=0; i < dump_tables.records; i++) --- 1.48/mysql-test/r/mysqldump.result 2005-06-22 15:32:02 +02:00 +++ 1.49/mysql-test/r/mysqldump.result 2005-06-22 15:43:46 +02:00 @@ -1529,6 +1529,28 @@ /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + + + + + + + + + + + + + + + + + + + + + + DROP TABLE t1, t2; DROP DATABASE mysqldump_test_db; create database mysqldump_test_db; --- 1.42/mysql-test/t/mysqldump.test 2005-06-22 15:32:02 +02:00 +++ 1.43/mysql-test/t/mysqldump.test 2005-06-22 15:43:46 +02:00 @@ -600,6 +600,8 @@ INSERT INTO t2 VALUES (1), (2); --exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db --exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db t1 t2 +--exec $MYSQL_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db +--exec $MYSQL_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db t1 t2 DROP TABLE t1, t2; DROP DATABASE mysqldump_test_db;