1. 15 Mar, 2011 4 commits
    • Dmitry Shulga's avatar
      Manual merge from mysql-5.1 for Bug#11764168 (56976: Severe denial · b138b0c9
      Dmitry Shulga authored
      of service in prepared statements).
      
      sql/sql_prepare.cc:
        At mysql_stmt_get_longdata(): instead of pushing an internal
        error handler (as done in 5.1-tree) we save, set and restore
        the statement's diagnostics area and warning info.
      b138b0c9
    • Dmitry Shulga's avatar
      Fixed Bug#11764168 "56976: SEVERE DENIAL OF SERVICE IN PREPARED STATEMENTS". · 0dd27502
      Dmitry Shulga authored
      The problem was that server didn't check resulting size of prepared
      statement argument which was set using mysql_send_long_data() API.
      By calling mysql_send_long_data() several times it was possible
      to create overly big string and thus force server to allocate
      memory for it. There was no way to limit this allocation.
      
      The solution is to add check for size of result string against
      value of max_long_data_size start-up parameter. When intermediate
      string exceeds max_long_data_size value an appropriate error message
      is emitted.
      
      We can't use existing max_allowed_packet parameter for this purpose
      since its value is limited by 1GB and therefore using it as a limit
      for data set through mysql_send_long_data() API would have been an
      incompatible change. Newly introduced max_long_data_size parameter
      gets value from max_allowed_packet parameter unless its value is
      specified explicitly. This new parameter is marked as deprecated
      and will be eventually replaced by max_allowed_packet parameter.
      Value of max_long_data_size parameter can be set only at server
      startup.
      
      
      mysql-test/t/variables.test:
        Added checking for new start-up parameter max_long_data_size.
      sql/item.cc:
        Added call to my_message() when accumulated string exceeds
        max_long_data_size value. my_message() calls error handler
        that was installed in mysql_stmt_get_longdata before call
        to Item_param::set_longdata.
        
        The error handler then sets state, last_error and last_errno
        fields for current statement to values which correspond to
        error which was caught.
      sql/mysql_priv.h:
        Added max_long_data_size variable declaration.
      sql/mysqld.cc:
        Added support for start-up parameter 'max_long_data_size'.
        This parameter limits size of data which can be sent from
        client to server using mysql_send_long_data() API.
      sql/set_var.cc:
        Added variable 'max_long_data_size' into list of variables
        displayed by command 'show variables'.
      sql/sql_prepare.cc:
        Added error handler class Set_longdata_error_handler.
        This handler is used to catch any errors that can be
        generated during execution of Item_param::set_longdata().
        
        Source code snippet that makes checking for statement's state 
        during statement execution is moved from Prepared_statement::execute()
        to Prepared_statement::execute_loop() in order not to call
        set_parameters() when statement has failed during
        set_long_data() execution. If this hadn't been done
        the call to set_parameters() would have failed.
      tests/mysql_client_test.c:
        A testcase for the bug #56976 was added.
      0dd27502
    • Jon Olav Hauglid's avatar
      Bug #11765416 (former 58381) · aa7591ff
      Jon Olav Hauglid authored
      FAILED DROP DATABASE CAN BREAK STATEMENT BASED REPLICATION
      
      The first phase of DROP DATABASE is to delete the tables in the database.
      If deletion of one or more of the tables fail (e.g. due to a FOREIGN KEY
      constraint), DROP DATABASE will be aborted. However, some tables could
      still have been deleted. The problem was that nothing would be written
      to the binary log in this case, so any slaves would not delete these tables.
      Therefore the master and the slaves would get out of sync.
      
      This patch fixes the problem by making sure that DROP TABLE is written
      to the binary log for the tables that were in fact deleted by the failed
      DROP DATABASE statement.
      
      Test case added to binlog.binlog_database.test.
      aa7591ff
    • Bjorn Munch's avatar
  2. 14 Mar, 2011 5 commits
    • Chuck Bell's avatar
      Local merger for BUG#59752 · b0003265
      Chuck Bell authored
      b0003265
    • Davi Arnaut's avatar
      Merge of mysql-5.1 into mysql-5.5. · 017e5419
      Davi Arnaut authored
      017e5419
    • Davi Arnaut's avatar
      Bug#11765202: Dbug_violation_helper::~Dbug_violation_helper(): Assertion `!_entered' failed. · 1c911042
      Davi Arnaut authored
      Add a missing DBUG_RETURN function test_if_number().
      1c911042
    • Magne Mahre's avatar
      Bug#11858960 - WINDOWS SERVICE FAILING TO START IMMEDIATELY AFTER · 7061f203
      Magne Mahre authored
                     INSTALLATION
      
      When starting mysqld as an MS Windows NT service, it crashed 
      with "Error 1067: The process terminated unexpectedly".
      
      The problem is that thread local variables are not allocated
      and initialized properly when started as a service. When the
      server is started as a regular executable, the problem does
      not occur.
      
      Analysis showed that this is a regression after the patch for 
      Bug#11765237/Bug#11763065.   Before, the thread local storage
      was initialized by the call chain:
      win_main->my_basic_init->my_thread_basic_global_init->
      my_thread_init
      
      When the my_init() structure was changed, this initialization
      was moved from win_main to mysqld_main.   When started as
      a service win_main is run in a separate thread, which does
      not have mysqld_main in its call path, so my_thread_init
      is never called for this thread.
      
      Added a call to my_thread_init / my_thread_end in the service
      handler function, which solves the problem.
      7061f203
    • Alexander Nozdrin's avatar
      A patch for Bug#11765297 (58251 - archive_plugin and blackhole_plugin · df7d2b91
      Alexander Nozdrin authored
      fails when running with ps-protocol).
      
      The problem was that when running in --ps-protocol mode mysqltest.cc
      didn't close created prepared statements. So, the plugins could not be
      unistalled because there was a prepared statement using them.
      
      A fix is to add a dummy statement that forces mysqltest.cc to close
      the last prepared statement (which uses a plugin-defined table).
      df7d2b91
  3. 11 Mar, 2011 11 commits
    • Chuck Bell's avatar
      BUG#59752 : mysql.user.plugin length (60) vs. mysql.plugin.name length (64) · 0449995f
      Chuck Bell authored
      This patch corrects the problem by fixing the definition and alterations
      of the mysql.user table in the .sql files.
      
      Also included are new result files for tests that examine the name 
      column of the mysql.user table.
      0449995f
    • Joerg Bruehe's avatar
      Fight a problem in internal test builds: · 9b5048b1
      Joerg Bruehe authored
      When a RPM test build in a non-release branch is done,
      the $MYSQL_BINDIR variable ends in "/usr"
      (rather than in "/usr/lib" as in a RPM release build),
      this made test "file_contents" fail.
      
      A branch for this case is added to the test.
      The test result is unchanged.
      
      
      
      mysql-test/t/file_contents.test:
        Fight a problem in internal test builds:
        
        When a RPM test build in a non-release branch is done,
        the $MYSQL_BINDIR variable ends in "/usr"
        (rather than in "/usr/lib" as in a RPM release build),
        this made test "file_contents" fail.
        
        Because of this, the old logic did not recognize
        that a RPM build is done (trailing '/' missing!)
        and took the tar.gz branch.
        Just removing the trailing '/' from the "/usr" is
        not enough, as the logic for RPMs used to replace
        "/lib" which is not present at all; rather, a new
        branch was added.
        
        To help in case of future problems, the error messages
        for a failing "open()" now also report "$MYSQL_BINDIR".
      9b5048b1
    • Bjorn Munch's avatar
      null upmerge · 358499cb
      Bjorn Munch authored
      358499cb
    • Bjorn Munch's avatar
      merge from 5.5-mtr · 65498bf0
      Bjorn Munch authored
      65498bf0
    • Bjorn Munch's avatar
      merge from 5.1-mtr · f9f525ee
      Bjorn Munch authored
      f9f525ee
    • Mayank Prasad's avatar
      merge from mysql5.1 for bug#11760210 · b4a74617
      Mayank Prasad authored
      b4a74617
    • Mayank Prasad's avatar
      BUG #11760210: 52596: SSL_CIPHER_LIST NOT SET OR RETURNED FOR "SHOW STATUS LIKE 'SSL_CIPHER_LIST'" · 4a04347c
      Mayank Prasad authored
      Issue:
            SSL_CIPHER set to a specific CIPHER name was not getting picked up by SHOW STATUS Command.
      
      Solution:
            If specific cipher name is specified, avoid overwriting of Cipher List with default Cipher names.
      
      
      extra/yassl/src/yassl_int.cpp:
        If user specified Cipher name is there, avoid populating default
        cipher names' list.
      mysql-test/r/ssl_cipher.result:
        Expected file for ssl_cipher.test test case
      mysql-test/t/ssl_cipher-master.opt:
        Server option file for ssl_cipher.test test case.
      mysql-test/t/ssl_cipher.test:
        Test case to verify that user specified SSL cipher name is shown in SHOW STATUS Command.
      4a04347c
    • Marc Alff's avatar
      Test cleanup · 007e5463
      Marc Alff authored
      007e5463
    • Bjorn Munch's avatar
      null upmerge · 46133871
      Bjorn Munch authored
      46133871
    • Bjorn Munch's avatar
      merge from 5.5 main · 04357463
      Bjorn Munch authored
      04357463
    • Bjorn Munch's avatar
      merge from 5.1 main · 96a48032
      Bjorn Munch authored
      96a48032
  4. 10 Mar, 2011 8 commits
  5. 09 Mar, 2011 5 commits
  6. 08 Mar, 2011 6 commits
    • Bjorn Munch's avatar
      Add extra line after unit test report in MTR · 5112deb9
      Bjorn Munch authored
      5112deb9
    • Bjorn Munch's avatar
      null upmerge · 0675a0bc
      Bjorn Munch authored
      0675a0bc
    • Bjorn Munch's avatar
      merge from 5.1 main · fb0e66fd
      Bjorn Munch authored
      fb0e66fd
    • Bjorn Munch's avatar
      merge from 5.5 main · 3aeafc3c
      Bjorn Munch authored
      3aeafc3c
    • Marc Alff's avatar
      Bug#11830755 - UNIT TESTS PFS_INSTR AND PFS_INSTR_CLASS CRASH IN MUTEX CALLS ON WINDOWS · 7fd63cac
      Marc Alff authored
      Before this fix, two performance schema unit tests crashed on windows.
      
      The problem was a missing initialization to PFS_atomics,
      which caused the crash only for platform not compiled with native atomics.
      
      This fix adds the missing initialization in the unit tests.
      No production code was changed, this is a unit test bug only.
      7fd63cac
    • Jon Olav Hauglid's avatar
      Bug #11755431 (former 47205) · 739b073e
      Jon Olav Hauglid authored
      MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR ENGINES NOT
      SUPPORTING NATIVE REPAIR
      
      Executing 'mysqlcheck --check-upgrade --auto-repair ...' will first issue
      'CHECK TABLE FOR UPGRADE' for all tables in the database in order to check if the
      tables are compatible with the current version of MySQL. Any tables that are
      found incompatible are then upgraded using 'REPAIR TABLE'.
      
      The problem was that some engines (e.g. InnoDB) do not support 'REPAIR TABLE'.
      This caused any such tables to be left incompatible. As a result such tables were
      not properly fixed by the mysql_upgrade tool.
      
      This patch fixes the problem by first changing 'CHECK TABLE FOR UPGRADE' to return
      a different error message if the engine does not support REPAIR. Instead of
      "Table upgrade required. Please do "REPAIR TABLE ..." it will report
      "Table rebuild required. Please do "ALTER TABLE ... FORCE ..."
      
      Second, the patch changes mysqlcheck to do 'ALTER TABLE ... FORCE' instead of
      'REPAIR TABLE' in these cases.
      
      This patch also fixes 'ALTER TABLE ... FORCE' to actually rebuild the table.
      This change should be reflected in the documentation. Before this patch,
      'ALTER TABLE ... FORCE' was unused (See Bug#11746162)
      
      Test case added to mysqlcheck.test
      
      
      client/mysqlcheck.c:
        Changed mysqlcheck to do 'ALTER TABLE ... FORCE' if
        'CHECK TABLE FOR UPGRADE' reports ER_TABLE_NEEDS_REBUILD
        and not ER_TABLE_NEEDS_UPGRADE.
      mysql-test/r/mysqlcheck.result:
        Added regression test.
      mysql-test/std_data/bug47205.frm:
        InnoDB 5.0 FRM which contains a varchar primary key using
        utf8_general_ci. This is an incompatible FRM for 5.5.
      mysql-test/t/mysqlcheck.test:
        Added regression test.
      sql/handler.h:
        Added new HA_CAN_REPAIR flag.
      sql/share/errmsg-utf8.txt:
        Added new error message ER_TABLE_NEEDS_REBUILD
      sql/sql_admin.cc:
        Changed 'CHECK TABLE FOR UPDATE' to give ER_TABLE_NEEDS_REBUILD
        instead of ER_TABLE_NEEDS_UPGRADE if the engine does not support
        REPAIR (as indicated by the new HA_CAN_REPAIR flag).
      sql/sql_lex.h:
        Remove unused ALTER_FORCE flag.
      sql/sql_yacc.yy:
        Make sure ALTER TABLE ... FORCE recreates the table
        by setting the ALTER_RECREATE flag as the ALTER_FORCE
        flag was unused.
      storage/archive/ha_archive.h:
        Added new HA_CAN_REPAIR flag to Archive
      storage/csv/ha_tina.h:
        Added new HA_CAN_REPAIR flag to CSV
      storage/federated/ha_federated.h:
        Added new HA_CAN_REPAIR flag to Federated
      storage/myisam/ha_myisam.cc:
        Added new HA_CAN_REPAIR flag to MyISAM
      739b073e
  7. 07 Mar, 2011 1 commit
    • Jon Olav Hauglid's avatar
      Bug #11784056 ENABLE CONCURRENT READS WHILE CREATING · 96ee4c84
      Jon Olav Hauglid authored
                    NON-PRIMARY UNIQUE INDEX USING INNODB
      
      This patch adds the HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE
      capability flag to InnoDB, indicating that concurrent reads
      can be allowed while non-primary unique indexes are created.
      
      This is an follow-up to Bug #11751388 which enabled concurrent
      reads when creating non-primary non-unique indexes.
      
      Test case added to innodb_mysql_sync.test.
      96ee4c84