1. 12 May, 2012 3 commits
  2. 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
  3. 10 May, 2012 1 commit
  4. 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
  5. 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
  6. 03 May, 2012 1 commit
    • unknown's avatar
      Fix bug lp:993745 · c9a73aa2
      unknown authored
      This is a backport of the fix for MySQL bug #13723054 in 5.6.
      
      Original comment:
            The crash is caused by arbitrary memory area owerwriting in case of
            BLOB fields during attempt to copy BLOB field key image into record
            buffer(record buffer is too small to get BLOB key part image).
            note:
            QUICK_GROUP_MIN_MAX_SELECT can not work with BLOB fields
            because it uses record buffer as temporary buffer for key values
            however this case is filtered out by covering_keys() check
            in get_best_group_min_max() as BLOBs always require key length
            modificator in the key declaration and if the key has a BLOB
            then it can not be covered key.
            The fix is to use 'max_used_key_length' key length instead of 0.
      
      Analysis:
      Spcifically the crash in this bug was a result of the call to key_copy()
      that copied the whole key, inlcuding the BLOB field which is not used
      for index access. Copying the blob field overwrote memory as far as the
      function parameter 'key_info'. As a result the contents of key_info was
      all 0, which resulted in a crash when this key_info was accessed few
      lines below in key_cmp().
      c9a73aa2
  7. 02 May, 2012 1 commit
  8. 03 May, 2012 1 commit
  9. 02 May, 2012 8 commits
  10. 29 Apr, 2012 1 commit
    • Alexey Botchkov's avatar
      bug #977021 ST_BUFFER fails with the negative D. · af084bcd
      Alexey Botchkov authored
        Points and lines should disappear if we got negative D.
        To make it work properly inside the GEOMETRYCOLLECTION,
        we add the empty operation there.
      
      bug #986977 Assertion `!cur_p->event' failed in Gcalc_scan_iterator::arrange_event(int, int).
        The double->inernal coord conversion produced -0 (minus zero) on some data.
        That minus-zero produces invalid comparison results when compared agains plus-zero.
        So we fixed the gcalc_set_double() to avoid it.
      
      per-file comments:
        mysql-test/r/gis-precise.result
              result updated.
        mysql-test/t/gis-precise.test
              tests for #977021 and #986977 added.
        sql/gcalc_slicescan.cc
              bug #986977. The gcalc_set_double fixed to not produce minus-zero.
        sql/item_geofunc.cc
              bug #977021. Add the NOOP for the disappearing features.
      af084bcd
  11. 26 Apr, 2012 1 commit
  12. 27 Apr, 2012 1 commit
    • unknown's avatar
      Fix bug lp:985667, MDEV-229 · c04786d3
      unknown authored
      Analysis:
      
      The reason for the wrong result is the interaction between constant
      optimization (in this case 1-row table) and subquery optimization.
      
      - First the outer query is optimized, and 'make_join_statistics' finds that
      table t2 has one row, reads that row, and marks the whole table as constant.
      This also means that all fields of t2 are constant.
      
      - Next, we optimize the subquery in the end of the outer 'make_join_statistics'.
      The field 'f2' is considered constant, with value '3'. The subquery predicate
      is rewritten as the constant TRUE.
      
      - The outer query execution detects early that the whole query result is empty
      and calls 'return_zero_rows'. Since the query is with implicit grouping, we
      have to produce one row with special values for the aggregates (depending on
      each aggregate function), and NULL values for all non-aggregate fields.  This
      function calls 'no_rows_in_result' to set each aggregate function to the
      default value when it aggregates over an empty result, and then calls
      'send_data', which in turn evaluates each Item in the SELECT list.
      
      - When evaluation reaches the subquery predicate, it executes the subquery
      with field 'f2' having a constant value '3', and the subquery produces the
      incorrect result '7'.
      
      Solution:
      
      Implement Item::no_rows_in_result for all subquery predicates. In order to
      make this work, it is also needed to make all val_* methods of all subquery
      predicates respect the Item_subselect::forced_const flag. Otherwise subqueries
      are executed anyways, and override the default value set by no_rows_in_result
      with whatever result is produced from the subquery evaluation.
      c04786d3
  13. 25 Apr, 2012 1 commit
  14. 24 Apr, 2012 1 commit
  15. 23 Apr, 2012 2 commits
  16. 20 Apr, 2012 1 commit
    • Vladislav Vaintroub's avatar
      LPBUG#983285 - incompatibility in frm in case of VIEWs with non-default ALGORITHM option. · 97aa8e8c
      Vladislav Vaintroub authored
      As part of derived tables redesign, values for VIEW_ALGORITHM_MERGE and VIEW_ALGORITHM_TMPTABLE have changed from (former values 1 rsp 2 , new values 5 rsp 9).
      
      This lead to the problem that views, created with version 5.2  or earlier would not work in all situations  (e.g "SHOW CREATE VIEW"), or with mysqldump.
      
      The fix is to restore backward compatibility for the from file, and convert algorithm={1,2} in the frm to {5,9} when reading .frm from disk, and store backward compatible values when writing from to disk. 
      
      Also allow processing correct processing for "invalid" .frms created with MariaDB 5.3/5.5 GA releases (where algorithm stored in memory matched the one stored in frm).
      97aa8e8c
  17. 19 Apr, 2012 3 commits
    • unknown's avatar
      LP BUG#978847 fixed. · 9997b78a
      unknown authored
      Fixed incorrect type casting which made all fields (except very first) changes to materialized table incorrect.
      Saved list of view/derived table used items after expanding '*'.
      9997b78a
    • Sergey Petrunya's avatar
      BUG#978479: Wrong result (extra rows) with... · b9bbe4a1
      Sergey Petrunya authored
      BUG#978479: Wrong result (extra rows) with derived_with_keys+loosescan+semijoin=ON, materialization=OFF
      - Part#2: Don't try to construct a LooseScan access on indexes that do not guarantee 
        index-ordered reads.
      
      b9bbe4a1
    • Sergey Petrunya's avatar
      BUG#978479: Wrong result (extra rows) with... · 994c6db2
      Sergey Petrunya authored
      BUG#978479: Wrong result (extra rows) with derived_with_keys+loosescan+semijoin=ON, materialization=OFF
      Part#1: make EXPLAIN's plan match the one by actual execution: 
      Item_subselect::used_tables() should return the same value irrespectively 
      of whether we're running an EXPLAIN or a SELECT.
      994c6db2
  18. 18 Apr, 2012 1 commit
  19. 16 Apr, 2012 4 commits