--- mysql-6.0.2-alpha/client/mysqldump.c 2007-08-29 11:01:35.000000000 -0700 +++ mysql-6.0.2-alpha-nw/client/mysqldump.c 2007-11-01 17:20:06.000000000 -0700 @@ -34,9 +34,10 @@ ** and adapted to mysqldump 05/11/01 by Jani Tolonen ** Added --single-transaction option 06/06/2002 by Peter Zaitsev ** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov +** Handles federated tables much better (--federated-data) 20071101 by Nicklas Westerlund */ -#define DUMP_VERSION "10.12" +#define DUMP_VERSION "10.13" #include #include @@ -99,7 +100,7 @@ opt_replace_into= 0, opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1, opt_events= 0, - opt_alltspcs=0, opt_notspcs= 0; + opt_alltspcs=0, opt_notspcs= 0, opt_federated_data= 0; static ulong opt_max_allowed_packet, opt_net_buffer_length; static MYSQL mysql_connection,*mysql=0; static my_bool insert_pat_inited= 0, info_flag; @@ -450,7 +451,9 @@ (uchar**) &where, (uchar**) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} + {"federated-data", 'W', "Include data from FEDERATED tables. (default = no)", (uchar**) &opt_federated_data, + (uchar**) &opt_federated_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; static const char *load_default_groups[]= { "mysqldump","client",0 }; @@ -2441,6 +2444,16 @@ */ if (strcmp (table_type, "VIEW") == 0) DBUG_VOID_RETURN; + + /* + If we haven't been explicitly asked to include federated data, let's ignore it. + */ + if (strcmp (table_type, "FEDERATED") == 0 && !opt_federated_data) + { + verbose_msg("-- Skipping dump data for table '%s', --federated-data not specified\n", + table); + DBUG_VOID_RETURN; + } /* Check --no-data flag */ if (opt_no_data)