From: Ole John Aske Date: October 15 2010 6:56pm Subject: bzr commit into mysql-5.1-telco-7.0-spj branch (ole.john.aske:3224) List-Archive: http://lists.mysql.com/commits/120870 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2044539938==" --===============2044539938== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///home/oleja/mysql/mysql-5.1-telco-7.0-spj/ based on revid:ole.john.aske@stripped 3224 Ole John Aske 2010-10-15 Cleanup: Removed some leftovers of cherry picked bugfixes / temp. patches which now are part of mysql 5.1.51 which we have just merged from. modified: sql/sql_select.cc === modified file 'sql/sql_select.cc' --- a/sql/sql_select.cc 2010-10-15 14:42:00 +0000 +++ b/sql/sql_select.cc 2010-10-15 18:56:29 +0000 @@ -116,17 +116,9 @@ static void reset_nj_counters(List *join_list, uint first_unused); -/** - * SPJ MERGE TODO Bug#48971: - * BEWARE: Temp fix for Bug#48971 in SPJ branch affects signature - * to optimize_cond. - * Permanent fix has not been merged to this branch yet. - * Needed as this was a showstopper for further SPJ testing. - */ static COND *optimize_cond(JOIN *join, COND *conds, List *join_list, - Item::cond_result *cond_value, - bool build_equalites); + Item::cond_result *cond_value); static bool const_expression_in_where(COND *conds,Item *item, Item **comp_item); static bool open_tmp_table(TABLE *table); static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param, @@ -894,7 +886,7 @@ JOIN::optimize() thd->restore_active_arena(arena, &backup); } - conds= optimize_cond(this, conds, join_list, &cond_value, TRUE); + conds= optimize_cond(this, conds, join_list, &cond_value); if (thd->is_error()) { error= 1; @@ -903,7 +895,7 @@ JOIN::optimize() } { - having= optimize_cond(this, having, join_list, &having_value, FALSE); + having= optimize_cond(this, having, join_list, &having_value); if (thd->is_error()) { error= 1; @@ -9266,39 +9258,6 @@ static bool check_interleaving_with_nj(J function for the first table in join order (for which check_interleaving_with_nj has not been called) - The algorithm is the reciprocal of check_interleaving_with_nj(), hence - parent join nest nodes are updated only when the last table in its child - node is removed. The ASCII graphic below will clarify. - - %A table nesting such as t1 x [ ( t2 x t3 ) x ( t4 x t5 ) ] is - represented by the below join nest tree. - - @verbatim - NJ1 - _/ / \ - _/ / NJ2 - _/ / / \ - / / / \ - t1 x [ (t2 x t3) x (t4 x t5) ] - @endverbatim - - At the point in time when check_interleaving_with_nj() adds the table t5 to - the query execution plan, QEP, it also directs the node named NJ2 to mark - the table as covered. NJ2 does so by incrementing its @c counter - member. Since all of NJ2's tables are now covered by the QEP, the algorithm - proceeds up the tree to NJ1, incrementing its counter as well. All join - nests are now completely covered by the QEP. - - restore_prev_nj_state() does the above in reverse. As seen above, the node - NJ1 contains the nodes t2, t3, and NJ2. Its counter being equal to 3 means - that the plan covers t2, t3, and NJ2, @e and that the sub-plan (t4 x t5) - completely covers NJ2. The removal of t5 from the partial plan will first - decrement NJ2's counter to 1. It will then detect that NJ2 went from being - completely to partially covered, and hence the algorithm must continue - upwards to NJ1 and decrement its counter to 2. %A subsequent removal of t4 - will however not influence NJ1 since it did not un-cover the last table in - NJ2. - @param last join table to remove, it is assumed to be the last in current partial join order. */ @@ -9325,16 +9284,9 @@ static void restore_prev_nj_state(JOIN_T } -/** - * SPJ MERGE TODO Bug#48971: - * BEWARE: Temp fix for Bug#48971 in SPJ branch affects signature - * to optimize_cond. - * Permanent fix has not been merged to this branch yet. - * Needed as this was a showstopper for further SPJ testing. - */ static COND * optimize_cond(JOIN *join, COND *conds, List *join_list, - Item::cond_result *cond_value, bool build_equalites) + Item::cond_result *cond_value) { THD *thd= join->thd; DBUG_ENTER("optimize_cond"); @@ -9352,12 +9304,9 @@ optimize_cond(JOIN *join, COND *conds, L multiple equality contains a constant. */ DBUG_EXECUTE("where", print_where(conds, "original", QT_ORDINARY);); - if (build_equalites) - { - conds= build_equal_items(join->thd, conds, NULL, join_list, - &join->cond_equal); - DBUG_EXECUTE("where",print_where(conds,"after equal_items",QT_ORDINARY);); - } + conds= build_equal_items(join->thd, conds, NULL, join_list, + &join->cond_equal); + DBUG_EXECUTE("where",print_where(conds,"after equal_items",QT_ORDINARY);); /* change field = field to field = const for each found field = const */ propagate_cond_constants(thd, (I_List *) 0, conds, conds); --===============2044539938== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/ole.john.aske@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: ole.john.aske@stripped\ # kg0piznbf4mr65ml # target_branch: file:///home/oleja/mysql/mysql-5.1-telco-7.0-spj/ # testament_sha1: 46bc88fcaa58c7e5c4a4f621ca430aaea5eb98ed # timestamp: 2010-10-15 20:57:05 +0200 # base_revision_id: ole.john.aske@stripped\ # 07i47xttempfa75r # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWZpADlgAAfb/gEAwACBRd/// frW2YL////BQBIyec6JwDnQFsJRE1NMFPEyk2ZGp6T1M0ITEbJDGo9GkZBKQQNGjEI9TVPUGj1PU HqGINAYCPUaDUwpspPSZHqJspoNAAAAADQAOYExNBhMmTJkYTBNNMjEwBDAJJCmZNExTU3pT9GpM zUm1GTIaGgAANHka0lny1LgZGu/zPvXU6CEoVMsK5o5SFQqiYJW15c0bjjFE93AArILAYjOwWfAa 3szERQA9vMQirFsaBgsc0VrmRTYNNXKjEqQHhVM8Nv347vlQG+Xz/rpEygYyPdnqejInP7ImkXUw h5bbrLOayzFLOj1LENfMavs+3DQNtU6Ymb3ypMOFTxXguMxBSewhGdVxeLGwTLZByZyzjpzED7pp E1gkWskcZCx90BeRgZlGQZv6g0jZsI0FCSHsZZ3PPL6QrpTwgunYVP5BaUFkMLjJ4KTAkCRpvcLY spVS52eaZQ70bh0FQYbb7hCotfiOsE9tEzVSX4RvXksm8rBzhB0zgunMWpVYkm4NB1eRiqDLOWUp B8JyUMYOg0komtNYLNhYOkYYCUArSCVQyBl71kjYRFcTjeJKAuOexlohdYyOYm3xBe2isrMY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