Loading BitKeeper/triggers/pre-delta +11 −0 Original line number Diff line number Diff line #!/bin/sh if [ "$BK_USER" = "Administrator" -o "$BK_USER" = "mysqldev" ] then echo "Error: you cannot checkin as 'Administrator' or 'mysqldev' user." echo "as a workaround set BK_USER to your nickname" echo "e.g.: export BK_USER='bar'" echo "" echo "Checkin FAILED!" echo "Set BK_USER and retry." exit 1 fi if [ `tail -c1 $BK_FILE` ] then echo "File $BK_FILE does not end with a new-line character!" 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 +93 −8 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 @@ -130,6 +131,15 @@ 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; HASH ignore_table; static struct my_option my_long_options[] = { Loading Loading @@ -235,6 +245,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 @@ -506,6 +521,28 @@ 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) { 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)) exit(EX_EOM); } static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), Loading Loading @@ -577,6 +614,30 @@ 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: { uint len= (uint)strlen(argument); TABLE_RULE_ENT* e; if (!strchr(argument, '.')) { fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n"); exit(1); } /* len is always > 0 because we know the there exists a '.' */ e= (TABLE_RULE_ENT*)my_malloc(sizeof(TABLE_RULE_ENT) + len, MYF(MY_WME)); if (!e) exit(EX_EOM); e->key= (char*)e + sizeof(TABLE_RULE_ENT); e->key_len= len; memcpy(e->key, argument, len); if (!hash_inited(&ignore_table)) init_table_rule_hash(&ignore_table); if(my_hash_insert(&ignore_table, (byte*)e)) exit(EX_EOM); break; } case (int) OPT_COMPATIBLE: { char buff[255]; Loading Loading @@ -617,6 +678,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } if (end!=compatible_mode_normal_str) end[-1]= 0; /* Set charset to the default compiled value if it hasn't been reset yet by --default-character-set=xxx. */ if (default_charset == (char*) MYSQL_UNIVERSAL_CLIENT_CHARSET) default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; break; } case (int) OPT_MYSQL_PROTOCOL: Loading Loading @@ -1991,6 +2058,14 @@ static int init_dumping(char *database) } /* init_dumping */ my_bool include_table(byte* hash_key, uint len) { if (hash_search(&ignore_table, (byte*) hash_key, len)) return FALSE; return TRUE; } static int dump_all_tables_in_db(char *database) { Loading @@ -1998,6 +2073,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 @@ -2023,6 +2104,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 @@ -2030,6 +2114,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 configure.in +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ NDB_VERSION_STATUS="alpha" # Remember that regexps needs to quote [ and ] since this is run through m4 MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"` MYSQL_BASE_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|\.[[^.]]*$||"` MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'` MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/[[^0-9.]]//g; s/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'` # The port should be constant for a LONG time MYSQL_TCP_PORT_DEFAULT=3306 Loading include/violite.h +12 −10 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, HANDLE event_server_wrote, HANDLE event_server_read, HANDLE event_client_wrote, HANDLE event_client_read); HANDLE event_client_read, HANDLE event_conn_closed); int vio_read_pipe(Vio *vio, gptr buf, int size); int vio_write_pipe(Vio *vio, const gptr buf, int size); int vio_close_pipe(Vio * vio); Loading Loading @@ -197,6 +198,7 @@ struct st_vio HANDLE event_server_read; HANDLE event_client_wrote; HANDLE event_client_read; HANDLE event_conn_closed; long shared_memory_remain; char *shared_memory_pos; NET *net; Loading Loading
BitKeeper/triggers/pre-delta +11 −0 Original line number Diff line number Diff line #!/bin/sh if [ "$BK_USER" = "Administrator" -o "$BK_USER" = "mysqldev" ] then echo "Error: you cannot checkin as 'Administrator' or 'mysqldev' user." echo "as a workaround set BK_USER to your nickname" echo "e.g.: export BK_USER='bar'" echo "" echo "Checkin FAILED!" echo "Set BK_USER and retry." exit 1 fi if [ `tail -c1 $BK_FILE` ] then echo "File $BK_FILE does not end with a new-line character!" 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 +93 −8 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 @@ -130,6 +131,15 @@ 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; HASH ignore_table; static struct my_option my_long_options[] = { Loading Loading @@ -235,6 +245,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 @@ -506,6 +521,28 @@ 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) { 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)) exit(EX_EOM); } static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), Loading Loading @@ -577,6 +614,30 @@ 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: { uint len= (uint)strlen(argument); TABLE_RULE_ENT* e; if (!strchr(argument, '.')) { fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n"); exit(1); } /* len is always > 0 because we know the there exists a '.' */ e= (TABLE_RULE_ENT*)my_malloc(sizeof(TABLE_RULE_ENT) + len, MYF(MY_WME)); if (!e) exit(EX_EOM); e->key= (char*)e + sizeof(TABLE_RULE_ENT); e->key_len= len; memcpy(e->key, argument, len); if (!hash_inited(&ignore_table)) init_table_rule_hash(&ignore_table); if(my_hash_insert(&ignore_table, (byte*)e)) exit(EX_EOM); break; } case (int) OPT_COMPATIBLE: { char buff[255]; Loading Loading @@ -617,6 +678,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } if (end!=compatible_mode_normal_str) end[-1]= 0; /* Set charset to the default compiled value if it hasn't been reset yet by --default-character-set=xxx. */ if (default_charset == (char*) MYSQL_UNIVERSAL_CLIENT_CHARSET) default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; break; } case (int) OPT_MYSQL_PROTOCOL: Loading Loading @@ -1991,6 +2058,14 @@ static int init_dumping(char *database) } /* init_dumping */ my_bool include_table(byte* hash_key, uint len) { if (hash_search(&ignore_table, (byte*) hash_key, len)) return FALSE; return TRUE; } static int dump_all_tables_in_db(char *database) { Loading @@ -1998,6 +2073,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 @@ -2023,6 +2104,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 @@ -2030,6 +2114,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
configure.in +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ NDB_VERSION_STATUS="alpha" # Remember that regexps needs to quote [ and ] since this is run through m4 MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"` MYSQL_BASE_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|\.[[^.]]*$||"` MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'` MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/[[^0-9.]]//g; s/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'` # The port should be constant for a LONG time MYSQL_TCP_PORT_DEFAULT=3306 Loading
include/violite.h +12 −10 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, HANDLE event_server_wrote, HANDLE event_server_read, HANDLE event_client_wrote, HANDLE event_client_read); HANDLE event_client_read, HANDLE event_conn_closed); int vio_read_pipe(Vio *vio, gptr buf, int size); int vio_write_pipe(Vio *vio, const gptr buf, int size); int vio_close_pipe(Vio * vio); Loading Loading @@ -197,6 +198,7 @@ struct st_vio HANDLE event_server_read; HANDLE event_client_wrote; HANDLE event_client_read; HANDLE event_conn_closed; long shared_memory_remain; char *shared_memory_pos; NET *net; Loading