1. 19 Nov, 2010 2 commits
    • unknown's avatar
      - Fixed innodb_mysql_lock2 test failure because the test did not · b1c6dc6e
      unknown authored
        anticipate different execution paths resulting in different
        thd->proc_info.
      - Fixed subselect_cache to contain correct results. The results
        are currently wrong in 5.3, but are correct in 5.2, and 5.3-mwl89.
      b1c6dc6e
    • unknown's avatar
      Fixed LP BUG#641203: Query returns rows where no result is expected (impossible WHERE) · de35f143
      unknown authored
      The cause for the bug was two-fold:
      1. Incorrect detection of whether a table is the first one in a query plan -
        "used_table & 1" actually checks if used_table is table with number "1".
      2. Missing logic to delay the evaluation of (expensive) constant conditions
        during the execution phase.
      
      The fix adds/changes:
      The patch:
      - removes incorrect treatment of expensive predicates from make_cond_for_table,
        and lets the caller decide when to evaluate expensive predicates.
      - saves expensive constant conditions in JOIN::exec_const_cond,
        which is evaluated once in the beginning of JOIN::exec.
      de35f143
  2. 05 Nov, 2010 2 commits
  3. 02 Nov, 2010 9 commits
    • Igor Babaev's avatar
      Merge · 2dc2098e
      Igor Babaev authored
      2dc2098e
    • Igor Babaev's avatar
      Removed empty lines. · 1f70c2a6
      Igor Babaev authored
      1f70c2a6
    • Igor Babaev's avatar
      Merge · 66191ef0
      Igor Babaev authored
      66191ef0
    • Igor Babaev's avatar
      Fixed LP bug #669420. · 432c9b20
      Igor Babaev authored
      This bug in the MRR code for Maria engine caused wrong results when
      MRR was used to scan ranges for each record.
      
      Added test cases for bugs 669420 and 669423 (as a duplicate of 669420).
      432c9b20
    • unknown's avatar
      Fixed LP BUG#652727 and LP BUG#643424. · 9f2bddbd
      unknown authored
      The fixes for #643424 was part of the fix for #652727, that's why both
      fixes are pushed together.
      
      - The cause for #643424 was the improper use of get_partial_join_cost(),
        which assumed that the 'n_tables' parameter was the upper bound for
        query plan node indexes.
        Fixed by generalizing get_partial_join_cost() as a method that computes
        the cost of any partial join.
      
      - The cause of #652727 was that JOIN::choose_subquery_plan() incorrectly
        deleted the contents of the old keyuse array in the cases when an injected
        plan would not provide more key accesses, and reoptimization was not actually
        performed.
      9f2bddbd
    • Sergei Golubchik's avatar
      merge · c186b79b
      Sergei Golubchik authored
      c186b79b
    • Sergei Golubchik's avatar
      fix windows embedded · 9a732491
      Sergei Golubchik authored
      9a732491
    • Sergei Golubchik's avatar
      merge w/ 5.2 · 74711a46
      Sergei Golubchik authored
      74711a46
    • Michael Widenius's avatar
      Fixed wrong queue_replace(), which caused timeout failure in pbxt.flush_read_lock_kill · c4a5cf11
      Michael Widenius authored
      Fixed compiler warnings.
      
      include/queues.h:
        Added prototype for queue_replace()
      mysys/queues.c:
        Fixed wrong queue_replace()
      mysys/thr_alarm.c:
        Added DBUG_PRINT
      sql/item_subselect.cc:
        Check return value of ha_rnd_init().
        (Fixes compiler warnings)
      sql/sql_class.cc:
        Fixed wrong test
      sql/sql_show.cc:
        Removed not used variable.
      c4a5cf11
  4. 30 Oct, 2010 2 commits
  5. 29 Oct, 2010 3 commits
  6. 28 Oct, 2010 1 commit
  7. 27 Oct, 2010 4 commits
    • unknown's avatar
      Fixed LP bug #613009 · 3bdede3c
      unknown authored
      The set of Ordered keys of a rowid merge engine is dense. Thus when
      we decide not to create a key for a column that has only NULLs, this
      column shouldn't be counted.
      
      Notice that the caller has already precomputed the correct total
      number of keys that should be created.
      3bdede3c
    • unknown's avatar
      Fixed LP bug #609121 · 3b11e4f8
      unknown authored
      Post-review fix - avoid re-evaluation of the having clause
      when it evaluates to true.
      3b11e4f8
    • unknown's avatar
      Fix test failure (timeout) in --valgrind tests in Buildbot. · 4cb9a326
      unknown authored
      The main.ps_ddl test does SELECT * FROM mysql.general_log; that can be really
      expensive with --valgrind if previous test cases put lots of data in the
      general log since last server restart. Fix by truncating the log at test start.
      4cb9a326
    • unknown's avatar
      Type of the variables fixed. · a09e5f50
      unknown authored
      sql/sql_expression_cache.cc:
        Type of the variable fixed.
      sql/sql_expression_cache.h:
        Type of the variable fixed.
      a09e5f50
  8. 26 Oct, 2010 2 commits
    • unknown's avatar
      Fixed LP bug #601156 · b4d5f30a
      unknown authored
      The cause for this bug is that MariaDB 5.3 still processes derived tables
      (subqueries in the FROM clause) by fully executing them during the parse
      phase. This will be remedied by MWL#106 once merged into the main 5.3.
      
      The assert statement is triggered when MATERIALIZATION is ON for EXPLAIN
      EXTENDED for derived tables with an IN subquery as follows:
      - mysql_parse calls JOIN::exec for the derived table as if it is regular
        execution (not explain).
      - When materialization is ON, this call goes all the way to
        subselect_hash_sj_engine::exec, which creates a partial match engine
        because of NULL presence.
      - In order to proceed with normal execution, the hash_sj engine substitutes
        itself with the created partial match engine.
      - After the parse phase it turns out that this execution was part of
        EXPLAIN EXTENDED, which in turn calls
        Item_cond::print -> ... -> Item_subselect::print,
        which calls engine->print().
        Since subselect_hash_sj_engine::exec substituted the current
        Item_subselect engine with a  partial match engine, eventually we call
        its ::print() method. However the partial match engines are designed only
        for execution, hence there is no implementation of this print() method.
      
      The fix temporarily removes the assert, until this code is merged with
      MWL#106.
      b4d5f30a
    • Sergei Golubchik's avatar
      fixes for windows · 7c24e8d5
      Sergei Golubchik authored
      7c24e8d5
  9. 25 Oct, 2010 3 commits
    • unknown's avatar
      Fixed LP bug #609121 · db4738a1
      unknown authored
      The bug was a result of missing logic to handle the case
      when there are 'expensive' predicates that are not evaluated
      during constant table optimization. Such is the case for
      the IN predicate, which is considered expensive if it is
      computed via materialization. In general this bug can be
      triggered with any expensive predicate instead of IN.
      
      When FALSE constant predicates are not evaluated during constant
      optimization, the execution path changes so that instead of
      setting JOIN::zero_result_cause after make_join_select, and
      exiting JOIN::exec via the call to return_zero_rows(), execution
      ends in JOIN::exec in the branch:
      if (join->tables == join->const_tables)
      {
        ...
        else if (join->send_row_on_empty_set())
           ...
           rc= join->result->send_data(*columns_list);
      }
      Unlike return_zero_rows(), this branch didn't evaluate the
      having clause of the query.
      
      The patch adds a call to evaluate the HAVING clause of a query even
      when all tables are constant, because even for an empty result set
      some aggregate functions may produce a NULL value.
      db4738a1
    • Sergei Golubchik's avatar
      merge with 5.1 · 04a4b433
      Sergei Golubchik authored
      04a4b433
    • Sergei Golubchik's avatar
      forgotten option handled · 37a78d68
      Sergei Golubchik authored
      37a78d68
  10. 24 Oct, 2010 1 commit
  11. 23 Oct, 2010 1 commit
  12. 22 Oct, 2010 1 commit
  13. 20 Oct, 2010 1 commit
  14. 26 Oct, 2010 1 commit
  15. 20 Oct, 2010 4 commits
    • unknown's avatar
      MWL#89: Cost-based choice between Materialization and IN->EXISTS transformation · e85a4cb6
      unknown authored
      - Added more tests to the MWL#89 specific test, and made the test more modular.
      - Updated test files.
      - Fixed a memory leak.
      - More comments.
      
      mysql-test/r/subselect_mat.result:
        - Updated the test file to reflect the new optimizer switches related to
          materialized subquery execution.
        - Added one extra test to test all cases that expose BUG#40037 (this is an old bug from 5.x).
        - Updated the test result with correct results that expose BUG#40037.
      mysql-test/t/subselect_mat.test:
        - Updated the test file to reflect the new optimizer switches related to
          materialized subquery execution.
        - Added one extra test to test all cases that expose BUG#40037 (this is an old bug from 5.x).
        - Updated the test result with correct results that expose BUG#40037.
      sql/sql_select.cc:
        Fixed a memory leak reported by Valgrind.
      e85a4cb6
    • Sergei Golubchik's avatar
      better fix for MySQL bugs · 60c15066
      Sergei Golubchik authored
      BUG#26447 prefer a clustered key for an index scan, as secondary index is always slower
        ... which was fixed to cause
      BUG#35850 queries take 50% longer
        ... and was reverted
      
      and
      
      BUG#39653 prefer a secondary index for an index scan, as clustered key is always slower
        ... which was fixed to cause
      BUG#55656 mysqldump takes six days instead of half an hour
        ... and was amended with a special case workaround
      
      
      sql/opt_range.cc:
        move get_index_only_read_time() into the handler class
      sql/sql_select.cc:
        use cost not an index length when choosing a cheaper index
      60c15066
    • Sergei Golubchik's avatar
      b56086cb
    • Sergei Golubchik's avatar
      updated test results · 36fe0441
      Sergei Golubchik authored
      36fe0441
  16. 19 Oct, 2010 3 commits