Loading mysql-test/r/alter_table.result +4 −0 Original line number Diff line number Diff line Loading @@ -523,6 +523,10 @@ alter table t1 drop key no_such_key; ERROR 42000: Can't DROP 'no_such_key'; check that column/key exists alter table t1 drop key a; drop table t1; CREATE TABLE T12207(a int) ENGINE=MYISAM; ALTER TABLE T12207 DISCARD TABLESPACE; ERROR HY000: Table storage engine for 'T12207' doesn't have this option DROP TABLE T12207; create table t1 (a text) character set koi8r; insert into t1 values (_koi8r''); select hex(a) from t1; Loading mysql-test/t/alter_table.test +8 −0 Original line number Diff line number Diff line Loading @@ -337,6 +337,14 @@ alter table t1 drop key no_such_key; alter table t1 drop key a; drop table t1; # # BUG 12207 alter table ... discard table space on MyISAM table causes ERROR 2013 (HY000) # CREATE TABLE T12207(a int) ENGINE=MYISAM; --error 1031 ALTER TABLE T12207 DISCARD TABLESPACE; DROP TABLE T12207; # # Bug #6479 ALTER TABLE ... changing charset fails for TEXT columns # Loading server-tools/instance-manager/Makefile.am +0 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,6 @@ mysqlmanager_SOURCES= command.cc command.h mysqlmanager.cc \ user_map.h user_map.cc \ messages.h messages.cc \ commands.h commands.cc \ factory.h factory.cc \ instance.h instance.cc \ instance_map.h instance_map.cc\ instance_options.h instance_options.cc \ Loading server-tools/instance-manager/commands.cc +21 −31 Original line number Diff line number Diff line Loading @@ -461,7 +461,8 @@ int Show_instance_log::execute(struct st_net *net, ulong connection_id) /* Instance has no such log */ if (logpath == NULL) return ER_NO_SUCH_LOG; else if (*logpath == '\0') if (*logpath == '\0') return ER_GUESS_LOGFILE; Loading Loading @@ -571,6 +572,7 @@ int Show_instance_log_files::execute(struct st_net *net, ulong connection_id) if ((instance= instance_map-> find(instance_name, strlen(instance_name))) == NULL) goto err; { /* We have alike structure in instance_options.cc. We use such to be able Loading Loading @@ -686,7 +688,7 @@ Set_option::Set_option(Instance_map *instance_map_arg, option. RETURN ER_BAD_INSTANCE_NAME The instance name specified is not valid ER_OUT_OF_RESOURCES out of resources ER_ACCESS_OPTION_FILE Cannot access the option file 0 - ok */ Loading @@ -694,22 +696,14 @@ Set_option::Set_option(Instance_map *instance_map_arg, int Set_option::correct_file(int skip) { int error; const static int mysys_to_im_error[]= { 0, ER_OUT_OF_RESOURCES, ER_ACCESS_OPTION_FILE }; error= modify_defaults_file(Options::config_file, option, option_value, instance_name, skip); switch (error) { case 0: return 0; /* everything was fine */ case 1: return ER_OUT_OF_RESOURCES; case 2: return ER_ACCESS_OPTION_FILE; default: DBUG_ASSERT(0); /* should never get here */ } DBUG_ASSERT(error >= 0 && error <= 2); return 0; /* keep compiler happy */ return mysys_to_im_error[error]; } Loading @@ -725,10 +719,9 @@ int Set_option::correct_file(int skip) 1 - error occured */ int Set_option::do_command(struct st_net *net) { int error= 0; int error; /* we must hold the instance_map mutex while changing config file */ instance_map->lock(); Loading @@ -746,15 +739,13 @@ int Set_option::execute(struct st_net *net, ulong connection_id) int val; val= do_command(net); if (val == 0) { net_send_ok(net, connection_id, NULL); return 0; } return val; } else return ER_BAD_INSTANCE_NAME; } Loading Loading @@ -785,17 +776,16 @@ int Stop_instance::execute(struct st_net *net, ulong connection_id) if (instance == 0) return ER_BAD_INSTANCE_NAME; /* haven't found an instance */ else { if (!(instance->options.nonguarded)) instance_map->guardian-> stop_guard(instance); instance_map->guardian->stop_guard(instance); if ((err_code= instance->stop())) return err_code; net_send_ok(net, connection_id, NULL); return 0; } } int Syntax_error::execute(struct st_net *net, ulong connection_id) Loading server-tools/instance-manager/factory.ccdeleted 100644 → 0 +0 −100 Original line number Diff line number Diff line /* Copyright (C) 2004 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "factory.h" Show_instances *Command_factory::new_Show_instances() { return new Show_instances(&instance_map); } Flush_instances *Command_factory::new_Flush_instances() { return new Flush_instances(&instance_map); } Show_instance_status *Command_factory:: new_Show_instance_status(const char *name, uint len) { return new Show_instance_status(&instance_map, name, len); } Show_instance_options *Command_factory:: new_Show_instance_options(const char *name, uint len) { return new Show_instance_options(&instance_map, name, len); } Start_instance *Command_factory:: new_Start_instance(const char *name, uint len) { return new Start_instance(&instance_map, name, len); } Stop_instance *Command_factory::new_Stop_instance(const char *name, uint len) { return new Stop_instance(&instance_map, name, len); } Syntax_error *Command_factory::new_Syntax_error() { return new Syntax_error(); } Set_option *Command_factory:: new_Set_option(const char* name, uint len, const char *option_arg, uint option_len, const char *option_value_arg, uint option_value_len) { return new Set_option(&instance_map, name, len, option_arg, option_len, option_value_arg, option_value_len); } Unset_option *Command_factory:: new_Unset_option(const char* name, uint len, const char *option_arg, uint option_len, const char *option_value_arg, uint option_value_len) { return new Unset_option(&instance_map, name, len, option_arg, option_len, option_value_arg, option_value_len); } Show_instance_log *Command_factory:: new_Show_instance_log(const char *name, uint len, Log_type log_type_arg, const char *size, const char *offset) { return new Show_instance_log(&instance_map, name, len, log_type_arg, size, offset); } Show_instance_log_files *Command_factory:: new_Show_instance_log_files(const char *name, uint len) { return new Show_instance_log_files(&instance_map, name, len); } Loading
mysql-test/r/alter_table.result +4 −0 Original line number Diff line number Diff line Loading @@ -523,6 +523,10 @@ alter table t1 drop key no_such_key; ERROR 42000: Can't DROP 'no_such_key'; check that column/key exists alter table t1 drop key a; drop table t1; CREATE TABLE T12207(a int) ENGINE=MYISAM; ALTER TABLE T12207 DISCARD TABLESPACE; ERROR HY000: Table storage engine for 'T12207' doesn't have this option DROP TABLE T12207; create table t1 (a text) character set koi8r; insert into t1 values (_koi8r''); select hex(a) from t1; Loading
mysql-test/t/alter_table.test +8 −0 Original line number Diff line number Diff line Loading @@ -337,6 +337,14 @@ alter table t1 drop key no_such_key; alter table t1 drop key a; drop table t1; # # BUG 12207 alter table ... discard table space on MyISAM table causes ERROR 2013 (HY000) # CREATE TABLE T12207(a int) ENGINE=MYISAM; --error 1031 ALTER TABLE T12207 DISCARD TABLESPACE; DROP TABLE T12207; # # Bug #6479 ALTER TABLE ... changing charset fails for TEXT columns # Loading
server-tools/instance-manager/Makefile.am +0 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,6 @@ mysqlmanager_SOURCES= command.cc command.h mysqlmanager.cc \ user_map.h user_map.cc \ messages.h messages.cc \ commands.h commands.cc \ factory.h factory.cc \ instance.h instance.cc \ instance_map.h instance_map.cc\ instance_options.h instance_options.cc \ Loading
server-tools/instance-manager/commands.cc +21 −31 Original line number Diff line number Diff line Loading @@ -461,7 +461,8 @@ int Show_instance_log::execute(struct st_net *net, ulong connection_id) /* Instance has no such log */ if (logpath == NULL) return ER_NO_SUCH_LOG; else if (*logpath == '\0') if (*logpath == '\0') return ER_GUESS_LOGFILE; Loading Loading @@ -571,6 +572,7 @@ int Show_instance_log_files::execute(struct st_net *net, ulong connection_id) if ((instance= instance_map-> find(instance_name, strlen(instance_name))) == NULL) goto err; { /* We have alike structure in instance_options.cc. We use such to be able Loading Loading @@ -686,7 +688,7 @@ Set_option::Set_option(Instance_map *instance_map_arg, option. RETURN ER_BAD_INSTANCE_NAME The instance name specified is not valid ER_OUT_OF_RESOURCES out of resources ER_ACCESS_OPTION_FILE Cannot access the option file 0 - ok */ Loading @@ -694,22 +696,14 @@ Set_option::Set_option(Instance_map *instance_map_arg, int Set_option::correct_file(int skip) { int error; const static int mysys_to_im_error[]= { 0, ER_OUT_OF_RESOURCES, ER_ACCESS_OPTION_FILE }; error= modify_defaults_file(Options::config_file, option, option_value, instance_name, skip); switch (error) { case 0: return 0; /* everything was fine */ case 1: return ER_OUT_OF_RESOURCES; case 2: return ER_ACCESS_OPTION_FILE; default: DBUG_ASSERT(0); /* should never get here */ } DBUG_ASSERT(error >= 0 && error <= 2); return 0; /* keep compiler happy */ return mysys_to_im_error[error]; } Loading @@ -725,10 +719,9 @@ int Set_option::correct_file(int skip) 1 - error occured */ int Set_option::do_command(struct st_net *net) { int error= 0; int error; /* we must hold the instance_map mutex while changing config file */ instance_map->lock(); Loading @@ -746,15 +739,13 @@ int Set_option::execute(struct st_net *net, ulong connection_id) int val; val= do_command(net); if (val == 0) { net_send_ok(net, connection_id, NULL); return 0; } return val; } else return ER_BAD_INSTANCE_NAME; } Loading Loading @@ -785,17 +776,16 @@ int Stop_instance::execute(struct st_net *net, ulong connection_id) if (instance == 0) return ER_BAD_INSTANCE_NAME; /* haven't found an instance */ else { if (!(instance->options.nonguarded)) instance_map->guardian-> stop_guard(instance); instance_map->guardian->stop_guard(instance); if ((err_code= instance->stop())) return err_code; net_send_ok(net, connection_id, NULL); return 0; } } int Syntax_error::execute(struct st_net *net, ulong connection_id) Loading
server-tools/instance-manager/factory.ccdeleted 100644 → 0 +0 −100 Original line number Diff line number Diff line /* Copyright (C) 2004 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "factory.h" Show_instances *Command_factory::new_Show_instances() { return new Show_instances(&instance_map); } Flush_instances *Command_factory::new_Flush_instances() { return new Flush_instances(&instance_map); } Show_instance_status *Command_factory:: new_Show_instance_status(const char *name, uint len) { return new Show_instance_status(&instance_map, name, len); } Show_instance_options *Command_factory:: new_Show_instance_options(const char *name, uint len) { return new Show_instance_options(&instance_map, name, len); } Start_instance *Command_factory:: new_Start_instance(const char *name, uint len) { return new Start_instance(&instance_map, name, len); } Stop_instance *Command_factory::new_Stop_instance(const char *name, uint len) { return new Stop_instance(&instance_map, name, len); } Syntax_error *Command_factory::new_Syntax_error() { return new Syntax_error(); } Set_option *Command_factory:: new_Set_option(const char* name, uint len, const char *option_arg, uint option_len, const char *option_value_arg, uint option_value_len) { return new Set_option(&instance_map, name, len, option_arg, option_len, option_value_arg, option_value_len); } Unset_option *Command_factory:: new_Unset_option(const char* name, uint len, const char *option_arg, uint option_len, const char *option_value_arg, uint option_value_len) { return new Unset_option(&instance_map, name, len, option_arg, option_len, option_value_arg, option_value_len); } Show_instance_log *Command_factory:: new_Show_instance_log(const char *name, uint len, Log_type log_type_arg, const char *size, const char *offset) { return new Show_instance_log(&instance_map, name, len, log_type_arg, size, offset); } Show_instance_log_files *Command_factory:: new_Show_instance_log_files(const char *name, uint len) { return new Show_instance_log_files(&instance_map, name, len); }