The world's most popular open source database
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
| #define AUTO_INCREMENT_FLAG 512 |
Definition at line 90 of file mysql_com.h.
Referenced by add_field_to_list(), copy_data_between_tables(), ha_archive::create(), ha_heap::create(), create_field::init(), Field_num::is_equal(), Field_new_decimal::is_equal(), remove_eq_conds(), and test_field_flags().
| #define BINARY_FLAG 128 |
Definition at line 86 of file mysql_com.h.
Referenced by Field_str::Field_str(), Item::init_make_field(), and Field_str::is_equal().
| #define BINCMP_FLAG 131072 |
Definition at line 98 of file mysql_com.h.
Referenced by Field_str::is_equal(), and mysql_prepare_table().
| #define BLOB_FLAG 16 |
Definition at line 83 of file mysql_com.h.
Referenced by add_key_field(), calc_used_field_length(), compare_tables(), copy_blobs(), create_field::create_field(), create_myisam_tmp_table(), create_tmp_field_from_field(), create_tmp_table(), create_virtual_tmp_table(), Field_blob::Field_blob(), Field::fill_cache_field(), find_key_for_maxmin(), free_blobs(), free_delayed_insert_blobs(), get_addon_fields(), create_field::init(), mysql_load(), mysql_prepare_table(), new_Cached_item(), open_table_from_share(), prepare_blob_field(), Copy_field::set(), setup_copy_fields(), and unlink_blobs().
| #define CLIENT_COMPRESS 32 |
Definition at line 130 of file mysql_com.h.
Referenced by check_connection(), CLI_MYSQL_REAL_CONNECT(), handle_one_connection(), mysql_options(), and mysql_read_default_options().
| #define CLIENT_CONNECT_WITH_DB 8 |
Definition at line 128 of file mysql_com.h.
Referenced by check_connection(), and CLI_MYSQL_REAL_CONNECT().
| #define CLIENT_FOUND_ROWS 2 |
| #define CLIENT_IGNORE_SIGPIPE 4096 |
Definition at line 137 of file mysql_com.h.
| #define CLIENT_IGNORE_SPACE 256 |
| #define CLIENT_INTERACTIVE 1024 |
Definition at line 135 of file mysql_com.h.
Referenced by check_connection(), and mysql_read_default_options().
| #define CLIENT_LOCAL_FILES 128 |
Definition at line 132 of file mysql_com.h.
Referenced by mysql_execute_command(), mysql_init(), mysql_options(), and mysql_read_default_options().
| #define CLIENT_LONG_FLAG 4 |
Definition at line 127 of file mysql_com.h.
Referenced by check_connection(), Mysql_connection_thread::check_connection(), Protocol::send_fields(), and unpack_fields().
| #define CLIENT_LONG_PASSWORD 1 |
Definition at line 125 of file mysql_com.h.
| #define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS |
| #define CLIENT_MULTI_RESULTS 131072 |
Definition at line 142 of file mysql_com.h.
Referenced by CLI_MYSQL_REAL_CONNECT(), handle_bootstrap(), init_event_thread(), mysql_execute_command(), mysql_read_default_options(), test_bug12001(), and test_bug15752().
| #define CLIENT_MULTI_STATEMENTS 65536 |
Definition at line 141 of file mysql_com.h.
Referenced by CLI_MYSQL_REAL_CONNECT(), connect_n_handle_errors(), dispatch_command(), mysql_read_default_options(), MYSQLlex(), safe_connect(), sql_real_connect(), test_bug12001(), test_bug15752(), test_bug9992(), test_multi_statements(), and test_prepare_multi_statements().
| #define CLIENT_NO_SCHEMA 16 |
Definition at line 129 of file mysql_com.h.
| #define CLIENT_ODBC 64 |
Definition at line 131 of file mysql_com.h.
| #define CLIENT_PROTOCOL_41 512 |
Definition at line 134 of file mysql_com.h.
Referenced by check_connection(), Mysql_connection_thread::check_connection(), CLI_MYSQL_REAL_CONNECT(), net_printf_error(), net_send_error_packet(), Protocol::send_fields(), send_ok(), unpack_fields(), and write_eof_packet().
| #define CLIENT_REMEMBER_OPTIONS (((ulong) 1) << 31) |
| #define CLIENT_RESERVED 16384 |
Definition at line 139 of file mysql_com.h.
| #define CLIENT_SECURE_CONNECTION 32768 |
Definition at line 140 of file mysql_com.h.
Referenced by check_connection(), Mysql_connection_thread::check_connection(), CLI_MYSQL_REAL_CONNECT(), cli_read_change_user_result(), dispatch_command(), and mysql_change_user().
| #define CLIENT_SSL 2048 |
Definition at line 136 of file mysql_com.h.
Referenced by check_connection(), and CLI_MYSQL_REAL_CONNECT().
| #define CLIENT_TRANSACTIONS 8192 |
Definition at line 138 of file mysql_com.h.
Referenced by check_connection(), and cli_read_query_result().
| #define COMP_HEADER_SIZE 3 |
Definition at line 391 of file mysql_com.h.
Referenced by my_net_init(), my_real_read(), net_real_write(), and net_realloc().
| #define ENUM_FLAG 256 |
Definition at line 89 of file mysql_com.h.
Referenced by create_field::create_field(), Field_enum::Field_enum(), and Field_set::Field_set().
| #define FIELD_IN_ADD_INDEX (1<< 20) |
| #define FIELD_IN_PART_FUNC_FLAG (1 << 19) |
Definition at line 100 of file mysql_com.h.
| #define FIELD_IS_RENAMED (1<< 21) |
| #define FIELD_TYPE_BIT MYSQL_TYPE_BIT |
Definition at line 274 of file mysql_com.h.
Referenced by calc_group_buffer(), calc_pack_length(), create_tmp_field(), create_tmp_table(), field_conv(), fieldtype2str(), get_schema_column_record(), make_empty_rec(), make_field(), mysql_prepare_table(), prepare_create_field(), sp_prepare_create_field(), and Field_bit::type().
| #define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB |
Definition at line 268 of file mysql_com.h.
Referenced by calc_group_buffer(), calc_pack_length(), create_field::create_field(), field_conv(), Item_func_group_concat::field_type(), fieldtype2str(), get_blob_type_from_length(), get_schema_column_record(), handler::ha_check_for_upgrade(), create_field::init(), mysql_alter_table(), mysql_checksum_table(), prepare_blob_field(), prepare_create_field(), store_create_info(), store_key::store_key(), and Field_blob::type().
| #define FIELD_TYPE_CHAR MYSQL_TYPE_TINY |
Definition at line 271 of file mysql_com.h.
| #define FIELD_TYPE_DATE MYSQL_TYPE_DATE |
Definition at line 258 of file mysql_com.h.
Referenced by calc_pack_length(), analyse::end_of_records(), field_conv(), fieldtype2str(), get_mm_leaf(), create_field::init(), make_field(), prepare_create_field(), remove_eq_conds(), Field_newdate::type(), and Field_date::type().
| #define FIELD_TYPE_DATETIME MYSQL_TYPE_DATETIME |
Definition at line 260 of file mysql_com.h.
Referenced by calc_pack_length(), analyse::end_of_records(), field_conv(), fieldtype2str(), get_mm_leaf(), create_field::init(), make_field(), prepare_create_field(), remove_eq_conds(), and Field_datetime::type().
| #define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL |
Definition at line 247 of file mysql_com.h.
Referenced by calc_pack_length(), dump_table(), analyse::end_of_records(), field_conv(), fieldtype2str(), get_schema_column_record(), create_field::init(), make_field(), and Field_decimal::type().
| #define FIELD_TYPE_DOUBLE MYSQL_TYPE_DOUBLE |
Definition at line 253 of file mysql_com.h.
Referenced by calc_pack_length(), Item::field_type(), fieldtype2str(), get_schema_column_record(), create_field::init(), make_field(), and Field_double::type().
| #define FIELD_TYPE_ENUM MYSQL_TYPE_ENUM |
Definition at line 263 of file mysql_com.h.
Referenced by calc_pack_length(), check_that_all_fields_are_given_values(), field_conv(), fieldtype2str(), get_access(), create_field::init(), make_empty_rec(), mysql_prepare_table(), prepare_create_field(), Field_enum::real_type(), replace_user_table(), and sp_prepare_create_field().
| #define FIELD_TYPE_FLOAT MYSQL_TYPE_FLOAT |
Definition at line 252 of file mysql_com.h.
Referenced by calc_pack_length(), fieldtype2str(), get_schema_column_record(), create_field::init(), make_field(), test_if_ref(), and Field_float::type().
| #define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY |
Definition at line 273 of file mysql_com.h.
Referenced by calc_pack_length(), create_field::create_field(), fieldtype2str(), create_field::init(), pack_fields(), and prepare_create_field().
| #define FIELD_TYPE_INT24 MYSQL_TYPE_INT24 |
Definition at line 257 of file mysql_com.h.
Referenced by calc_pack_length(), fieldtype2str(), get_schema_column_record(), create_field::init(), make_field(), pack_length_to_packflag(), and Field_medium::type().
| #define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM |
Definition at line 272 of file mysql_com.h.
| #define FIELD_TYPE_LONG MYSQL_TYPE_LONG |
Definition at line 251 of file mysql_com.h.
Referenced by calc_pack_length(), fieldtype2str(), get_schema_column_record(), create_field::init(), make_field(), mysqld_list_processes(), pack_length_to_packflag(), test_view_insert(), and Field_long::type().
| #define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB |
Definition at line 267 of file mysql_com.h.
Referenced by calc_pack_length(), create_field::create_field(), fieldtype2str(), get_blob_type_from_length(), create_field::init(), Item_empty_string::make_field(), and prepare_create_field().
| #define FIELD_TYPE_LONGLONG MYSQL_TYPE_LONGLONG |
Definition at line 256 of file mysql_com.h.
Referenced by calc_pack_length(), Item::field_type(), fieldtype2str(), get_schema_column_record(), create_field::init(), make_field(), pack_length_to_packflag(), and proc_analyse_init().
| #define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB |
Definition at line 266 of file mysql_com.h.
Referenced by calc_pack_length(), create_field::create_field(), fieldtype2str(), get_blob_type_from_length(), create_field::init(), Item_empty_string::make_field(), and prepare_create_field().
| #define FIELD_TYPE_NEWDATE MYSQL_TYPE_NEWDATE |
Definition at line 262 of file mysql_com.h.
Referenced by calc_pack_length(), analyse::end_of_records(), fieldtype2str(), create_field::init(), make_field(), prepare_create_field(), and Field_newdate::real_type().
| #define FIELD_TYPE_NEWDECIMAL MYSQL_TYPE_NEWDECIMAL |
Definition at line 248 of file mysql_com.h.
Referenced by calc_pack_length(), handler::check_old_types(), field_conv(), Item::field_type(), fieldtype2str(), get_schema_column_record(), create_field::init(), make_field(), prepare_create_field(), and Field_new_decimal::type().
| #define FIELD_TYPE_NULL MYSQL_TYPE_NULL |
Definition at line 254 of file mysql_com.h.
Referenced by calc_pack_length(), fieldtype2str(), create_field::init(), make_field(), prepare_create_field(), Copy_field::set(), and Field_null::type().
| #define FIELD_TYPE_SET MYSQL_TYPE_SET |
Definition at line 264 of file mysql_com.h.
Referenced by calc_pack_length(), analyse::end_of_records(), field_conv(), fieldtype2str(), Item_func_find_in_set::fix_length_and_dec(), create_field::init(), mysql_prepare_table(), prepare_create_field(), Field_set::real_type(), and sp_prepare_create_field().
| #define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT |
Definition at line 250 of file mysql_com.h.
Referenced by calc_pack_length(), fieldtype2str(), get_schema_column_record(), create_field::init(), make_field(), pack_length_to_packflag(), and Field_short::type().
| #define FIELD_TYPE_STRING MYSQL_TYPE_STRING |
Definition at line 270 of file mysql_com.h.
Referenced by fieldtype2str(), prepare_create_field(), Field_string::real_type(), send_fields(), test_view(), and Field_enum::type().
| #define FIELD_TYPE_TIME MYSQL_TYPE_TIME |
Definition at line 259 of file mysql_com.h.
Referenced by calc_pack_length(), analyse::end_of_records(), fieldtype2str(), create_field::init(), make_field(), prepare_create_field(), and Field_time::type().
| #define FIELD_TYPE_TIMESTAMP MYSQL_TYPE_TIMESTAMP |
Definition at line 255 of file mysql_com.h.
Referenced by add_field_to_list(), calc_pack_length(), create_field::create_field(), analyse::end_of_records(), fieldtype2str(), create_field::init(), make_field(), pack_header(), prepare_create_field(), read_sep_field(), Copy_field::set(), set_field_to_null_with_conversions(), store_create_info(), Field_timestamp::type(), and Item_func_unix_timestamp::val_int().
| #define FIELD_TYPE_TINY MYSQL_TYPE_TINY |
Definition at line 249 of file mysql_com.h.
Referenced by calc_pack_length(), fieldtype2str(), get_schema_column_record(), create_field::init(), make_field(), pack_length_to_packflag(), and Field_tiny::type().
| #define FIELD_TYPE_TINY_BLOB MYSQL_TYPE_TINY_BLOB |
Definition at line 265 of file mysql_com.h.
Referenced by calc_pack_length(), create_field::create_field(), fieldtype2str(), get_blob_type_from_length(), create_field::init(), and prepare_create_field().
| #define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING |
Definition at line 269 of file mysql_com.h.
Referenced by fieldtype2str(), and Item_empty_string::make_field().
| #define FIELD_TYPE_YEAR MYSQL_TYPE_YEAR |
Definition at line 261 of file mysql_com.h.
Referenced by calc_pack_length(), analyse::end_of_records(), fieldtype2str(), create_field::init(), make_empty_rec(), make_field(), and Field_year::type().
| #define GET_FIXED_FIELDS_FLAG (1 << 18) |
| #define GROUP_FLAG 32768 |
| #define HOSTNAME_LENGTH 60 |
Definition at line 25 of file mysql_com.h.
Referenced by check_connection(), db_load_routine(), dump_triggers_for_table(), Item_func_user::fix_length_and_dec(), get_view_structure(), mysql_create_user(), mysql_grant(), mysql_routine_grant(), mysql_show_grants(), mysql_table_grant(), replace_column_table(), and sp_head::set_definer().
| #define LOCAL_HOST "localhost" |
Definition at line 38 of file mysql_com.h.
Referenced by CLI_MYSQL_REAL_CONNECT(), Instance::is_running(), and sql_connect().
| #define LOCAL_HOST_NAMEDPIPE "." |
| #define MAX_BIGINT_WIDTH 20 |
Definition at line 178 of file mysql_com.h.
Referenced by Item_func_get_user_var::fix_length_and_dec(), and create_field::init().
| #define MAX_BLOB_WIDTH 8192 |
Definition at line 180 of file mysql_com.h.
Referenced by calc_group_buffer(), create_tmp_table(), Item_xml_str_func::fix_length_and_dec(), Item_nodeset_context_cache::fix_length_and_dec(), Item_nodeset_func::fix_length_and_dec(), Item_func_date_format::fix_length_and_dec(), Item_func_uncompress::fix_length_and_dec(), Item_load_file::fix_length_and_dec(), Item_func_lpad::fix_length_and_dec(), Item_func_rpad::fix_length_and_dec(), Item_func_repeat::fix_length_and_dec(), Item_func_insert::fix_length_and_dec(), Item_func_replace::fix_length_and_dec(), Item_func_concat_ws::fix_length_and_dec(), Item_func_concat::fix_length_and_dec(), and Item_func_get_user_var::fix_length_and_dec().
| #define MAX_CHAR_WIDTH 255 |
| #define MAX_INT_WIDTH 10 |
| #define MAX_MEDIUMINT_WIDTH 8 |
| #define MAX_SMALLINT_WIDTH 5 |
| #define MAX_TINYINT_WIDTH 3 |
| #define MULTIPLE_KEY_FLAG 8 |
Definition at line 82 of file mysql_com.h.
Referenced by get_schema_column_record(), and test_field_flags().
| #define MYSQL_ERRMSG_SIZE 512 |
Definition at line 164 of file mysql_com.h.
Referenced by Item_func_group_concat::cleanup(), expand_error(), make_truncated_value_warning(), mark_as_dependent(), mysql_admin_table(), mysql_create_like_table(), mysqld_show_warnings(), net_send_error(), net_send_error_323(), net_send_error_packet(), prepare_blob_field(), handler::print_error(), handler::print_keydup_error(), Item_singlerow_subselect::select_transformer(), send_ok(), and Item_in_subselect::single_value_transformer().
| #define MYSQL_LONG_DATA_HEADER 6 |
Definition at line 447 of file mysql_com.h.
Referenced by mysql_stmt_get_longdata(), and mysql_stmt_send_long_data().
| #define MYSQL_SHUTDOWN_KILLABLE_CONNECT (unsigned char)(1 << 0) |
Definition at line 280 of file mysql_com.h.
| #define MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE (unsigned char)(1 << 2) |
Definition at line 282 of file mysql_com.h.
| #define MYSQL_SHUTDOWN_KILLABLE_TRANS (unsigned char)(1 << 1) |
Definition at line 281 of file mysql_com.h.
| #define MYSQL_SHUTDOWN_KILLABLE_UPDATE (unsigned char)(1 << 3) |
Definition at line 283 of file mysql_com.h.
| #define MYSQL_STMT_HEADER 4 |
Definition at line 446 of file mysql_com.h.
Referenced by mysql_stmt_close(), mysql_stmt_prepare(), and reset_stmt_handle().
| #define NAME_LEN 64 |
Definition at line 24 of file mysql_com.h.
Referenced by acl_load(), add_field_to_list(), build_completion_hash(), check_column_name(), check_connection(), check_db_name(), check_grant_db(), check_if_ignore_table(), check_table_name(), CLI_MYSQL_REAL_CONNECT(), create_frm(), db_create_event(), db_create_routine(), db_load_routine(), Rpl_filter::db_ok_with_wild_table(), dispatch_command(), dump_all_tables_in_db(), dump_all_views_in_db(), dump_events_for_db(), dump_routines_for_db(), dump_selected_tables(), dump_table(), dump_triggers_for_table(), sp_head::execute(), find_field_in_group_list(), find_field_in_tables(), find_files(), fix_object_name(), get_actual_table_name(), get_cached_table_share(), get_table_structure(), get_view_structure(), init_dumping(), insert_fields(), list_dbs(), list_tables(), main(), make_unique_view_field_name(), sp_head::merge_table_list(), mi_check_print_msg(), mysql_admin_table(), mysql_checksum_table(), mysql_create_like_table(), mysql_execute_command(), mysql_grant(), mysql_rename_table(), mysqld_list_processes(), mysqld_show_column_types(), mysqld_show_create(), mysqld_show_create_db(), mysqld_show_privileges(), name_hash_search(), plugin_dl_add(), primary_key_fields(), print_result(), select_describe(), Ndb::setDatabaseAndSchemaName(), Events::show_create_event(), sp_head::show_create_function(), sp_head::show_create_procedure(), sp_cache_routines_and_add_tables_aux(), store_create_info(), Rpl_filter::tables_ok(), test_explain_bug(), test_field_misc(), test_set_variable(), and truncate_names().
| #define NET_HEADER_SIZE 4 |
Definition at line 390 of file mysql_com.h.
Referenced by my_net_init(), my_net_read(), my_net_write(), my_real_read(), net_printf_error(), net_real_write(), net_realloc(), and net_write_command().
| #define net_new_transaction | ( | net | ) | ((net)->pkt_nr=0) |
| #define NET_READ_TIMEOUT 30 |
Definition at line 165 of file mysql_com.h.
| #define NET_WAIT_TIMEOUT 8*60*60 |
Definition at line 167 of file mysql_com.h.
| #define NET_WRITE_TIMEOUT 60 |
Definition at line 166 of file mysql_com.h.
| #define NO_DEFAULT_VALUE_FLAG 4096 |
Definition at line 93 of file mysql_com.h.
Referenced by check_that_all_fields_are_given_values(), create_field::create_field(), create_tmp_field_from_field(), Item_default_value::fix_fields(), get_schema_column_record(), create_field::init(), mysql_alter_table(), prepare_create_field(), Item_default_value::save_in_field(), and store_create_info().
| #define NOT_NULL_FLAG 1 |
Definition at line 79 of file mysql_com.h.
Referenced by add_field_to_list(), calc_used_field_length(), compare_tables(), create_myisam_tmp_table(), create_table_from_items(), Item_sum_hybrid::create_tmp_field(), create_tmp_field_from_field(), create_tmp_table(), create_virtual_tmp_table(), Field::Field(), get_schema_column_record(), get_schema_stat_record(), create_field::init(), Item::init_make_field(), make_empty_rec(), Item_sum::make_field(), Item_ident_for_show::make_field(), Field::make_field(), mysql_prepare_table(), prepare_create_field(), remove_eq_conds(), store_create_info(), and test_field_flags().
| #define NULL_LENGTH ((unsigned long) ~0) |
Definition at line 445 of file mysql_com.h.
Referenced by cli_read_query_result(), cli_read_rows(), net_field_length(), net_field_length_ll(), and read_one_row().
| #define NUM_FLAG 32768 |
| #define ONLY_KILL_QUERY 1 |
| #define packet_error (~(unsigned long) 0) |
Definition at line 221 of file mysql_com.h.
Referenced by check_connection(), Mysql_connection_thread::check_connection(), cli_advanced_command(), cli_flush_use_result(), CLI_MYSQL_REAL_CONNECT(), cli_read_binary_rows(), cli_read_change_user_result(), cli_read_prepare_result(), cli_read_query_result(), cli_read_rows(), cli_safe_read(), cli_unbuffered_fetch(), do_command(), Mysql_connection_thread::do_command(), dump_remote_log_entries(), Load_log_processor::load_old_format_file(), my_net_read(), my_real_read(), mysql_manager_connect(), mysql_manager_fetch_line(), read_one_row(), and safe_net_read().
| #define PART_KEY_FLAG 16384 |
Definition at line 95 of file mysql_com.h.
Referenced by add_key_field(), find_key_for_maxmin(), and st_table::mark_columns_needed_for_delete().
| #define PRI_KEY_FLAG 2 |
Definition at line 80 of file mysql_com.h.
Referenced by add_field_to_list(), get_schema_column_record(), and test_field_flags().
| #define REFRESH_DES_KEY_FILE 0x40000L |
Definition at line 122 of file mysql_com.h.
| #define REFRESH_FAST 32768 |
Definition at line 117 of file mysql_com.h.
Referenced by reload_acl_and_cache(), and signal_hand().
| #define REFRESH_GRANT 1 |
Definition at line 104 of file mysql_com.h.
Referenced by execute_commands(), reload_acl_and_cache(), and signal_hand().
| #define REFRESH_HOSTS 8 |
| #define REFRESH_LOG 2 |
Definition at line 105 of file mysql_com.h.
Referenced by handler::check_if_log_table_locking_is_allowed(), dump_all_tables_in_db(), dump_all_views_in_db(), dump_selected_tables(), execute_commands(), main(), reload_acl_and_cache(), and signal_hand().
| #define REFRESH_MASTER 128 |
| #define REFRESH_QUERY_CACHE 65536 |
| #define REFRESH_QUERY_CACHE_FREE 0x20000L |
| #define REFRESH_READ_LOCK 16384 |
Definition at line 116 of file mysql_com.h.
Referenced by execute_commands(), and reload_acl_and_cache().
| #define REFRESH_SLAVE 64 |
| #define REFRESH_STATUS 16 |
| #define REFRESH_TABLES 4 |
Definition at line 106 of file mysql_com.h.
Referenced by reload_acl_and_cache(), and signal_hand().
| #define REFRESH_THREADS 32 |
| #define REFRESH_USER_RESOURCES 0x80000L |
Definition at line 123 of file mysql_com.h.
| #define SCRAMBLE_LENGTH 20 |
Definition at line 72 of file mysql_com.h.
Referenced by acl_getroot(), check_connection(), Mysql_connection_thread::check_connection(), check_scramble(), check_user(), CLI_MYSQL_REAL_CONNECT(), Mysql_connection_thread::init(), mysql_change_user(), mysql_show_grants(), scramble(), set_user_salt(), and sp_grant_privileges().
| #define SCRAMBLE_LENGTH_323 8 |
Definition at line 73 of file mysql_com.h.
Referenced by check_connection(), Mysql_connection_thread::check_connection(), check_scramble_323(), check_user(), CLI_MYSQL_REAL_CONNECT(), cli_read_change_user_result(), mysql_change_user(), scramble_323(), set_user_salt(), and sp_grant_privileges().
| #define SCRAMBLED_PASSWORD_CHAR_LENGTH (SCRAMBLE_LENGTH*2+1) |
Definition at line 75 of file mysql_com.h.
Referenced by acl_load(), Item_func_password::alloc(), check_change_password(), Item_func_password::fix_length_and_dec(), User::init(), User_map::load(), mysql_show_grants(), replace_user_table(), set_user_salt(), sp_grant_privileges(), and Item_func_password::val_str().
| #define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2) |
Definition at line 76 of file mysql_com.h.
Referenced by acl_load(), Item_func_old_password::alloc(), check_change_password(), Item_func_old_password::fix_length_and_dec(), replace_user_table(), set_user_salt(), sp_grant_privileges(), and Item_func_old_password::val_str().
| #define SERVER_MORE_RESULTS_EXISTS 8 |
Definition at line 147 of file mysql_com.h.
Referenced by cli_advanced_command(), cli_safe_read(), cli_stmt_execute(), mysql_execute_command(), mysql_more_results(), mysql_next_result(), mysql_reset_thd_for_next_command(), MYSQLlex(), net_send_error(), and write_eof_packet().
| #define SERVER_QUERY_NO_GOOD_INDEX_USED 16 |
Definition at line 148 of file mysql_com.h.
Referenced by dispatch_command(), log_slow_statement(), make_join_readinfo(), mysql_execute_command(), mysql_reset_thd_for_next_command(), and select_describe().
| #define SERVER_QUERY_NO_INDEX_USED 32 |
Definition at line 149 of file mysql_com.h.
Referenced by dispatch_command(), log_slow_statement(), make_join_readinfo(), mysql_delete(), mysql_execute_command(), mysql_reset_thd_for_next_command(), and select_describe().
| #define SERVER_STATUS_AUTOCOMMIT 2 |
Definition at line 146 of file mysql_com.h.
Referenced by CLI_MYSQL_REAL_CONNECT(), cli_read_prepare_result(), cli_read_query_result(), Mysql_connection_thread::init(), and set_option_autocommit().
| #define SERVER_STATUS_CURSOR_EXISTS 64 |
Definition at line 155 of file mysql_com.h.
Referenced by Materialized_cursor::fetch(), Sensitive_cursor::fetch(), mysql_stmt_execute(), mysql_stmt_store_result(), Materialized_cursor::open(), and Sensitive_cursor::open().
| #define SERVER_STATUS_DB_DROPPED 256 |
| #define SERVER_STATUS_IN_TRANS 1 |
Definition at line 145 of file mysql_com.h.
Referenced by begin_trans(), check_tx_isolation(), cli_read_prepare_result(), cli_read_query_result(), end_active_trans(), end_trans(), mysql_execute_command(), mysql_reconnect(), and trans_register_ha().
| #define SERVER_STATUS_LAST_ROW_SENT 128 |
Definition at line 160 of file mysql_com.h.
Referenced by Materialized_cursor::fetch(), Sensitive_cursor::fetch(), mysql_stmt_store_result(), and stmt_read_row_from_cursor().
| #define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512 |
Definition at line 162 of file mysql_com.h.
Referenced by add_line(), fix_sql_mode_var(), mysql_real_escape_string(), and test_bug10214().
| #define SERVER_VERSION_LENGTH 60 |
| #define SET_FLAG 2048 |
Definition at line 92 of file mysql_com.h.
Referenced by create_field::create_field(), and Field_set::Field_set().
| #define SQLSTATE_LENGTH 5 |
Definition at line 28 of file mysql_com.h.
Referenced by cli_safe_read(), get_errcodes(), net_printf_error(), and net_send_error().
| #define TIMESTAMP_FLAG 1024 |
| #define UNIQUE_FLAG 65536 |
| #define UNIQUE_KEY_FLAG 4 |
Definition at line 81 of file mysql_com.h.
Referenced by add_field_to_list(), get_schema_column_record(), and test_field_flags().
| #define UNSIGNED_FLAG 32 |
Definition at line 84 of file mysql_com.h.
Referenced by convert_constant_item(), create_field::create_length_to_internal_length(), do_field_int(), fetch_result_int32(), fetch_result_int64(), fetch_result_short(), fetch_result_tinyint(), fetch_result_with_conversion(), field_conv(), Field_num::Field_num(), Field_timestamp::Field_timestamp(), create_field::init(), Item::init_make_field(), Field_num::is_equal(), Field_new_decimal::is_equal(), prepare_create_field(), and Item_field::set_field().
| #define USER_HOST_BUFF_SIZE HOSTNAME_LENGTH + USERNAME_LENGTH + 2 |
Definition at line 36 of file mysql_com.h.
Referenced by create_string(), Table_triggers_list::create_trigger(), db_create_routine(), fill_schema_proc(), get_or_create_user_conn(), get_schema_triggers_record(), get_schema_views_record(), replace_routine_table(), replace_table_table(), reset_mqh(), and sp_find_routine().
| #define USERNAME_LENGTH 16 |
Definition at line 26 of file mysql_com.h.
Referenced by check_connection(), check_grant_db(), CLI_MYSQL_REAL_CONNECT(), db_load_routine(), dump_triggers_for_table(), Item_func_user::fix_length_and_dec(), get_user_name(), get_view_structure(), User::init(), User_map::load(), mysql_create_user(), mysql_grant(), mysql_routine_grant(), mysql_show_grants(), mysql_table_grant(), name_hash_search(), read_user_name(), sp_head::set_definer(), and User::User().
| #define ZEROFILL_FLAG 64 |
Definition at line 85 of file mysql_com.h.
Referenced by fetch_long_with_conversion(), Field_num::Field_num(), Field_timestamp::Field_timestamp(), create_field::init(), and prepare_create_field().
| typedef struct st_udf_args UDF_ARGS |
| typedef struct st_udf_init UDF_INIT |
Definition at line 172 of file mysql_com.h.
| enum enum_cursor_type |
| CURSOR_TYPE_NO_CURSOR | |
| CURSOR_TYPE_READ_ONLY | |
| CURSOR_TYPE_FOR_UPDATE | |
| CURSOR_TYPE_SCROLLABLE |
Definition at line 310 of file mysql_com.h.
00311 { 00312 CURSOR_TYPE_NO_CURSOR= 0, 00313 CURSOR_TYPE_READ_ONLY= 1, 00314 CURSOR_TYPE_FOR_UPDATE= 2, 00315 CURSOR_TYPE_SCROLLABLE= 4 00316 };
| enum enum_field_types |
Definition at line 223 of file mysql_com.h.
00223 { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, 00224 MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, 00225 MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE, 00226 MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, 00227 MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24, 00228 MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, 00229 MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR, 00230 MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR, 00231 MYSQL_TYPE_BIT, 00232 MYSQL_TYPE_NEWDECIMAL=246, 00233 MYSQL_TYPE_ENUM=247, 00234 MYSQL_TYPE_SET=248, 00235 MYSQL_TYPE_TINY_BLOB=249, 00236 MYSQL_TYPE_MEDIUM_BLOB=250, 00237 MYSQL_TYPE_LONG_BLOB=251, 00238 MYSQL_TYPE_BLOB=252, 00239 MYSQL_TYPE_VAR_STRING=253, 00240 MYSQL_TYPE_STRING=254, 00241 MYSQL_TYPE_GEOMETRY=255 00242 00243 };
Definition at line 320 of file mysql_com.h.
00321 { 00322 MYSQL_OPTION_MULTI_STATEMENTS_ON, 00323 MYSQL_OPTION_MULTI_STATEMENTS_OFF 00324 };
| enum enum_server_command |
Definition at line 52 of file mysql_com.h.
00053 { 00054 COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, 00055 COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS, 00056 COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING, 00057 COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP, 00058 COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE, 00059 COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE, 00060 COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON, 00061 /* don't forget to update const char *command_name[] in sql_parse.cc */ 00062 00063 /* Must be last */ 00064 COM_END 00065 };
| enum Item_result |
Definition at line 364 of file mysql_com.h.
00364 {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, 00365 DECIMAL_RESULT};
| SHUTDOWN_DEFAULT | |
| SHUTDOWN_WAIT_CONNECTIONS | |
| SHUTDOWN_WAIT_TRANSACTIONS | |
| SHUTDOWN_WAIT_UPDATES | |
| SHUTDOWN_WAIT_ALL_BUFFERS | |
| SHUTDOWN_WAIT_CRITICAL_BUFFERS | |
| KILL_CONNECTION |
Definition at line 285 of file mysql_com.h.
00285 { 00286 /* 00287 We want levels to be in growing order of hardness (because we use number 00288 comparisons). Note that DEFAULT does not respect the growing property, but 00289 it's ok. 00290 */ 00291 SHUTDOWN_DEFAULT = 0, 00292 /* wait for existing connections to finish */ 00293 SHUTDOWN_WAIT_CONNECTIONS= MYSQL_SHUTDOWN_KILLABLE_CONNECT, 00294 /* wait for existing trans to finish */ 00295 SHUTDOWN_WAIT_TRANSACTIONS= MYSQL_SHUTDOWN_KILLABLE_TRANS, 00296 /* wait for existing updates to finish (=> no partial MyISAM update) */ 00297 SHUTDOWN_WAIT_UPDATES= MYSQL_SHUTDOWN_KILLABLE_UPDATE, 00298 /* flush InnoDB buffers and other storage engines' buffers*/ 00299 SHUTDOWN_WAIT_ALL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1), 00300 /* don't flush InnoDB buffers, flush other storage engines' buffers*/ 00301 SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1, 00302 /* Now the 2 levels of the KILL command */ 00303 #if MYSQL_VERSION_ID >= 50000 00304 KILL_QUERY= 254, 00305 #endif 00306 KILL_CONNECTION= 255 00307 };
| my_bool check_scramble | ( | const char * | reply, | |
| const char * | message, | |||
| const unsigned char * | hash_stage2 | |||
| ) |
Definition at line 476 of file password.c.
References buf, memcmp(), my_crypt(), mysql_sha1_input(), mysql_sha1_reset(), mysql_sha1_result(), SCRAMBLE_LENGTH, and SHA1_HASH_SIZE.
Referenced by acl_getroot(), and User_map::authenticate().
00478 { 00479 SHA1_CONTEXT sha1_context; 00480 uint8 buf[SHA1_HASH_SIZE]; 00481 uint8 hash_stage2_reassured[SHA1_HASH_SIZE]; 00482 00483 mysql_sha1_reset(&sha1_context); 00484 /* create key to encrypt scramble */ 00485 mysql_sha1_input(&sha1_context, (const uint8 *) message, SCRAMBLE_LENGTH); 00486 mysql_sha1_input(&sha1_context, hash_stage2, SHA1_HASH_SIZE); 00487 mysql_sha1_result(&sha1_context, buf); 00488 /* encrypt scramble */ 00489 my_crypt((char *) buf, buf, (const uchar *) scramble, SCRAMBLE_LENGTH); 00490 /* now buf supposedly contains hash_stage1: so we can get hash_stage2 */ 00491 mysql_sha1_reset(&sha1_context); 00492 mysql_sha1_input(&sha1_context, buf, SHA1_HASH_SIZE); 00493 mysql_sha1_result(&sha1_context, hash_stage2_reassured); 00494 return memcmp(hash_stage2, hash_stage2_reassured, SHA1_HASH_SIZE); 00495 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_bool check_scramble_323 | ( | const char * | , | |
| const char * | message, | |||
| unsigned long * | salt | |||
| ) |
Definition at line 207 of file password.c.
References DBUG_ASSERT, hash_password(), my_rnd(), pos(), randominit(), SCRAMBLE_LENGTH_323, and to.
Referenced by acl_getroot().
00209 { 00210 struct rand_struct rand_st; 00211 ulong hash_message[2]; 00212 char buff[16],*to,extra; /* Big enough for check */ 00213 const char *pos; 00214 00215 hash_password(hash_message, message, SCRAMBLE_LENGTH_323); 00216 randominit(&rand_st,hash_pass[0] ^ hash_message[0], 00217 hash_pass[1] ^ hash_message[1]); 00218 to=buff; 00219 DBUG_ASSERT(sizeof(buff) > SCRAMBLE_LENGTH_323); 00220 for (pos=scrambled ; *pos && to < buff+sizeof(buff) ; pos++) 00221 *to++=(char) (floor(my_rnd(&rand_st)*31)+64); 00222 if (pos-scrambled != SCRAMBLE_LENGTH_323) 00223 return 1; 00224 extra=(char) (floor(my_rnd(&rand_st)*31)); 00225 to=buff; 00226 while (*scrambled) 00227 { 00228 if (*scrambled++ != (char) (*to++ ^ extra)) 00229 return 1; /* Wrong password */ 00230 } 00231 return 0; 00232 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void create_random_string | ( | char * | to, | |
| unsigned int | length, | |||
| struct rand_struct * | rand_st | |||
| ) |
Definition at line 297 of file password.c.
References my_rnd().
Referenced by check_connection(), and Mysql_connection_thread::init().
00298 { 00299 char *end= to + length; 00300 /* Use pointer arithmetics as it is faster way to do so. */ 00301 for (; to < end; to++) 00302 *to= (char) (my_rnd(rand_st)*94+33); 00303 *to= '\0'; 00304 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void get_salt_from_password | ( | unsigned char * | res, | |
| const char * | password | |||
| ) |
Definition at line 507 of file password.c.
References hex2octet(), and SHA1_HASH_SIZE.
Referenced by User::init(), and set_user_salt().
00508 { 00509 hex2octet(hash_stage2, password+1 /* skip '*' */, SHA1_HASH_SIZE * 2); 00510 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void get_salt_from_password_323 | ( | unsigned long * | res, | |
| const char * | password | |||
| ) |
Definition at line 252 of file password.c.
References char_val.
Referenced by set_user_salt().
00253 { 00254 res[0]= res[1]= 0; 00255 if (password) 00256 { 00257 while (*password) 00258 { 00259 ulong val=0; 00260 uint i; 00261 for (i=0 ; i < 8 ; i++) 00262 val=(val << 4)+char_val(*password++); 00263 *res++=val; 00264 } 00265 } 00266 }
Here is the caller graph for this function:

| char* get_tty_password | ( | const char * | opt_message | ) |
Definition at line 153 of file get_password.c.
References DBUG_ENTER, DBUG_RETURN, ECHO, get_password(), memset, MY_FAE, my_strdup(), MYF, strnmov(), and TERMIO.
00154 { 00155 #ifdef HAVE_GETPASS 00156 char *passbuff; 00157 #else /* ! HAVE_GETPASS */ 00158 TERMIO org,tmp; 00159 #endif /* HAVE_GETPASS */ 00160 char buff[80]; 00161 00162 DBUG_ENTER("get_tty_password"); 00163 00164 #ifdef HAVE_GETPASS 00165 passbuff = getpass(opt_message ? opt_message : "Enter password: "); 00166 00167 /* copy the password to buff and clear original (static) buffer */ 00168 strnmov(buff, passbuff, sizeof(buff) - 1); 00169 #ifdef _PASSWORD_LEN 00170 memset(passbuff, 0, _PASSWORD_LEN); 00171 #endif 00172 #else 00173 if (isatty(fileno(stderr))) 00174 { 00175 fputs(opt_message ? opt_message : "Enter password: ",stderr); 00176 fflush(stderr); 00177 } 00178 #if defined(HAVE_TERMIOS_H) 00179 tcgetattr(fileno(stdin), &org); 00180 tmp = org; 00181 tmp.c_lflag &= ~(ECHO | ISIG | ICANON); 00182 tmp.c_cc[VMIN] = 1; 00183 tmp.c_cc[VTIME] = 0; 00184 tcsetattr(fileno(stdin), TCSADRAIN, &tmp); 00185 get_password(buff, sizeof(buff)-1, fileno(stdin), isatty(fileno(stderr))); 00186 tcsetattr(fileno(stdin), TCSADRAIN, &org); 00187 #elif defined(HAVE_TERMIO_H) 00188 ioctl(fileno(stdin), (int) TCGETA, &org); 00189 tmp=org; 00190 tmp.c_lflag &= ~(ECHO | ISIG | ICANON); 00191 tmp.c_cc[VMIN] = 1; 00192 tmp.c_cc[VTIME]= 0; 00193 ioctl(fileno(stdin),(int) TCSETA, &tmp); 00194 get_password(buff,sizeof(buff)-1,fileno(stdin),isatty(fileno(stderr))); 00195 ioctl(fileno(stdin),(int) TCSETA, &org); 00196 #else 00197 gtty(fileno(stdin), &org); 00198 tmp=org; 00199 tmp.sg_flags &= ~ECHO; 00200 tmp.sg_flags |= RAW; 00201 stty(fileno(stdin), &tmp); 00202 get_password(buff,sizeof(buff)-1,fileno(stdin),isatty(fileno(stderr))); 00203 stty(fileno(stdin), &org); 00204 #endif 00205 if (isatty(fileno(stderr))) 00206 fputc('\n',stderr); 00207 #endif /* HAVE_GETPASS */ 00208 00209 DBUG_RETURN(my_strdup(buff,MYF(MY_FAE))); 00210 }
Here is the call graph for this function:

| void hash_password | ( | unsigned long * | to, | |
| const char * | password, | |||
| unsigned int | password_len | |||
| ) |
Definition at line 118 of file password.c.
Referenced by check_scramble_323(), make_scrambled_password_323(), scramble_323(), and SQL_CRYPT::SQL_CRYPT().
00119 { 00120 register ulong nr=1345345333L, add=7, nr2=0x12345671L; 00121 ulong tmp; 00122 const char *password_end= password + password_len; 00123 for (; password < password_end; password++) 00124 { 00125 if (*password == ' ' || *password == '\t') 00126 continue; /* skip space in password */ 00127 tmp= (ulong) (uchar) *password; 00128 nr^= (((nr & 63)+add)*tmp)+ (nr << 8); 00129 nr2+=(nr2 << 8) ^ nr; 00130 add+=tmp; 00131 } 00132 result[0]=nr & (((ulong) 1L << 31) -1L); /* Don't use sign bit (str2int) */; 00133 result[1]=nr2 & (((ulong) 1L << 31) -1L); 00134 }
Here is the caller graph for this function:

| void make_password_from_salt | ( | char * | to, | |
| const unsigned char * | hash_stage2 | |||
| ) |
Definition at line 520 of file password.c.
References octet2hex(), PVERSION41_CHAR, and SHA1_HASH_SIZE.
Referenced by mysql_show_grants(), and sp_grant_privileges().
00521 { 00522 *to++= PVERSION41_CHAR; 00523 octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE); 00524 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void make_password_from_salt_323 | ( | char * | to, | |
| const unsigned long * | salt | |||
| ) |
Definition at line 277 of file password.c.
Referenced by mysql_show_grants(), and sp_grant_privileges().
00278 { 00279 sprintf(to,"%08lx%08lx", salt[0], salt[1]); 00280 }
Here is the caller graph for this function:

| void make_scrambled_password | ( | char * | to, | |
| const char * | password | |||
| ) |
Definition at line 393 of file password.c.
References mysql_sha1_input(), mysql_sha1_reset(), mysql_sha1_result(), octet2hex(), PVERSION41_CHAR, SHA1_HASH_SIZE, and strlen().
Referenced by Item_func_password::alloc(), execute_commands(), User::set_password(), and Item_func_password::val_str().
00394 { 00395 SHA1_CONTEXT sha1_context; 00396 uint8 hash_stage2[SHA1_HASH_SIZE]; 00397 00398 mysql_sha1_reset(&sha1_context); 00399 /* stage 1: hash password */ 00400 mysql_sha1_input(&sha1_context, (uint8 *) password, (uint) strlen(password)); 00401 mysql_sha1_result(&sha1_context, (uint8 *) to); 00402 /* stage 2: hash stage1 output */ 00403 mysql_sha1_reset(&sha1_context); 00404 mysql_sha1_input(&sha1_context, (uint8 *) to, SHA1_HASH_SIZE); 00405 /* separate buffer is used to pass 'to' in octet2hex */ 00406 mysql_sha1_result(&sha1_context, hash_stage2); 00407 /* convert hash_stage2 to hex string */ 00408 *to++= PVERSION41_CHAR; 00409 octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE); 00410 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void make_scrambled_password_323 | ( | char * | to, | |
| const char * | password | |||
| ) |
Definition at line 146 of file password.c.
References hash_password(), and strlen().
Referenced by Item_func_old_password::alloc(), execute_commands(), and Item_func_old_password::val_str().
00147 { 00148 ulong hash_res[2]; 00149 hash_password(hash_res, password, (uint) strlen(password)); 00150 sprintf(to, "%08lx%08lx", hash_res[0], hash_res[1]); 00151 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int my_connect | ( | my_socket | s, | |
| const struct sockaddr * | name, | |||
| unsigned int | namelen, | |||
| unsigned int | timeout | |||
| ) |
Definition at line 140 of file client.c.
References errno, flags, and wait_for_data().
Referenced by CLI_MYSQL_REAL_CONNECT(), and mysql_manager_connect().
00142 { 00143 #if defined(__WIN__) || defined(__NETWARE__) 00144 return connect(fd, (struct sockaddr*) name, namelen); 00145 #else 00146 int flags, res, s_err; 00147 00148 /* 00149 If they passed us a timeout of zero, we should behave 00150 exactly like the normal connect() call does. 00151 */ 00152 00153 if (timeout == 0) 00154 return connect(fd, (struct sockaddr*) name, namelen); 00155 00156 flags = fcntl(fd, F_GETFL, 0); /* Set socket to not block */ 00157 #ifdef O_NONBLOCK 00158 fcntl(fd, F_SETFL, flags | O_NONBLOCK); /* and save the flags.. */ 00159 #endif 00160 00161 res= connect(fd, (struct sockaddr*) name, namelen); 00162 s_err= errno; /* Save the error... */ 00163 fcntl(fd, F_SETFL, flags); 00164 if ((res != 0) && (s_err != EINPROGRESS)) 00165 { 00166 errno= s_err; /* Restore it */ 00167 return(-1); 00168 } 00169 if (res == 0) /* Connected quickly! */ 00170 return(0); 00171 return wait_for_data(fd, timeout); 00172 #endif 00173 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 117 of file net.c.
References st_net::buff, st_net::buff_end, COMP_HEADER_SIZE, st_net::compress, st_net::compress_pkt_nr, DBUG_ENTER, DBUG_RETURN, st_net::error, FALSE, st_net::fd, st_net::last_errno, st_net::last_error, st_net::max_packet, my_malloc(), my_net_local_init(), MY_WME, MYF, NET_HEADER_SIZE, st_net::no_send_eof, st_net::no_send_error, st_net::no_send_ok, st_net::pkt_nr, st_net::query_cache_query, st_net::read_pos, st_net::reading_or_writing, st_net::remain_in_buf, st_net::report_error, st_net::return_errno, st_net::return_status, TEST_BLOCKING, test_flags, st_net::vio, vio_blocking, vio_fastsend, vio_fd(), st_net::where_b, and st_net::write_pos.
Referenced by bootstrap(), CLI_MYSQL_REAL_CONNECT(), handle_connections_sockets(), Mysql_connection_thread::init(), init_event_thread(), and mysql_manager_connect().
00118 { 00119 DBUG_ENTER("my_net_init"); 00120 my_net_local_init(net); /* Set some limits */ 00121 if (!(net->buff=(uchar*) my_malloc((uint32) net->max_packet+ 00122 NET_HEADER_SIZE + COMP_HEADER_SIZE, 00123 MYF(MY_WME)))) 00124 DBUG_RETURN(1); 00125 net->buff_end=net->buff+net->max_packet; 00126 net->vio = vio; 00127 net->no_send_ok= net->no_send_eof= net->no_send_error= 0; 00128 net->error=0; net->return_errno=0; net->return_status=0; 00129 net->pkt_nr=net->compress_pkt_nr=0; 00130 net->write_pos=net->read_pos = net->buff; 00131 net->last_error[0]=0; 00132 net->compress=0; net->reading_or_writing=0; 00133 net->where_b = net->remain_in_buf=0; 00134 net->last_errno=0; 00135 net->query_cache_query=0; 00136 net->report_error= 0; 00137 00138 if (vio != 0) /* If real connection */ 00139 { 00140 net->fd = vio_fd(vio); /* For perl DBI/DBD */ 00141 #if defined(MYSQL_SERVER) && !defined(__WIN__) 00142 if (!(test_flags & TEST_BLOCKING)) 00143 { 00144 my_bool old_mode; 00145 vio_blocking(vio, FALSE, &old_mode); 00146 } 00147 #endif 00148 vio_fastsend(vio); 00149 } 00150 DBUG_RETURN(0); 00151 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void my_net_local_init | ( | NET * | net | ) |
Definition at line 1518 of file libmysql.c.
References global_system_variables, max, system_variables::max_allowed_packet, st_net::max_packet, st_net::max_packet_size, system_variables::net_buffer_length, system_variables::net_read_timeout, system_variables::net_retry_count, system_variables::net_write_timeout, st_net::read_timeout, st_net::retry_count, and st_net::write_timeout.
Referenced by my_net_init().
01519 { 01520 net->max_packet= (uint) net_buffer_length; 01521 net->read_timeout= (uint) net_read_timeout; 01522 net->write_timeout=(uint) net_write_timeout; 01523 net->retry_count= 1; 01524 net->max_packet_size= max(net_buffer_length, max_allowed_packet); 01525 }
Here is the caller graph for this function:

| unsigned long my_net_read | ( | NET * | net | ) |
Definition at line 969 of file net.c.
References st_net::buf_length, st_net::buff, st_net::compress, ER_NET_UNCOMPRESS_ERROR, st_net::error, st_net::last_errno, MAX_PACKET_LENGTH, memmove, my_real_read(), my_uncompress(), NET_HEADER_SIZE, packet_error, st_net::read_pos, st_net::remain_in_buf, st_net::report_error, st_net::save_char, uint3korr, and st_net::where_b.
Referenced by check_connection(), Mysql_connection_thread::check_connection(), check_user(), cli_safe_read(), do_command(), Mysql_connection_thread::do_command(), Load_log_processor::load_old_format_file(), mysql_manager_connect(), mysql_manager_fetch_line(), and safe_net_read().
00970 { 00971 ulong len,complen; 00972 00973 #ifdef HAVE_COMPRESS 00974 if (!net->compress) 00975 { 00976 #endif 00977 len = my_real_read(net,&complen); 00978 if (len == MAX_PACKET_LENGTH) 00979 { 00980 /* First packet of a multi-packet. Concatenate the packets */ 00981 ulong save_pos = net->where_b; 00982 ulong total_length=0; 00983 do 00984 { 00985 net->where_b += len; 00986 total_length += len; 00987 len = my_real_read(net,&complen); 00988 } while (len == MAX_PACKET_LENGTH); 00989 if (len != packet_error) 00990 len+= total_length; 00991 net->where_b = save_pos; 00992 } 00993 net->read_pos = net->buff + net->where_b; 00994 if (len != packet_error) 00995 net->read_pos[len]=0; /* Safeguard for mysql_use_result */ 00996 return len; 00997 #ifdef HAVE_COMPRESS 00998 } 00999 else 01000 { 01001 /* We are using the compressed protocol */ 01002 01003 ulong buf_length; 01004 ulong start_of_packet; 01005 ulong first_packet_offset; 01006 uint read_length, multi_byte_packet=0; 01007 01008 if (net->remain_in_buf) 01009 { 01010 buf_length= net->buf_length; /* Data left in old packet */ 01011 first_packet_offset= start_of_packet= (net->buf_length - 01012 net->remain_in_buf); 01013 /* Restore the character that was overwritten by the end 0 */ 01014 net->buff[start_of_packet]= net->save_char; 01015 } 01016 else 01017 { 01018 /* reuse buffer, as there is nothing in it that we need */ 01019 buf_length= start_of_packet= first_packet_offset= 0; 01020 } 01021 for (;;) 01022 { 01023 ulong packet_len; 01024 01025 if (buf_length - start_of_packet >= NET_HEADER_SIZE) 01026 { 01027 read_length = uint3korr(net->buff+start_of_packet); 01028 if (!read_length) 01029 { 01030 /* End of multi-byte packet */ 01031 start_of_packet += NET_HEADER_SIZE; 01032 break; 01033 } 01034 if (read_length + NET_HEADER_SIZE <= buf_length - start_of_packet) 01035 { 01036 if (multi_byte_packet) 01037 { 01038 /* Remove packet header for second packet */ 01039 memmove(net->buff + first_packet_offset + start_of_packet, 01040 net->buff + first_packet_offset + start_of_packet + 01041 NET_HEADER_SIZE, 01042 buf_length - start_of_packet); 01043 start_of_packet += read_length; 01044 buf_length -= NET_HEADER_SIZE; 01045 } 01046 else 01047 start_of_packet+= read_length + NET_HEADER_SIZE; 01048 01049 if (read_length != MAX_PACKET_LENGTH) /* last package */ 01050 { 01051 multi_byte_packet= 0; /* No last zero len packet */ 01052 break; 01053 } 01054 multi_byte_packet= NET_HEADER_SIZE; 01055 /* Move data down to read next data packet after current one */ 01056 if (first_packet_offset) 01057 { 01058 memmove(net->buff,net->buff+first_packet_offset, 01059 buf_length-first_packet_offset); 01060 buf_length-=first_packet_offset; 01061 start_of_packet -= first_packet_offset; 01062 first_packet_offset=0; 01063 } 01064 continue; 01065 } 01066 } 01067 /* Move data down to read next data packet after current one */ 01068 if (first_packet_offset) 01069 { 01070 memmove(net->buff,net->buff+first_packet_offset, 01071 buf_length-first_packet_offset); 01072 buf_length-=first_packet_offset; 01073 start_of_packet -= first_packet_offset; 01074 first_packet_offset=0; 01075 } 01076 01077 net->where_b=buf_length; 01078 if ((packet_len = my_real_read(net,&complen)) == packet_error) 01079 return packet_error; 01080 if (my_uncompress((byte*) net->buff + net->where_b, &packet_len, 01081 &complen)) 01082 { 01083 net->error= 2; /* caller will close socket */ 01084 net->report_error= 1; 01085 #ifdef MYSQL_SERVER 01086 net->last_errno=ER_NET_UNCOMPRESS_ERROR; 01087 #endif 01088 return packet_error; 01089 } 01090 buf_length+=packet_len; 01091 } 01092 01093 net->read_pos= net->buff+ first_packet_offset + NET_HEADER_SIZE; 01094 net->buf_length= buf_length; 01095 net->remain_in_buf= (ulong) (buf_length - start_of_packet); 01096 len = ((ulong) (start_of_packet - first_packet_offset) - NET_HEADER_SIZE - 01097 multi_byte_packet); 01098 net->save_char= net->read_pos[len]; /* Must be saved */ 01099 net->read_pos[len]=0; /* Safeguard for mysql_use_result */ 01100 } 01101 #endif /* HAVE_COMPRESS */ 01102 return len; 01103 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 357 of file net.c.
References DBUG_DUMP, int3store, MAX_PACKET_LENGTH, NET_HEADER_SIZE, net_write_buff(), st_net::pkt_nr, test, unlikely, and st_net::vio.
Referenced by CLI_MYSQL_REAL_CONNECT(), cli_read_change_user_result(), dispatch_command(), handle_local_infile(), Load_log_processor::load_old_format_file(), mysql_manager_command(), mysql_manager_connect(), net_send_error(), net_send_error_323(), net_send_ok(), send_eof(), Protocol::send_fields(), send_fields(), send_ok(), send_old_password_request(), send_prep_stmt(), Protocol::write(), Show_instance_log::write_data(), Show_instance_options::write_data(), Show_instance_status::write_data(), Show_instances::write_data(), and write_eof_packet().
00358 { 00359 uchar buff[NET_HEADER_SIZE]; 00360 if (unlikely(!net->vio)) /* nowhere to write */ 00361 return 0; 00362 /* 00363 Big packets are handled by splitting them in packets of MAX_PACKET_LENGTH 00364 length. The last packet is always a packet that is < MAX_PACKET_LENGTH. 00365 (The last packet may even have a length of 0) 00366 */ 00367 while (len >= MAX_PACKET_LENGTH) 00368 { 00369 const ulong z_size = MAX_PACKET_LENGTH; 00370 int3store(buff, z_size); 00371 buff[3]= (uchar) net->pkt_nr++; 00372 if (net_write_buff(net, (char*) buff, NET_HEADER_SIZE) || 00373 net_write_buff(net, packet, z_size)) 00374 return 1; 00375 packet += z_size; 00376 len-= z_size; 00377 } 00378 /* Write last packet */ 00379 int3store(buff,len); 00380 buff[3]= (uchar) net->pkt_nr++; 00381 if (net_write_buff(net,(char*) buff,NET_HEADER_SIZE)) 00382 return 1; 00383 #ifndef DEBUG_DATA_PACKETS 00384 DBUG_DUMP("packet_header",(char*) buff,NET_HEADER_SIZE); 00385 #endif 00386 return test(net_write_buff(net,packet,len)); 00387 }
Here is the call graph for this function:

Here is the caller graph for this function:

| double my_rnd | ( | struct rand_struct * | ) |
Definition at line 100 of file password.c.
References rand_struct::max_value, rand_struct::max_value_dbl, rand_struct::seed1, and rand_struct::seed2.
Referenced by check_scramble_323(), create_random_string(), SQL_CRYPT::crypt_init(), SQL_CRYPT::decode(), SQL_CRYPT::encode(), scramble_323(), set_clock_seq_str(), Item_func_rand::val_real(), and Item_func_uuid::val_str().
00101 { 00102 rand_st->seed1=(rand_st->seed1*3+rand_st->seed2) % rand_st->max_value; 00103 rand_st->seed2=(rand_st->seed1+rand_st->seed2+33) % rand_st->max_value; 00104 return (((double) rand_st->seed1)/rand_st->max_value_dbl); 00105 }
Here is the caller graph for this function:

| void my_thread_end | ( | void | ) |
| my_bool my_thread_init | ( | void | ) |
| const char* mysql_errno_to_sqlstate | ( | unsigned int | mysql_errno | ) |
Definition at line 34 of file sql_state.c.
References array_elements, map, and sqlstate_map.
Referenced by errno_to_sqlstate(), sp_rcontext::find_handler(), net_printf_error(), and net_send_error_packet().
00035 { 00036 uint first=0, end= array_elements(sqlstate_map)-1; 00037 struct st_map_errno_to_sqlstate *map; 00038 00039 /* Do binary search in the sorted array */ 00040 while (first != end) 00041 { 00042 uint mid= (first+end)/2; 00043 map= sqlstate_map+mid; 00044 if (map->mysql_errno < mysql_errno) 00045 first= mid+1; 00046 else 00047 end= mid; 00048 } 00049 map= sqlstate_map+first; 00050 if (map->mysql_errno == mysql_errno) 00051 return map->odbc_state; 00052 return "HY000"; /* General error */ 00053 }
Here is the caller graph for this function:

| void net_clear | ( | NET * | net | ) |
Definition at line 276 of file net.c.
References st_net::buff, st_net::compress_pkt_nr, count, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, st_net::error, FALSE, st_net::max_packet, net_data_is_ready(), st_net::pkt_nr, st_vio::sd, TRUE, st_net::vio, vio_blocking, vio_description(), vio_read, and st_net::write_pos.
Referenced by cli_advanced_command(), cli_stmt_execute(), and safe_query().
00277 { 00278 int count, ready; 00279 DBUG_ENTER("net_clear"); 00280 #if !defined(EMBEDDED_LIBRARY) 00281 while((ready= net_data_is_ready(net->vio->sd)) > 0) 00282 { 00283 /* The socket is ready */ 00284 if ((count= vio_read(net->vio, (char*) (net->buff), 00285 (uint32) net->max_packet)) > 0) 00286 { 00287 DBUG_PRINT("info",("skipped %d bytes from file: %s", 00288 count, vio_description(net->vio))); 00289 #ifdef EXTRA_DEBUG 00290 fprintf(stderr,"skipped %d bytes from file: %s\n", 00291 count, vio_description(net->vio)); 00292 #endif 00293 } 00294 else 00295 { 00296 DBUG_PRINT("info",("socket ready but only EOF to read - disconnected")); 00297 net->error= 2; 00298 break; 00299 } 00300 } 00301 #ifdef NET_DATA_IS_READY_CAN_RETURN_MINUS_ONE 00302 /* 'net_data_is_ready' returned "don't know" */ 00303 if (ready == -1) 00304 { 00305 /* Read unblocking to clear net */ 00306 my_bool old_mode; 00307 if (!vio_blocking(net->vio, FALSE, &old_mode)) 00308 { 00309 while ((count= vio_read(net->vio, (char*) (net->buff), 00310 (uint32) net->max_packet)) > 0) 00311 DBUG_PRINT("info",("skipped %d bytes from file: %s", 00312 count, vio_description(net->vio))); 00313 vio_blocking(net->vio, TRUE, &old_mode); 00314 } 00315 } 00316 #endif 00317 #endif 00318 net->pkt_nr=net->compress_pkt_nr=0; /* Ready for new command */ 00319 net->write_pos=net->buff; 00320 DBUG_VOID_RETURN; 00321 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void net_end | ( | NET * | net | ) |
Definition at line 154 of file net.c.
References st_net::buff, DBUG_ENTER, DBUG_VOID_RETURN, MY_ALLOW_ZERO_PTR, my_free, and MYF.
Referenced by Mysql_connection_thread::cleanup(), end_server(), event_scheduler_thread(), event_worker_thread(), handle_bootstrap(), and mysql_manager_close().
00155 { 00156 DBUG_ENTER("net_end"); 00157 my_free((gptr) net->buff,MYF(MY_ALLOW_ZERO_PTR)); 00158 net->buff=0; 00159 DBUG_VOID_RETURN; 00160 }
Here is the caller graph for this function:

Definition at line 326 of file net.c.
References st_net::buff, st_net::compress, st_net::compress_pkt_nr, DBUG_ENTER, DBUG_RETURN, error, net_real_write(), st_net::pkt_nr, test, and st_net::write_pos.
Referenced by CLI_MYSQL_REAL_CONNECT(), cli_read_change_user_result(), dispatch_command(), Show_instances::execute(), Protocol::flush(), handle_local_infile(), Load_log_processor::load_old_format_file(), mysql_manager_command(), mysql_manager_connect(), mysql_table_dump(), net_send_error(), net_send_error_323(), net_send_ok(), net_write_command(), send_eof(), send_ok(), Show_instance_log_files::send_ok_response(), Show_instance_log::send_ok_response(), Show_instance_options::send_ok_response(), Show_instance_status::send_ok_response(), and send_old_password_request().
00327 { 00328 my_bool error= 0; 00329 DBUG_ENTER("net_flush"); 00330 if (net->buff != net->write_pos) 00331 { 00332 error=test(net_real_write(net,(char*) net->buff, 00333 (ulong) (net->write_pos - net->buff))); 00334 net->write_pos=net->buff; 00335 } 00336 /* Sync packet number if using compression */ 00337 if (net->compress) 00338 net->pkt_nr=net->compress_pkt_nr; 00339 DBUG_RETURN(error); 00340 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int net_real_write | ( | NET * | net, | |
| const char * | packet, | |||
| unsigned long | len | |||
| ) |
Definition at line 542 of file net.c.
References COMP_HEADER_SIZE, st_net::compress, st_net::compress_pkt_nr, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, ER_NET_ERROR_ON_WRITE, ER_NET_WRITE_INTERRUPTED, ER_OUT_OF_RESOURCES, st_net::error, int3store, interrupted, st_net::last_errno, memcpy, my_compress(), my_free, my_malloc(), my_progname, MY_WME, MYF, NET_HEADER_SIZE, pos(), query_cache_insert(), st_net::query_cache_query, st_net::reading_or_writing, st_net::report_error, st_net::retry_count, SOCKET_EINTR, thd_increment_bytes_sent, thr_alarm, thr_alarm_in_use, thr_alarm_init, thr_end_alarm, thr_got_alarm, TRUE, update_statistics, st_net::vio, vio_blocking, vio_errno, vio_is_blocking, vio_should_retry, vio_timeout, vio_write, and st_net::write_timeout.
Referenced by net_flush(), net_printf_error(), and net_write_buff().
00543 { 00544 long int length; 00545 char *pos,*end; 00546 thr_alarm_t alarmed; 00547 #ifndef NO_ALARM 00548 ALARM alarm_buff; 00549 #endif 00550 uint retry_count=0; 00551 my_bool net_blocking = vio_is_blocking(net->vio); 00552 DBUG_ENTER("net_real_write"); 00553 00554 #if defined(MYSQL_SERVER) && defined(HAVE_QUERY_CACHE) \ 00555 && !defined(MYSQL_INSTANCE_MANAGER) 00556 if (net->query_cache_query != 0) 00557 query_cache_insert(net, packet, len); 00558 #endif 00559 00560 if (net->error == 2) 00561 DBUG_RETURN(-1); /* socket can't be used */ 00562 00563 net->reading_or_writing=2; 00564 #ifdef HAVE_COMPRESS 00565 if (net->compress) 00566 { 00567 ulong complen; 00568 uchar *b; 00569 uint header_length=NET_HEADER_SIZE+COMP_HEADER_SIZE; 00570 if (!(b=(uchar*) my_malloc((uint32) len + NET_HEADER_SIZE + 00571 COMP_HEADER_SIZE, MYF(MY_WME)))) 00572 { 00573 #ifdef MYSQL_SERVER 00574 net->last_errno= ER_OUT_OF_RESOURCES; 00575 net->error= 2; 00576 /* TODO is it needed to set this variable if we have no socket */ 00577 net->report_error= 1; 00578 #endif 00579 net->reading_or_writing= 0; 00580 DBUG_RETURN(1); 00581 } 00582 memcpy(b+header_length,packet,len); 00583 00584 if (my_compress((byte*) b+header_length,&len,&complen)) 00585 complen=0; 00586 int3store(&b[NET_HEADER_SIZE],complen); 00587 int3store(b,len); 00588 b[3]=(uchar) (net->compress_pkt_nr++); 00589 len+= header_length; 00590 packet= (char*) b; 00591 } 00592 #endif /* HAVE_COMPRESS */ 00593 00594 /* DBUG_DUMP("net",packet,len); */ 00595 #ifndef NO_ALARM 00596 thr_alarm_init(&alarmed); 00597 if (net_blocking) 00598 thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff); 00599 #else 00600 alarmed=0; 00601 vio_timeout(net->vio, 1, net->write_timeout); 00602 #endif /* NO_ALARM */ 00603 00604 pos=(char*) packet; end=pos+len; 00605 while (pos != end) 00606 { 00607 if ((long) (length=vio_write(net->vio,pos,(uint32) (end-pos))) <= 0) 00608 { 00609 my_bool interrupted = vio_should_retry(net->vio); 00610 #if !defined(__WIN__) 00611 if ((interrupted || length==0) && !thr_alarm_in_use(&alarmed)) 00612 { 00613 if (!thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff)) 00614 { /* Always true for client */ 00615 my_bool old_mode; 00616 while (vio_blocking(net->vio, TRUE, &old_mode) < 0) 00617 { 00618 if (vio_should_retry(net->vio) && retry_count++ < net->retry_count) 00619 continue; 00620 #ifdef EXTRA_DEBUG 00621 fprintf(stderr, 00622 "%s: my_net_write: fcntl returned error %d, aborting thread\n", 00623 my_progname,vio_errno(net->vio)); 00624 #endif /* EXTRA_DEBUG */ 00625 #ifdef MYSQL_SERVER 00626 net->last_errno= ER_NET_ERROR_ON_WRITE; 00627 #endif 00628 net->error= 2; /* Close socket */ 00629 net->report_error= 1; 00630 goto end; 00631 } 00632 retry_count=0; 00633 continue; 00634 } 00635 } 00636 else 00637 #endif /* !defined(__WIN__) */ 00638 if (thr_alarm_in_use(&alarmed) && !thr_got_alarm(&alarmed) && 00639 interrupted) 00640 { 00641 if (retry_count++ < net->retry_count) 00642 continue; 00643 #ifdef EXTRA_DEBUG 00644 fprintf(stderr, "%s: write looped, aborting thread\n", 00645 my_progname); 00646 #endif /* EXTRA_DEBUG */ 00647 } 00648 #if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER) 00649 if (vio_errno(net->vio) == SOCKET_EINTR) 00650 { 00651 DBUG_PRINT("warning",("Interrupted write. Retrying...")); 00652 continue; 00653 } 00654 #endif /* defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER) */ 00655 net->error= 2; /* Close socket */ 00656 net->report_error= 1; 00657 #ifdef MYSQL_SERVER 00658 net->last_errno= (interrupted ? ER_NET_WRITE_INTERRUPTED : 00659 ER_NET_ERROR_ON_WRITE); 00660 #endif /* MYSQL_SERVER */ 00661 break; 00662 } 00663 pos+=length; 00664 update_statistics(thd_increment_bytes_sent(length)); 00665 } 00666 #ifndef __WIN__ 00667 end: 00668 #endif 00669 #ifdef HAVE_COMPRESS 00670 if (net->compress) 00671 my_free((char*) packet,MYF(0)); 00672 #endif 00673 if (thr_alarm_in_use(&alarmed)) 00674 { 00675 my_bool old_mode; 00676 thr_end_alarm(&alarmed); 00677 vio_blocking(net->vio, net_blocking, &old_mode); 00678 } 00679 net->reading_or_writing=0; 00680 DBUG_RETURN(((int) (pos != end))); 00681 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 165 of file net.c.
References st_net::buff, st_net::buff_end, COMP_HEADER_SIZE, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, ER_NET_PACKET_TOO_LARGE, ER_OUT_OF_RESOURCES, st_net::error, IO_SIZE, st_net::last_errno, st_net::max_packet, st_net::max_packet_size, my_realloc(), MY_WME, MYF, NET_HEADER_SIZE, st_net::report_error, and st_net::write_pos.
Referenced by handle_bootstrap(), and my_realloc_str().
00166 { 00167 uchar *buff; 00168 ulong pkt_length; 00169 DBUG_ENTER("net_realloc"); 00170 DBUG_PRINT("enter",("length: %lu", length)); 00171 00172 if (length >= net->max_packet_size) 00173 { 00174 DBUG_PRINT("error", ("Packet too large. Max size: %lu", 00175 net->max_packet_size)); 00176 net->error= 1; 00177 net->report_error= 1; 00178 net->last_errno= ER_NET_PACKET_TOO_LARGE; 00179 DBUG_RETURN(1); 00180 } 00181 pkt_length = (length+IO_SIZE-1) & ~(IO_SIZE-1); 00182 /* 00183 We must allocate some extra bytes for the end 0 and to be able to 00184 read big compressed blocks 00185 */ 00186 if (!(buff=(uchar*) my_realloc((char*) net->buff, (uint32) pkt_length + 00187 NET_HEADER_SIZE + COMP_HEADER_SIZE, 00188 MYF(MY_WME)))) 00189 { 00190 net->error= 1; 00191 net->report_error= 1; 00192 net->last_errno= ER_OUT_OF_RESOURCES; 00193 DBUG_RETURN(1); 00194 } 00195 net->buff=net->write_pos=buff; 00196 net->buff_end=buff+(net->max_packet=pkt_length); 00197 DBUG_RETURN(0); 00198 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_bool net_write_command | ( | NET * | net, | |
| unsigned char | command, | |||
| const char * | header, | |||
| unsigned long | head_len, | |||
| const char * | packet, | |||
| unsigned long | len | |||
| ) |
Definition at line 418 of file net.c.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, int3store, MAX_PACKET_LENGTH, net_flush(), NET_HEADER_SIZE, net_write_buff(), st_net::pkt_nr, and test.
Referenced by check_connection(), Mysql_connection_thread::check_connection(), cli_advanced_command(), net_send_error_packet(), and safe_query().
00421 { 00422 ulong length=len+1+head_len; /* 1 extra byte for command */ 00423 uchar buff[NET_HEADER_SIZE+1]; 00424 uint header_size=NET_HEADER_SIZE+1; 00425 DBUG_ENTER("net_write_command"); 00426 DBUG_PRINT("enter",("length: %lu", len)); 00427 00428 buff[4]=command; /* For first packet */ 00429 00430 if (length >= MAX_PACKET_LENGTH) 00431 { 00432 /* Take into account that we have the command in the first header */ 00433 len= MAX_PACKET_LENGTH - 1 - head_len; 00434 do 00435 { 00436 int3store(buff, MAX_PACKET_LENGTH); 00437 buff[3]= (uchar) net->pkt_nr++; 00438 if (net_write_buff(net,(char*) buff, header_size) || 00439 net_write_buff(net, header, head_len) || 00440 net_write_buff(net, packet, len)) 00441 DBUG_RETURN(1); 00442 packet+= len; 00443 length-= MAX_PACKET_LENGTH; 00444 len= MAX_PACKET_LENGTH; 00445 head_len= 0; 00446 header_size= NET_HEADER_SIZE; 00447 } while (length >= MAX_PACKET_LENGTH); 00448 len=length; /* Data left to be written */ 00449 } 00450 int3store(buff,length); 00451 buff[3]= (uchar) net->pkt_nr++; 00452 DBUG_RETURN(test(net_write_buff(net, (char*) buff, header_size) || 00453 (head_len && net_write_buff(net, (char*) header, head_len)) || 00454 net_write_buff(net, packet, len) || net_flush(net))); 00455 }
Here is the call graph for this function:

Here is the caller graph for this function:

| char* octet2hex | ( | char * | to, | |
| const char * | str, | |||
| unsigned int | len | |||
| ) |
Definition at line 324 of file password.c.
References _dig_vec_upper.
Referenced by Item_str_func::check_well_formed_result(), make_password_from_salt(), make_scrambled_password(), pack_header(), str_to_hex(), and Item_func_hex::val_str().
00325 { 00326 const char *str_end= str + len; 00327 for (; str != str_end; ++str) 00328 { 00329 *to++= _dig_vec_upper[((uchar) *str) >> 4]; 00330 *to++= _dig_vec_upper[((uchar) *str) & 0x0F]; 00331 } 00332 *to= '\0'; 00333 return to; 00334 }
Here is the caller graph for this function:

| void randominit | ( | struct rand_struct * | , | |
| unsigned long | seed1, | |||
| unsigned long | seed2 | |||
| ) |
Definition at line 79 of file password.c.
References bzero.
Referenced by check_scramble_323(), SQL_CRYPT::crypt_init(), execute_commands(), Item_func_rand::fix_fields(), Mysql_connection_thread::init(), init_server_components(), scramble_323(), and Item_func_uuid::val_str().
00080 { /* For mysql 3.21.# */ 00081 #ifdef HAVE_purify 00082 bzero((char*) rand_st,sizeof(*rand_st)); /* Avoid UMC varnings */ 00083 #endif 00084 rand_st->max_value= 0x3FFFFFFFL; 00085 rand_st->max_value_dbl=(double) rand_st->max_value; 00086 rand_st->seed1=seed1%rand_st->max_value ; 00087 rand_st->seed2=seed2%rand_st->max_value; 00088 }
Here is the caller graph for this function:

| void scramble | ( | char * | to, | |
| const char * | message, | |||
| const char * | password | |||
| ) |
Definition at line 431 of file password.c.
References my_crypt(), mysql_sha1_input(), mysql_sha1_reset(), mysql_sha1_result(), SCRAMBLE_LENGTH, SHA1_HASH_SIZE, and strlen().
Referenced by CLI_MYSQL_REAL_CONNECT(), and mysql_change_user().
00432 { 00433 SHA1_CONTEXT sha1_context; 00434 uint8 hash_stage1[SHA1_HASH_SIZE]; 00435 uint8 hash_stage2[SHA1_HASH_SIZE]; 00436 00437 mysql_sha1_reset(&sha1_context); 00438 /* stage 1: hash password */ 00439 mysql_sha1_input(&sha1_context, (uint8 *) password, (uint) strlen(password)); 00440 mysql_sha1_result(&sha1_context, hash_stage1); 00441 /* stage 2: hash stage 1; note that hash_stage2 is stored in the database */ 00442 mysql_sha1_reset(&sha1_context); 00443 mysql_sha1_input(&sha1_context, hash_stage1, SHA1_HASH_SIZE); 00444 mysql_sha1_result(&sha1_context, hash_stage2); 00445 /* create crypt string as sha1(message, hash_stage2) */; 00446 mysql_sha1_reset(&sha1_context); 00447 mysql_sha1_input(&sha1_context, (const uint8 *) message, SCRAMBLE_LENGTH); 00448 mysql_sha1_input(&sha1_context, hash_stage2, SHA1_HASH_SIZE); 00449 /* xor allows 'from' and 'to' overlap: lets take advantage of it */ 00450 mysql_sha1_result(&sha1_context, (uint8 *) to); 00451 my_crypt(to, (const uchar *) to, hash_stage1, SCRAMBLE_LENGTH); 00452 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void scramble_323 | ( | char * | to, | |
| const char * | message, | |||
| const char * | password | |||
| ) |
Definition at line 166 of file password.c.
References hash_password(), my_rnd(), randominit(), SCRAMBLE_LENGTH_323, and strlen().
Referenced by CLI_MYSQL_REAL_CONNECT(), cli_read_change_user_result(), and mysql_change_user().
00167 { 00168 struct rand_struct rand_st; 00169 ulong hash_pass[2], hash_message[2]; 00170 00171 if (password && password[0]) 00172 { 00173 char extra, *to_start=to; 00174 const char *message_end= message + SCRAMBLE_LENGTH_323; 00175 hash_password(hash_pass,password, (uint) strlen(password)); 00176 hash_password(hash_message, message, SCRAMBLE_LENGTH_323); 00177 randominit(&rand_st,hash_pass[0] ^ hash_message[0], 00178 hash_pass[1] ^ hash_message[1]); 00179 for (; message < message_end; message++) 00180 *to++= (char) (floor(my_rnd(&rand_st)*31)+64); 00181 extra=(char) (floor(my_rnd(&rand_st)*31)); 00182 while (to_start != to) 00183 *(to_start++)^=extra; 00184 } 00185 *to= 0; 00186 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.4.7

