1. 05 Nov, 2010 3 commits
    • Alfranio Correia's avatar
      BUG#57275 binlog_cache_size affects trx- and stmt-cache and gets twice the expected memory · 3f5a9c7e
      Alfranio Correia authored
            
      After the WL#2687, the binlog_cache_size and max_binlog_cache_size affect both the
      stmt-cache and the trx-cache. This means that the resource used is twice the amount
      expected/defined by the user.
            
      The binlog_cache_use is incremented when the stmt-cache or the trx-cache is used
      and binlog_cache_disk_use is incremented when the disk space from the stmt-cache or the
      trx-cache is used. This behavior does not allow to distinguish which cache may be harming
      performance due to the extra disk accesses and needs to have its in-memory cache
      increased.
            
      To fix the problem, we introduced two new options and status variables related to the
      stmt-cache:
            
        Options:
            
          . binlog_stmt_cache_size
          . max_binlog_stmt_cache_size
            
          Status Variables:
            
          . binlog_stmt_cache_use
          . binlog_stmt_cache_disk_use
      
      So there are
      
        . binlog_cache_size that defines the size of the transactional cache for
        updates to transactional engines for the binary log.
      
        . binlog_stmt_cache_size that defines the size of the statement cache for
        updates to non-transactional engines for the binary log.
      
        . max_binlog_cache_size that sets the total size of the transactional
        cache.
      
        . max_binlog_stmt_cache_size that sets the total size of the statement
        cache.
      
        . binlog_cache_use that identifies the number of transactions that used the
        temporary transactional binary log cache.
      
        . binlog_cache_disk_use that identifies the number of transactions that used
        the temporary transactional binary log cache but that exceeded the value of
        binlog_cache_size.
      
        . binlog_stmt_cache_use that identifies the number of statements that used the
        temporary non-transactional binary log cache.
      
        . binlog_stmt_cache_disk_use that identifies the number of statements that used
        the temporary non-transactional binary log cache but that exceeded the value of
        binlog_stmt_cache_size.
      
      include/my_sys.h:
        Updated message on disk_writes' usage.
      mysql-test/extra/binlog_tests/binlog_cache_stat.test:
        Updated the test case and added code to check the new status variables
        binlog_stmt_cache_use and binlog_stmt_cache_disk_use.
      mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test:
        Updated the test case to use the new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size.
      mysql-test/r/mysqld--help-notwin.result:
        Updated the result file.
      mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result:
        Updated the result file.
      mysql-test/suite/binlog/r/binlog_row_cache_stat.result:
        Updated the result file.
      mysql-test/suite/binlog/r/binlog_stm_cache_stat.result:
        Updated the result file.
      mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result:
        Update the result file.
      mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result:
        Update the result file.
      mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result:
        Updated the result file.
      mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc:
        Added a test case to check the binlog_stmt_cache_size.
      mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result:
        Updated the result file.
      mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result:
        Updated the result file.
      mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result:
        Updated the result file.
      mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test:
        Added a test case to check the binlog_stmt_cache_size.
      mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test:
        Added a test case to check the binlog_stmt_cache_size.
      mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt:
        Removed because there is no test case max_binlog_cache_size_func.
      mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test:
        Added a test case to check the system variable max_binlog_stmt_cache_size.
      sql/log.cc:
        There two main changes in here:
        
          . Changed the set_write_error() as an error message is set according
          to the type of the cache.
        
          . Created the function set_binlog_cache_info where references to the
          appropriate status and system variables are set and the server can
          smoothly compute statistics and set the maximum size for each cache.
      sql/log.h:
        Changed the signature of the function in order to identify the error message
        to be printed out as there is a different error code for each type of cache.
      sql/mysqld.cc:
        Added new status variables binlog_stmt_cache_use and binlog_stmt_cache_disk_use.
      sql/mysqld.h:
        Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size.
      sql/share/errmsg-utf8.txt:
        Added new error message related to the statement cache.
      sql/sys_vars.cc:
        Added new system variables max_binlog_stmt_cache_size and binlog_stmt_cache_size.
      3f5a9c7e
    • Alfranio Correia's avatar
      423501aa
    • Alfranio Correia's avatar
      BUG#56343 binlog_cache_use status is bigger than expected · 2d84c155
      Alfranio Correia authored
      The binlog_cache_use is incremented twice when changes to a transactional table
      are committed, i.e. TC_LOG_BINLOG::log_xid calls is called. The problem happens
      because log_xid calls both binlog_flush_stmt_cache and binlog_flush_trx_cache
      without checking if such caches are empty thus unintentionally increasing the
      binlog_cache_use value twice.
      
      Although not explicitly mentioned in the bug, the binlog_cache_disk_use presents
      the same problem.
      
      The binlog_cache_use and binlog_cache_disk_use are status variables that are
      incremented when transactional (i.e. trx-cache) or non-transactional (i.e.
      stmt-cache) changes are committed. They are used to compute the ratio between
      the use of disk and memory while gathering updates for a transaction.
      
      The problem reported is fixed by avoiding incrementing the binlog_cache_use
      and binlog_cache_disk_use if a cache is empty. We also have decided to increment
      both variables when a cache is truncated as the cache is used although its
      content is discarded and is not written to the binary log.
      
      In this patch, we take the opportunity to re-organize the code around the
      function binlog_flush_trx_cache and binlog_flush_stmt_cache.
      
      mysql-test/extra/binlog_tests/binlog_cache_stat.test:
        Updated the test case with comments and additional tests to check both
        transactional and non-transactional changes and what happens when a 
        is transaction either committed or aborted.
      mysql-test/suite/binlog/r/binlog_innodb.result:
        Updated the result file.
      mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result:
        Updated the result file.
      mysql-test/suite/binlog/r/binlog_row_cache_stat.result:
        Updated the result file.
      mysql-test/suite/binlog/r/binlog_stm_cache_stat.result:
        Updated the result file.
      mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test:
        Updated the test case with a new source file.
      mysql-test/suite/binlog/t/binlog_row_cache_stat.test:
        Updated the test case with a new source file.
      mysql-test/suite/binlog/t/binlog_stm_cache_stat.test:
        Updated the test case with a new source file.
      sql/log.cc:
        There are four changes in here:
        
          . Computed statistics on binlog_cache_use and binlog_cache_disk_use while
          resting the cache.
        
          . Refactored the code so binlog_flush_cache handles both the trx-cache and
          stmt-cache.
        
          . There are functions that encapsulate the calls to binlog_flush_cache and
          make easier to read the code.
        
          . binlog_commit_flush_stmt_cache is now taking into account the result:
          success or error.
      sql/log_event.h:
        Guaranteed Xid_log_event is always classified as a transactional event.
      2d84c155
  2. 04 Nov, 2010 5 commits
    • Jorgen Loland's avatar
      Bug#57882 - Item_func_conv_charset::val_str(String*): · f0ce6787
      Jorgen Loland authored
                  Assertion `fixed == 1' failed
      
      Followup patch. Test case relied on system variable that is
      only available if replication is compiled in. Replaced with
      variable available in all builds.
      
      mysql-test/r/errors.result:
        Test case relied on system variable that is only available if
        replication is compiled in. Replaced with variable available in
        all builds.
      mysql-test/t/errors.test:
        Test case relied on system variable that is only available if
        replication is compiled in. Replaced with variable available in
        all builds.
      f0ce6787
    • smenon's avatar
      merge · a9a6cd13
      smenon authored
      a9a6cd13
    • smenon's avatar
      Bug #57746: Win directory of source distribution - out-of-date files / support for new files · 0752b54a
      smenon authored
      (win/README updated with some more changes)
      0752b54a
    • Jorgen Loland's avatar
      Bug#57882 - Item_func_conv_charset::val_str(String*): · 64bee6fd
      Jorgen Loland authored
                  Assertion `fixed == 1' failed
      
      (also fixes duplicate bug 57515)
      
      agg_item_set_converter() (item.cc) handles conversion of 
      character sets by creating a new Item. fix_fields() is then 
      called on this newly created item. Prior to this patch, it was
      not checked whether fix_fields() was successful or not. Thus, 
      agg_item_set_converter() would return success even when an 
      error occured. This patch makes it return error (TRUE) if 
      fix_fields() fails.
      
      mysql-test/r/errors.result:
        Add test for BUG#57882
      mysql-test/t/errors.test:
        Add test for BUG#57882
      sql/item.cc:
        Make agg_item_set_converter() return with error if fix_fields() 
        on the newly created converted item fails.
      64bee6fd
    • He Zhenxing's avatar
      BUG#47027 delegates_init() failure is not user friendly (usability issue) · 6429e7d3
      He Zhenxing authored
            
      Function delegetas_init() did not report proper error messages
      when there are failures, which made it hard to know where the problem
      occurred.
      
      Fixed the problem by adding specific error message for every possible
      place that can fail. And since these failures are supposed to never
      happen, ask the user to report a bug if they happened.
      6429e7d3
  3. 03 Nov, 2010 8 commits
  4. 02 Nov, 2010 5 commits
  5. 01 Nov, 2010 5 commits
  6. 31 Oct, 2010 2 commits
    • Gleb Shchepa's avatar
      71082fd1
    • Gleb Shchepa's avatar
      Bug #52160: crash and inconsistent results when grouping · 20d70497
      Gleb Shchepa authored
                  by a function and column
      
      The bugreport reveals two different bugs about grouping
      on a function:
      
      1) grouping by the TIME_TO_SEC function result caused
         a server crash or wrong results and
      2) grouping by the function returning a blob caused
         an unexpected "Duplicate entry" error and wrong
         result.
      
      Details for the 1st bug:
      
      TIME_TO_SEC() returns NULL if its argument is invalid (empty
      string for example). Thus its nullability depends not only
      on the nullability of its arguments but also on their values.
      Fixed by (overoptimistically) setting TIME_TO_SEC() to be
      nullable despite the nullability of its arguments.
      
      Details for the 2nd bug:
      
      The server is unable to create indices on blobs without
      explicit blob key part length. However, this fact was
      ignored for blob function result fields of GROUP BY
      intermediate tables.
      Fixed by disabling GROUP BY index creation for blob
      function result fields like regular blob fields.
      
      
      mysql-test/r/func_time.result:
        Test case for bug #52160.
      mysql-test/r/type_blob.result:
        Test case for bug #52160.
      mysql-test/t/func_time.test:
        Test case for bug #52160.
      mysql-test/t/type_blob.test:
        Test case for bug #52160.
      sql/item_timefunc.h:
        Bug #52160: crash and inconsistent results when grouping
                    by a function and column
        
        TIME_TO_SEC() returns NULL if its argument is invalid (empty
        string for example). Thus its nullability depends not only
        Fixed by (overoptimistically) setting TIME_TO_SEC() to be
        nullable despite the nullability of its arguments.
      sql/sql_select.cc:
        Bug #52160: crash and inconsistent results when grouping
                    by a function and column
        
        The server is unable to create indices on blobs without
        explicit blob key part length. However, this fact was
        ignored for blob function result fields of GROUP BY
        intermediate tables.
        Fixed by disabling GROUP BY index creation for blob
        function result fields like regular blob fields.
      20d70497
  7. 29 Oct, 2010 3 commits
  8. 28 Oct, 2010 2 commits
    • Calvin Sun's avatar
      Bug#52062: Compiler warning in os0file.c on windows 64-bit · 460ad14e
      Calvin Sun authored
      On Windows, the parameter for number of bytes passed into WriteFile()
      and ReadFile() is DWORD. Casting is needed to silence the warning on
      64-bit Windows.
      
      Also, adding several asserts to ensure the variable for number of bytes
      is no more than 32 bits, even on 64-bit Windows.
      
      This is for InnoDB Plugin.
      
      rb://415
      Approved by: Inaam
      460ad14e
    • Calvin Sun's avatar
      Bug#52062: Compiler warning in os0file.c on windows 64-bit · 16feea41
      Calvin Sun authored
      On Windows, the parameter for number of bytes passed into WriteFile()
      and ReadFile() is DWORD. Casting is needed to silence the warning on
      64-bit Windows.
      
      Also, adding several asserts to ensure the variable for number of bytes
      is no more than 32 bits, even on 64-bit Windows.
      
      This is for built-in InnoDB.
      
      rb://415
      Approved by: Inaam
      16feea41
  9. 27 Oct, 2010 1 commit
  10. 29 Oct, 2010 3 commits
  11. 28 Oct, 2010 3 commits
    • Vasil Dimov's avatar
      Fix a compilation warning: · e3decfa0
      Vasil Dimov authored
      /export/home/pb2/build/sb_0-2459340-1288264809.63/mysql-5.5.8-ga/storage/innobase/os/os0sync.c: In function 'os_cond_wait_timed':
      /export/home/pb2/build/sb_0-2459340-1288264809.63/mysql-5.5.8-ga/storage/innobase/os/os0sync.c:184: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'time_t'
      gmake[2]: *** [storage/innobase/CMakeFiles/innobase.dir/os/os0sync.c.o] Error 1 
      e3decfa0
    • Mattias Jonsson's avatar
      post merge fix · 1a9083b9
      Mattias Jonsson authored
      1a9083b9
    • Calvin Sun's avatar
      8fc8e01f