1. 10 Jun, 2012 2 commits
  2. 05 Jun, 2012 1 commit
    • unknown's avatar
      Fixed bug lp:1000649 · f1ab0089
      unknown authored
      Analysis:
      
      When the method JOIN::choose_subquery_plan() decided to apply
      the IN-TO-EXISTS strategy, it set the unit and select_lex
      uncacheable flag to UNCACHEABLE_DEPENDENT_INJECTED unconditionally.
      As result, even if IN-TO-EXISTS injected non-correlated predicates,
      the subquery was still treated as correlated.
      
      Solution:
      Set the subquery as correlated only if the injected predicate(s) depend
      on the outer query.
      f1ab0089
  3. 04 Jun, 2012 1 commit
  4. 02 Jun, 2012 1 commit
  5. 01 Jun, 2012 2 commits
  6. 30 May, 2012 1 commit
    • unknown's avatar
      Fix for bug lp:1006231 · 66dfceb1
      unknown authored
      Analysis:
      
      When a subquery that needs a temp table is executed during
      the prepare or optimize phase of the outer query, at the end
      of the subquery execution all the JOIN_TABs of the subquery
      are replaced by a new JOIN_TAB that selects from the temp table.
      However that temp table has no corresponding TABLE_LIST.
      Once EXPLAIN execution reaches its last phase, it tries to print
      the names of the subquery tables through its TABLE_LISTs, but in
      the case of this bug there is no such TABLE_LIST (it is NULL),
      hence a crash.
      
      Solution:
      The fix is to block subquery evaluation inside
      Item_func_like::fix_fields and Item_func_like::select_optimize()
      using the Item::is_expensive() test.
      66dfceb1
  7. 29 May, 2012 1 commit
    • Alexey Botchkov's avatar
      MDEV-294 SELECT WHERE ST_CONTAINS doesn't return all the records where ST_CONTAINS() is 1. · 662c51ba
      Alexey Botchkov authored
              Optimizator fails using index with ST_Within(g, constant_poly).
      
      per-file comments:
        mysql-test/r/gis-rt-precise.result
              test result fixed.
        mysql-test/r/gis-rtree.result
              test result fixed.
        mysql-test/suite/maria/r/maria-gis-rtree-dynamic.result
              test result fixed.
        mysql-test/suite/maria/r/maria-gis-rtree-trans.result
              test result fixed.
        mysql-test/suite/maria/r/maria-gis-rtree.result
              test result fixed.
        storage/maria/ma_rt_index.c
              Use MBR_INTERSECT mode when optimizing the select WITH ST_Within.
        storage/myisam/rt_index.c
              Use MBR_INTERSECT mode when optimizing the select WITH ST_Within.
      662c51ba
  8. 25 May, 2012 2 commits
  9. 24 May, 2012 1 commit
  10. 23 May, 2012 3 commits
  11. 22 May, 2012 1 commit
    • unknown's avatar
      Fix bug lp:1002079 · 02bdc608
      unknown authored
        
        Analysis:
        The optimizer detects an empty result through constant table optimization.
        Then it calls return_zero_rows(), which in turns calls inderctly
        Item_maxmin_subselect::no_rows_in_result(). The latter method set "value=0",
        however "value" is pointer to Item_cache, and not just an integer value.
        
        All of the Item_[maxmin | singlerow]_subselect::val_XXX methods does:
          if (forced_const)
            return value->val_real();
        which of course crashes when value is a NULL pointer.
        
        Solution:
        When the optimizer discovers an empty result set, set
        Item_singlerow_subselect::value to a FALSE constant Item instead of NULL.
      02bdc608
  12. 21 May, 2012 1 commit
    • Alexey Botchkov's avatar
      MDEV-136 Non-blocking "set read_only". · b87ccfdf
      Alexey Botchkov authored
          Handle the 'set read_only=1' in lighter way, than the FLUSH TABLES READ LOCK;
          For the transactional engines we don't wait for operations on that tables to finish.
      
      per-file comments:
       mysql-test/r/read_only_innodb.result
      MDEV-136 Non-blocking "set read_only".
             test result updated.
       mysql-test/t/read_only_innodb.test
      MDEV-136 Non-blocking "set read_only".
             test case added.
        sql/mysql_priv.h
      MDEV-136 Non-blocking "set read_only".
              The close_cached_tables_set_readonly() declared.
        sql/set_var.cc
      MDEV-136 Non-blocking "set read_only".
               Call close_cached_tables_set_readonly() for the read_only::set_var.
         sql/sql_base.cc
       MDEV-136 Non-blocking "set read_only".
               Parameters added to the close_cached_tables implementation,
               close_cached_tables_set_readonly declared.
               Prevent blocking on the transactional tables if the
               set_readonly_mode is on.
      b87ccfdf
  13. 20 May, 2012 1 commit
  14. 18 May, 2012 4 commits
  15. 17 May, 2012 3 commits
  16. 15 May, 2012 1 commit
    • unknown's avatar
      Fix for LP bug#998516 · 3d37b67b
      unknown authored
      If we did nothing in resolving unique table conflict we should not retry (it leed to infinite loop).
      Now we retry (recheck) unique table check only in case if we materialized a table.
      3d37b67b
  17. 13 May, 2012 1 commit
    • Sergey Petrunya's avatar
      BUG#998236: Assertion failure or valgrind errors at best_access_path ... · 6d41fa0d
      Sergey Petrunya authored
      - Let fix_semijoin_strategies_for_picked_join_order() set 
        POSITION::prefix_record_count for POSITION records that it copies from
        SJ_MATERIALIZATION_INFO::tables. 
        (These records do not have prefix_record_count set, because they are optimized
         as joins-inside-semijoin-nests, without full advance_sj_state() processing).  
       
      6d41fa0d
  18. 12 May, 2012 3 commits
  19. 11 May, 2012 2 commits
    • unknown's avatar
      Merge 5.2->5.3 · e10fecc0
      unknown authored
      e10fecc0
    • unknown's avatar
      fix for LP bug#994392 · f2cbc014
      unknown authored
      The not_null_tables() of Item_func_not_all and Item_in_optimizer was inherited from
      Item_func by mistake. It made the optimizer think that  subquery
      predicates with ALL/ANY/IN were null-rejecting. This could trigger invalid
      conversions of outer joins into inner joins.
      f2cbc014
  20. 10 May, 2012 1 commit
  21. 08 May, 2012 3 commits
    • unknown's avatar
      Fix compiler warnings. · fe0a0bdb
      unknown authored
      fe0a0bdb
    • unknown's avatar
      Addition to the fix to LP bug#994275. · 4e2926d9
      unknown authored
      It is problem of constant propagated to ref* access method (the problem was hiden by using debug binaries for testing).
      4e2926d9
    • Vladislav Vaintroub's avatar
      MDEV-262 : log_state occationally fails in buildbot. · 54534a69
      Vladislav Vaintroub authored
      The failures are  missing entries in the slow query log.  The reason for the failure  are sleep() calls  with short duration 10ms, which is less than the default system timer resolution for various WaitForXXXObject functions  (15.6 ms) and thus can't work reliably.
      The fix is to make sleeps tiny bit longer (20ms from 10ms) in the test.
      54534a69
  22. 07 May, 2012 4 commits
    • Vladislav Vaintroub's avatar
      MDEV-261 : mysqtest crashes when assigning variable to result of select , like · 597e98bc
      Vladislav Vaintroub authored
      let x = `SELECT <something>`
      
      The fix is to detect the condition "no active connection",  to report error and die.
      Note, that the check for no active connection was already in place for ordinary commands, 
      and was missing only for assign-variable command.
      597e98bc
    • unknown's avatar
      LP bug#994275 fix. · ea8314fd
      unknown authored
      In 5.3 we substitute constants in ref access values it can't be null so we do not need add NOT NULL for early NULL filtering.
      ea8314fd
    • unknown's avatar
      Fix for LP bug#993726 · 80651436
      unknown authored
      Optimization of aggregate functions detected constant under max() and evalueted it, but condition in the WHWRE clause (which is always FALSE) was not taken into account
      80651436
    • unknown's avatar
      Fix for bug lp:992405 · 213476ef
      unknown authored
      The patch backports two patches from mysql 5.6:
      - BUG#12640437: USING SQL_BUFFER_RESULT RESULTS IN A DIFFERENT QUERY OUTPUT
      - Bug#12578908: SELECT SQL_BUFFER_RESULT OUTPUTS TOO MANY ROWS WHEN GROUP IS OPTIMIZED AWAY
      
      Original comment:
      -----------------
      3714 Jorgen Loland	2012-03-01
            BUG#12640437 - USING SQL_BUFFER_RESULT RESULTS IN A DIFFERENT 
                           QUERY OUTPUT
            
            For all but simple grouped queries, temporary tables are used to
            resolve grouping. In these cases, the list of grouping fields is
            stored in the temporary table and grouping is resolved
            there (e.g. by adding a unique constraint on the involved
            fields). Because of this, grouping is already done when the rows
            are read from the temporary table.
            
            In the case where a group clause may be optimized away, grouping
            does not have to be resolved using a temporary table. However, if
            a temporary table is explicitly requested (e.g. because the
            SQL_BUFFER_RESULT hint is used, or the statement is
            INSERT...SELECT), a temporary table is used anyway. In this case,
            the temporary table is created with an empty group list (because
            the group clause was optimized away) and it will therefore not
            create groups. Since the temporary table does not take care of
            grouping, JOIN::group shall not be set to false in 
            make_simple_join(). This was fixed in bug 12578908. 
            
            However, there is an exception where make_simple_join() should
            set JOIN::group to false even if the query uses a temporary table
            that was explicitly requested but is not strictly needed. That
            exception is if the loose index scan access method (explain
            says "Using index for group-by") is used to read into the 
            temporary table. With loose index scan, grouping is resolved 
            by the access method. This is exactly what happens in this bug.
      213476ef