From: Marc Alff Date: March 19 2012 2:41pm Subject: bzr push into mysql-trunk-pfs-tuning branch (marc.alff:3478 to 3479) List-Archive: http://lists.mysql.com/commits/143240 Message-Id: <201203191441.q2JEfPAx026461@acsmt357.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3479 Marc Alff 2012-03-19 [merge] Merge mysql-trunk --> mysql-trunk-pfs-tuning removed: mysql-test/suite/sys_vars/r/pfs_digests_size.result mysql-test/suite/sys_vars/t/pfs_digests_size-master_basic.opt added: mysql-test/r/bug12969156.result mysql-test/suite/sys_vars/r/pfs_digests_size_basic.result mysql-test/suite/sys_vars/t/pfs_digests_size_basic-master.opt mysql-test/t/bug12969156-master.opt mysql-test/t/bug12969156.test modified: .bzrignore plugin/daemon_example/daemon_example.cc sql/opt_explain_json.cc sql/opt_range.cc sql/opt_trace_context.h sql/sys_vars.cc unittest/gunit/opt_range-t.cc 3478 Marc Alff 2012-03-19 [merge] Merge mysql-trunk --> mysql-trunk-pfs-tuning modified: BUILD/compile-dist mysql-test/r/innodb_mysql_lock.result mysql-test/suite/innodb/r/innodb-system-table-view.result mysql-test/suite/innodb/r/innodb_16k.result mysql-test/suite/innodb/r/innodb_4k.result mysql-test/suite/innodb/r/innodb_8k.result mysql-test/suite/innodb/t/innodb-system-table-view.test mysql-test/suite/innodb/t/innodb_16k.test mysql-test/suite/innodb/t/innodb_4k.test mysql-test/suite/innodb/t/innodb_8k.test mysql-test/suite/rpl/t/rpl_deadlock_innodb.test mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test mysql-test/t/innodb_mysql_lock.test sql/opt_explain_json.cc sql/rpl_info.h sql/rpl_info_factory.cc sql/rpl_slave.cc sql/sys_vars.cc unittest/gunit/opt_range-t.cc === modified file '.bzrignore' --- a/.bzrignore 2012-03-06 14:29:42 +0000 +++ b/.bzrignore 2012-03-19 11:14:55 +0000 @@ -3133,3 +3133,4 @@ source_downloads client/mysql_plugin support-files/plugins.files storage/perfschema/pfs_lex_token.h +storage/perfschema/gen_pfs_lex_token === added file 'mysql-test/r/bug12969156.result' --- a/mysql-test/r/bug12969156.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/r/bug12969156.result 2012-03-12 15:37:47 +0000 @@ -0,0 +1,24 @@ +# +# Bug #12969156 : SEGMENTATION FAULT ON UNINSTALLING +# DAEMON_EXAMPLE PLUGIN +# +INSTALL PLUGIN daemon_example SONAME 'DAEMONEXAMPLE'; +UNINSTALL PLUGIN daemon_example; +INSTALL PLUGIN daemon_example SONAME 'DAEMONEXAMPLE'; +UNINSTALL PLUGIN daemon_example; +INSTALL PLUGIN daemon_example SONAME 'DAEMONEXAMPLE'; +UNINSTALL PLUGIN daemon_example; +INSTALL PLUGIN daemon_example SONAME 'DAEMONEXAMPLE'; +UNINSTALL PLUGIN daemon_example; +INSTALL PLUGIN daemon_example SONAME 'DAEMONEXAMPLE'; +UNINSTALL PLUGIN daemon_example; +INSTALL PLUGIN daemon_example SONAME 'DAEMONEXAMPLE'; +UNINSTALL PLUGIN daemon_example; +INSTALL PLUGIN daemon_example SONAME 'DAEMONEXAMPLE'; +UNINSTALL PLUGIN daemon_example; +INSTALL PLUGIN daemon_example SONAME 'DAEMONEXAMPLE'; +UNINSTALL PLUGIN daemon_example; +INSTALL PLUGIN daemon_example SONAME 'DAEMONEXAMPLE'; +UNINSTALL PLUGIN daemon_example; +INSTALL PLUGIN daemon_example SONAME 'DAEMONEXAMPLE'; +UNINSTALL PLUGIN daemon_example; === removed file 'mysql-test/suite/sys_vars/r/pfs_digests_size.result' --- a/mysql-test/suite/sys_vars/r/pfs_digests_size.result 2011-06-13 11:54:30 +0000 +++ b/mysql-test/suite/sys_vars/r/pfs_digests_size.result 1970-01-01 00:00:00 +0000 @@ -1,23 +0,0 @@ -select @@global.performance_schema_digests_size; -@@global.performance_schema_digests_size -200 -select @@session.performance_schema_digests_size; -ERROR HY000: Variable 'performance_schema_digests_size' is a GLOBAL variable -show global variables like 'performance_schema_digests_size'; -Variable_name Value -performance_schema_digests_size 200 -show session variables like 'performance_schema_digests_size'; -Variable_name Value -performance_schema_digests_size 200 -select * from information_schema.global_variables -where variable_name='performance_schema_digests_size'; -VARIABLE_NAME VARIABLE_VALUE -PERFORMANCE_SCHEMA_DIGESTS_SIZE 200 -select * from information_schema.session_variables -where variable_name='performance_schema_digests_size'; -VARIABLE_NAME VARIABLE_VALUE -PERFORMANCE_SCHEMA_DIGESTS_SIZE 200 -set global performance_schema_digests_size=1; -ERROR HY000: Variable 'performance_schema_digests_size' is a read only variable -set session performance_schema_digests_size=1; -ERROR HY000: Variable 'performance_schema_digests_size' is a read only variable === added file 'mysql-test/suite/sys_vars/r/pfs_digests_size_basic.result' --- a/mysql-test/suite/sys_vars/r/pfs_digests_size_basic.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/sys_vars/r/pfs_digests_size_basic.result 2012-03-19 11:14:55 +0000 @@ -0,0 +1,23 @@ +select @@global.performance_schema_digests_size; +@@global.performance_schema_digests_size +123 +select @@session.performance_schema_digests_size; +ERROR HY000: Variable 'performance_schema_digests_size' is a GLOBAL variable +show global variables like 'performance_schema_digests_size'; +Variable_name Value +performance_schema_digests_size 123 +show session variables like 'performance_schema_digests_size'; +Variable_name Value +performance_schema_digests_size 123 +select * from information_schema.global_variables +where variable_name='performance_schema_digests_size'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_DIGESTS_SIZE 123 +select * from information_schema.session_variables +where variable_name='performance_schema_digests_size'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_DIGESTS_SIZE 123 +set global performance_schema_digests_size=1; +ERROR HY000: Variable 'performance_schema_digests_size' is a read only variable +set session performance_schema_digests_size=1; +ERROR HY000: Variable 'performance_schema_digests_size' is a read only variable === removed file 'mysql-test/suite/sys_vars/t/pfs_digests_size-master_basic.opt' --- a/mysql-test/suite/sys_vars/t/pfs_digests_size-master_basic.opt 2011-06-13 11:54:30 +0000 +++ b/mysql-test/suite/sys_vars/t/pfs_digests_size-master_basic.opt 1970-01-01 00:00:00 +0000 @@ -1,2 +0,0 @@ ---loose-enable-performance-schema ---loose-performance-schema-digests-size=200 === added file 'mysql-test/suite/sys_vars/t/pfs_digests_size_basic-master.opt' --- a/mysql-test/suite/sys_vars/t/pfs_digests_size_basic-master.opt 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/sys_vars/t/pfs_digests_size_basic-master.opt 2012-03-19 11:14:55 +0000 @@ -0,0 +1,2 @@ +--loose-enable-performance-schema +--loose-performance-schema-digests-size=123 === added file 'mysql-test/t/bug12969156-master.opt' --- a/mysql-test/t/bug12969156-master.opt 1970-01-01 00:00:00 +0000 +++ b/mysql-test/t/bug12969156-master.opt 2012-03-12 15:37:47 +0000 @@ -0,0 +1 @@ +--plugin-dir=$DAEMONEXAMPLE_DIR === added file 'mysql-test/t/bug12969156.test' --- a/mysql-test/t/bug12969156.test 1970-01-01 00:00:00 +0000 +++ b/mysql-test/t/bug12969156.test 2012-03-12 15:37:47 +0000 @@ -0,0 +1,15 @@ +--source include/not_embedded.inc + +--echo # +--echo # Bug #12969156 : SEGMENTATION FAULT ON UNINSTALLING +--echo # DAEMON_EXAMPLE PLUGIN +--echo # + +let $counter= 0; +while ($counter < 10) +{ +--replace_result $DAEMONEXAMPLE DAEMONEXAMPLE + eval INSTALL PLUGIN daemon_example SONAME '$DAEMONEXAMPLE'; + UNINSTALL PLUGIN daemon_example; + inc $counter; +} === modified file 'plugin/daemon_example/daemon_example.cc' --- a/plugin/daemon_example/daemon_example.cc 2012-03-06 14:29:42 +0000 +++ b/plugin/daemon_example/daemon_example.cc 2012-03-12 15:37:47 +0000 @@ -46,7 +46,6 @@ pthread_handler_t mysql_heartbeat(void * DBUG_ENTER("mysql_heartbeat"); struct mysql_heartbeat_context *con= (struct mysql_heartbeat_context *)p; char buffer[HEART_STRING_BUFFER]; - unsigned int x= 0; time_t result; struct tm tm_tmp; @@ -65,7 +64,6 @@ pthread_handler_t mysql_heartbeat(void * tm_tmp.tm_min, tm_tmp.tm_sec); my_write(con->heartbeat_file, (uchar*) buffer, strlen(buffer), MYF(0)); - x++; } DBUG_RETURN(0); @@ -160,6 +158,7 @@ static int daemon_example_plugin_deinit( (struct mysql_heartbeat_context *)plugin->data; time_t result= time(NULL); struct tm tm_tmp; + void *dummy_retval; pthread_cancel(con->heartbeat_thread); @@ -173,6 +172,13 @@ static int daemon_example_plugin_deinit( tm_tmp.tm_min, tm_tmp.tm_sec); my_write(con->heartbeat_file, (uchar*) buffer, strlen(buffer), MYF(0)); + + /* + Need to wait for the hearbeat thread to terminate before closing + the file it writes to and freeing the memory it uses + */ + pthread_join(con->heartbeat_thread, &dummy_retval); + my_close(con->heartbeat_file, MYF(0)); my_free(con); === modified file 'sql/opt_explain_json.cc' --- a/sql/opt_explain_json.cc 2012-03-19 11:39:18 +0000 +++ b/sql/opt_explain_json.cc 2012-03-19 14:40:35 +0000 @@ -1718,7 +1718,6 @@ bool Explain_format_JSON::end_context(Ex DBUG_ASSERT(current_context->type == ctx); bool ret= false; -#ifdef LATER if (current_context->parent == NULL) { Opt_trace_context json; @@ -1766,7 +1765,6 @@ bool Explain_format_JSON::end_context(Ex } current_context= current_context->parent; -#endif return ret; } === modified file 'sql/opt_range.cc' --- a/sql/opt_range.cc 2012-03-14 13:10:55 +0000 +++ b/sql/opt_range.cc 2012-03-19 12:44:38 +0000 @@ -884,11 +884,11 @@ static void trace_range_all_keyparts(Opt const String *range_so_far, SEL_ARG *keypart_root, const KEY_PART_INFO *key_parts); -static void append_range(String *out, - const KEY_PART_INFO *key_parts, - const uchar *min_key, const uchar *max_key, - const uint flag); #endif +void append_range(String *out, + const KEY_PART_INFO *key_parts, + const uchar *min_key, const uchar *max_key, + const uint flag); static SEL_TREE *tree_and(RANGE_OPT_PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2); static SEL_TREE *tree_or(RANGE_OPT_PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2); @@ -13067,8 +13067,6 @@ static void print_ror_scans_arr(TABLE *t #endif /* !DBUG_OFF */ -#ifdef OPTIMIZER_TRACE - /** Print a key to a string @@ -13127,10 +13125,10 @@ restore_col_map: @param[in] flag Key range flags defining what min_key and max_key represent @see my_base.h */ -static void append_range(String *out, - const KEY_PART_INFO *key_part, - const uchar *min_key, const uchar *max_key, - const uint flag) +void append_range(String *out, + const KEY_PART_INFO *key_part, + const uchar *min_key, const uchar *max_key, + const uint flag) { if (out->length() > 0) out->append(STRING_WITH_LEN(" AND ")); @@ -13156,6 +13154,9 @@ static void append_range(String *out, } } + +#ifdef OPTIMIZER_TRACE + /** Traverse an R-B tree of range conditions and append all ranges for this keypart and consecutive keyparts to the optimizer trace. See === modified file 'sql/opt_trace_context.h' --- a/sql/opt_trace_context.h 2012-02-29 11:17:52 +0000 +++ b/sql/opt_trace_context.h 2012-03-19 12:44:38 +0000 @@ -425,6 +425,15 @@ public: FLAG_ONE_LINE= 1 << 1 }; static bool is_started() { return false; } + bool start(bool support_I_S, + bool support_dbug_or_missing_priv, + bool end_marker, bool one_line, + long offset, long limit, ulong max_mem_size, + ulonglong features) + { return false; } + const char *get_tail(size_t size) + { return ""; } + void end() {} }; #endif /* OPTIMIZER_TRACE */ === modified file 'sql/sys_vars.cc' --- a/sql/sys_vars.cc 2012-03-16 15:04:13 +0000 +++ b/sql/sys_vars.cc 2012-03-19 11:14:55 +0000 @@ -491,7 +491,7 @@ static Sys_var_ulong Sys_pfs_digest_size "performance_schema_digests_size", "Size of the statement digest.", READ_ONLY GLOBAL_VAR(pfs_param.m_digest_sizing), - CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 200), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024 * 1024), DEFAULT(PFS_DIGEST_SIZE), BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); === modified file 'unittest/gunit/opt_range-t.cc' --- a/unittest/gunit/opt_range-t.cc 2012-03-19 11:39:18 +0000 +++ b/unittest/gunit/opt_range-t.cc 2012-03-19 14:40:35 +0000 @@ -162,7 +162,6 @@ public: static void print_selarg_ranges(String *s, SEL_ARG *sel_arg, const KEY_PART_INFO *kpi) { -#ifdef LATER for (SEL_ARG *cur= sel_arg->first(); cur != &null_element; cur= cur->right) @@ -176,7 +175,6 @@ static void print_selarg_ranges(String * s->append(current_range); } -#endif } No bundle (reason: useless for push emails).