From: Rafal Somla Date: September 30 2011 12:28pm Subject: bzr push into mysql-trunk branch (rafal.somla:3458 to 3459) Bug#12982926 List-Archive: http://lists.mysql.com/commits/141238 X-Bug: 12982926 Message-Id: <201109301228.p8UCSPwk023954@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3459 Rafal Somla 2011-09-30 [merge] merge of bug#12982926 modified: libmysql/authentication_win/handshake_client.cc 3458 Guilhem Bichot 2011-09-30 fix for Bug#13040136 - ASSERT IN PLAN_CHANGE_WATCHDOG::~PLAN_CHANGE_WATCHDOG(): save_quick was not initialized. @ mysql-test/t/join_outer.test used to assert like this: mysqld: /m/bzrrepos_new/opt_trace_transfo_/sql/sql_select.cc:21558: Plan_change_watchdog::~Plan_change_watchdog(): Assertion `tab->select->quick == quick' failed. @ sql/sql_select.cc In the test query, we enter test_if_skip_sort_order() with a JOIN_TAB which has both a ref access and a non-NULL select->quick. save_quick is initialized to NULL. It doesn't change, because we don't go through the "else" branch below: if (tab->ref.key >= 0 && tab->ref.key_parts) { ref_key= tab->ref.key; ref_key_parts= tab->ref.key_parts; if (tab->type == JT_REF_OR_NULL || tab->type == JT_FT) DBUG_RETURN(0); } else if (select && select->quick) // Range found by opt_range { int quick_type= select->quick->get_type(); save_quick= select->quick; <<<<< this is not reached, because of ref access!! Then we come to use_filesort: use_filesort: // Restore original save_quick if (select && select->quick != save_quick) select->set_quick(save_quick); which sets the not-changed-so-far tab->select->quick to save_quick i.e. NULL! The fix: always initialize save_quick. modified: mysql-test/r/join_outer.result mysql-test/r/join_outer_bka.result mysql-test/r/join_outer_bka_nobnl.result mysql-test/t/join_outer.test sql/sql_select.cc === modified file 'libmysql/authentication_win/handshake_client.cc' --- a/libmysql/authentication_win/handshake_client.cc 2011-09-21 11:01:41 +0000 +++ b/libmysql/authentication_win/handshake_client.cc 2011-09-30 12:27:08 +0000 @@ -161,6 +161,21 @@ int Handshake_client::write_packet(Blob keep all the data. */ unsigned block_count= data.len()/512 + ((data.len() % 512) ? 1 : 0); + +#if !defined(DBUG_OFF) && defined(WINAUTH_USE_DBUG_LIB) + + /* + For testing purposes, use wrong block count to see how server + handles this. + */ + DBUG_EXECUTE_IF("winauth_first_packet_test",{ + block_count= data.len() == 601 ? 0 : + data.len() == 602 ? 1 : + block_count; + }); + +#endif + DBUG_ASSERT(block_count < (unsigned)0x100); saved_byte= data[254]; data[254] = block_count; No bundle (reason: useless for push emails).