diff --git a/src/sql/optimizer/ob_join_order.cpp b/src/sql/optimizer/ob_join_order.cpp index 75f8be8960..322814f345 100644 --- a/src/sql/optimizer/ob_join_order.cpp +++ b/src/sql/optimizer/ob_join_order.cpp @@ -1963,8 +1963,7 @@ int ObJoinOrder::init_column_store_est_info_with_filter(const uint64_t table_id, } if (OB_FAIL(ret) || filter_columns.empty()) { } else if (max_pos < 0 || max_pos >= column_group_infos.count()) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("can not find column group info for filter", K(ret)); + //table filter with index column group } else if (OB_FAIL(column_group_infos.at(max_pos).filters_.push_back(filter))) { LOG_WARN("failed to push back filter", K(ret)); } else if (use_filter_sel) { diff --git a/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_index_mysql.result b/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_index_mysql.result index 1f86bc453e..f4ccb4e610 100644 --- a/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_index_mysql.result +++ b/tools/deploy/mysql_test/test_suite/geometry/r/mysql/geometry_index_mysql.result @@ -220,3 +220,7 @@ st_astext(g) POINT(0 0) POINT(0 0) POINT(0 0) +drop table if exists spatial_index; +CREATE TABLE spatial_index (i INT, g GEOMETRY NOT NULL SRID 4326, PRIMARY KEY (i), SPATIAL KEY (g))with column group ( each column); +select i, st_astext(g) from spatial_index where ST_Intersects(g, ST_GEOMFROMTEXT('POINT(2 2)', 4326)); +i st_astext(g) diff --git a/tools/deploy/mysql_test/test_suite/geometry/t/geometry_index_mysql.test b/tools/deploy/mysql_test/test_suite/geometry/t/geometry_index_mysql.test index 6f70fba93a..4367cd721f 100644 --- a/tools/deploy/mysql_test/test_suite/geometry/t/geometry_index_mysql.test +++ b/tools/deploy/mysql_test/test_suite/geometry/t/geometry_index_mysql.test @@ -241,3 +241,10 @@ if (1) { CREATE INDEX idx ON spatial_index_rebuild (g); SELECT /*+INDEX(spatial_index_rebuild idx)*/ st_astext(g) FROM spatial_index_rebuild WHERE ST_INTERSECTS(g, ST_GEOMFROMTEXT('POINT(0 0)', 4326)); } + +#bug fix +--disable_warnings +drop table if exists spatial_index; +--enable_warnings +CREATE TABLE spatial_index (i INT, g GEOMETRY NOT NULL SRID 4326, PRIMARY KEY (i), SPATIAL KEY (g))with column group ( each column); +select i, st_astext(g) from spatial_index where ST_Intersects(g, ST_GEOMFROMTEXT('POINT(2 2)', 4326)); \ No newline at end of file