1. 09 Apr, 2013 3 commits
  2. 07 Apr, 2013 1 commit
    • Igor Babaev's avatar
      Fixed bug mdev-4363. · e3bf08d4
      Igor Babaev authored
      When calculating the selectivity of a range in the function
      get_column_range_cardinality a check whether NULL values are
      included into into the range must be done.
      e3bf08d4
  3. 06 Apr, 2013 4 commits
    • Igor Babaev's avatar
      Fixed bug mdev-4369. · 10f0530b
      Igor Babaev authored
      The function was adjusted to be able to aggregate
      the counters of the merged elements. 
      Before this change it was not possible to guarantee the correctness
      of the counters passed to the the call-back parameter walk_action.
      As a result, when some elements of a Unique object were flushed into
      disk the function passed to merge_walk() as the call-back parameter
      could return wrong counters of elements. This could lead to building
      wrong histograms. 
      10f0530b
    • Igor Babaev's avatar
      Fixed bug mdev-4372. · 1c30fb2a
      Igor Babaev authored
      Range analysis of non-indexed columns should handle properly range trees
      with type == SEL_TREE::MAYBE.
      1c30fb2a
    • Igor Babaev's avatar
      Fixed bug mdev-4373: · b2d0a33e
      Igor Babaev authored
      Valgrind complained on usage of uninitialized memory.
      b2d0a33e
    • Igor Babaev's avatar
      Fixed bugs mdev-4357 and mdev-4359. · 1ae352af
      Igor Babaev authored
      The values of the column HIST_TYPE from the statistical table
      mysql.column_stats were stored in the table and read from the
      table incorrectly.
      1ae352af
  4. 05 Apr, 2013 2 commits
    • Igor Babaev's avatar
      Fixed bug mdev-4371. · 503731d8
      Igor Babaev authored
      Avoid possible division by 0.
      503731d8
    • Igor Babaev's avatar
      Fixed bug mdev-4370. · daaa5834
      Igor Babaev authored
      Don't try to a histogram if it is not read into the cache for statistical data.
      It may happen so if optimizer_use_condition_selectivity is set to 3. This 
      setting orders the optimizer not use histograms to calculate selectivity.
      daaa5834
  5. 04 Apr, 2013 3 commits
    • Igor Babaev's avatar
      Fixed bug mdev-4366. · 4079a5dc
      Igor Babaev authored
      When performing the range analysis for a conjunction the function
      calculate_cond_selectivity_for_table should take in to account that
      the analysis of some conjuncts may return SEL_ARG::IMPOSSIBLE.
      4079a5dc
    • Igor Babaev's avatar
      Fixed bug mdev-4367. · 50d4d1ca
      Igor Babaev authored
      When calculating selectivity of conditions one should take into account
      the cases when some tables to be joined are empty.
      50d4d1ca
    • Igor Babaev's avatar
      Fixed bug mdev-4350. · d62ee4e9
      Igor Babaev authored
      Wrong formulas used by the function Histogram::point_selectivity()
      could result in a negative value of selectivity returned by the
      function.
      d62ee4e9
  6. 03 Apr, 2013 2 commits
  7. 02 Apr, 2013 2 commits
    • Sergey Petrunya's avatar
      Fix buildbot failure in show_explain.test: · ef5241ae
      Sergey Petrunya authored
      mysqltest: At line 477: query 'show explain for $thr2' failed: 1933: Target is not running an EXPLAINable command
      
      After the fix for MDEV-4144, subquery with WHERE pk= (select ...) became a degenerate, constant 
      SELECT.  It is not executed in normal way anymore, so it is not possible to catch it in-execution.
      ef5241ae
    • Igor Babaev's avatar
      Fixed bug mdev-4348. · 70badba5
      Igor Babaev authored
      The bug was caused a wrong casting.
      70badba5
  8. 01 Apr, 2013 3 commits
  9. 31 Mar, 2013 5 commits
  10. 30 Mar, 2013 1 commit
    • Igor Babaev's avatar
      Fixed several bugs for mwl #253. · 90554986
      Igor Babaev authored
      One of them is quite serious: the function table_cond_selectivity used
      the TABLE_REF structure for ref/eq_ref access methods as if they had been
      filled. In  fact these structure are filled after the best execution plan
      has been chosen.
      
      The other bugs happened due to:
      - an erroneous attempt at get statistics on the result of materialization
        of a view
      - incorrect handling of ranges with no left/right limits when calculating
        selectivity of range conditions on non-indexed columns
      - lack of cleanup for some newly introduced fields
       
      90554986
  11. 29 Mar, 2013 3 commits
    • unknown's avatar
      Fix for MDEV-4144 · 599a1384
      unknown authored
        
      Analysis:
      The reason for the inefficent plan was that Item_subselect::is_expensive()
      didn't detect the special case when a subquery was optimized, but had no
      join plan because it either has no table, or its tables have been optimized
      away, or the optimizer detected that the result set is empty.
        
      Solution:
      Identify the special cases above in the Item_subselect::is_expensive(),
      and consider such degenerate subqueries inexpensive.
      599a1384
    • Vladislav Vaintroub's avatar
      fa01b76b
    • Igor Babaev's avatar
      Merge 5.3->5.5. · e91e8c8c
      Igor Babaev authored
      e91e8c8c
  12. 28 Mar, 2013 2 commits
    • Igor Babaev's avatar
      Merge · a2c3d7d3
      Igor Babaev authored
      a2c3d7d3
    • Igor Babaev's avatar
      Fixed bug mdev-4311 (bug #68749). · 323fdd7a
      Igor Babaev authored
      This bug was introduced by the patch for WL#3220.
      If the memory allocated for the tree to store unique elements
      to be counted is not big enough to include all of them then
      an external file is used to store the elements.
      The unique elements are guaranteed not to be nulls. So, when 
      reading them from the file we don't have to care about the null
      flags of the read values. However, we should remove the flag 
      at the very beginning of the process. If we don't do it and
      if the last value written into the record buffer for the field
      whose distinct values needs to be counted happens to be null,
      then all values read from the file  are considered to be nulls
      and are not counted in.
      The fix does not remove a possible null flag for the read values.
      Rather it just counts the values in the same way it was done
      before WL #3220.
      323fdd7a
  13. 27 Mar, 2013 3 commits
  14. 26 Mar, 2013 6 commits