From: Date: January 11 2007 4:46pm Subject: bk commit into 5.0 tree (cmiller:1.2327) BUG#24795 List-Archive: http://lists.mysql.com/commits/17955 X-Bug: 24795 Message-Id: <20070111154613.A636283049@zippy> Below is the list of changes that have just been committed into a local 5.0 repository of cmiller. When cmiller does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-01-11 10:46:07-05:00, cmiller@stripped +14 -0 Reverting most of patch! Bug#24795: Add SHOW PROFILE This code is not complete. I'm removing the guts, and leaving only the macro that sets the THD proc_info patch. That part will be useful scaffolding for adding profiling (and other things) later. Jeremy Cole will continue to work on SHOW PROFILE and submit a patch later that is complete. BitKeeper/deleted/.del-profile.result@stripped, 2007-01-11 09:50:04-05:00, cmiller@stripped +0 -0 Delete: mysql-test/r/profile.result BitKeeper/deleted/.del-profile.test@stripped, 2007-01-11 09:49:59-05:00, cmiller@stripped +0 -0 Delete: mysql-test/t/profile.test BitKeeper/deleted/.del-sql_profile.cc@stripped, 2007-01-11 09:49:44-05:00, cmiller@stripped +0 -0 Delete: sql/sql_profile.cc BitKeeper/deleted/.del-sql_profile.h@stripped, 2007-01-11 09:49:42-05:00, cmiller@stripped +0 -0 Delete: sql/sql_profile.h libmysqld/Makefile.am@stripped, 2007-01-11 10:46:05-05:00, cmiller@stripped +0 -1 Reverted profiling code. sql/Makefile.am@stripped, 2007-01-11 10:46:05-05:00, cmiller@stripped +0 -2 Reverted profiling code. sql/lex.h@stripped, 2007-01-11 10:46:05-05:00, cmiller@stripped +0 -13 Reverted profiling code. sql/mysql_priv.h@stripped, 2007-01-11 10:46:05-05:00, cmiller@stripped +0 -4 Reverted profiling code. sql/sql_class.cc@stripped, 2007-01-11 10:46:05-05:00, cmiller@stripped +0 -2 Reverted profiling code. proc_info macro remains. sql/sql_class.h@stripped, 2007-01-11 10:46:05-05:00, cmiller@stripped +6 -3 Reverted profiling code. proc_info macro remains. sql/sql_lex.cc@stripped, 2007-01-11 10:46:05-05:00, cmiller@stripped +0 -1 Reverted profiling code. proc_info macro remains. sql/sql_lex.h@stripped, 2007-01-11 10:46:05-05:00, cmiller@stripped +0 -3 Reverted profiling code. proc_info macro remains. sql/sql_parse.cc@stripped, 2007-01-11 10:46:05-05:00, cmiller@stripped +0 -15 Reverted profiling code. proc_info macro remains. sql/sql_yacc.yy@stripped, 2007-01-11 10:46:05-05:00, cmiller@stripped +1 -73 Reverted profiling code. proc_info macro remains. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: cmiller # Host: zippy.cornsilk.net # Root: /home/cmiller/work/mysql/mysql-5.0-community--bug24795 --- 1.129/sql/Makefile.am 2007-01-11 10:46:12 -05:00 +++ 1.130/sql/Makefile.am 2007-01-11 10:46:12 -05:00 @@ -52,7 +52,6 @@ noinst_HEADERS = item.h item_func.h item procedure.h sql_class.h sql_lex.h sql_list.h \ sql_manager.h sql_map.h sql_string.h unireg.h \ sql_error.h field.h handler.h mysqld_suffix.h \ - sql_profile.h \ ha_myisammrg.h\ ha_heap.h ha_myisam.h ha_berkeley.h ha_innodb.h \ ha_ndbcluster.h opt_range.h protocol.h \ @@ -81,7 +80,6 @@ mysqld_SOURCES = sql_lex.cc sql_handler. set_var.cc sql_parse.cc sql_yacc.yy \ sql_base.cc table.cc sql_select.cc sql_insert.cc \ sql_prepare.cc sql_error.cc sql_locale.cc \ - sql_profile.cc \ sql_update.cc sql_delete.cc uniques.cc sql_do.cc \ procedure.cc item_uniq.cc sql_test.cc \ log.cc log_event.cc init.cc derror.cc sql_acl.cc \ --- 1.145/sql/lex.h 2007-01-11 10:46:12 -05:00 +++ 1.146/sql/lex.h 2007-01-11 10:46:12 -05:00 @@ -88,7 +88,6 @@ static SYMBOL symbols[] = { { "BINLOG", SYM(BINLOG_SYM)}, { "BIT", SYM(BIT_SYM)}, { "BLOB", SYM(BLOB_SYM)}, - { "BLOCK", SYM(BLOCK_SYM)}, { "BOOL", SYM(BOOL_SYM)}, { "BOOLEAN", SYM(BOOLEAN_SYM)}, { "BOTH", SYM(BOTH)}, @@ -127,10 +126,8 @@ static SYMBOL symbols[] = { { "CONSISTENT", SYM(CONSISTENT_SYM)}, { "CONSTRAINT", SYM(CONSTRAINT)}, { "CONTAINS", SYM(CONTAINS_SYM)}, - { "CONTEXT", SYM(CONTEXT_SYM)}, { "CONTINUE", SYM(CONTINUE_SYM)}, { "CONVERT", SYM(CONVERT_SYM)}, - { "CPU", SYM(CPU_SYM)}, { "CREATE", SYM(CREATE)}, { "CROSS", SYM(CROSS)}, { "CUBE", SYM(CUBE_SYM)}, @@ -196,7 +193,6 @@ static SYMBOL symbols[] = { { "EXTENDED", SYM(EXTENDED_SYM)}, { "FALSE", SYM(FALSE_SYM)}, { "FAST", SYM(FAST_SYM)}, - { "FAULTS", SYM(FAULTS_SYM)}, { "FETCH", SYM(FETCH_SYM)}, { "FIELDS", SYM(COLUMNS)}, { "FILE", SYM(FILE_SYM)}, @@ -256,9 +252,7 @@ static SYMBOL symbols[] = { { "INTEGER", SYM(INT_SYM)}, { "INTERVAL", SYM(INTERVAL_SYM)}, { "INTO", SYM(INTO)}, - { "IO", SYM(IO_SYM)}, { "IO_THREAD", SYM(RELAY_THREAD)}, - { "IPC", SYM(IPC_SYM)}, { "IS", SYM(IS)}, { "ISOLATION", SYM(ISOLATION)}, { "ISSUER", SYM(ISSUER_SYM)}, @@ -316,7 +310,6 @@ static SYMBOL symbols[] = { { "MEDIUMBLOB", SYM(MEDIUMBLOB)}, { "MEDIUMINT", SYM(MEDIUMINT)}, { "MEDIUMTEXT", SYM(MEDIUMTEXT)}, - { "MEMORY", SYM(MEMORY_SYM)}, { "MERGE", SYM(MERGE_SYM)}, { "MICROSECOND", SYM(MICROSECOND_SYM)}, { "MIDDLEINT", SYM(MEDIUMINT)}, /* For powerbuilder */ @@ -364,7 +357,6 @@ static SYMBOL symbols[] = { { "OUT", SYM(OUT_SYM)}, { "OUTER", SYM(OUTER)}, { "OUTFILE", SYM(OUTFILE)}, - { "PAGE", SYM(PAGE_SYM)}, { "PACK_KEYS", SYM(PACK_KEYS_SYM)}, { "PARTIAL", SYM(PARTIAL)}, { "PASSWORD", SYM(PASSWORD)}, @@ -379,8 +371,6 @@ static SYMBOL symbols[] = { { "PROCEDURE", SYM(PROCEDURE)}, { "PROCESS" , SYM(PROCESS)}, { "PROCESSLIST", SYM(PROCESSLIST_SYM)}, - { "PROFILE", SYM(PROFILE_SYM)}, - { "PROFILES", SYM(PROFILES_SYM)}, { "PURGE", SYM(PURGE)}, { "QUARTER", SYM(QUARTER_SYM)}, { "QUERY", SYM(QUERY_SYM)}, @@ -448,7 +438,6 @@ static SYMBOL symbols[] = { { "SOME", SYM(ANY_SYM)}, { "SONAME", SYM(UDF_SONAME_SYM)}, { "SOUNDS", SYM(SOUNDS_SYM)}, - { "SOURCE", SYM(SOURCE_SYM)}, { "SPATIAL", SYM(SPATIAL_SYM)}, { "SPECIFIC", SYM(SPECIFIC_SYM)}, { "SQL", SYM(SQL_SYM)}, @@ -483,8 +472,6 @@ static SYMBOL symbols[] = { { "SUBJECT", SYM(SUBJECT_SYM)}, { "SUPER", SYM(SUPER_SYM)}, { "SUSPEND", SYM(SUSPEND_SYM)}, - { "SWAPS", SYM(SWAPS_SYM)}, - { "SWITCHES", SYM(SWITCHES_SYM)}, { "TABLE", SYM(TABLE_SYM)}, { "TABLES", SYM(TABLES)}, { "TABLESPACE", SYM(TABLESPACE)}, --- 1.425/sql/mysql_priv.h 2007-01-11 10:46:12 -05:00 +++ 1.426/sql/mysql_priv.h 2007-01-11 10:46:12 -05:00 @@ -174,8 +174,6 @@ MY_LOCALE *my_locale_by_name(const char #define BDB_LOG_ALLOC_BLOCK_SIZE 1024 #define WARN_ALLOC_BLOCK_SIZE 2048 #define WARN_ALLOC_PREALLOC_SIZE 1024 -#define PROFILE_ALLOC_BLOCK_SIZE 2048 -#define PROFILE_ALLOC_PREALLOC_SIZE 1024 /* The following parameters is to decide when to use an extra cache to @@ -544,8 +542,6 @@ typedef my_bool (*qc_engine_callback)(TH #include "field.h" /* Field definitions */ #include "protocol.h" #include "sql_udf.h" -#include "sql_profile.h" - class user_var_entry; class Security_context; enum enum_var_type --- 1.255/sql/sql_class.cc 2007-01-11 10:46:12 -05:00 +++ 1.256/sql/sql_class.cc 2007-01-11 10:46:12 -05:00 @@ -248,7 +248,6 @@ THD::THD() init(); /* Initialize sub structures */ init_sql_alloc(&warn_root, WARN_ALLOC_BLOCK_SIZE, WARN_ALLOC_PREALLOC_SIZE); - profiling.set_thd(this); user_connect=(USER_CONN *)0; hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0, (hash_get_key) get_var_key, @@ -331,7 +330,6 @@ void THD::init_for_queries() variables.trans_alloc_block_size, variables.trans_prealloc_size); #endif - profiling.reset(); transaction.xid_state.xid.null(); transaction.xid_state.in_thd=1; } --- 1.313/sql/sql_class.h 2007-01-11 10:46:12 -05:00 +++ 1.314/sql/sql_class.h 2007-01-11 10:46:12 -05:00 @@ -1073,6 +1073,9 @@ public: }; + +#define THD_PROC_INFO(thd, msg) do { (thd)->proc_info= (msg); } while (0) + /* For each client connection we create a separate thread with THD serving as a thread/connection descriptor @@ -1155,6 +1158,9 @@ public: Points to info-string that we show in SHOW PROCESSLIST You are supposed to update thd->proc_info only if you have coded a time-consuming piece that MySQL can get stuck in for a long time. + + Set it using the THD_PROC_INFO(THD *thread, const char *message) + macro. */ const char *proc_info; @@ -1309,9 +1315,6 @@ public: List warn_list; uint warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_END]; uint total_warn_count; - - PROFILING profiling; - /* Id of current query. Statement can be reused to execute several queries query_id is global in context of the whole MySQL server. --- 1.207/sql/sql_lex.cc 2007-01-11 10:46:12 -05:00 +++ 1.208/sql/sql_lex.cc 2007-01-11 10:46:12 -05:00 @@ -174,7 +174,6 @@ void lex_start(THD *thd, uchar *buf,uint lex->proc_list.first= 0; lex->escape_used= FALSE; lex->reset_query_tables_list(FALSE); - lex->profile_options= PROFILE_NONE; lex->nest_level=0 ; lex->allow_sum_func= 0; --- 1.234/sql/sql_lex.h 2007-01-11 10:46:12 -05:00 +++ 1.235/sql/sql_lex.h 2007-01-11 10:46:12 -05:00 @@ -95,7 +95,6 @@ enum enum_sql_command { SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE, SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER, SQLCOM_SHOW_PROC_CODE, SQLCOM_SHOW_FUNC_CODE, - SQLCOM_SHOW_PROFILE, SQLCOM_SHOW_PROFILES, /* This should be the last !!! */ SQLCOM_END @@ -941,8 +940,6 @@ typedef struct st_lex : public Query_tab enum enum_var_type option_type; enum enum_view_create_mode create_view_mode; enum enum_drop_mode drop_mode; - uint profile_options; - uint profile_query_id; uint uint_geom_type; uint grant, grant_tot_col, which_columns; uint fk_delete_opt, fk_update_opt, fk_match_option; --- 1.592/sql/sql_parse.cc 2007-01-11 10:46:12 -05:00 +++ 1.593/sql/sql_parse.cc 2007-01-11 10:46:13 -05:00 @@ -2696,20 +2696,6 @@ mysql_execute_command(THD *thd) (1L << (uint) MYSQL_ERROR::WARN_LEVEL_ERROR)); break; } - case SQLCOM_SHOW_PROFILES: - { - thd->profiling.store(); - thd->profiling.discard(); - res= thd->profiling.show_profiles(); - break; - } - case SQLCOM_SHOW_PROFILE: - { - thd->profiling.store(); - thd->profiling.discard(); // will get re-enabled by reset() - res= thd->profiling.show_last(lex->profile_options); - break; - } case SQLCOM_SHOW_NEW_MASTER: { if (check_global_access(thd, REPL_SLAVE_ACL)) @@ -5645,7 +5631,6 @@ void mysql_reset_thd_for_next_command(TH thd->total_warn_count=0; // Warnings for this query thd->rand_used= 0; thd->sent_row_count= thd->examined_row_count= 0; - thd->profiling.reset(); } DBUG_VOID_RETURN; } --- 1.499/sql/sql_yacc.yy 2007-01-11 10:46:13 -05:00 +++ 1.500/sql/sql_yacc.yy 2007-01-11 10:46:13 -05:00 @@ -181,7 +181,6 @@ bool my_yyoverflow(short **a, YYSTYPE ** %token BIT_SYM %token BIT_XOR %token BLOB_SYM -%token BLOCK_SYM %token BOOLEAN_SYM %token BOOL_SYM %token BOTH @@ -222,12 +221,10 @@ bool my_yyoverflow(short **a, YYSTYPE ** %token CONSISTENT_SYM %token CONSTRAINT %token CONTAINS_SYM -%token CONTEXT_SYM %token CONTINUE_SYM %token CONVERT_SYM %token CONVERT_TZ_SYM %token COUNT_SYM -%token CPU_SYM %token CREATE %token CROSS %token CUBE_SYM @@ -301,7 +298,6 @@ bool my_yyoverflow(short **a, YYSTYPE ** %token EXTRACT_SYM %token FALSE_SYM %token FAST_SYM -%token FAULTS_SYM %token FETCH_SYM %token FIELD_FUNC %token FILE_SYM @@ -371,8 +367,6 @@ bool my_yyoverflow(short **a, YYSTYPE ** %token INT_SYM %token INVOKER_SYM %token IN_SYM -%token IO_SYM -%token IPC_SYM %token IS %token ISOLATION %token ISSUER_SYM @@ -441,7 +435,6 @@ bool my_yyoverflow(short **a, YYSTYPE ** %token MEDIUMINT %token MEDIUMTEXT %token MEDIUM_SYM -%token MEMORY_SYM %token MERGE_SYM %token MICROSECOND_SYM %token MIGRATE_SYM @@ -500,7 +493,6 @@ bool my_yyoverflow(short **a, YYSTYPE ** %token OUTFILE %token OUT_SYM %token PACK_KEYS_SYM -%token PAGE_SYM %token PARTIAL %token PASSWORD %token PARAM_MARKER @@ -518,8 +510,6 @@ bool my_yyoverflow(short **a, YYSTYPE ** %token PROCEDURE %token PROCESS %token PROCESSLIST_SYM -%token PROFILE_SYM -%token PROFILES_SYM %token PURGE %token QUARTER_SYM %token QUERY_SYM @@ -590,7 +580,6 @@ bool my_yyoverflow(short **a, YYSTYPE ** %token SMALLINT %token SNAPSHOT_SYM %token SOUNDS_SYM -%token SOURCE_SYM %token SPATIAL_SYM %token SPECIFIC_SYM %token SQLEXCEPTION_SYM @@ -621,8 +610,6 @@ bool my_yyoverflow(short **a, YYSTYPE ** %token SUM_SYM %token SUPER_SYM %token SUSPEND_SYM -%token SWAPS_SYM -%token SWITCHES_SYM %token SYSDATE %token TABLES %token TABLESPACE @@ -748,7 +735,7 @@ bool my_yyoverflow(short **a, YYSTYPE ** union_opt select_derived_init option_type2 %type - ulong_num raid_types merge_insert_types opt_profile_query_arg + ulong_num raid_types merge_insert_types %type ulonglong_num @@ -6485,48 +6472,6 @@ opt_table_sym: /* empty */ | TABLE_SYM; -opt_profile_defs: - /* empty */ - | profile_defs - -profile_defs: - profile_def - | profile_defs ',' profile_def - -profile_def: - CPU_SYM - { Lex->profile_options|= PROFILE_CPU; } - | MEMORY_SYM - { Lex->profile_options|= PROFILE_MEMORY; } - | BLOCK_SYM IO_SYM - { Lex->profile_options|= PROFILE_BLOCK_IO; } - | CONTEXT_SYM SWITCHES_SYM - { Lex->profile_options|= PROFILE_CONTEXT; } - | PAGE_SYM FAULTS_SYM - { Lex->profile_options|= PROFILE_PAGE_FAULTS; } - | IPC_SYM - { Lex->profile_options|= PROFILE_IPC; } - | SWAPS_SYM - { Lex->profile_options|= PROFILE_SWAPS; } - | SOURCE_SYM - { Lex->profile_options|= PROFILE_SOURCE; } - | ALL - { Lex->profile_options|= PROFILE_ALL; } - ; - -opt_profile_query_arg: - /* empty */ - { $$= 0; } - | QUERY_SYM NUM - { $$= atoi($2.str); } - ; - -opt_profile_args: - /* empty */ - | FOR_SYM opt_profile_query_arg - { Lex->profile_query_id = $2; } - ; - /* Show things */ show: SHOW @@ -6662,10 +6607,6 @@ show_param: { Lex->sql_command = SQLCOM_SHOW_WARNS;} | ERRORS opt_limit_clause_init { Lex->sql_command = SQLCOM_SHOW_ERRORS;} - | PROFILES_SYM - { Lex->sql_command = SQLCOM_SHOW_PROFILES; } - | PROFILE_SYM opt_profile_defs opt_profile_args opt_limit_clause_init - { Lex->sql_command = SQLCOM_SHOW_PROFILE; } | opt_var_type STATUS_SYM wild_and_where { LEX *lex= Lex; @@ -7757,7 +7698,6 @@ keyword_sp: | BERKELEY_DB_SYM {} | BINLOG_SYM {} | BIT_SYM {} - | BLOCK_SYM {} | BOOL_SYM {} | BOOLEAN_SYM {} | BTREE_SYM {} @@ -7774,8 +7714,6 @@ keyword_sp: | COMPRESSED_SYM {} | CONCURRENT {} | CONSISTENT_SYM {} - | CONTEXT_SYM {} - | CPU_SYM {} | CUBE_SYM {} | DATA_SYM {} | DATETIME {} @@ -7798,7 +7736,6 @@ keyword_sp: | EXPANSION_SYM {} | EXTENDED_SYM {} | FAST_SYM {} - | FAULTS_SYM {} | FOUND_SYM {} | DISABLE_SYM {} | ENABLE_SYM {} @@ -7823,8 +7760,6 @@ keyword_sp: | ISSUER_SYM {} | INNOBASE_SYM {} | INSERT_METHOD {} - | IO_SYM {} - | IPC_SYM {} | RELAY_THREAD {} | LAST_SYM {} | LEAVES {} @@ -7854,7 +7789,6 @@ keyword_sp: | MAX_UPDATES_PER_HOUR {} | MAX_USER_CONNECTIONS_SYM {} | MEDIUM_SYM {} - | MEMORY_SYM {} | MERGE_SYM {} | MICROSECOND_SYM {} | MIGRATE_SYM {} @@ -7881,7 +7815,6 @@ keyword_sp: | ONE_SHOT_SYM {} | ONE_SYM {} | PACK_KEYS_SYM {} - | PAGE_SYM {} | PARTIAL {} | PASSWORD {} | PHASE_SYM {} @@ -7891,8 +7824,6 @@ keyword_sp: | PRIVILEGES {} | PROCESS {} | PROCESSLIST_SYM {} - | PROFILE_SYM {} - | PROFILES_SYM {} | QUARTER_SYM {} | QUERY_SYM {} | QUICK {} @@ -7926,7 +7857,6 @@ keyword_sp: | SHUTDOWN {} | SNAPSHOT_SYM {} | SOUNDS_SYM {} - | SOURCE_SYM {} | SQL_CACHE_SYM {} | SQL_BUFFER_RESULT {} | SQL_NO_CACHE_SYM {} @@ -7938,8 +7868,6 @@ keyword_sp: | SUBJECT_SYM {} | SUPER_SYM {} | SUSPEND_SYM {} - | SWAPS_SYM {} - | SWITCHES_SYM {} | TABLES {} | TABLESPACE {} | TEMPORARY {} --- 1.71/libmysqld/Makefile.am 2007-01-11 10:46:13 -05:00 +++ 1.72/libmysqld/Makefile.am 2007-01-11 10:46:13 -05:00 @@ -53,7 +53,6 @@ sqlsources = derror.cc field.cc field_co protocol.cc net_serv.cc opt_range.cc \ opt_sum.cc procedure.cc records.cc sql_acl.cc \ sql_load.cc discover.cc sql_locale.cc \ - sql_profile.cc \ sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \ sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \ sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc sql_parse.cc \