1. 02 Apr, 2011 1 commit
    • Sergey Petrunya's avatar
      Make EXPLAIN better at displaying MRR/BKA: · 997445bc
      Sergey Petrunya authored
      - "Using MRR" is no longer shown with range access.
      - Instead, both range and BKA accesses will show one of the following:
        = "Rowid-ordered scan"
        = "Key-ordered scan"
        = "Key-ordered Rowid-ordered scan"
      depending on whether DS-MRR implementation will do scan keys in order, rowids in order,
      or both.
      - The patch also introduces a way for other storage engines/MRR implementations to
        pass information to EXPLAIN output about the properties of employed MRR scans.
      997445bc
  2. 25 Mar, 2011 3 commits
  3. 24 Mar, 2011 1 commit
    • unknown's avatar
      Fix LP BUG#715738 · ec239491
      unknown authored
      Analysis:
      A query with implicit grouping is one with aggregate functions and
      no GROUP BY clause. MariaDB inherits from MySQL an SQL extenstion
      that allows mixing aggregate functions with non-aggregate fields.
      If a query with such mixed select clause produces an empty result
      set, the meaning of aggregate functions is well defined - either
      NULL (MIN, MAX, etc.), or 0 (count(*)). However the non-aggregated
      fields must also have some value, and the only reasonable value in
      the case of empty result is NULL.
      
      The cause of the many wrong results was that if a field is declared
      as non-nullable (e.g. because it is a PK or NOT NULL), the semantic
      analysis and the optimization phases treat this field as non-nullable,
      and generate all related query plan elements based on this assumption.
      
      Later during execution, these incorrectly configured/generated query
      plan elements result in a wrong result because the selected fields
      are not null due to the not-null assumption during optimization.
      
      Solution:
      Detect before the context analysys phase that a query uses implicit
      grouping with mixed aggregates/non-aggregates, and set all fields
      as nullable. The parser already walks the SELECT clause, and
      already sets Item::with_sum_func for Items that reference aggreagate
      functions. The patch adds a symmetric Item::with_field so that all
      Items that reference an Item_field are marked during their
      construction at parse time in the same way as with aggregate function
      use.
      ec239491
  4. 15 Mar, 2011 1 commit
  5. 13 Mar, 2011 3 commits
    • unknown's avatar
      Merge in the fix for LPBUG#730604, and a corrected fix for LP BUG#719198, · 3f944c43
      unknown authored
      after Monty's review.
      3f944c43
    • unknown's avatar
      Fix LP BUG#719198, LP BUG#730604 · 428b52f5
      unknown authored
      Analysis (BUG#719198):
      The assert failed because the execution code for
      partial matching is designed with the assumption that
      NULLs on the left side are detected as early as possible,
      and a NULL result is returned before any lookups are
      performed at all.
      
      However, in the case of an Item_cache object on the left
      side, null was not detected properly, because detection
      was done via Item::is_null(), which is not implemented at
      all for Item_cache, and resolved to the default Item::is_null()
      which always returns FALSE.
      
      Solution:
      Imlpement Item::is_null().
      
      ******
      
      Analysis (BUG#730604):
      The method Item_field::is_null() determines if an item is NULL from its
      Item_field::field object. However, for Item_fields that represent internal
      temporary tables, Item_field::field represents the field of the original
      table that was the source for the temporary table (in this case t1.f3).
      Both in the committed test case, and in the original bug report the current
      value of t1.f3 is not NULL. This results in an incorrect count of NULLs
      for this column. As a consequence, all related Ordered_key buffers are
      allocated with incorrect sizes. Depending on the exact query and data,
      these incorrect sizes result in various crashes or failed asserts.
      
      Solution:
      The correct value of the current field of the internal temp table is
      in Item_field::result_field. This value is determined by
      Item::is_null_result().
      428b52f5
    • Igor Babaev's avatar
      Merge · edc69e32
      Igor Babaev authored
      edc69e32
  6. 12 Mar, 2011 3 commits
  7. 11 Mar, 2011 8 commits
  8. 10 Mar, 2011 1 commit
  9. 09 Mar, 2011 3 commits
  10. 08 Mar, 2011 5 commits
    • Michael Widenius's avatar
    • unknown's avatar
      Fix LP BUG#719198 · 546a166b
      unknown authored
      Analysis:
      The assert failed because the execution code for
      partial matching is designed with the assumption that
      NULLs on the left side are detected as early as possible,
      and a NULL result is returned before any lookups are
      performed at all.
      
      However, in the case of an Item_cache object on the left
      side, null was not detected properly, because detection
      was done via Item::is_null(), which is not implemented at
      all for Item_cache, and resolved to the default Item::is_null()
      which always returns FALSE.
      
      Solution:
      Use the property Item::null_value instead of is_null(), which
      is properly updated for Item_cache objects as well.
      546a166b
    • Michael Widenius's avatar
      Automatic merge with 5.1 · ce675406
      Michael Widenius authored
      ce675406
    • Michael Widenius's avatar
      Don't check if LAST_IO_Error has changed as this is not a user variable and it... · 251a5fa9
      Michael Widenius authored
      Don't check if LAST_IO_Error has changed as this is not a user variable and it may change depending on timing issues between master and slave
      251a5fa9
    • Igor Babaev's avatar
      Fixed LP bug #729039. · 3d3d5f1d
      Igor Babaev authored
      If join condition is of the form <t2.key>=<t1.no_key> then the server
      performs no index look-ups when looking for matching rows of t2 for
      the rows from t1 with t1.no_key=NULL. It happens because the function
      add_not_null_conds() injects an additional condition of the form 
      IS NOT NULL(<t1.no_key>) into the WHERE condition.
      However if the join condition was of the form <t.key>=<outer_ref> no
      additional null rejecting predicate was generated. This could lead
      to extra records in the result set if the value of <outer_ref> happened
      to be NULL.
      The new code injects null rejecting predicates of the form 
      IS NOT NULL(<outer_ref>) and evaluates them before the first row
      the subquery is constructed.
      3d3d5f1d
  11. 07 Mar, 2011 1 commit
  12. 05 Mar, 2011 1 commit
    • Sergey Petrunya's avatar
      BUG#727667 Wrong result with OR + NOT NULL in maria-5.3 · 76165dc7
      Sergey Petrunya authored
      - put the code that sets HA_NULL_PART bit back
      - Fix test_if_ref/part_of_refkey() so that 
        = NULL-ability of lookup columns does not prevent the equality 
          from being removed (we now have early/late NULLs filtering which 
          will filter out NULL values)
        = equality is not removed if it is ref_or_null access, and the value 
          of the lookup column can alternate between the lookup value and NULL.
      76165dc7
  13. 04 Mar, 2011 7 commits
  14. 03 Mar, 2011 2 commits