1. 10 Jul, 2011 1 commit
    • Igor Babaev's avatar
      Fixed LP bug #806097. · a515802c
      Igor Babaev authored
      The value of THD::used tables should be re-evaluated after merges
      of views and derived tables into the main query. 
      Now it's done in the function SELECT_LEX::update_used_tables.
      The re-evaluation of the 'used_table' bitmaps for the items
      in HAVING, GROUP BY and ORDER BY clauses has been added as well.
       
      a515802c
  2. 09 Jul, 2011 3 commits
  3. 08 Jul, 2011 9 commits
  4. 07 Jul, 2011 7 commits
    • Igor Babaev's avatar
      Merge. · f222a513
      Igor Babaev authored
      f222a513
    • Igor Babaev's avatar
      Fixed LP bug #806477. · e55e78ee
      Igor Babaev authored
      The offending query returns a wrong result set because the optimizer
      erroneously eliminated the where condition evaluated it to TRUE.
      The cause of this wrong transformation was that the flag maybe_null
      for an inner table of the outer join was not set to TRUE after the 
      table had replaced the wrapping view.
      Now the function SELECT_LEX::update_used_tables resets the value
      of the maybe_null flag for each leaf table of the query after all
      merges of views have been done.
      
       
      e55e78ee
    • unknown's avatar
      Test for bug lp:612543 · 0f36ab3a
      unknown authored
      The bug itself has been fixed by MWL#89.
      0f36ab3a
    • unknown's avatar
      Test case for bug lp:611690 · 5f5cbf76
      unknown authored
      The bug itself has been fixed by MWL#89.
      5f5cbf76
    • unknown's avatar
      Fix bug lp:806943 · 4128ec48
      unknown authored
      Analysis:
      This bug is yet another incarnation of the generic problem
      where optimization of the outer query triggers evaluation
      of a subquery, and this evaluation performs a destructive
      change to the subquery plan. Specifically a temp table is
      created for the DISTINCT operation that replaces the
      original subquery table. Later, select_describe() attempts
      to print the table name, however, there is no corresponding
      TABLE_LIST object to the internal temp table, so we get a
      crash. Execution works fine because it is not interested in
      the corresponding TABLE_LIST object (or its name).
      
      Solution:
      Similar to other such bugs, block the evaluation of expensive
      Items in convert_const_to_int().
      4128ec48
    • Igor Babaev's avatar
      Merge. · 801a4ebc
      Igor Babaev authored
      801a4ebc
    • Igor Babaev's avatar
      Fixed LP bug #806431. · b79316f5
      Igor Babaev authored
      The function generate_derived_keys_for_table incorrectly handled
      the cases when a materialized view or derived table could be accessed
      by different keys on the same fields if these keys depended on the
      same tables.
        
      b79316f5
  5. 06 Jul, 2011 4 commits
  6. 05 Jul, 2011 6 commits
  7. 04 Jul, 2011 5 commits
    • Sergey Petrunya's avatar
      Change the default @@optimizer_switch setting from · c1de6f8b
      Sergey Petrunya authored
        semijoin=on,firstmatch=on,loosescan=on
      to
        semijoin=off,firstmatch=off,loosescan=off
      Adjust the testcases:
      - Modify subselect*.test and join_cache.test so that all tests
        use the same execution paths as before (i.e. optimizations that
        are being tested are enabled)
      - Let all other test files run with the new default settings (i.e.
        with new optimizations disabled)
      - Copy subquery testcases from these files into t/subselect_extra.test
        which will run them with new optimizations enabled.
      c1de6f8b
    • Igor Babaev's avatar
      Merge. · 3984062b
      Igor Babaev authored
      3984062b
    • Michael Widenius's avatar
      Automatic merge · c9e969b6
      Michael Widenius authored
      c9e969b6
    • unknown's avatar
      Fix LP bug lp:802979 · 59784abe
      unknown authored
      Analysis:
      This bug consists of two related problems that are
      result of too early evaluation of single-row subqueries
      during the optimization phase of the outer query.
      
      Several optimizer code paths try to evaluate single-row
      subqueries in order to produce a constant and use that
      constant for further optimzation.
      
      When the execution of the subquery peforms destructive
      changes to the representation of the subquery, and these
      changes are not anticipated by the subsequent optimization
      phases of the outer query, we tipically get a crash or
      failed assert.
      
      Specifically, in this bug the inner-most suqbuery with
      DISTINCT triggers a substitution of the original JOIN
      object by a single-table JOIN object with a temp table
      needed to perform the DISTINCT operation (created by
      JOIN::make_simple_join).
      
      This substitution breaks EXPLAIN because:
      a) in the first example JOIN::cleanup no longer can
      reach the original table of the innermost subquery, and
      close all indexes, and
      b) in this second test query, EXPLAIN attempts to print
      the name of the internal temp table, and crashes because
      the temp table has no name (NULL pointer instead).
      
      Solution:
      a) fully disable subquery evaluation during optimization
      in all cases - both for constant propagation and range
      optimization, and
      b) change JOIN::join_free() to perform cleanup irrespective
      of EXPLAIN or not.
      59784abe
    • Michael Widenius's avatar
      Aria fixes: · 7199ac59
      Michael Widenius authored
      - Fixed multi-user problem with one thread doing inserts and another doing scans that gave error 175
      - Fixed bug that caused assert in move_to_next_bitmap() & _ma_read_bitmap_page()
      - Much more DBUG_ASSERT(!maria_assert_if_crashed_table) to detect errors early
      - EXTERNAL_LOCKING -> MARIA_EXTERNAL_LOCKING (to use same define everywhere
      
      storage/maria/ma_bitmap.c:
        More secure handling of first_bitmap_with_space (now we also take care of wrong values)
        Don't set page to -1; This fixed unlikely bug that caused assert in move_to_next_bitmap() & _ma_read_bitmap_page()
      storage/maria/ma_blockrec.c:
        More DBUG_ASSERT()'s
        Fixed multi-user problem with one thread doing inserts and another doing scans that gave error 175
        (We should use data_file_length from start of scan, not new value as new bitmap page may not yet be in page cache)
      storage/maria/ma_check.c:
        EXTERNAL_LOCKING -> MARIA_EXTERNAL_LOCKING (to use same define everywhere)
      storage/maria/ma_checkpoint.c:
        Made maria_checkpoint_min_activity static so that one can change it in debugger while testing.
        Fixed long standing performance problem that caused write of state info at checkpoint for any file that was ever changed since open.
      storage/maria/ma_create.c:
        EXTERNAL_LOCKING -> MARIA_EXTERNAL_LOCKING (to use same define everywhere
      storage/maria/ma_dynrec.c:
        Added missing MARIA_EXTERNAL_LOCKING (minor performance improvement)
      storage/maria/ma_locking.c:
        EXTERNAL_LOCKING -> MARIA_EXTERNAL_LOCKING (to use same define everywhere
      storage/maria/ma_open.c:
        EXTERNAL_LOCKING -> MARIA_EXTERNAL_LOCKING (to use same define everywhere
      storage/maria/ma_pagecache.c:
        Added assert to detect reads outside of data file
      storage/maria/maria_def.h:
        Added checkpoint_state to cache state writes in checkpoint
      7199ac59
  8. 03 Jul, 2011 1 commit
    • Igor Babaev's avatar
      Fixed LP bug #804686. · 3f7d51d0
      Igor Babaev authored
      The assert conditions in the functions Item_direct_ref_to_ident::transform
      and Item_direct_ref_to_ident::compile could be not valid after constant
      propagation when fields and field references may be substituted for constants.
      Not only these invalid asserts have been removed, but the functions containing
      them have been removed as well because now Item_ref::transform and 
      Item_ref::compile can be used instead of them.
      3f7d51d0
  9. 02 Jul, 2011 2 commits
  10. 01 Jul, 2011 2 commits