From: Jorgen Loland Date: April 7 2011 1:29pm Subject: bzr push into mysql-trunk branch (jorgen.loland:3288 to 3289) List-Archive: http://lists.mysql.com/commits/134937 Message-Id: <20110407132916.BF2363A7@atum21.norway.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3289 Jorgen Loland 2011-04-07 Very small fix: make SEL_ARG *keypart_range const in trace_range_all_keyparts() @ sql/opt_range.cc Make SEL_ARG *keypart_range const in trace_range_all_keyparts() modified: sql/opt_range.cc 3288 Jorgen Loland 2011-04-06 Fix optimizer tracing in range access plan analysis: Fixed misunderstanding: SEL_ARG::next_key_part does not point to a single SEL_ARG but to the root of a SEL_ARG tree * Old optimizer tracing code that effectively printed all intervals of the first keypart and appended it with only the root of consecutive keyparts is replaced with recursive function that combines a range over the current keypart with all ranges in consecutive keyparts * Fixed documentation that describes how SEL_ARG red-black trees are structured. * Added test case that used to fail to print all ranges for a range access plan. Bonus: With new understanding of how SEL_ARG R-B trees are structured, it was possible to: * Remove tracing from sel_arg_range_seq_next() (and all RANGE_SEQ_IF::next() implementations) and step_down_to(). This was replaced with tracing of SEL_ARG trees in the range optimizer. modified: mysql-test/include/optimizer_trace_range.inc mysql-test/r/optimizer_trace_range_no_prot.result mysql-test/r/optimizer_trace_range_ps_prot.result sql/handler.cc sql/handler.h sql/opt_range.cc sql/opt_range.h sql/sql_join_cache.cc === modified file 'sql/opt_range.cc' --- a/sql/opt_range.cc 2011-04-06 09:19:23 +0000 +++ b/sql/opt_range.cc 2011-04-07 13:29:04 +0000 @@ -12429,7 +12429,7 @@ static void trace_range_all_keyparts(Opt // Navigate to first interval in red-black tree const KEY_PART_INFO *cur_key_part= key_parts + keypart_root->part; - SEL_ARG *keypart_range= keypart_root->first(); + const SEL_ARG *keypart_range= keypart_root->first(); while (keypart_range) { No bundle (reason: useless for push emails).