Loading client/client_priv.h +1 −0 Original line number Diff line number Diff line Loading @@ -49,4 +49,5 @@ enum options_client #ifdef HAVE_NDBCLUSTER_DB ,OPT_NDBCLUSTER,OPT_NDB_CONNECTSTRING #endif ,OPT_IGNORE_TABLE }; client/mysqldump.c +99 −7 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ #include <my_sys.h> #include <m_string.h> #include <m_ctype.h> #include <hash.h> #include "client_priv.h" #include "mysql.h" Loading Loading @@ -128,6 +129,16 @@ const char *compatible_mode_names[]= TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1, "", compatible_mode_names, NULL}; #define TABLE_RULE_HASH_SIZE 16 typedef struct st_table_rule_ent { char* key; /* dbname.tablename */ uint key_len; } TABLE_RULE_ENT; my_bool ignore_table_inited; HASH ignore_table; static struct my_option my_long_options[] = { Loading Loading @@ -233,6 +244,11 @@ static struct my_option my_long_options[] = (gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) ¤t_host, (gptr*) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ignore-table", OPT_IGNORE_TABLE, "Do not dump the specified table. To specify more than one table to ignore, " "use the directive multiple times, once for each table. Each table must " "be specified with both database and table names, e.g. --ignore-table=database.table", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...", (gptr*) &lines_terminated, (gptr*) &lines_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, Loading Loading @@ -502,6 +518,32 @@ static void write_footer(FILE *sql_file) } /* write_footer */ static void free_table_ent(TABLE_RULE_ENT* e) { my_free((gptr) e, MYF(0)); } static byte* get_table_key(TABLE_RULE_ENT* e, uint* len, my_bool not_used __attribute__((unused))) { *len= e->key_len; return (byte*)e->key; } void init_table_rule_hash(HASH* h, bool* h_inited) { if(hash_init(h, charset_info, TABLE_RULE_HASH_SIZE, 0, 0, (hash_get_key) get_table_key, (hash_free_key) free_table_ent, 0)) { fprintf(stderr, "Internal hash initialization error\n"); exit(1); } *h_inited= 1; } static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), Loading Loading @@ -573,6 +615,37 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case (int) OPT_TABLES: opt_databases=0; break; case (int) OPT_IGNORE_TABLE: { const char* dot = strchr(argument, '.'); if (!dot) { fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n"); exit(1); } // len is always > 0 because we know the there exists a '.' uint len= (uint)strlen(argument); TABLE_RULE_ENT* e= (TABLE_RULE_ENT*)my_malloc(sizeof(TABLE_RULE_ENT) + len, MYF(MY_WME)); if (!e) { fprintf(stderr, "Internal memory allocation error\n"); exit(1); } e->key= (char*)e + sizeof(TABLE_RULE_ENT); e->key_len= len; memcpy(e->key, argument, len); if (!ignore_table_inited) init_table_rule_hash(&ignore_table, &ignore_table_inited); if(my_hash_insert(&ignore_table, (byte*)e)) { fprintf(stderr, "Internal hash insert error\n"); exit(1); } break; } case (int) OPT_COMPATIBLE: { char buff[255]; Loading Loading @@ -1946,6 +2019,15 @@ static int init_dumping(char *database) } /* init_dumping */ my_bool include_table(byte* hash_key, uint len) { if (ignore_table_inited && hash_search(&ignore_table, (byte*) hash_key, len)) return FALSE; return TRUE; } static int dump_all_tables_in_db(char *database) { Loading @@ -1953,6 +2035,12 @@ static int dump_all_tables_in_db(char *database) uint numrows; char table_buff[NAME_LEN*2+3]; char hash_key[2*NAME_LEN+2]; /* "db.tablename" */ char *afterdot; afterdot= strmov(hash_key, database); *afterdot++= '.'; if (init_dumping(database)) return 1; if (opt_xml) Loading @@ -1978,6 +2066,9 @@ static int dump_all_tables_in_db(char *database) /* We shall continue here, if --force was given */ } while ((table= getTableName(0))) { char *end= strmov(afterdot, table); if (include_table(hash_key, end - hash_key)) { numrows = getTableStructure(table, database); if (!dFlag && numrows > 0) Loading @@ -1985,6 +2076,7 @@ static int dump_all_tables_in_db(char *database) my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); order_by= 0; } } if (opt_xml) { fputs("</database>\n", md_result_file); Loading innobase/row/row0mysql.c +69 −36 Original line number Diff line number Diff line Loading @@ -1843,17 +1843,10 @@ row_drop_table_for_mysql_in_background( ut_print_name(stderr, name); fputs(" in background drop list\n", stderr); */ /* Drop the table in InnoDB */ /* Try to drop the table in InnoDB */ error = row_drop_table_for_mysql(name, trx, FALSE); if (error != DB_SUCCESS) { ut_print_timestamp(stderr); fputs(" InnoDB: Error: Dropping table ", stderr); ut_print_name(stderr, trx, name); fputs(" in background drop list failed\n", stderr); } /* Flush the log to reduce probability that the .frm files and the InnoDB data dictionary get out-of-sync if the user runs with innodb_flush_log_at_trx_commit = 0 */ Loading @@ -1864,7 +1857,7 @@ row_drop_table_for_mysql_in_background( trx_free_for_background(trx); return(DB_SUCCESS); return(error); } /************************************************************************* Loading Loading @@ -1898,6 +1891,7 @@ row_drop_tables_for_mysql_in_background(void) mutex_exit(&kernel_mutex); if (drop == NULL) { /* All tables dropped */ return(n_tables + n_tables_dropped); } Loading Loading @@ -1965,21 +1959,21 @@ row_get_background_drop_list_len_low(void) } /************************************************************************* Adds a table to the list of tables which the master thread drops in background. We need this on Unix because in ALTER TABLE MySQL may call drop table even if the table has running queries on it. */ If a table is not yet in the drop list, adds the table to the list of tables which the master thread drops in background. We need this on Unix because in ALTER TABLE MySQL may call drop table even if the table has running queries on it. Also, if there are running foreign key checks on the table, we drop the table lazily. */ static void ibool row_add_table_to_background_drop_list( /*==================================*/ /* out: TRUE if the table was not yet in the drop list, and was added there */ dict_table_t* table) /* in: table */ { row_mysql_drop_t* drop; drop = mem_alloc(sizeof(row_mysql_drop_t)); drop->table_name = mem_strdup(table->name); mutex_enter(&kernel_mutex); if (!row_mysql_drop_list_inited) { Loading @@ -1988,6 +1982,25 @@ row_add_table_to_background_drop_list( row_mysql_drop_list_inited = TRUE; } /* Look if the table already is in the drop list */ drop = UT_LIST_GET_FIRST(row_mysql_drop_list); while (drop != NULL) { if (strcmp(drop->table_name, table->name) == 0) { /* Already in the list */ mutex_exit(&kernel_mutex); return(FALSE); } drop = UT_LIST_GET_NEXT(row_mysql_drop_list, drop); } drop = mem_alloc(sizeof(row_mysql_drop_t)); drop->table_name = mem_strdup(table->name); UT_LIST_ADD_LAST(row_mysql_drop_list, row_mysql_drop_list, drop); /* fputs("InnoDB: Adding table ", stderr); Loading @@ -1995,6 +2008,8 @@ row_add_table_to_background_drop_list( fputs(" to background drop list\n", stderr); */ mutex_exit(&kernel_mutex); return(TRUE); } /************************************************************************* Loading Loading @@ -2581,19 +2596,27 @@ row_drop_table_for_mysql( } if (table->n_mysql_handles_opened > 0) { ibool added; added = row_add_table_to_background_drop_list(table); if (added) { ut_print_timestamp(stderr); fputs(" InnoDB: Warning: MySQL is trying to drop table ", stderr); fputs(" InnoDB: Warning: MySQL is trying to drop table ", stderr); ut_print_name(stderr, trx, table->name); fputs("\n" "InnoDB: though there are still open handles to it.\n" "InnoDB: Adding the table to the background drop queue.\n", stderr); row_add_table_to_background_drop_list(table); /* We return DB_SUCCESS to MySQL though the drop will happen lazily later */ err = DB_SUCCESS; } else { /* The table is already in the background drop list */ err = DB_ERROR; } goto funct_exit; } Loading @@ -2606,6 +2629,11 @@ row_drop_table_for_mysql( if (table->n_foreign_key_checks_running > 0) { ibool added; added = row_add_table_to_background_drop_list(table); if (added) { ut_print_timestamp(stderr); fputs(" InnoDB: You are trying to drop table ", stderr); ut_print_name(stderr, trx, table->name); Loading @@ -2614,9 +2642,14 @@ row_drop_table_for_mysql( "InnoDB: Adding the table to the background drop queue.\n", stderr); row_add_table_to_background_drop_list(table); /* We return DB_SUCCESS to MySQL though the drop will happen lazily later */ err = DB_SUCCESS; } else { /* The table is already in the background drop list */ err = DB_ERROR; } goto funct_exit; } Loading mysql-test/r/mysqldump.result +33 −0 Original line number Diff line number Diff line Loading @@ -480,3 +480,36 @@ UNLOCK TABLES; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; DROP TABLE t1; CREATE TABLE t1 (a int); CREATE TABLE t2 (a int); INSERT INTO t1 VALUES (1),(2),(3); INSERT INTO t2 VALUES (4),(5),(6); /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; DROP TABLE IF EXISTS `t2`; CREATE TABLE `t2` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; LOCK TABLES `t2` WRITE; INSERT INTO `t2` VALUES (4),(5),(6); UNLOCK TABLES; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; DROP TABLE t1; DROP TABLE t2; mysql-test/t/mysqldump.test +12 −0 Original line number Diff line number Diff line Loading @@ -153,3 +153,15 @@ INSERT INTO t1 VALUES (_latin1 ' --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1 DROP TABLE t1; # # WL #2319: Exclude Tables from dump # CREATE TABLE t1 (a int); CREATE TABLE t2 (a int); INSERT INTO t1 VALUES (1),(2),(3); INSERT INTO t2 VALUES (4),(5),(6); --exec $MYSQL_DUMP --skip-comments --ignore-table=test.t1 test DROP TABLE t1; DROP TABLE t2; Loading
client/client_priv.h +1 −0 Original line number Diff line number Diff line Loading @@ -49,4 +49,5 @@ enum options_client #ifdef HAVE_NDBCLUSTER_DB ,OPT_NDBCLUSTER,OPT_NDB_CONNECTSTRING #endif ,OPT_IGNORE_TABLE };
client/mysqldump.c +99 −7 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ #include <my_sys.h> #include <m_string.h> #include <m_ctype.h> #include <hash.h> #include "client_priv.h" #include "mysql.h" Loading Loading @@ -128,6 +129,16 @@ const char *compatible_mode_names[]= TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1, "", compatible_mode_names, NULL}; #define TABLE_RULE_HASH_SIZE 16 typedef struct st_table_rule_ent { char* key; /* dbname.tablename */ uint key_len; } TABLE_RULE_ENT; my_bool ignore_table_inited; HASH ignore_table; static struct my_option my_long_options[] = { Loading Loading @@ -233,6 +244,11 @@ static struct my_option my_long_options[] = (gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) ¤t_host, (gptr*) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ignore-table", OPT_IGNORE_TABLE, "Do not dump the specified table. To specify more than one table to ignore, " "use the directive multiple times, once for each table. Each table must " "be specified with both database and table names, e.g. --ignore-table=database.table", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...", (gptr*) &lines_terminated, (gptr*) &lines_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, Loading Loading @@ -502,6 +518,32 @@ static void write_footer(FILE *sql_file) } /* write_footer */ static void free_table_ent(TABLE_RULE_ENT* e) { my_free((gptr) e, MYF(0)); } static byte* get_table_key(TABLE_RULE_ENT* e, uint* len, my_bool not_used __attribute__((unused))) { *len= e->key_len; return (byte*)e->key; } void init_table_rule_hash(HASH* h, bool* h_inited) { if(hash_init(h, charset_info, TABLE_RULE_HASH_SIZE, 0, 0, (hash_get_key) get_table_key, (hash_free_key) free_table_ent, 0)) { fprintf(stderr, "Internal hash initialization error\n"); exit(1); } *h_inited= 1; } static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), Loading Loading @@ -573,6 +615,37 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case (int) OPT_TABLES: opt_databases=0; break; case (int) OPT_IGNORE_TABLE: { const char* dot = strchr(argument, '.'); if (!dot) { fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n"); exit(1); } // len is always > 0 because we know the there exists a '.' uint len= (uint)strlen(argument); TABLE_RULE_ENT* e= (TABLE_RULE_ENT*)my_malloc(sizeof(TABLE_RULE_ENT) + len, MYF(MY_WME)); if (!e) { fprintf(stderr, "Internal memory allocation error\n"); exit(1); } e->key= (char*)e + sizeof(TABLE_RULE_ENT); e->key_len= len; memcpy(e->key, argument, len); if (!ignore_table_inited) init_table_rule_hash(&ignore_table, &ignore_table_inited); if(my_hash_insert(&ignore_table, (byte*)e)) { fprintf(stderr, "Internal hash insert error\n"); exit(1); } break; } case (int) OPT_COMPATIBLE: { char buff[255]; Loading Loading @@ -1946,6 +2019,15 @@ static int init_dumping(char *database) } /* init_dumping */ my_bool include_table(byte* hash_key, uint len) { if (ignore_table_inited && hash_search(&ignore_table, (byte*) hash_key, len)) return FALSE; return TRUE; } static int dump_all_tables_in_db(char *database) { Loading @@ -1953,6 +2035,12 @@ static int dump_all_tables_in_db(char *database) uint numrows; char table_buff[NAME_LEN*2+3]; char hash_key[2*NAME_LEN+2]; /* "db.tablename" */ char *afterdot; afterdot= strmov(hash_key, database); *afterdot++= '.'; if (init_dumping(database)) return 1; if (opt_xml) Loading @@ -1978,6 +2066,9 @@ static int dump_all_tables_in_db(char *database) /* We shall continue here, if --force was given */ } while ((table= getTableName(0))) { char *end= strmov(afterdot, table); if (include_table(hash_key, end - hash_key)) { numrows = getTableStructure(table, database); if (!dFlag && numrows > 0) Loading @@ -1985,6 +2076,7 @@ static int dump_all_tables_in_db(char *database) my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); order_by= 0; } } if (opt_xml) { fputs("</database>\n", md_result_file); Loading
innobase/row/row0mysql.c +69 −36 Original line number Diff line number Diff line Loading @@ -1843,17 +1843,10 @@ row_drop_table_for_mysql_in_background( ut_print_name(stderr, name); fputs(" in background drop list\n", stderr); */ /* Drop the table in InnoDB */ /* Try to drop the table in InnoDB */ error = row_drop_table_for_mysql(name, trx, FALSE); if (error != DB_SUCCESS) { ut_print_timestamp(stderr); fputs(" InnoDB: Error: Dropping table ", stderr); ut_print_name(stderr, trx, name); fputs(" in background drop list failed\n", stderr); } /* Flush the log to reduce probability that the .frm files and the InnoDB data dictionary get out-of-sync if the user runs with innodb_flush_log_at_trx_commit = 0 */ Loading @@ -1864,7 +1857,7 @@ row_drop_table_for_mysql_in_background( trx_free_for_background(trx); return(DB_SUCCESS); return(error); } /************************************************************************* Loading Loading @@ -1898,6 +1891,7 @@ row_drop_tables_for_mysql_in_background(void) mutex_exit(&kernel_mutex); if (drop == NULL) { /* All tables dropped */ return(n_tables + n_tables_dropped); } Loading Loading @@ -1965,21 +1959,21 @@ row_get_background_drop_list_len_low(void) } /************************************************************************* Adds a table to the list of tables which the master thread drops in background. We need this on Unix because in ALTER TABLE MySQL may call drop table even if the table has running queries on it. */ If a table is not yet in the drop list, adds the table to the list of tables which the master thread drops in background. We need this on Unix because in ALTER TABLE MySQL may call drop table even if the table has running queries on it. Also, if there are running foreign key checks on the table, we drop the table lazily. */ static void ibool row_add_table_to_background_drop_list( /*==================================*/ /* out: TRUE if the table was not yet in the drop list, and was added there */ dict_table_t* table) /* in: table */ { row_mysql_drop_t* drop; drop = mem_alloc(sizeof(row_mysql_drop_t)); drop->table_name = mem_strdup(table->name); mutex_enter(&kernel_mutex); if (!row_mysql_drop_list_inited) { Loading @@ -1988,6 +1982,25 @@ row_add_table_to_background_drop_list( row_mysql_drop_list_inited = TRUE; } /* Look if the table already is in the drop list */ drop = UT_LIST_GET_FIRST(row_mysql_drop_list); while (drop != NULL) { if (strcmp(drop->table_name, table->name) == 0) { /* Already in the list */ mutex_exit(&kernel_mutex); return(FALSE); } drop = UT_LIST_GET_NEXT(row_mysql_drop_list, drop); } drop = mem_alloc(sizeof(row_mysql_drop_t)); drop->table_name = mem_strdup(table->name); UT_LIST_ADD_LAST(row_mysql_drop_list, row_mysql_drop_list, drop); /* fputs("InnoDB: Adding table ", stderr); Loading @@ -1995,6 +2008,8 @@ row_add_table_to_background_drop_list( fputs(" to background drop list\n", stderr); */ mutex_exit(&kernel_mutex); return(TRUE); } /************************************************************************* Loading Loading @@ -2581,19 +2596,27 @@ row_drop_table_for_mysql( } if (table->n_mysql_handles_opened > 0) { ibool added; added = row_add_table_to_background_drop_list(table); if (added) { ut_print_timestamp(stderr); fputs(" InnoDB: Warning: MySQL is trying to drop table ", stderr); fputs(" InnoDB: Warning: MySQL is trying to drop table ", stderr); ut_print_name(stderr, trx, table->name); fputs("\n" "InnoDB: though there are still open handles to it.\n" "InnoDB: Adding the table to the background drop queue.\n", stderr); row_add_table_to_background_drop_list(table); /* We return DB_SUCCESS to MySQL though the drop will happen lazily later */ err = DB_SUCCESS; } else { /* The table is already in the background drop list */ err = DB_ERROR; } goto funct_exit; } Loading @@ -2606,6 +2629,11 @@ row_drop_table_for_mysql( if (table->n_foreign_key_checks_running > 0) { ibool added; added = row_add_table_to_background_drop_list(table); if (added) { ut_print_timestamp(stderr); fputs(" InnoDB: You are trying to drop table ", stderr); ut_print_name(stderr, trx, table->name); Loading @@ -2614,9 +2642,14 @@ row_drop_table_for_mysql( "InnoDB: Adding the table to the background drop queue.\n", stderr); row_add_table_to_background_drop_list(table); /* We return DB_SUCCESS to MySQL though the drop will happen lazily later */ err = DB_SUCCESS; } else { /* The table is already in the background drop list */ err = DB_ERROR; } goto funct_exit; } Loading
mysql-test/r/mysqldump.result +33 −0 Original line number Diff line number Diff line Loading @@ -480,3 +480,36 @@ UNLOCK TABLES; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; DROP TABLE t1; CREATE TABLE t1 (a int); CREATE TABLE t2 (a int); INSERT INTO t1 VALUES (1),(2),(3); INSERT INTO t2 VALUES (4),(5),(6); /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; DROP TABLE IF EXISTS `t2`; CREATE TABLE `t2` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; LOCK TABLES `t2` WRITE; INSERT INTO `t2` VALUES (4),(5),(6); UNLOCK TABLES; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; DROP TABLE t1; DROP TABLE t2;
mysql-test/t/mysqldump.test +12 −0 Original line number Diff line number Diff line Loading @@ -153,3 +153,15 @@ INSERT INTO t1 VALUES (_latin1 ' --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1 DROP TABLE t1; # # WL #2319: Exclude Tables from dump # CREATE TABLE t1 (a int); CREATE TABLE t2 (a int); INSERT INTO t1 VALUES (1),(2),(3); INSERT INTO t2 VALUES (4),(5),(6); --exec $MYSQL_DUMP --skip-comments --ignore-table=test.t1 test DROP TABLE t1; DROP TABLE t2;