1. 10 Dec, 2009 1 commit
  2. 07 Dec, 2009 1 commit
    • Georgi Kodinov's avatar
      Bug #42760: Select doesn't return desired results when we have null values · b19593a5
      Georgi Kodinov authored
      Part 2 : 
      There was a special optimization on the ref access method for 
      ORDER BY ... DESC that was set without actually looking on the type of the 
      selected index for ORDER BY.
      Fixed the SELECT ... ORDER BY .. DESC (it uses a different code path compared
      to the ASC that has been fixed with the previous fix).
      b19593a5
  3. 10 Dec, 2009 2 commits
    • Ramil Kalimullin's avatar
      Auto-merge. · 587e4742
      Ramil Kalimullin authored
      587e4742
    • He Zhenxing's avatar
      Post fix for bug#45520 · 48adc9ac
      He Zhenxing authored
      mysql-test/include/kill_query.inc:
        Error 1034 can be generated when change MyISAM table indexes was interrupted
      mysql-test/r/rpl_killed_ddl.result:
        table t4 may not exists because the ALTER above was interrupted
      mysql-test/t/rpl_killed_ddl.test:
        table t4 may not exists because the ALTER above was interrupted
      48adc9ac
  4. 09 Dec, 2009 2 commits
    • He Zhenxing's avatar
      removed rpl_killed_ddl from disabled list · 67b6743b
      He Zhenxing authored
      67b6743b
    • He Zhenxing's avatar
      BUG#45520 rpl_killed_ddl fails sporadically in pb2 · be3fe854
      He Zhenxing authored
      There are three issues that caused rpl_killed_ddl fails sporadically
      in pb2:
      
       1) thd->clear_error() was not called before create Query event
      if operation is executed successfully.
       2) DATABASE d2 might do exist because the statement to CREATE or
      ALTER it was killed
       3) because of bug 43353, kill the query that do DROP FUNCTION or
          DROP PROCEDURE can result in SP not found
      
      This patch fixed all above issues by:
       1) Called thd->clear_error() if the operation succeeded.
       2) Add IF EXISTS to the DROP DATABASE d2 statement
       3) Temporarily disabled testing DROP FUNCTION/PROCEDURE IF EXISTS.
      
      mysql-test/t/rpl_killed_ddl.test:
        DATABASE d2 might not exists, add IF EXITS to the DROP statement
      sql/sql_db.cc:
        Called thd->clear_error() if the operation succeeded
      be3fe854
  5. 06 Dec, 2009 1 commit
    • Staale Smedseng's avatar
      Bug #47391 no stack trace printed to error log on · 76f1127f
      Staale Smedseng authored
      solaris after a crash
            
      This patch adds a Solaris-specific version of
      print_stacktrace() which uses printstack(2), available on all
      Solaris versions since Solaris 9. (While Solaris 11 adds
      support for the glibc functions backtrace_*() as of
      PSARC/2007/162, printstack() is used for consistency over all
      Solaris versions.)
      
      The symbol names are mangled, so use of c++filt may be
      required as described in the MySQL documentation.
      
      
      sql/stacktrace.c:
        Added Solaris-specific print_stacktrace().
      76f1127f
  6. 04 Dec, 2009 1 commit
    • Ramil Kalimullin's avatar
      Fix for bug#49199: Optimizer handles incorrectly: · cb744ed9
      Ramil Kalimullin authored
      field='const1' AND field='const2' in some cases
      
      Building multiple equality predicates containing
      a constant which is compared as a datetime (with a field)
      we should take this fact into account and compare the 
      constant with another possible constatns as datetimes 
      as well.
      
      E.g. for the
      SELECT ... WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'
      we should compare '2001-01-01' with '2001-01-01 00:00:00' as
      datetimes but not as strings.
      
      
      mysql-test/r/select.result:
        Fix for bug#49199: Optimizer handles incorrectly: 
        field='const1' AND field='const2' in some cases
          - test result.
      mysql-test/t/select.test:
        Fix for bug#49199: Optimizer handles incorrectly: 
        field='const1' AND field='const2' in some cases
          - test case.
      sql/item_cmpfunc.cc:
        Fix for bug#49199: Optimizer handles incorrectly: 
        field='const1' AND field='const2' in some cases
          - adding a constant to Item_equal compare it as
        a datetime value with stored one if there's a 
        date[time] field in a equality predicate.
      sql/item_cmpfunc.h:
        Fix for bug#49199: Optimizer handles incorrectly: 
        field='const1' AND field='const2' in some cases
          - adding a constant to Item_equal compare it as
        a datetime value with stored one if there's a 
        date[time] field in a equality predicate.
      sql/sql_select.cc:
        Fix for bug#49199: Optimizer handles incorrectly: 
        field='const1' AND field='const2' in some cases
          - adding a constant to Item_equal compare it as
        a datetime value with stored one if there's a 
        date[time] field in a equality predicate.
      cb744ed9
  7. 03 Dec, 2009 2 commits
  8. 02 Dec, 2009 1 commit
  9. 01 Dec, 2009 2 commits
    • Evgeny Potemkin's avatar
      Bug#48508: Crash on prepared statement re-execution. · 298ecc19
      Evgeny Potemkin authored
      Actually there is two different bugs.
      The first one caused crash on queries with WHERE condition over views
      containing WHERE condition. A wrong check for prepared statement phase led
      to items for view fields being allocated in the execution memory and freed
      at the end of execution. Thus the optimized WHERE condition refers to
      unallocated memory on the second execution and server crashed.
      The second one caused by the Item_cond::compile function not saving changes
      it made to the item tree. Thus on the next execution changes weren't
      reverted and server crashed on dereferencing of unallocated space.
      
      The new helper function called is_stmt_prepare_or_first_stmt_execute
      is added to the Query_arena class.
      The find_field_in_view function now uses
      is_stmt_prepare_or_first_stmt_execute() to check whether
      newly created view items should be freed at the end of the query execution.
      The Item_cond::compile function now saves changes it makes to item tree.
      
      mysql-test/r/ps.result:
        Added a test case for the bug#48508.
      mysql-test/t/ps.test:
        Added a test case for the bug#48508.
      sql/item_cmpfunc.cc:
        Bug#48508: Crash on prepared statement re-execution.
        The Item_cond::compile function now saves changes it makes to item tree.
      sql/sql_base.cc:
        Bug#48508: Crash on prepared statement re-execution.
        The find_field_in_view function now uses
        is_stmt_prepare_or_first_stmt_execute() to check whether
        newly created view items should be freed at the end of the query execution.
      sql/sql_class.h:
        Bug#48508: Crash on prepared statement re-execution.
        The Query_arena::is_stmt_prepare_or_first_sp_execute function now correctly
        do its check.
      298ecc19
    • Gleb Shchepa's avatar
      Bug #38883 (reopened): thd_security_context is not thread safe, crashes? · 4e3f4320
      Gleb Shchepa authored
      The bug 38816 changed the lock that protects THD::query from
      LOCK_thread_count to LOCK_thd_data, but didn't update the associated
      InnoDB functions.
      
      1. The innobase_mysql_prepare_print_arbitrary_thd and the
      innobase_mysql_end_print_arbitrary_thd InnoDB functions have been
      removed, since now we have a per-thread mutex: now we don't need to wrap
      several inter-thread access tries to THD::query with a single global
      LOCK_thread_count lock, so we can simplify the code.
      
      2. The innobase_mysql_print_thd function has been modified to lock
      LOCK_thd_data in direct way.
      4e3f4320
  10. 27 Nov, 2009 4 commits
  11. 25 Nov, 2009 2 commits
    • Satya B's avatar
      Applying InnoDB snapshot 5.0-ss6230, part 2. Fixes BUG#46000 · 0885eea9
      Satya B authored
      BUG#46000 - using index called GEN_CLUST_INDEX crashes server
      
      Detailed revision comments:
      
      r6180 | jyang | 2009-11-17 10:54:57 +0200 (Tue, 17 Nov 2009) | 7 lines
      branches/5.0: Merge/Port fix for bug #46000 from branches/5.1
      -r5895 to branches/5.0. Disallow creating index with the
      name of "GEN_CLUST_INDEX" which is reserved for the default
      system primary index. Minor adjusts on table name screening
      format for added tests.
      
      
      0885eea9
    • Satya B's avatar
      Applying InnoDB snapshot 5.0-ss6230, Part 1. Fixes BUG#47777 · 5233f063
      Satya B authored
      BUG#47777 - innodb dies with spatial pk: Failing assertion: buf <= original_buf + buf_len
      
      Detailed revision comments:
      
      r6178 | jyang | 2009-11-17 08:52:11 +0200 (Tue, 17 Nov 2009) | 6 lines
      branches/5.0: Merge fix for bug #47777 from branches/5.1 -r6045
      to bracnches/5.0. Treat the Geometry data same as Binary BLOB
      in ha_innobase::store_key_val_for_row(), since the Geometry
      data is stored as Binary BLOB in Innodb.
      
      
      5233f063
  12. 23 Nov, 2009 2 commits
  13. 20 Nov, 2009 1 commit
  14. 18 Nov, 2009 1 commit
    • Georgi Kodinov's avatar
      Bug#48864: MySQL fails to compile on 64 bit Fedora 12 · e499b503
      Georgi Kodinov authored
      Fixed 2 errors in comp_err executable : 
      1. Wrong (off by 1) length passed to my_checksum()
      2. strmov() was used on overlapping strings. This is
       not legal according to the docs in stpcpy(). Used 
      the overlap safe memmove() instead.
      e499b503
  15. 17 Nov, 2009 2 commits
    • Kent Boortz's avatar
    • Alexey Kopytov's avatar
      Bug #48472: Loose index scan inappropriately chosen for some · 37f45abf
      Alexey Kopytov authored
                  WHERE conditions 
       
      check_group_min_max() checks if the loose index scan 
      optimization is applicable for a given WHERE condition, that is 
      if the MIN/MAX attribute participates only in range predicates 
      comparing the corresponding field with constants. 
       
      The problem was that it considered the whole predicate suitable 
      for the loose index scan optimization as soon as it encountered 
      a constant as a predicate argument. This is obviously wrong for 
      cases when a constant is the first argument of a predicate 
      which does not satisfy the above condition. 
       
      Fixed check_group_min_max() so that all arguments of the input 
      predicate are considered to decide if it passes the test, even 
      though a constant has already been encountered.
      
      mysql-test/r/group_min_max.result:
        Added a test case for bug #48472.
      mysql-test/t/group_min_max.test:
        Added a test case for bug #48472.
      sql/opt_range.cc:
        Fixed check_group_min_max() so that all arguments of the input 
        predicate are considered to decide if it passes the test, even 
        though a constant has already been encountered.
      37f45abf
  16. 12 Nov, 2009 2 commits
  17. 09 Nov, 2009 2 commits
  18. 10 Nov, 2009 1 commit
    • Georgi Kodinov's avatar
      Bug #42760: Select doesn't return desired results when we have null · b41d9093
      Georgi Kodinov authored
       values
       
       We should re-set the access method functions when changing the access
       method when switching to another index to avoid sorting.
       
       Fixed by doing a little re-engineering : encapsulating all the function
       assignment into a special function and calling it when flipping the 
       indexes.
      b41d9093
  19. 06 Nov, 2009 2 commits
    • Alexey Kopytov's avatar
      Automerge. · b9272879
      Alexey Kopytov authored
      b9272879
    • Alexey Kopytov's avatar
      Bug #48475: DISTINCT is ignored with GROUP BY WITH ROLLUP and · 4bd2b0b0
      Alexey Kopytov authored
                  only const tables
      
      The problem was caused by two shortcuts in the optimizer that
      are inapplicable in the ROLLUP case.
      
      Normally in a case when only const tables are involved in a
      query, DISTINCT clause can be safely optimized away since there
      may be only one row produced by the join. Similarly, we don't
      need to create a temporary table to resolve DISTINCT/GROUP
      BY/ORDER BY. Both of these are inapplicable when the WITH
      ROLLUP modifier is present.
      
      Fixed by disabling the said optimizations for the WITH ROLLUP
      case.
      
      mysql-test/r/olap.result:
        Added a test case for bug #48475.
      mysql-test/t/olap.test:
        Added a test case for bug #48475.
      sql/sql_select.cc:
        Disabled const-only table optimizations for the WITH ROLLUP
        case.
      4bd2b0b0
  20. 04 Nov, 2009 5 commits
  21. 03 Nov, 2009 3 commits