From: Ole John Aske Date: October 26 2010 10:44am Subject: bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (ole.john.aske:3324 to 3325) List-Archive: http://lists.mysql.com/commits/121914 Message-Id: <20101026104444.C527721D@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3325 Ole John Aske 2010-10-26 spj-svs: 1) Prevent EXPLAIN EXTENDED from reporting single table queries as non-pushable. 2) Updated ndb_gis.result as a result of more EXPLAIN EXTENDED output. modified: mysql-test/suite/ndb/r/ndb_gis.result sql/ha_ndbcluster.cc 3324 Ole John Aske 2010-10-26 Fixed buildfailure after previous commit: get_referred_table_access_name() is now also used wo/ DBUG code as part of EXPLAIN_NO_PUSH() - Removed enclosing '#if !defined(DBUG_OFF)' around this function. modified: sql/ha_ndbcluster.cc === modified file 'mysql-test/suite/ndb/r/ndb_gis.result' --- a/mysql-test/suite/ndb/r/ndb_gis.result 2010-07-14 12:40:14 +0000 +++ b/mysql-test/suite/ndb/r/ndb_gis.result 2010-10-26 10:44:16 +0000 @@ -406,6 +406,8 @@ id select_type table type possible_keys 1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort 1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer Warnings: +Note 1644 Table g1 not pushable, 'read_set' contain BLOB columns +Note 1644 Table g2 not pushable, 'read_set' contain BLOB columns Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid` DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; CREATE TABLE t1 ( @@ -958,6 +960,8 @@ id select_type table type possible_keys 1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort 1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer Warnings: +Note 1644 Table g1 not pushable, 'read_set' contain BLOB columns +Note 1644 Table g2 not pushable, 'read_set' contain BLOB columns Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid` DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; CREATE TABLE t1 ( === modified file 'sql/ha_ndbcluster.cc' --- a/sql/ha_ndbcluster.cc 2010-10-26 09:42:11 +0000 +++ b/sql/ha_ndbcluster.cc 2010-10-26 10:44:16 +0000 @@ -466,7 +466,9 @@ public: ndb_pushed_builder_ctx(AQP::Join_plan& plan) : m_plan(plan), m_join_root(), m_join_scope(), m_const_scope() - { init_pushability(); + { + if (plan.get_access_count() > 1) + init_pushability(); } void set_root(const AQP::Table_access* const join_root) @@ -550,7 +552,7 @@ private: struct pushed_tables { pushed_tables() : - m_maybe_pushable(PUSHABLE_AS_CHILD | PUSHABLE_AS_PARENT), + m_maybe_pushable(0), m_parent(MAX_TABLES), m_ancestors(), m_last_scan_descendant(MAX_TABLES), No bundle (reason: useless for push emails).