diff options
author | unknown <serg@janus.mylan> | 2007-04-16 18:16:17 +0200 |
---|---|---|
committer | unknown <serg@janus.mylan> | 2007-04-16 18:16:17 +0200 |
commit | dcef028f713d84135013d6b9edd7c007818ad3fc (patch) | |
tree | 45078bb08a9d29ab98b50746b333b59e2f1f43af /sql | |
parent | 7cb8a33b1af33dcd8806ec6021655a39f375d904 (diff) | |
download | mariadb-git-dcef028f713d84135013d6b9edd7c007818ad3fc.tar.gz |
wl#2936 post-merge fixes
client/mysqltest.c:
warnings
extra/comp_err.c:
warnings
sql/event_queue.cc:
warnings
sql/handler.h:
warnings
sql/opt_range.cc:
warnings
sql/opt_range.h:
warnings
sql/rpl_mi.cc:
warnings
sql/sql_class.cc:
wl#2936 post-merge fixes, warnings
Diffstat (limited to 'sql')
-rw-r--r-- | sql/event_queue.cc | 4 | ||||
-rw-r--r-- | sql/ha_partition.cc | 3 | ||||
-rw-r--r-- | sql/handler.h | 5 | ||||
-rw-r--r-- | sql/opt_range.cc | 9 | ||||
-rw-r--r-- | sql/opt_range.h | 4 | ||||
-rw-r--r-- | sql/rpl_mi.cc | 4 | ||||
-rw-r--r-- | sql/set_var.cc | 22 | ||||
-rw-r--r-- | sql/set_var.h | 5 | ||||
-rw-r--r-- | sql/sql_class.cc | 7 | ||||
-rw-r--r-- | sql/sql_plugin.cc | 26 | ||||
-rw-r--r-- | sql/sql_table.cc | 5 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 23 |
12 files changed, 55 insertions, 62 deletions
diff --git a/sql/event_queue.cc b/sql/event_queue.cc index 92622bcc2c2..efa4b95a9ea 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -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= ""; diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 762c11ed6b2..a79803e6e83 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -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, diff --git a/sql/handler.h b/sql/handler.h index a940841170b..052c245b801 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -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) { diff --git a/sql/opt_range.cc b/sql/opt_range.cc index f5cf79bd609..96ae6174fdb 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -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; diff --git a/sql/opt_range.h b/sql/opt_range.h index 1ad9567cddd..76a4caa1ccb 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -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; diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 354a97cefde..bb9d0e6d953 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -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; diff --git a/sql/set_var.cc b/sql/set_var.cc index dd271ddcae6..fa6d899c5f8 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -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); diff --git a/sql/set_var.h b/sql/set_var.h index 5ec7eb7ef4a..5556e9c9587 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -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; } }; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 3d2683786c4..2cee2783988 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -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), diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 34accdc6494..bc545f23428 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -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; } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index a994ede6bdf..61228b31a8a 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -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), diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index c0a8ebada43..99681905bfa 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -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 |