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.1972 05/06/10 16:48:28 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
mysql-test/t/mysqldump.test
1.40 05/06/10 16:48:25 msvensson@neptunus.(none) +2 -0
Add tests for XML and --no-data as well.
mysql-test/r/mysqldump.result
1.46 05/06/10 16:48:25 msvensson@neptunus.(none) +22 -0
Update test results add ouput for --xml and --no-data
client/mysqldump.c
1.182 05/06/10 16:48:25 msvensson@neptunus.(none) +21 -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/mysqldump-5.0
--- 1.181/client/mysqldump.c 2005-05-26 12:19:36 +02:00
+++ 1.182/client/mysqldump.c 2005-06-10 16:48:25 +02:00
@@ -1592,6 +1592,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);
@@ -2201,8 +2221,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;
}
--- 1.45/mysql-test/r/mysqldump.result 2005-06-10 16:27:37 +02:00
+++ 1.46/mysql-test/r/mysqldump.result 2005-06-10 16:48:25 +02:00
@@ -1480,5 +1480,27 @@
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+<?xml version="1.0"?>
+<mysqldump>
+<database name="mysqldump_test_db">
+ <table_structure name="t1">
+ <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
+ </table_structure>
+ <table_structure name="t2">
+ <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
+ </table_structure>
+</database>
+</mysqldump>
+<?xml version="1.0"?>
+<mysqldump>
+<database name="mysqldump_test_db">
+ <table_structure name="t1">
+ <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
+ </table_structure>
+ <table_structure name="t2">
+ <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
+ </table_structure>
+</database>
+</mysqldump>
DROP TABLE t1, t2;
DROP DATABASE mysqldump_test_db;
--- 1.39/mysql-test/t/mysqldump.test 2005-06-10 16:27:37 +02:00
+++ 1.40/mysql-test/t/mysqldump.test 2005-06-10 16:48:25 +02:00
@@ -576,5 +576,7 @@
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;
| Thread |
|---|
| • bk commit into 5.0 tree (msvensson:1.1972) BUG#9558 | msvensson | 10 Jun |