summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 5.3->5.5 mergeSergei Golubchik2011-11-27119-890/+10421
|\
| * Small fixes to make compilers happy.Alexey Botchkov2011-11-221-3/+3
| |
| * Windows has no 'nearbyint' in libraries.Alexey Botchkov2011-11-221-2/+1
| | | | | | | | | | So removed.
| * Merge default materialization=on.unknown2011-11-2231-225/+342
| |\
| | * Merge enabling materialization=on by default.unknown2011-11-2131-225/+342
| | |\
| | | * Merge enabling of materialization=on by default with main tree.unknown2011-11-2131-225/+342
| | | |\
| | | | * Fixed PBXT test cases.unknown2011-11-092-7/+11
| | | | |
| | | | * - Removed a comment that is not true any more.unknown2011-11-092-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | - Consistent use of the SUBS_NOT_TRANSFORMED constant for in_strategy.
| | | | * Enable subquery materialization=ON by default.unknown2011-11-0927-216/+327
| | | | |
| * | | | Correct test file.unknown2011-11-211-1/+1
| | | | |
| * | | | Fix test to pass on 32-bit machines by reducingunknown2011-11-215-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | the depth of subquery nestedness to less than 31 (sizeof(ulong)-1).
| * | | | Merge.Igor Babaev2011-11-215-3/+99
| |\ \ \ \
| | * | | | Fixed LP bug #887496.Igor Babaev2011-11-215-3/+99
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug in the function Loose_scan_opt::check_ref_access_part1 could lead to choosing an invalid execution plan employing a loose scan access to a semi-join table even in the cases when such access could not be used at all. This could result in wrong answers for some queries with IN subqueries.
| * | | | Fix bug lp:833777unknown2011-11-218-3/+68
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis: The optimizer distinguishes two kinds of 'constant' conditions: expensive ones, and non-expensive ones. The non-expensive conditions are evaluated inside make_join_select(), and if false, already the optimizer detects empty query results. In order to avoid arbitrarily expensive optimization, the evaluation of expensive constant conditions is delayed until execution. These conditions are attached to JOIN::exec_const_cond and evaluated in the beginning of JOIN::exec. The relevant execution logic is: JOIN::exec() { if (! join->exec_const_cond->val_int()) { produce an empty result; stop execution } continue execution execute the original WHERE clause (that contains exec_const_cond) ... } As a result, when an expensive constant condition is TRUE, it is evaluated twice - once through JOIN::exec_const_cond, and once through JOIN::cond. When the expensive constant condition is a subquery, predicate, the subquery is evaluated twice. If we have many levels of subqueries, this logic results in a chain of recursive subquery executions that walk a perfect binary tree. The result is that for subquries with depth N, JOIN::exec is executed O(2^N) times. Solution: Notice that the second execution of the constant conditions happens inside do_select(), in the branch: if (join->table_count == join->const_tables) { ... } In this case exec_const_cond is equivalent to the whole WHERE clause, therefore the WHERE clause has already been checked in the beginnig of JOIN::exec, and has been found to be true. The bug is addressed by not evaluating the WHERE clause if there was exec_const_conds, and it was TRUE.
| * | | Corrected the patch that made the optimizer switch for index condition pushdownIgor Babaev2011-11-211-1/+1
| | | | | | | | | | | | | | | | set to 'on' by default.
| * | | Made the optimizer switch for index condition pushdown set to 'on' by default. Igor Babaev2011-11-2140-323/+324
| | | |
| * | | Fixed LP bug #892725.Igor Babaev2011-11-203-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A non-first execution of a prepared statement missed a call of the TABLE_LIST::process_index_hints() method in the code of the function setup_tables(). At some scenarios this could lead to the choice of a quite inefficient execution plan for the base query of the prepared statement.
| * | | Fix for bug #809849 spatial operations must be KILL-able.Alexey Botchkov2011-11-206-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checks for thd->killed state added to the long loops in geometry calculations. per-file comments: sql/gcalc_slicescan.cc Fix for bug #809849 spatial operations must be KILL-able. checks for TERMINATED_STATE added. sql/gcalc_slicescan.h Fix for bug #809849 spatial operations must be KILL-able. defines added to include checks for termination in the library. sql/gcalc_tools.cc Fix for bug #809849 spatial operations must be KILL-able. checks for TERMINATED_STATE added. sql/gcalc_tools.h Fix for bug #809849 spatial operations must be KILL-able. TERMINATED_STATE pointers added. sql/item_geofunc.cc Fix for bug #809849 spatial operations must be KILL-able. sql/item_geofunc.h Fix for bug #809849 spatial operations must be KILL-able.
| * | | Fixed LP bug #891995.Igor Babaev2011-11-183-2/+92
| | | | | | | | | | | | | | | | | | | | | | | | This bug in the function setup_semijoin_dups_elimination() could lead to invalid choice of the sequence of tables for which semi-join duplicate elimination was applied.
| * | | Fixed LP bug #891953.Igor Babaev2011-11-184-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to this bug the function SEL_IMERGE::or_sel_tree_with_checks() could build an inconsistent merge tree if one of the SEL_TREEs in the resulting index merge happened to contain a full key range. This could trigger an assertion failure.
| * | | unused variable removed.Alexey Botchkov2011-11-181-2/+1
| | | |
| * | | GCALC_CHECK_WITH_FLOAT disabled.Alexey Botchkov2011-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | That's not a good option for an onrdinary user.
| * | | Fixed LP bug #800184.Igor Babaev2011-11-184-4/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The function key_and() erroneously called SEL_ARG::increment_use_count() when SEL_ARG::incr_refs() should had been called. This could lead to wrong values of use_count for some SEL_ARG trees.
| * | | Merge.Igor Babaev2011-11-171-2/+2
| |\ \ \ | | |/ / | |/| |
| | * | Corrected the fix for bug 891052.Igor Babaev2011-11-171-2/+2
| | | |
| * | | small fixes to make compiler happy.Alexey Botchkov2011-11-172-2/+2
| | | |
| * | | test results updated.Alexey Botchkov2011-11-174-12/+11
| | | |
| * | | merging.Alexey Botchkov2011-11-1735-312/+9229
| |\ \ \ | | |/ / | |/| |
| | * | merging.Alexey Botchkov2011-11-12568-11234/+47077
| | |\ \
| | * | | code cleanup.Alexey Botchkov2011-10-161-48/+0
| | | | |
| | * | | GIS code cleanup.Alexey Botchkov2011-10-162-484/+458
| | | | |
| | * | | #define addedAlexey Botchkov2011-10-141-0/+2
| | | | |
| | * | | repeating calcualtions eliminated.Alexey Botchkov2011-10-142-15/+139
| | | | |
| | * | | GIS code.Alexey Botchkov2011-10-145-1042/+1038
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Forward calculations introduced. per-file comments: sql/gcalc_slicescan.cc sql/gcalc_slicescan.h sql/gcalc_tools.cc sql/gcalc_tools.h sql/item_geofunc.cc
| | * | | Copyright notices fixed.Alexey Botchkov2011-10-066-2/+8
| | | | |
| | * | | Valgrind warning fixed.Alexey Botchkov2011-10-054-60/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coordinate size limitation removed. per-file comments: mysql-test/r/gis-precise.result test result updated. sql/gcalc_slicescan.cc Check coordinate extent to pick better precidion in the ::set_double() sql/gcalc_slicescan.h free_list() can lead to valgrind warnig. Fixed sql/gcalc_tools.cc free_list() call changed.
| | * | | GIS code cleanup.Alexey Botchkov2011-10-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCALC_xxx macros fixed for the GCALC_DBUG_OFF case. per-file comments: sql/gcalc_slicescan.h GIS code cleanup.
| | * | | GIS library code cleanup.Alexey Botchkov2011-10-044-620/+370
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCALC_DBUG_OFF and related infrastructure defined so we can enable/disable debugging conveniently. per-file comments: sql/gcalc_slicescan.cc GIS library code cleanup. sql/gcalc_slicescan.h GIS library code cleanup. sql/gcalc_tools.cc GIS library code cleanup. sql/gcalc_tools.h GIS library code cleanup.
| | * | | bug 857087 Wrong result with ST_INTERSECTS and LINESTRINGsAlexey Botchkov2011-09-234-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Line autointersection point was treated as if it doesn't belong to the line. It's in some way logical, but seems to confuse people. Fixed. per_file_comments: mysql-test/r/gis-precise.result bug 857087 Wrong result with ST_INTERSECTS and LINESTRINGs test result updated. mysql-test/t/gis-precise.test bug 857087 Wrong result with ST_INTERSECTS and LINESTRINGs test case added. sql/gcalc_tools.cc bug 857087 Wrong result with ST_INTERSECTS and LINESTRINGs Point of line autointersection handled as it belongs to the line. sql/gcalc_tools.h bug 857087 Wrong result with ST_INTERSECTS and LINESTRINGs Gcalc_function::set_i_state() added
| | * | | bug #857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGONAlexey Botchkov2011-09-233-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | actually only testcase added as the bug was fixed already. modified: mysql-test/r/gis-precise.result bug #857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGON test result updated. mysql-test/t/gis-precise.test bug #857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGON test case added. sql/gcalc_tools.cc superfluous variable removed.
| | * | | fix for bug 857051 ST_EQUALS returns TRUE on two nonidentical MULTIPOINTsAlexey Botchkov2011-09-233-53/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'single point' event was forgotten in the relation's calculation per-file comments: mysql-test/r/gis-precise.result fix for bug 857051 ST_EQUALS returns TRUE on two nonidentical MULTIPOINTs test result updated. mysql-test/t/gis-precise.test fix for bug 857051 ST_EQUALS returns TRUE on two nonidentical MULTIPOINTs test case added. sql/gcalc_tools.cc fix for bug 857051 ST_EQUALS returns TRUE on two nonidentical MULTIPOINTs scev_single_point is properly handled.
| | * | | fix for 857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGONAlexey Botchkov2011-09-232-21/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | return GEOMETRYCOLLECTION EMPTY, not NULL for the query per-file comments: mysql-test/r/gis.result fix for 857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGON test result updated. sql/spatial.cc fix for 857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGON return of the Geometry::envelope() changed for the empty geometry.
| | * | | fixed bugsAlexey Botchkov2011-09-229-258/+372
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 855485 ST_CROSSES returns different result than PostGIS for overlapping polygons 855487 ST_WITHIN returns wrong result for partially overlapping polygons 855492 ST_WITHIN returns TRUE on point on the edge of a polygon 855497 ST_ENVELOPE of GEOMETRYCOLLECTION EMPTY returns NULL and not GEOMETRYCOLLECTION EMPTY 855503 ST_EQUALS reports TRUE between a POLYGON and a MULTILINESTRING 855505 ST_TOUCHES reports TRUE for intersecting polygon and linestring Changed the way weird functions like Crosses or Touches treated. Added BORDER handling to the Gcalc_function. per-file comments: mysql-test/r/gis-precise.result GIS bugs fixed. test result updated. mysql-test/t/gis-precise.test GIS bugs fixed. test cases added. sql/gcalc_slicescan.h GIS bugs fixed. sql/gcalc_tools.cc GIS bugs fixed. sql/gcalc_tools.h GIS bugs fixed. sql/item_create.cc GIS bugs fixed. sql/item_geofunc.cc GIS bugs fixed. sql/item_geofunc.h GIS bugs fixed. sql/spatial.cc GIS bugs fixed.
| | * | | bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed.Alexey Botchkov2011-09-215-9/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | per-file comments: mysql-test/r/gis.result bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. test result updated. mysql-test/t/gis.test bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. test case added. sql/item_geofunc.cc bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. geom_length() call fixed. sql/spatial.cc bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. Geometry_collection::geom_length implemented. sql/spatial.h bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. Geometry_collection::geom_length declaration added.
| | * | | fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of ↵Alexey Botchkov2011-09-216-34/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "GEOMETRYCOLLECTION EMPTY" per-file comments: mysql-test/r/gis.result fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" test result updated. mysql-test/t/gis.test fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" test case added. sql/gstream.cc fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" lookup_next_word() implemented. sql/gstream.h fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" lookup_next_word() added. sql/spatial.cc fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" name changed for the empty geometry. sql/spatial.h fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" declarations modified.
| | * | | bugs fixedAlexey Botchkov2011-09-215-7/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 855253 Compiler error: gcalc_slicescan.cc:2036: error: suggest parentheses around comparison in operand of .|. in maria-5.3-gis 850775 ST_AREA does not work on GEOMETRYCOLLECTIONs in maria-5.3-gis per-file comments: mysql-test/r/gis.result test result updated. mysql-test/t/gis.test test case added for 850775. sql/gcalc_slicescan.cc compiler error fixed. sql/spatial.cc ST_AREA implementation for GEOMETRY_COLLECTION, POINT and LINESTRING. sql/spatial.h area() declarations added.
| | * | | several bugs fixed here.Alexey Botchkov2011-09-218-330/+1572
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 849789 Second assertion `m_poly_borders->next' failed in Gcalc_operation_reducer::count_slice in maria-5.3-gis 849791 Fourth assertion `n > 0 && n < SINUSES_CALCULATED*2+1' in get_n_sincos 849789 Second assertion `m_poly_borders->next' failed in Gcalc_operation_reducer::count_slice in maria-5.3-gis 848901 Assertion `fabs(cur_isc->x-m_cur_intersection->x) + fabs(cur_isc->y-m_cur_intersection->y) < 0.000000000001' failed in Gcalc_scan_iterator::intersection_scan() in maria-5.3-gis per-file comments: mysql-test/r/gis-precise.result test result updated. mysql-test/r/gis.result test result updated. sql/gcalc_slicescan.cc bugfixes. sql/gcalc_slicescan.h bugfixes. sql/gcalc_tools.cc bugfixes. sql/gcalc_tools.h bugfixes. sql/item_geofunc.cc bugfixes. sql/spatial.cc bugfixes.
| | * | | Fix for bug 848939 Wrong result with ST_INTERSECTION between linestrings and ↵Alexey Botchkov2011-09-133-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a polygon in 5.3-gis Coordinates were mistakenly reversed for MULTIPOINT. per-file comments: mysql-test/r/gis-precise.result Fix for bug 848939 Wrong result with ST_INTERSECTION between linestrings and a polygon in 5.3-gis test result updated. mysql-test/t/gis-precise.test Fix for bug 848939 Wrong result with ST_INTERSECTION between linestrings and a polygon in 5.3-gis test case added. sql/gcalc_tools.cc Fix for bug 848939 Wrong result with ST_INTERSECTION between linestrings and a polygon in 5.3-gis coordinates set in the proper order.
| | * | | Fix for bug #848901 Assertion `fabs(cur_isc->x-m_cur_intersection->x) + ↵Alexey Botchkov2011-09-133-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fabs(cur_isc->y-m_cur_intersection->y) < 0.000000000001' failed in Gcalc_scan_iterator::intersection_scan() in maria-5.3-gis That assertion's check was too tight. Released it a bit. per-file comments: mysql-test/r/gis-precise.result Fix for bug #848901 test result updated. mysql-test/t/gis-precise.test Fix for bug #848901 test case added. sql/gcalc_slicescan.cc Fix for bug #848901 The DBUG_ASSERT check is too tight here.
| | * | | Fix for few similar bugs:Alexey Botchkov2011-09-135-35/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #841622 Assertion `t->rp->type == Gcalc_function::shape_line' failed in Gcalc_operation_reducer::end_line in maria-5.3-gi #841625 Assertion `m_poly_borders->next' failed in Gcalc_operation_reducer::count_slice in maria-5.3-gis #841638 Assertion `!m_prev || m_prev->x != x || m_prev->y != y' failed in Gcalc_shape_transporter::int_add_point in maria-5.3-gis #841662 Third assertion `n > 0 && n < SINUSES_CALCULATED*2+1' in get_n_sincos #841745 Assertion `!sp0->is_bottom()' failed in Gcalc_scan_iterator::find_intersections in maria-5.3-gis They mostly was caused by inprecision of double arithmetic. Fixed by changes in how to handle multiple intersections to keep their order right. Also ST_DISTANCE(GEOM, EMPTY_GEOM) was defined as NULL. per-file comments: mysql-test/r/gis-precise.result GIS bugfixes. test result updated. mysql-test/t/gis-precise.test GIS bugfixes. test cases added. sql/gcalc_slicescan.cc GIS bugfixes. If intersections are close, add order checks to cope with the double calcualtions imprecision. sql/gcalc_slicescan.h GIS bugfixes. n_row parameter added to intersection to check their order. sql/item_geofunc.cc GIS bugfixes. ST_DISTANCE(GEOM, EMPTY_GEOM) returns NULL.