1. 12 Apr, 2012 3 commits
    • Tor Didriksen's avatar
      Bug#13871079 RQG_MYISAM_DML_ALTER_VALGRIND FAILS ON VALGRIND PN PB2 · 6ce7d81e
      Tor Didriksen authored
      The class Copy_field contains a String tmp, 
      which may allocate memory on the heap.
      That means that all instances of Copy_field
      must be properly destroyed. Alas they are not.
      
      Solution: don't use Copy_field::tmp for copying
      from_field => tmp => to_field
      in do_field_string()
      
      
      sql/field.cc:
        In Field_set::val_str
        return empty string (of appropriate character set) for an empty set.
      sql/field.h:
        New private member in Field_enum: empty_set_string.
      sql/field_conv.cc:
        In do_field_string, use an auto variable for copying
        from_field => tmp => to_field
        rather than copy->tmp.
      6ce7d81e
    • Georgi Kodinov's avatar
      merge mysql-5.5->mysql-5.5-security · 04cb9980
      Georgi Kodinov authored
      04cb9980
    • Sujatha Sivakumar's avatar
      BUG#12662190:COM_COMMIT IS NOT INCREMENTED FROM THE BINARY LOGS ON SLAVE, COM_BEGIN IS · 25d6d742
      Sujatha Sivakumar authored
      PROBLEM:
      
      --------
      
      When binary log statements are replayed on the slave, BEGIN is represented
      
      in com_counters but COMMIT is not. Similarly in 'ROW' based replication
      
      'INSERT','UPDATE',and 'DELETE' com_counters are not getting incremented
      
      when the binary log statements are replayed at slave.
      
      ANALYSIS:
      ---------
      
      In 'ROW' based replication for COMMIT,INSERT,UPDATE and DELETE operations
      following special events are invoked.
      Xid_log_event,Write_rows_log_event,Update_rows_log_event,Update_rows_log_event.
      
      The above mentioned events doesn't go through the parser where the
      'COM_COUNTERS' are incremented.
      
      
      FIX:
      -----
      Increment statements are added at appropriate events.
      Respective functions are listed below.
      
      'Xid_log_event::do_apply_event'
      'Write_rows_log_event::do_before_row_operations'
      'Update_rows_log_event::do_before_row_operations'
      'Delete_rows_log_event::do_before_row_operations' 
      
      sql/log_event.cc:
        Added code to increment counts for 'COM_INSERT','COM_UPDATE',
        'COM_DELETE' and 'COM_COMMIT'during ROW based replicaiton
      25d6d742
  2. 11 Apr, 2012 1 commit
    • unknown's avatar
      Bug#11815557 60269: MYSQL SHOULD REJECT ATTEMPTS TO CREATE SYSTEM · 3320be96
      unknown authored
                          TABLES IN INCORRECT ENGINE
      
      PROBLEM:
        CREATE/ALTER TABLE currently can move system tables like
      mysql.db, user, host etc, to engines other than MyISAM. This is not
      completely supported as of now, by mysqld. When some of system tables
      like plugin, servers, event, func, *_priv, time_zone* are moved
      to innodb, mysqld restart crashes. Currently system tables
      can be moved to BLACKHOLE also!!!.
      
      ANALYSIS:
        The problem is that there is no check before creating or moving
      a system table to some particular engine.
      
        System tables are suppose to be residing in MyISAM. We can think
      of restricting system tables to exist only in MyISAM. But, there could
      be future needs of these system tables to be part of other engines
      by design. For eg, NDB cluster expects some tables to be on innodb
      or ndb engine. This calls for a solution, by which system
      tables can be supported by any desired engine, with minimal effort.
      
      FIX:
        The solution provides a handlerton interface using which,
      mysqld server can query particular storage engine handlerton for
      system tables that it supports. This way each storage engine
      layer can define their own system database and system tables.
      
        The check_engine() function uses the new handlerton function
      ha_check_if_supported_system_table() to check if db.tablename
      provided in the DDL is supported by the SE.
      
      Note: This fix has modified a test in help.test, which was moving
      mysql.help_* to innodb. The primary intention of the test was not
      to move them between engines.
      3320be96
  3. 10 Apr, 2012 5 commits
    • Georgi Kodinov's avatar
    • Georgi Kodinov's avatar
      merge mysql-5.5->mysql-5.5-security · a04a7536
      Georgi Kodinov authored
      a04a7536
    • Georgi Kodinov's avatar
      merge mysql-5.1->mysql-5.1-security · 1c8db081
      Georgi Kodinov authored
      1c8db081
    • Manish Kumar's avatar
      BUG#13917335 - ASSERTION `REPORT_PORT != 0' FAILED IN NETWORK_INIT () · 1652365a
      Manish Kumar authored
      Problem - The cause of the failure is mainly due to the assert added in
                the code as a result of the fix of the BUG-13333431. When we
                start the server with the --skip-networking option enabled
                we have the mysqld_port explicitly to 0. Since the value of
                report_port is set to mysqld_port, the assertion that
                (report_port!= 0) fails.
      
      Fix - the fix of the problem is to assert the not zero value of
            report_port only in the case the --skip-networking option is not
            used to start the mysqld server.
      
      sql/mysqld.cc:
        Added the code to check for the skip-networking option while starting
        the server.
      1652365a
    • Manish Kumar's avatar
      BUG#13812374 - RPL.RPL_REPORT_PORT FAILS OCCASIONALLY ON PB2 · 2df9664c
      Manish Kumar authored
      Problem - this failure occured in the test added for the fix of the 
                bug-13333431. The basic problem of the failure was the 
                value of the report_port which persisted even after the end 
                of the test (ie. rpl_end.inc). So this causes the assertion 
                in the test to fail if it is executed again.
      
      Fix - restarted the server with the default value being passed to the 
            report_port after testing the two expected case so that in the 
            next run of the test we will not encounter the previous value of
            report_port.
      
      
      
      mysql-test/suite/rpl/r/rpl_report_port.result:
        Updated the corresponding result file.
      mysql-test/suite/rpl/t/rpl_report_port-slave.opt:
        Removed the slave option file.
      mysql-test/suite/rpl/t/rpl_report_port.test:
        Added the restart server option before ending the test.
      2df9664c
  4. 09 Apr, 2012 3 commits
  5. 06 Apr, 2012 4 commits
  6. 04 Apr, 2012 3 commits
    • Sergey Glukhov's avatar
      5.1-security -> 5.5-security merge · b9a8cb3d
      Sergey Glukhov authored
      b9a8cb3d
    • Sergey Glukhov's avatar
      Bug#11766300 59387: FAILING ASSERTION: CURSOR->POS_STATE == 1997660512 (BTR_PCUR_IS_POSITIONE · 1893f0b1
      Sergey Glukhov authored
      Bug#13639204 64111: CRASH ON SELECT SUBQUERY WITH NON UNIQUE INDEX
      The crash happened due to wrong calculation
      of key length during creation of reference for
      sort order index. The problem is that
      keyuse->used_tables can have OUTER_REF_TABLE_BIT enabled
      but used_tables parameter(create_ref_for_key() func) does
      not have it. So key parts which have OUTER_REF_TABLE_BIT
      are ommited and it could lead to incorrect key length
      calculation(zero key length).
      
      
      mysql-test/r/subselect_innodb.result:
        test result
      mysql-test/t/subselect_innodb.test:
        test case
      sql/sql_select.cc:
        added OUTER_REF_TABLE_BIT to the used_tables parameter
        for create_ref_for_key() function.
      storage/innobase/handler/ha_innodb.cc:
        added assertion, request from Inno team
      storage/innodb_plugin/handler/ha_innodb.cc:
        added assertion, request from Inno team
      1893f0b1
    • Praveenkumar Hulakund's avatar
      Bug#12762885: 61713: MYSQL WILL NOT BIND TO "LOCALHOST" IF LOCALHOST IS BOTH · d12f47c2
      Praveenkumar Hulakund authored
                           IPV4/IPV6 ENABLED
      
      Analysis:
      ----------------------
      The problem was that if a hostname resolves to more than one IP-address,
      the server (5.5) does not start due to an error. In 5.1 the server used to
      take some IP-address and start.
      
      It's a regression and should be fixed.
      
      5.5 supports IPv6, while 5.1 does not. However, that should not 
      prevent the server from start -- if a hostname has both IPv4 and IPv6 addresses,
      the server should choose some IPv4-address and start.
      
      It's been decided to prefer IPv4-address to be backward compatible with 5.1.
      
      Another problem was that the 5.6 server did not report proper error message
      when the specified hostname could not be resolved. So, the code has been 
      changed to report proper error message.
      
      Testing
      ================================
      5.5
      =============================
      invalid hostname (localhos):
        => Following error message reported.
           120308 15:52:09 [ERROR] Can't start server: cannot resolve hostname!
           120308 15:52:09 [ERROR] Aborting
      
      invalid ip_address:
        => Following error message reported.
            120308 15:56:06 [Note] Server hostname (bind-address): '123.123.123.123'; port: 3306
            120308 15:56:06 [Note]   - '123.123.123.123' resolves to '123.123.123.123';
            120308 15:56:06 [Note] Server socket created on IP: '123.123.123.123'.
            120308 15:56:06 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
      
      Only ipv4 host configured:
        => Following message logged 
          120308 16:02:50 [Note] Server hostname (bind-address): 'localhost'; port: 3306
          120308 16:02:50 [Note]   - 'localhost' resolves to '127.0.0.1';
          120308 16:02:50 [Note] Server socket created on IP: '127.0.0.1'
      
      Only ipv6 host configured:    
        => Following message logged 
          120308 16:04:03 [Note] Server hostname (bind-address): 'localhost'; port: 3306
          120308 16:04:03 [Note]   - 'localhost' resolves to '::1';
          120308 16:04:03 [Note] Server socket created on IP: '::1'.
      
      ipv4 and ipv6 host configured:
        => Following message logged
          120308 16:05:02 [Note] Server hostname (bind-address): 'localhost'; port: 3306
          120308 16:05:02 [Note]   - 'localhost' resolves to '::1';
          120308 16:05:02 [Note]   - 'localhost' resolves to '127.0.0.1';
          120308 16:05:02 [Note] Server socket created on IP: '127.0.0.1'.
        => Non localhost address  
          120308 16:08:20 [Note] Server hostname (bind-address): 'mysql_addr'; port: 3306
          120308 16:08:20 [Note]   - 'mysql_addr' resolves to '10.178.58.216';
          120308 16:08:20 [Note]   - 'mysql_addr' resolves to 'fe80::120b:a9ff:fe69:59ec';
          120308 16:08:20 [Note] Server socket created on IP: '10.178.58.216'.
      
      More than one entry for ipv4 and ipv6 address:
        => Following message logged
          120308 16:06:19 [Note] Server hostname (bind-address): 'localhost'; port: 3306
          120308 16:06:19 [Note]   - 'localhost' resolves to '::1';
          120308 16:06:19 [Note]   - 'localhost' resolves to '::1';
          120308 16:06:19 [Note]   - 'localhost' resolves to '127.0.0.1';
          120308 16:06:19 [Note]   - 'localhost' resolves to '127.0.0.1';
          120308 16:06:19 [Note] Server socket created on IP: '127.0.0.1'.
      
      d12f47c2
  7. 03 Apr, 2012 1 commit
  8. 02 Apr, 2012 1 commit
  9. 30 Mar, 2012 1 commit
    • Rohit Kalhans's avatar
      BUG#11765650 - 58637: MARK UPDATES THAT DEPEND ON ORDER OF TWO KEYS UNSAFE · 617ec792
      Rohit Kalhans authored
            
       Description: When the table has more than one unique or primary key, 
       INSERT... ON DUP KEY UPDATE statement is sensitive to the order in which
       the storage engines checks the keys. Depending on this order, the storage
       engine may determine different rows to mysql, and hence mysql can update
       different rows on master and slave.
            
       Solution: We mark INSERT...ON DUP KEY UPDATE on a table with more than on unique
       key as unsafe therefore the event will be logged in row format if it is available
       (ROW/MIXED). If only STATEMENT format is available, a warning will be thrown. 
      
      mysql-test/suite/binlog/r/binlog_unsafe.result:
        Updated result file
      mysql-test/suite/binlog/t/binlog_unsafe.test:
        Added test to check  for warning being thrown when the unsafe statement is executed
      mysql-test/suite/rpl/r/rpl_known_bugs_detection.result:
        Updated result file
      sql/share/errmsg-utf8.txt:
        Added new warning message
      sql/sql_base.cc:
        check for tables in the query with more than one UNIQUE KEY and INSERT ON DUPLICATE KEY UPDATE, and mark such statements unsafe.
      617ec792
  10. 29 Mar, 2012 3 commits
    • Hery Ramilison's avatar
      Starting 5.5.23 build · e062a212
      Hery Ramilison authored
      e062a212
    • Tor Didriksen's avatar
      Patch for Bug#13805127: Stored program cache produces wrong result in same THD. · e09223b0
      Tor Didriksen authored
      Background:
      
        - as described in MySQL Internals Prepared Stored
          (http://forge.mysql.com/wiki/MySQL_Internals_Prepared_Stored),
          the Optimizer sometimes does destructive changes to the parsed
          LEX-object (Item-tree), which makes it impossible to re-use
          that tree for PS/SP re-execution.
      
        - in order to be able to re-use the Item-tree, the destructive
          changes are remembered and rolled back after the statement execution.
      
      The problem, discovered by this bug, was that the objects representing
      GROUP-BY clause did not restored after query execution. So, the GROUP-BY
      part of the statement could not be properly re-initialized for re-execution
      after destructive changes.
      
      Those objects do not take part in the Item-tree, so they can not be saved
      using the approach for Item-tree.
      
      The fix is as follows:
      
        - introduce a new array in st_select_lex to store the original
          ORDER pointers, representing the GROUP-BY clause;
      
        - Initialize this array in fix_prepare_information().
      
        - restore the list of GROUP-BY items in reinit_stmt_before_use().
      e09223b0
    • Sunny Bains's avatar
      Bug #13817703 - auto_increment_offset != 1 + innodb_autoinc_lock_mode=1 => bulk inserts fail · 45c2f05f
      Sunny Bains authored
              
      Fix the calculation of the next autoinc value when offset > 1. Some of the
      results have changed due to the changes in the allocation calculation. The
      new calculation will result in slightly bigger gaps for bulk inserts.
        
      rb://866 Approved by Jimmy Yang.
      Backported from mysql-trunk (5.6)
      45c2f05f
  11. 28 Mar, 2012 7 commits
    • Marc Alff's avatar
      Bug#13898343 THREAD LOOPS ENDLESSLY IN LF_PINBOX_PUT_PINS WHILE HOLDING · 6c941988
      Marc Alff authored
      LOCK_THREAD_COUNT
      
      When using the performance schema file io instrumentation in MySQL 5.5,
      a thread would loop forever inside lf_pinbox_put_pins, when disconnecting.
      It would also hold LOCK_thread_count while doing so, effectively killing the
      server.
      
      The root cause of the loop in lf_pinbox_put_pins() is a leak of LF_PINS,
      when used with the filename_hash LF_HASH table in the performance schema.
      
      This fix contains the following changes:
      
      1)
      Added the missing call to lf_hash_search_unpin(), to prevent the leak.
      
      2)
      In mysys/lf_alloc-pin.c, there was some extra debugging code
      (MY_LF_EXTRA_DEBUG) written to detect precisely this kind of issues,
      but it was never used.
      Replaced MY_LF_EXTRA_DEBUG with DBUG_OFF, so that leaks similar to this one
      can be always detected in regular debug builds.
      
      3)
      Backported the fix for the following bug, from 5.6 to 5.5:
      Bug#13417446 - 63339: INCORRECT FILE PATH IN PEFORMANCE_SCHEMA ON WINDOWS
      6c941988
    • Gleb Shchepa's avatar
      Bug #11880012: INDEX_SUBQUERY, BLACKHOLE, · cad9b4a4
      Gleb Shchepa authored
                     HANG IN PREPARING WITH 100% CPU USAGE
      
      Infinite loop in the subselect_indexsubquery_engine::exec()
      function caused Server hang with 100% CPU usage.
      
      The BLACKHOLE storage engine didn't update handler's
      table->status variable after index operations, that
      caused an infinite "while(!table->status)" execution.
      
      Index access methods of the BLACKHOLE engine handler
      have been updated to set table->status variable to
      STATUS_NOT_FOUND or 0 when such a method returns a
      HA_ERR_END_OF_FILE error or 0 respectively.
      
      
      mysql-test/r/blackhole.result:
        Bug #11880012: INDEX_SUBQUERY, BLACKHOLE,
                       HANG IN PREPARING WITH 100% CPU USAGE
        
        New test file for the BLACKHOLE engine.
      mysql-test/t/blackhole.test:
        Bug #11880012: INDEX_SUBQUERY, BLACKHOLE,
                       HANG IN PREPARING WITH 100% CPU USAGE
        
        New test file for the BLACKHOLE engine.
      storage/blackhole/ha_blackhole.cc:
        Bug #11880012: INDEX_SUBQUERY, BLACKHOLE,
                       HANG IN PREPARING WITH 100% CPU USAGE
        
        Index access methods of the BLACKHOLE engine handler
        have been updated to set table->status variable to
        STATUS_NOT_FOUND or 0 when such a method returns a
        HA_ERR_END_OF_FILE error or 0 respectively, like
        we do in MyISAM storage engine.
      cad9b4a4
    • Praveenkumar Hulakund's avatar
      Merge from 5.1 to 5.5 · a02ff2cb
      Praveenkumar Hulakund authored
      a02ff2cb
    • Praveenkumar Hulakund's avatar
      Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE · ee2992a8
      Praveenkumar Hulakund authored
      Analysis:
      -------------------------------
      According to the Manual
      (http://dev.mysql.com/doc/refman/5.1/en/identifier-case-sensitivity.html):
      "Column, index, stored routine, and event names are not case sensitive on any
      platform, nor are column aliases."
      
      In other words, 'lower_case_table_names' does not affect the behaviour of 
      those identifiers.
      
      On the other hand, trigger names are case sensitive on some platforms,
      and case insensitive on others. 'lower_case_table_names' does not affect
      the behaviour of trigger names either.
      
      The bug was that SHOW statements did case sensitive comparison
      for stored procedure / stored function / event names.
      
      Fix:
      Modified the code so that comparison in case insensitive for routines 
      and events for "SHOW" operation.
      
      As part of this commit, only fixing the test failures due to the actual code fix.
      ee2992a8
    • Sunny Bains's avatar
      Merge from mysql-5.1. · fb5ba3db
      Sunny Bains authored
      fb5ba3db
    • Sunny Bains's avatar
      Merge from mysql-5.0 · 2f143d27
      Sunny Bains authored
      2f143d27
    • Sunny Bains's avatar
      Bug# 13847885 - PURGING STALLS WHEN PURGE_SYS->N_PAGES_HANDLED OVERFLOWS · 7a68af27
      Sunny Bains authored
      Change the type of purge_sys_t::n_pages_handled and purge_sys_t::handle_limit
      to ulonglong from ulint. On a 32 bit system doing ~700 deletes per second the
      counters can overflow in ~3.5 months, if they are 32 bit.
      
      Approved by Jimmy Yang over IM.
      7a68af27
  12. 27 Mar, 2012 4 commits
  13. 26 Mar, 2012 1 commit
  14. 22 Mar, 2012 2 commits
  15. 21 Mar, 2012 1 commit