wl#2936 post-merge fixes

This commit is contained in:
serg@janus.mylan 2007-04-16 18:16:17 +02:00
parent 6bc9bc92df
commit 00479a441d
16 changed files with 79 additions and 89 deletions

View File

@ -1525,7 +1525,7 @@ void do_source(struct st_command *command)
{
static DYNAMIC_STRING ds_filename;
const struct command_arg source_args[] = {
"filename", ARG_STRING, TRUE, &ds_filename, "File to source"
{ "filename", ARG_STRING, TRUE, &ds_filename, "File to source" }
};
DBUG_ENTER("do_source");
@ -1911,7 +1911,7 @@ void do_remove_file(struct st_command *command)
int error;
static DYNAMIC_STRING ds_filename;
const struct command_arg rm_args[] = {
"filename", ARG_STRING, TRUE, &ds_filename, "File to delete"
{ "filename", ARG_STRING, TRUE, &ds_filename, "File to delete" }
};
DBUG_ENTER("do_remove_file");
@ -1945,8 +1945,8 @@ void do_copy_file(struct st_command *command)
static DYNAMIC_STRING ds_from_file;
static DYNAMIC_STRING ds_to_file;
const struct command_arg copy_file_args[] = {
"from_file", ARG_STRING, TRUE, &ds_from_file, "Filename to copy from",
"to_file", ARG_STRING, TRUE, &ds_to_file, "Filename to copy to"
{ "from_file", ARG_STRING, TRUE, &ds_from_file, "Filename to copy from" },
{ "to_file", ARG_STRING, TRUE, &ds_to_file, "Filename to copy to" }
};
DBUG_ENTER("do_copy_file");
@ -1982,8 +1982,8 @@ void do_chmod_file(struct st_command *command)
static DYNAMIC_STRING ds_mode;
static DYNAMIC_STRING ds_file;
const struct command_arg chmod_file_args[] = {
"mode", ARG_STRING, TRUE, &ds_mode, "Mode of file",
"file", ARG_STRING, TRUE, &ds_file, "Filename of file to modify"
{ "mode", ARG_STRING, TRUE, &ds_mode, "Mode of file" },
{ "file", ARG_STRING, TRUE, &ds_file, "Filename of file to modify" }
};
DBUG_ENTER("do_chmod_file");
@ -2020,7 +2020,7 @@ void do_file_exist(struct st_command *command)
int error;
static DYNAMIC_STRING ds_filename;
const struct command_arg file_exist_args[] = {
"filename", ARG_STRING, TRUE, &ds_filename, "File to check if it exist"
{ "filename", ARG_STRING, TRUE, &ds_filename, "File to check if it exist" }
};
DBUG_ENTER("do_file_exist");
@ -2102,8 +2102,8 @@ void do_write_file_command(struct st_command *command, my_bool append)
static DYNAMIC_STRING ds_filename;
static DYNAMIC_STRING ds_delimiter;
const struct command_arg write_file_args[] = {
"filename", ARG_STRING, TRUE, &ds_filename, "File to write to",
"delimiter", ARG_STRING, FALSE, &ds_delimiter, "Delimiter to read until"
{ "filename", ARG_STRING, TRUE, &ds_filename, "File to write to" },
{ "delimiter", ARG_STRING, FALSE, &ds_delimiter, "Delimiter to read until" }
};
DBUG_ENTER("do_write_file");
@ -2211,7 +2211,7 @@ void do_cat_file(struct st_command *command)
char buff[512];
static DYNAMIC_STRING ds_filename;
const struct command_arg cat_file_args[] = {
"filename", ARG_STRING, TRUE, &ds_filename, "File to read from"
{ "filename", ARG_STRING, TRUE, &ds_filename, "File to read from" }
};
DBUG_ENTER("do_cat_file");
@ -2275,8 +2275,8 @@ void do_diff_files(struct st_command *command)
static DYNAMIC_STRING ds_filename;
static DYNAMIC_STRING ds_filename2;
const struct command_arg diff_file_args[] = {
"file1", ARG_STRING, TRUE, &ds_filename, "First file to diff",
"file2", ARG_STRING, TRUE, &ds_filename2, "Second file to diff"
{ "file1", ARG_STRING, TRUE, &ds_filename, "First file to diff" },
{ "file2", ARG_STRING, TRUE, &ds_filename2, "Second file to diff" }
};
DBUG_ENTER("do_diff_files");
@ -2352,7 +2352,7 @@ void do_perl(struct st_command *command)
static DYNAMIC_STRING ds_script;
static DYNAMIC_STRING ds_delimiter;
const struct command_arg perl_args[] = {
"delimiter", ARG_STRING, FALSE, &ds_delimiter, "Delimiter to read until"
{ "delimiter", ARG_STRING, FALSE, &ds_delimiter, "Delimiter to read until" }
};
DBUG_ENTER("do_perl");
@ -3427,18 +3427,14 @@ void do_connect(struct st_command *command)
static DYNAMIC_STRING ds_sock;
static DYNAMIC_STRING ds_options;
const struct command_arg connect_args[] = {
"connection name", ARG_STRING, TRUE, &ds_connection_name,
"Name of the connection",
"host", ARG_STRING, TRUE, &ds_host, "Host to connect to",
"user", ARG_STRING, FALSE, &ds_user, "User to connect as",
"passsword", ARG_STRING, FALSE, &ds_password,
"Password used when connecting",
"database", ARG_STRING, FALSE, &ds_database,
"Dtabase to select after connect",
"port", ARG_STRING, FALSE, &ds_port, "Port to connect to",
"socket", ARG_STRING, FALSE, &ds_sock, "Socket to connect with",
"options", ARG_STRING, FALSE, &ds_options,
"Options to use while connecting"
{ "connection name", ARG_STRING, TRUE, &ds_connection_name, "Name of the connection" },
{ "host", ARG_STRING, TRUE, &ds_host, "Host to connect to" },
{ "user", ARG_STRING, FALSE, &ds_user, "User to connect as" },
{ "passsword", ARG_STRING, FALSE, &ds_password, "Password used when connecting" },
{ "database", ARG_STRING, FALSE, &ds_database, "Database to select after connect" },
{ "port", ARG_STRING, FALSE, &ds_port, "Port to connect to" },
{ "socket", ARG_STRING, FALSE, &ds_sock, "Socket to connect with" },
{ "options", ARG_STRING, FALSE, &ds_options, "Options to use while connecting" }
};
DBUG_ENTER("do_connect");

View File

@ -241,7 +241,7 @@ static int create_header_files(struct errors *error_head)
/* generating sql_state.h file */
if (tmp_error->sql_code1[0] || tmp_error->sql_code2[0])
fprintf(sql_statef,
"%-40s,\"%s\", \"%s\",\n", tmp_error->er_name,
"{ %-40s,\"%s\", \"%s\" },\n", tmp_error->er_name,
tmp_error->sql_code1, tmp_error->sql_code2);
/*generating er_name file */
fprintf(er_namef, "{ \"%s\", %d },\n", tmp_error->er_name,

View File

@ -55,6 +55,7 @@ engine = x
partition by key (a);
Warnings:
Warning 1286 Unknown table engine 'x'
Warning 1266 Using storage engine MyISAM for table 't1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (

View File

@ -73,8 +73,8 @@ Event_queue::Event_queue()
:mutex_last_locked_at_line(0), mutex_last_unlocked_at_line(0),
mutex_last_attempted_lock_at_line(0),
mutex_queue_data_locked(FALSE),
mutex_queue_data_attempting_lock(FALSE),
next_activation_at(0)
next_activation_at(0),
mutex_queue_data_attempting_lock(FALSE)
{
mutex_last_unlocked_in_func= mutex_last_locked_in_func=
mutex_last_attempted_lock_in_func= "";

View File

@ -2340,7 +2340,8 @@ err_handler:
handler *ha_partition::clone(MEM_ROOT *mem_root)
{
handler *new_handler= get_new_handler(table->s, mem_root, table->s->db_type);
handler *new_handler= get_new_handler(table->s, mem_root,
table->s->db_type());
((ha_partition*)new_handler)->m_part_info= m_part_info;
((ha_partition*)new_handler)->is_clone= TRUE;
if (new_handler && !new_handler->ha_open(table,

View File

@ -968,11 +968,12 @@ public:
Discrete_interval auto_inc_interval_for_cur_row;
handler(handlerton *ht_arg, TABLE_SHARE *share_arg)
:table_share(share_arg), estimation_rows_to_insert(0), ht(ht_arg),
:table_share(share_arg), table(0),
estimation_rows_to_insert(0), ht(ht_arg),
ref(0), key_used_on_scan(MAX_KEY), active_index(MAX_KEY),
ref_length(sizeof(my_off_t)),
ft_handler(0), inited(NONE), implicit_emptied(0),
pushed_cond(NULL), next_insert_id(0), insert_id_for_cur_row(0)
pushed_cond(0), next_insert_id(0), insert_id_for_cur_row(0)
{}
virtual ~handler(void)
{

View File

@ -1552,8 +1552,8 @@ QUICK_ROR_UNION_SELECT::~QUICK_ROR_UNION_SELECT()
QUICK_RANGE::QUICK_RANGE()
:min_key(0),max_key(0),min_length(0),max_length(0),
min_keypart_map(0), max_keypart_map(0),
flag(NO_MIN_RANGE | NO_MAX_RANGE)
flag(NO_MIN_RANGE | NO_MAX_RANGE),
min_keypart_map(0), max_keypart_map(0)
{}
SEL_ARG::SEL_ARG(SEL_ARG &arg) :Sql_alloc()
@ -10008,11 +10008,12 @@ QUICK_GROUP_MIN_MAX_SELECT(TABLE *table, JOIN *join_arg, bool have_min_arg,
ha_rows records_arg, uint key_infix_len_arg,
byte *key_infix_arg, MEM_ROOT *parent_alloc)
:join(join_arg), index_info(index_info_arg),
group_prefix_len(group_prefix_len_arg), have_min(have_min_arg),
group_prefix_len(group_prefix_len_arg),
group_key_parts(group_key_parts_arg), have_min(have_min_arg),
have_max(have_max_arg), seen_first_key(FALSE),
min_max_arg_part(min_max_arg_part_arg), key_infix(key_infix_arg),
key_infix_len(key_infix_len_arg), min_functions_it(NULL),
max_functions_it(NULL), group_key_parts(group_key_parts_arg)
max_functions_it(NULL)
{
head= table;
file= head->file;

View File

@ -52,9 +52,9 @@ class QUICK_RANGE :public Sql_alloc {
max_key((char*) sql_memdup(max_key_arg,max_length_arg+1)),
min_length((uint16) min_length_arg),
max_length((uint16) max_length_arg),
flag((uint16) flag_arg),
min_keypart_map(min_keypart_map_arg),
max_keypart_map(max_keypart_map_arg),
flag((uint16) flag_arg)
max_keypart_map(max_keypart_map_arg)
{
#ifdef HAVE_purify
dummy=0;

View File

@ -29,8 +29,8 @@ int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
MASTER_INFO::MASTER_INFO()
:ssl(0), fd(-1), io_thd(0), inited(0),
abort_slave(0),slave_running(0), slave_run_id(0),
ssl_verify_server_cert(0)
abort_slave(0),slave_running(0),
ssl_verify_server_cert(0), slave_run_id(0)
{
host[0] = 0; user[0] = 0; password[0] = 0;
ssl_ca[0]= 0; ssl_capath[0]= 0; ssl_cert[0]= 0;

View File

@ -317,10 +317,10 @@ static sys_var_long_ptr sys_myisam_data_pointer_size(&vars, "myisam_data_pointer
static sys_var_thd_ulonglong sys_myisam_max_sort_file_size(&vars, "myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1);
static sys_var_thd_ulong sys_myisam_repair_threads(&vars, "myisam_repair_threads", &SV::myisam_repair_threads);
static sys_var_thd_ulong sys_myisam_sort_buffer_size(&vars, "myisam_sort_buffer_size", &SV::myisam_sort_buff_size);
static sys_var_bool_ptr sys_myisam_use_mmap(&vars, "myisam_use_mmap",
static sys_var_bool_ptr sys_myisam_use_mmap(&vars, "myisam_use_mmap",
&opt_myisam_use_mmap);
static sys_var_thd_enum sys_myisam_stats_method(&vars, "myisam_stats_method",
static sys_var_thd_enum sys_myisam_stats_method(&vars, "myisam_stats_method",
&SV::myisam_stats_method,
&myisam_stats_method_typelib,
NULL);
@ -337,16 +337,17 @@ static sys_var_thd_ulong sys_net_retry_count(&vars, "net_retry_count",
&SV::net_retry_count,
0, fix_net_retry_count);
static sys_var_thd_bool sys_new_mode(&vars, "new", &SV::new_mode);
static sys_var_bool_ptr_readonly sys_old_mode(&vars, "old",
static sys_var_bool_ptr_readonly sys_old_mode(&vars, "old",
&global_system_variables.old_mode);
static sys_var_thd_bool sys_old_alter_table(&vars, "old_alter_table",
&SV::old_alter_table);
sys_var_thd_bool sys_old_passwords(&vars, "old_passwords", &SV::old_passwords);
static sys_var_thd_ulong sys_optimizer_prune_level(&vars, "optimizer_prune_level",
/* these two cannot be static */
sys_var_thd_bool sys_old_alter_table(&vars, "old_alter_table",
&SV::old_alter_table);
sys_var_thd_bool sys_old_passwords(&vars, "old_passwords", &SV::old_passwords);
static sys_var_thd_ulong sys_optimizer_prune_level(&vars, "optimizer_prune_level",
&SV::optimizer_prune_level);
static sys_var_thd_ulong sys_optimizer_search_depth(&vars, "optimizer_search_depth",
static sys_var_thd_ulong sys_optimizer_search_depth(&vars, "optimizer_search_depth",
&SV::optimizer_search_depth);
static sys_var_thd_ulong sys_preload_buff_size(&vars, "preload_buffer_size",
static sys_var_thd_ulong sys_preload_buff_size(&vars, "preload_buffer_size",
&SV::preload_buff_size);
static sys_var_thd_ulong sys_read_buff_size(&vars, "read_buffer_size",
&SV::read_buff_size);
@ -615,7 +616,8 @@ static sys_var_have_variable sys_have_dlopen(&vars, "have_dynamic_loading", &hav
static sys_var_have_variable sys_have_geometry(&vars, "have_geometry", &have_geometry);
static sys_var_have_plugin sys_have_innodb(&vars, "have_innodb", C_STRING_WITH_LEN("innodb"), MYSQL_STORAGE_ENGINE_PLUGIN);
static sys_var_have_plugin sys_have_ndbcluster(&vars, "have_ndbcluster", C_STRING_WITH_LEN("ndbcluster"), MYSQL_STORAGE_ENGINE_PLUGIN);
static sys_var_have_variable sys_have_openssl(&vars, "have_openssl", &have_openssl);
static sys_var_have_variable sys_have_openssl(&vars, "have_openssl", &have_ssl);
static sys_var_have_variable sys_have_ssl(&vars, "have_ssl", &have_ssl);
static sys_var_have_plugin sys_have_partition_db(&vars, "have_partitioning", C_STRING_WITH_LEN("partition"), MYSQL_STORAGE_ENGINE_PLUGIN);
static sys_var_have_variable sys_have_query_cache(&vars, "have_query_cache",
&have_query_cache);

View File

@ -182,8 +182,9 @@ public:
class sys_var_bool_ptr_readonly :public sys_var_bool_ptr
{
public:
sys_var_bool_ptr_readonly(const char *name_arg, my_bool *value_arg)
:sys_var_bool_ptr(name_arg, value_arg)
sys_var_bool_ptr_readonly(sys_var_chain *chain, const char *name_arg,
my_bool *value_arg)
:sys_var_bool_ptr(chain, name_arg, value_arg)
{}
bool is_readonly() const { return 1; }
};

View File

@ -294,15 +294,16 @@ THD::THD()
lock_id(&main_lock_id),
user_time(0), in_sub_stmt(0),
binlog_table_maps(0),
global_read_lock(0), is_fatal_error(0),
arg_of_last_insert_id_function(FALSE),
first_successful_insert_id_in_prev_stmt(0),
first_successful_insert_id_in_prev_stmt_for_binlog(0),
first_successful_insert_id_in_cur_stmt(0),
stmt_depends_on_first_successful_insert_id_in_prev_stmt(FALSE),
global_read_lock(0),
is_fatal_error(0),
rand_used(0),
time_zone_used(0),
in_lock_tables(0),
stmt_depends_on_first_successful_insert_id_in_prev_stmt(FALSE),
bootstrap(0),
derived_tables_processing(FALSE),
spcont(NULL)
@ -1836,7 +1837,7 @@ void Query_arena::cleanup_stmt()
Statement::Statement(LEX *lex_arg, MEM_ROOT *mem_root_arg,
enum enum_state state_arg, ulong id_arg)
:Query_arena(mem_root_arg, state_arg), main_lex(),
:Query_arena(mem_root_arg, state_arg),
id(id_arg),
mark_used_columns(MARK_COLUMNS_READ),
lex(lex_arg),

View File

@ -633,15 +633,9 @@ static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc CALLER_INFO_PROTO)
plugin_ref plugin_lock(THD *thd, plugin_ref *ptr CALLER_INFO_PROTO)
{
LEX *lex= NULL;
LEX *lex= thd ? thd->lex : 0;
plugin_ref rc;
DBUG_ENTER("plugin_lock");
/*
thd->lex may point to a nested LEX or a stored procedure LEX.
main_lex is tightly coupled to the thread.
*/
if (thd)
lex= !thd->lex ? &thd->main_lex : thd->lex;
pthread_mutex_lock(&LOCK_plugin);
rc= my_intern_plugin_lock_ci(lex, *ptr);
pthread_mutex_unlock(&LOCK_plugin);
@ -652,12 +646,10 @@ plugin_ref plugin_lock(THD *thd, plugin_ref *ptr CALLER_INFO_PROTO)
plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name, int type
CALLER_INFO_PROTO)
{
LEX *lex= NULL;
LEX *lex= thd ? thd->lex : 0;
plugin_ref rc= NULL;
st_plugin_int *plugin;
DBUG_ENTER("plugin_lock");
if (thd)
lex= !thd->lex ? &thd->main_lex : thd->lex;
pthread_mutex_lock(&LOCK_plugin);
if ((plugin= plugin_find_internal(name, type)))
rc= my_intern_plugin_lock_ci(lex, plugin_int_to_ref(plugin));
@ -946,7 +938,7 @@ static void intern_plugin_unlock(LEX *lex, plugin_ref plugin)
void plugin_unlock(THD *thd, plugin_ref plugin)
{
LEX *lex= thd ? ( !thd->lex ? &thd->main_lex : thd->lex) : NULL;
LEX *lex= thd ? thd->lex : 0;
DBUG_ENTER("plugin_unlock");
if (!plugin)
DBUG_VOID_RETURN;
@ -965,7 +957,7 @@ void plugin_unlock(THD *thd, plugin_ref plugin)
void plugin_unlock_list(THD *thd, plugin_ref *list, uint count)
{
LEX *lex= thd ? ( !thd->lex ? &thd->main_lex : thd->lex) : NULL;
LEX *lex= thd ? thd->lex : 0;
DBUG_ENTER("plugin_unlock_list");
DBUG_ASSERT(list);
pthread_mutex_lock(&LOCK_plugin);
@ -2037,7 +2029,7 @@ sys_var *find_sys_var(THD *thd, const char *str, uint length)
(pi= var->cast_pluginvar()))
{
rw_unlock(&LOCK_system_variables_hash);
LEX *lex= thd ? ( !thd->lex ? &thd->main_lex : thd->lex ) : NULL;
LEX *lex= thd ? thd->lex : 0;
if (!(plugin= my_intern_plugin_lock(lex, plugin_int_to_ref(pi->plugin))))
var= NULL; /* failed to lock it, it must be uninstalling */
else
@ -2361,18 +2353,18 @@ void plugin_thdvar_cleanup(THD *thd)
unlock_variables(thd, &thd->variables);
cleanup_variables(thd, &thd->variables);
if ((idx= thd->main_lex.plugins.elements))
if ((idx= thd->lex->plugins.elements))
{
list= ((plugin_ref*) thd->main_lex.plugins.buffer) + idx - 1;
list= ((plugin_ref*) thd->lex->plugins.buffer) + idx - 1;
DBUG_PRINT("info",("unlocking %d plugins", idx));
while ((char*) list >= thd->main_lex.plugins.buffer)
while ((char*) list >= thd->lex->plugins.buffer)
intern_plugin_unlock(NULL, *list--);
}
reap_plugins();
pthread_mutex_unlock(&LOCK_plugin);
reset_dynamic(&thd->main_lex.plugins);
reset_dynamic(&thd->lex->plugins);
DBUG_VOID_RETURN;
}

View File

@ -40,8 +40,7 @@ static int copy_data_between_tables(TABLE *from,TABLE *to,
enum enum_enable_or_disable keys_onoff);
static bool prepare_blob_field(THD *thd, create_field *sql_field);
static bool check_engine(THD *thd, const char *table_name,
HA_CREATE_INFO *create_info);
static bool check_engine(THD *, const char *, HA_CREATE_INFO *);
static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
List<create_field> *fields,
List<Key> *keys, bool tmp_table,
@ -7097,7 +7096,7 @@ static bool check_engine(THD *thd, const char *table_name,
if (req_engine && req_engine != *new_engine)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_WARN_USING_OTHER_HANDLER,
ER(ER_WARN_USING_OTHER_HANDLER),
ha_resolve_storage_engine_name(*new_engine),

View File

@ -4406,10 +4406,9 @@ default_collation:
storage_engines:
ident_or_text
{
LEX *lex= YYTHD->lex;
plugin_ref plugin;
plugin_ref plugin= ha_resolve_by_name(YYTHD, &$1);
if ((plugin= ha_resolve_by_name(YYTHD, &$1)))
if (plugin)
$$= plugin_data(plugin, handlerton*);
else
{
@ -4418,18 +4417,14 @@ storage_engines:
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str);
MYSQL_YYABORT;
}
if (lex->sql_command == SQLCOM_ALTER_TABLE)
{
TABLE_LIST *table= (TABLE_LIST *) lex->select_lex.table_list.first;
$$= ha_default_handlerton(YYTHD);
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_USING_OTHER_HANDLER,
ER(ER_WARN_USING_OTHER_HANDLER),
ha_resolve_storage_engine_name($$),
table->table_name);
}
$$= 0;
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_UNKNOWN_STORAGE_ENGINE,
ER(ER_UNKNOWN_STORAGE_ENGINE),
$1.str);
}
};
}
;
known_storage_engines:
ident_or_text

View File

@ -5098,7 +5098,7 @@ innobase_drop_database(
/* Get the transaction associated with the current thd, or create one
if not yet created */
parent_trx = check_trx_exists(hton, ha_thd());
parent_trx = check_trx_exists(hton, current_thd);
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads */