1. 01 Jun, 2010 16 commits
  2. 31 May, 2010 7 commits
    • Vasil Dimov's avatar
      Fix Bug #53947 InnoDB: Assertion failure in thread 4224 in file .\sync\sync0sync.c line 324 · 567a1246
      Vasil Dimov authored
      Destroy the rw-lock object before freeing the memory it is occupying.
      If we do not do this, then the mutex that is contained in the rw-lock
      object btr_search_latch_temp->mutex gets "freed" and subsequently
      mutex_free() from sync_close() hits a mutex whose memory has been
      freed and crashes.
      
      Approved by:	Heikki (via IRC)
      Discussed with:	Calvin
      567a1246
    • Alexander Nozdrin's avatar
      Backport of · fe5bcb47
      Alexander Nozdrin authored
        - revid:sp1r-svoj@mysql.com/june.mysql.com-20080324111246-00461
        - revid:sp1r-svoj@mysql.com/june.mysql.com-20080414125521-40866
      
        BUG#35274 - merge table doesn't need any base tables, gives
                    error 124 when key accessed
      
        SELECT queries that use index against a merge table with empty
        underlying tables list may return with error "Got error 124 from
        storage engine".
      
        The problem was that wrong error being returned.
      
      mysql-test/r/merge.result:
        Backport of
          - revid:sp1r-svoj@mysql.com/june.mysql.com-20080324111246-00461
          - revid:sp1r-svoj@mysql.com/june.mysql.com-20080414125521-40866
        
          A test case for BUG#35274.
        
          Modified a test case according to fix for BUG#35274. Key based
          reads are now allowed for merge tables with no underlying tables
          defined.
      mysql-test/t/merge.test:
        Backport of
          - revid:sp1r-svoj@mysql.com/june.mysql.com-20080324111246-00461
          - revid:sp1r-svoj@mysql.com/june.mysql.com-20080414125521-40866
        
          A test case for BUG#35274.
        
          Modified a test case according to fix for BUG#35274. Key based
          reads are now allowed for merge tables with no underlying tables
          defined.
      storage/myisammrg/myrg_queue.c:
        Backport of
          - revid:sp1r-svoj@mysql.com/june.mysql.com-20080324111246-00461
          - revid:sp1r-svoj@mysql.com/june.mysql.com-20080414125521-40866
        
          Return "end of file" error instead of "wrong index" error when
          we got a merge table with empty underlying tables list.
        
          In 5.1 we cannot rely on info->open_tables value when checking
          if a merge table has no underlying tables defined.
          Use info->tables instead.
      fe5bcb47
    • Gleb Shchepa's avatar
      Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY · fefbd756
      Gleb Shchepa authored
                  when it should use index
      
      Sometimes the LEFT/RIGHT JOIN with an empty table caused an
      unnecessary filesort.
      
      Sample query, where t1.i1 is indexed and t3 is empty:
      
        SELECT t1.*, t2.* FROM t1 JOIN t2 ON t1.i1 = t2.i2
                             LEFT JOIN t3 ON t2.i2 = t3.i3
          ORDER BY t1.i1 LIMIT 5;
      
      The server erroneously used an item of empty outer-joined
      table as a common constant of a Item_equal (multi-equivalence
      expression).
      By the fix for the bug 16590 the constant status of such
      an item has been propagated to st_table::const_key_parts
      map bits related to other Item_equal argument-related
      key parts (those are obviously not constant in our case).
      As far as test_if_skip_sort_order function skips constant
      prefixes of testing keys, this caused an ignorance of
      available indices, since some prefixes were marked as
      constant by mistake.
      
      
      mysql-test/r/order_by.result:
        Test case for bug #38745.
      mysql-test/t/order_by.test:
        Test case for bug #38745.
      sql/item.h:
        Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY
                    when it should use index
        
        Item::is_outer_field() has been added and overloaded for
        Item_field and Item_ref classes.
      sql/item_cmpfunc.cc:
        Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY
                    when it should use index
        
        Item_equal::update_const() and Item_equal::update_used_tables()
        have been updated to not take into account the constantness
        of outer-joined table items.
      fefbd756
    • Davi Arnaut's avatar
      77e744f8
    • Tor Didriksen's avatar
      Bug #49829 Many "hides virtual function" warnings with SunStudio · 8231f082
      Tor Didriksen authored
      Backport from mysql-pe (of those parts which have not been upmerged from 5.1)
      
      
      
      sql/field.cc:
        Local scope variable or method argument same as class attribute.
      sql/item.cc:
        Rename auto variable to avoid name clash.
      sql/item.h:
        Item_ref::basic_const_item had wrong signature (missing const)
        and was thus never called.
      sql/partition_info.cc:
        Rename, to avoid name clashes.
      sql/sql_load.cc:
        Rename, to avoid name clashes.
      8231f082
    • Vasil Dimov's avatar
      Fix coding style · f31af312
      Vasil Dimov authored
      f31af312
    • Sergey Glukhov's avatar
      test case fix · 07f07ffe
      Sergey Glukhov authored
      07f07ffe
  3. 28 May, 2010 11 commits
    • Davi Arnaut's avatar
      Backport: remove dead code. · a1b8e4dc
      Davi Arnaut authored
      Reorganize function to reflect that it does not actually uses curses
      and that there is no curses variant.
      a1b8e4dc
    • Davi Arnaut's avatar
      Backport: Remove unused and ancient files, functions, and facilities. · 11648411
      Davi Arnaut authored
      client/mysql.cc:
        Remove unused functions.
      client/sql_string.cc:
        Remove unused functions.
      include/my_pthread.h:
        Remove unused prototype.
      mysys/my_pthread.c:
        Remove unused function.
      sql/lock.cc:
        Remove unused function.
      sql/lock.h:
        Remove unused and duplicated prototypes.
      sql/sql_class.h:
        Removed unused variables.
      sql/sql_const.h:
        Remove unused defines.
      sql/sql_priv.h:
        Remove unused defines.
      sql/sql_string.cc:
        Remove unused prototype.
      sql/thr_malloc.cc:
        Remove unused function.
      sql/thr_malloc.h:
        Remove unused prototype.
      storage/myisam/CMakeLists.txt:
        Remove obsolete fulltext file.
      storage/myisam/Makefile.am:
        Remove obsolete files (were already commented out).
      storage/myisam/ft_eval.c:
        Remove obsolete fulltext file.
      storage/myisam/ft_eval.h:
        Remove obsolete fulltext file.
      storage/myisam/ft_stem.c:
        Remove obsolete fulltext file.
      storage/myisam/ft_test1.c:
        Remove obsolete fulltext file.
      storage/myisam/ft_test1.h:
        Remove obsolete fulltext file.
      11648411
    • Davi Arnaut's avatar
    • Davi Arnaut's avatar
      0ef35548
    • Davi Arnaut's avatar
      Backport a old cleanup patch. · ba485814
      Davi Arnaut authored
      Formatting cleanup: removing tabs and trailing spaces
      to conform to MySQL Internals Coding Guidelines.
      ba485814
    • unknown's avatar
      Bug#52168 decimal casting catastrophes: crashes and valgrind errors on simple casts · 229cc4e1
      unknown authored
      The problem is that if a NULL is stored in an Item_cache_decimal object,
      the associated my_decimal object is not initialized.  However, it is still
      accessed when val_int() is called. The fix is to check for null_value
      within val_int(), and return without accessing the my_decimal object when
      the cached value is NULL.
      
      Bug#52122 reports the same issue for val_real(), and this patch also includes
      fixes for val_real() and val_str() and corresponding test cases from that
      bug report.  
      
      Also, NULL is returned from val_decimal() when value is null. This will
      avoid that callers access an uninitialized my_decimal object.
      
      Made similar changes to all other Item_cache classes.  Now all val_*
      methods should return a well defined value when actual value is NULL.
      
      mysql-test/r/type_decimal.result:
        Updated result file with test cases for Bug#52168 and Bug#52122.
      mysql-test/t/type_decimal.test:
        Added test cases for Bug#52168 and Bug#52122.
      sql/item.cc:
        In Item_cache_*::val_* methods, return a well defined value
        when actual value is NULL.
        
        This is especially important for Item_cache_decimal since
        otherwise one risk accessing an uninitialized my_decimal object.
      sql/item.h:
        Added method Item_cache::has_value() which returns TRUE if cache 
        object contains a non-null value.
      229cc4e1
    • Vasil Dimov's avatar
    • Jonathan Perkin's avatar
    • Jonathan Perkin's avatar
      Merge · f02c9f13
      Jonathan Perkin authored
      f02c9f13
    • Calvin Sun's avatar
      mysql-trunk-innodb: undo r3119 of disabling test cases. · 825cb9b6
      Calvin Sun authored
      r3119 does not prevent the crash even the test is disabled.
      The crash occurs during shutdown.
      825cb9b6
    • Alexander Nozdrin's avatar
      Auto-merge from mysql-trunk. · 59a99129
      Alexander Nozdrin authored
      59a99129
  4. 27 May, 2010 6 commits
    • Vasil Dimov's avatar
      Add two debug assertions and a comment to make it clear that · 9ff587c6
      Vasil Dimov authored
      consecutive_ios[0] cannot be NULL when slot is assigned.
      9ff587c6
    • Joerg Bruehe's avatar
      Get rid of the "net retry count" difference which · 7758bdc8
      Joerg Bruehe authored
      is not needed any more with current versions of FreeBSD.
      (Entries 52410 and 52412 in the Bug DB)
      
      That change is based on Dan Nelson replying on the
      FreeBSD mailing list, freebsd-questions@freebsd.org
      in a thread running from 2010-Apr-29 to 2010-May-1 titled
           "Need info about FreeBSD and interrupted system
            calls for MySQL code"
      
      Also, ensure the cmake settings correspond to the autotools
      ones: Add "HAVE_BROKEN_REALPATH" to cmake.
      
      
      cmake/os/FreeBSD.cmake:
        With current versions of FreeBSD, threading is not done on
        the user-level any more, so the huge "net retry count"
        is not needed any more.
        However, it is still being kept as a comment for now,
        so that it can be re-activated should the need arise.
        
        In addition, set "HAVE_BROKEN_REALPATH" to completely
        mirror the autotools path.
      configure.in:
        With current versions of FreeBSD, threading is not done on
        the user-level any more, so the huge "net retry count"
        is not needed any more.
        This definitely holds for FreeBSD version 6 and up.
        
        Adapt the informational messages to the path taken.
      7758bdc8
    • Inaam Rana's avatar
      Fix the printout for long semaphore waits to not · cd1ee2b6
      Inaam Rana authored
            list a thread doing a wait_ex as an s-lock waiter.
      cd1ee2b6
    • Sergey Glukhov's avatar
      Bug#52430 Incorrect key in the error message for duplicate key error involving BINARY type · f1e1d1bd
      Sergey Glukhov authored
      For BINARY(N) strip trailing zeroes to make the error message nice-looking
      
      
      mysql-test/r/errors.result:
        test case
      mysql-test/r/type_binary.result:
        result fix
      mysql-test/t/errors.test:
        test case
      sql/key.cc:
        For BINARY(N) strip trailing zeroes to make the error message nice-looking
      f1e1d1bd
    • Sergey Glukhov's avatar
      Bug#52856 concurrent show columns or show full columns causes a crash!!!1 · 8fa381fd
      Sergey Glukhov authored
      We should avoid any SHARE fields assignments as
      this is shared structure and assignments may
      affect other therads. To avoid this
      copy of SHARE struct is created and
      stored into TABLE struct which is
      used in get_schema_coulumns_record later.
      
      
      
      mysql-test/r/mdl_sync.result:
        test case
      mysql-test/t/mdl_sync.test:
        test case
      sql/sql_show.cc:
        We should avoid any SHARE fields assignments as
        this is shared structure and assignments may
        affect other therads. To avoid this
        copy of SHARE struct is created and
        stored into TABLE struct which is
        used in get_schema_coulumns_record later.
      8fa381fd
    • Alfranio Correia's avatar
      BUG#53437 @@session.sql_bin_log support in substatements is incorrect · 83575960
      Alfranio Correia authored
            
      The thd->variables.option_bits & OPTION_BIN_LOG is currently abused: 
      it's both a system variable and an implementation switch. The current
      approach to this option bit breaks the session variable encapsulation. 
            
      Besides it is allowed to change @@session.sql_bin_log within a
      transaction what may lead to not correctly logging a transaction.
            
      To fix the problems,  we created a thd->variables variable to represent
      the "sql_log_bin" and prohibited its update inside a transaction or
      sub-statement.
      
      mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result:
        Updated result file. The reason the warnings are removed is
        related to BUG#50312.
      mysql-test/suite/binlog/r/binlog_switch_inside_trans.result:
        Checks when is possible to change the option @@session.sql_log_bin.
      mysql-test/suite/binlog/t/binlog_switch_inside_trans.test:
        Checks when is possible to change the option @@session.sql_log_bin.
      mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result:
        Updated the result file with warnings that were being printed
        due to the wrong use of the thd->variables.option_bits and
        sql_log_bin_top_level variables.
      mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result:
        Updated the result file with warnings that were being printed
        due to the wrong use of the thd->variables.option_bits and
        sql_log_bin_top_level variables.
      sql/share/errmsg-utf8.txt:
        Introduces two error messages to notify that the @@session.sql_log_bin
        cannot be changed inside a sub-statement or transaction.
      sql/sql_base.cc:
        Removes the variable sql_log_bin_toplevel and uses
        the session variable sql_log_bin.
      sql/sql_class.cc:
        Replaces the variable sql_log_bin_toplevel by the
        (variables.option_bits & OPTION_BIN_LOG).
      sql/sql_class.h:
        Removes the variable sql_log_bin_toplevel and creates 
        a session variable sql_log_bin.
      sql/sys_vars.cc:
        Checks when the sql_log_bin can be correctly updated.
      83575960