1. 16 Nov, 2010 5 commits
    • Marc Alff's avatar
      Bug#56760 PFS_lock::allocated_to_free() assert failures on osx10.5-x86-64bit · bef051a0
      Marc Alff authored
      Before this fix, an assert could fail in PFS_lock::allocated_to_free(), during shutdown.
      The assert itself is valid, and detects an anomaly caused by bug 56666.
      
      While bug 56666 has no real consequences in production,
      the failure caused by this new assert in the code is negatively
      impacting the test suite with automated tests.
      
      This fix is a work around only, that relaxes the integrity checks 
      during the server shutdown.
      bef051a0
    • Marc Alff's avatar
      Local merge · 6131fb34
      Marc Alff authored
      6131fb34
    • Marc Alff's avatar
      Local merge · 6afdcec0
      Marc Alff authored
      6afdcec0
    • Mattias Jonsson's avatar
      disabled main.create-big as pre-push fix · d59c608b
      Mattias Jonsson authored
      d59c608b
    • Mattias Jonsson's avatar
      Manual merge of bug#58197 to mysql-5.5. · d9045a1a
      Mattias Jonsson authored
      Including adding test in 5.5 requiring --big-test
      flag from mysql-test-run.pl and also disabled
      tests that fails.
      
      mysql-test/collections/default.weekly:
        Added all tests requiring --big-test in alphabetical order
      mysql-test/r/information_schema-big.result:
        Updated result
      mysql-test/r/variables-big.result:
        updated results
      mysql-test/t/disabled.def:
        Added tests that fails (has not been run
        regularly since they need --big-test)
      d9045a1a
  2. 15 Nov, 2010 6 commits
    • Mattias Jonsson's avatar
      merge · 631e5509
      Mattias Jonsson authored
      631e5509
    • Mattias Jonsson's avatar
      merge · c72b286c
      Mattias Jonsson authored
      c72b286c
    • Mattias Jonsson's avatar
      merge · 839ba627
      Mattias Jonsson authored
      839ba627
    • Mattias Jonsson's avatar
      merge · e1100b38
      Mattias Jonsson authored
      e1100b38
    • Jorgen Loland's avatar
      Bug#54812: assert in Diagnostics_area::set_ok_status · ac10cb5b
      Jorgen Loland authored
                 during EXPLAIN
      
      Before the patch, send_eof() of some subclasses of 
      select_result (e.g., select_send::send_eof()) could 
      handle being called after an error had occured while others 
      could not. The methods that were not well-behaved would trigger
      an ASSERT on debug builds. Release builds were not affected.
      
      Consider the following query as an example for how the ASSERT
      could be triggered:
      
      A user without execute privilege on f() does
         SELECT MAX(key1) INTO @dummy FROM t1 WHERE f() < 1;
      resulting in "ERROR 42000: execute command denied to user..." 
      
      The server would end the query by calling send_eof(). The 
      fact that the error had occured would make the ASSERT trigger. 
      
      select_dumpvar::send_eof() was the offending method in the
      bug report, but the problem also applied to other 
      subclasses of select_result. This patch uniforms send_eof() 
      of all subclasses of select_result to handle being called 
      after an error has occured. 
      
      mysql-test/r/not_embedded_server.result:
        Added test for BUG#54812
      mysql-test/t/not_embedded_server.test:
        Added test for BUG#54812
      sql/sql_class.cc:
        send_eof() of all subclasses of select_result can now handle being
        called after an error has occured.
      sql/sql_insert.cc:
        send_eof() of all subclasses of select_result can now handle being
        called after an error has occured.
        Also fix call to abort() in select_create::send_eof(), which was supposed to abort the result set, not terminate the server. This call to abort() should have been changed when the function was renamed from abort_result_set() but was forgotten. New test case added by BUG#54812 covered this line and terminated server.
      sql/sql_prepare.cc:
        send_eof() of all subclasses of select_result can now handle being
        called after an error has occured.
      sql/sql_update.cc:
        send_eof() of all subclasses of select_result can now handle being
        called after an error has occured.
      ac10cb5b
    • Mattias Jonsson's avatar
      Bug#58197: main.variables-big fails on windows · 931373bb
      Mattias Jonsson authored
      The test result differs on windows, since
      it writes out 'localhost:<port>' instead of
      only 'localhost', since it uses tcp/ip instead
      of unix sockets on windows.
      
      Fixed by replacing that column.
      
      Also requires --big-test from some long running tests
      and added a weekly run of all test requiring --big-test.
      
      mysql-test/collections/default.weekly:
        Added a run of big-test (already exists in 5.5).
      mysql-test/r/variables-big.result:
        Updated results
      mysql-test/suite/parts/t/part_supported_sql_func_innodb.test:
        requiring --big-test since the test takes long time
      mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test:
        requiring --big-test since the test takes long time
      mysql-test/suite/parts/t/partition_alter1_2_innodb.test:
        requiring --big-test since the test takes long time
      mysql-test/suite/parts/t/partition_alter4_innodb.test:
        requiring --big-test since the test takes long time
      mysql-test/t/disabled.def:
        Disabled two tests since they fail and was already
        reported as bugs (but was never run since they requires
        --big-test flag).
      mysql-test/t/variables-big.test:
        Replacing column 3 in process list since it
        is not the same on windows as in unix.
      931373bb
  3. 13 Nov, 2010 4 commits
    • Vladislav Vaintroub's avatar
      merge · 6574f4ba
      Vladislav Vaintroub authored
      6574f4ba
    • Vladislav Vaintroub's avatar
    • Vladislav Vaintroub's avatar
      Bug#58178: "make package" is broken with cmake 2.8.3 · 0e1e1491
      Vladislav Vaintroub authored
      Problem:  with "make package" , many small packages are 
      generated, one per CMake COMPONENT, instead of expected single
      package. This is due to the new (in cmake 2.8.3) component-based 
      install for archive( e.g ZIP,TGZ ) CPack generators.
      
      See http://public.kitware.com/Bug/view.php?id=11452 for discussion.
      
      Fix: use CPACK_MONOLITHIC_INSTALL=1 to enforce single package.
      Reset this variable temporarily to 0 for  MSI creation  (MSI needs 
      COMPONENTs)
      0e1e1491
    • Alexander Nozdrin's avatar
      Fix for Bug#56934 (mysql_stmt_fetch() incorrectly fills MYSQL_TIME · 6bf734f8
      Alexander Nozdrin authored
      structure buffer).
      
      This is a follow-up for WL#4435. The bug actually existed not only
      MYSQL_TYPE_DATETIME type. The problem was that Item_param::set_value()
      was written in an assumption that it's working with expressions, i.e.
      with basic data types.
      
      There are two different quick fixes here:
        a) Change Item_param::make_field() -- remove setting of
           Send_field::length, Send_field::charsetnr, Send_field::flags and
           Send_field::type.
      
           That would lead to marshalling all data using basic types to the client
           (MYSQL_TYPE_LONGLONG, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_STRING and
           MYSQL_TYPE_NEWDECIMAL). In particular, that means, DATETIME would be
           sent as MYSQL_TYPE_STRING, TINYINT -- as MYSQL_TYPE_LONGLONG, etc.
      
           That could be Ok for the client, because the client library does
           reverse conversion automatically (the client program would see DATETIME
           as MYSQL_TIME object). However, there is a problem with metadata --
           the metadata would be wrong (misleading): it would say that DATETIME is
           marshaled as MYSQL_TYPE_DATETIME, not as MYSQL_TYPE_STRING.
      
        b) Set Item_param::param_type properly to actual underlying field type.
           That would lead to double conversion inside the server: for example,
           MYSQL_TIME-object would be converted into STRING-object
           (in Item_param::set_value()), and then converted back to MYSQL_TIME-object
           (in Item_param::send()).
      
           The data however would be marshalled more properly, and also metadata would
           be correct.
      
      This patch implements b).
      
      There is also a possibility to avoid double conversion either by clonning
      the data field, or by storing a reference to it and using it on Item::send()
      time. That requires more work and might be done later.
      6bf734f8
  4. 12 Nov, 2010 5 commits
    • Joerg Bruehe's avatar
      Patch for bug#57596 · eecc2ae2
      Joerg Bruehe authored
            MySQL-shared RPM no longer provides mysql-shared
      
      The spec file is changed to explicitly "provide" "mysql-shared"
      by the "shared" sub-RPM.
      eecc2ae2
    • Vladislav Vaintroub's avatar
      Bug#58074: ADD_VERSION_INFO cmake/mysql_version.cmake fails if LINK_FLAGS are modified · c86a3340
      Vladislav Vaintroub authored
      Backport version info handling  (Windows-specific) from next-mr. 
      Instead of adding ".res" object as linker flag, add  resource file (.rc) file to the source list.
      This is more obvious and less error prone method.
      c86a3340
    • Marc Alff's avatar
      Bug#58052 Binary log IO not being accounted for properly · 9e7ca88f
      Marc Alff authored
      Before this fix, file io for the binary log file was not accounted properly,
      and showed no io at all.
      
      This bug was due to the following issues:
      
      1) file io for the binlog was instrumented:
      - sometime as "wait/io/file/sql/binlog"
      - sometime as "wait/io/file/sql/MYSQL_LOG"
      leading to inconsistent event_names.
      
      2) the binlog file itself was using an IO_CACHE,
      but the IO_CACHE implementation in mysys/mf_iocache.c was
      not instrumented to make performance schema calls to record file io.
      
      3) The "wait/io/file/sql/MYSQL_LOG" instrumentation was used
      for several log files, such as:
      - the binary log
      - the slow log
      - the query log
      which caused file io in these different log files to be accounted
      against the same instrument.
      The instrumentation needs to have a finer grain and report io
      in different event_names, because each file really serves a different purpose.
      
      With this fix:
      - the IO_CACHE implementation is now instrumented
      - the "wait/io/file/sql/MYSQL_LOG" instrument has been removed
      - binlog io is now always instrumented with "wait/io/file/sql/binlog"
      - the slow log is instrumented with a new name, "wait/io/file/sql/slow_log"
      - the query log is instrumented with a new name, "wait/io/file/sql/query_log"
      9e7ca88f
    • Vladislav Vaintroub's avatar
      merge · 496aff9e
      Vladislav Vaintroub authored
      496aff9e
    • Vladislav Vaintroub's avatar
      Bug #52275 CMake configure wrapper does not handle · 40311c56
      Vladislav Vaintroub authored
      --with-comment correctly
            
      Properly convert --with-comment
      do not uppercase it, quote as it might contain spaces.
      40311c56
  5. 11 Nov, 2010 8 commits
    • Sunanda Menon's avatar
      merge · e6aaad1e
      Sunanda Menon authored
      e6aaad1e
    • Sunanda Menon's avatar
      7a75c5ce
    • Marc Alff's avatar
      Bug#58003 Segfault on CHECKSUM TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG EXTENDED · 6730a56c
      Marc Alff authored
      This fix is a follow up on the fix for similar issue 56761.
      
      When sanitizing data read from the events_waits_history_long table,
      the code needs also to sanitize the schema_name / object_name / file_name pointers,
      because such pointers could also hold invalid values.
      Checking the string length alone was required but not sufficient.
      
      This fix verifies that:
      - the table schema and table name used in table io events
      - the file name used in file io events
      are valid pointers before dereferencing these pointers.
      6730a56c
    • Mattias Jonsson's avatar
      Bug#57890: Assertion failed: next_insert_id == 0 · c489f3ff
      Mattias Jonsson authored
                 with on duplicate key update
      
      There was a missed corner case in the partitioning
      handler, which caused the next_insert_id to be changed
      in the second level handlers (i.e the hander of a partition),
      which caused this debug assertion.
      
      The solution was to always ensure that only the partitioning
      level generates auto_increment values, since if it was done
      within a partition, it may fail to match the partition
      function.
      
      mysql-test/suite/parts/inc/partition_auto_increment.inc:
        Added tests
      mysql-test/suite/parts/r/partition_auto_increment_blackhole.result:
        updated results
      mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
        updated results
      mysql-test/suite/parts/r/partition_auto_increment_memory.result:
        updated results
      mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
        updated results
      sql/ha_partition.cc:
        In <engine>::write_row the auto_inc value is generated
        through handler::update_auto_increment (which calls <engine>::get_auto_increment() if needed).
        If:
        * INSERT_ID was set to 0
        * it was updated to 0 by 'INSERT ... ON DUPLICATE KEY UPDATE' and changed partitions for the row
        Then it would try to generate a auto_increment value in the
        <engine for a specific partition>::write_row, which will
        trigger the assert.
        
        So the solution is to prevent this by,
        in ha_partition::write_row set auto_inc_field_not_null and
        add MODE_NO_AUTO_VALUE_ON_ZERO
        in ha_partition::update_row (when changing partition) temporary
        set table->next_number_field to NULL which calling the
        partitions ::write_row().
      c489f3ff
    • Sergey Vojtovich's avatar
      Merge patch for BUG#58079. · bd9fc1f6
      Sergey Vojtovich authored
      bd9fc1f6
    • Sergey Vojtovich's avatar
      030e04d6
    • Dmitry Shulga's avatar
      e9bd55ad
    • Dmitry Shulga's avatar
      Fixed bug#54375 - Error in stored procedure leaves connection · af132f15
      Dmitry Shulga authored
      in different default schema.
      
      In strict mode, when data truncation or conversion happens,
      THD::killed is set to THD::KILL_BAD_DATA.
      
      This is abuse of KILL mechanism to guarantee that execution
      of statement is aborted.
      
      The stored procedures execution, on the other hand,
      upon detection that a connection was killed, would
      terminate immediately, without trying to restore the caller's
      context, in particular, restore the caller's current schema.
      
      The fix is, when terminating a stored procedure execution,
      to only bypass cleanup if the entire connection was killed,
      not in case of other forms of KILL.
      
      
      mysql-test/r/sp-bugs.result:
        Added result for a test case for bug#54375.
      mysql-test/t/sp-bugs.test:
        Added test case for bug#54375.
      sql/sp_head.cc:
        sp_head::execute modified: restore saved current db if
        connection is not killed.
      af132f15
  6. 10 Nov, 2010 8 commits
    • Vladislav Vaintroub's avatar
      Fix typo : SVR5=>SVR4 · 6a20a3ac
      Vladislav Vaintroub authored
      6a20a3ac
    • Georgi Kodinov's avatar
      14a1e2bd
    • Georgi Kodinov's avatar
      Bug #57744: sql-common/client.c: Missing DBUG_RETURN macro · b4330cdf
      Georgi Kodinov authored
      - added missing DBUG_RETURN
      - fixed whitespace according to coding style.
      b4330cdf
    • Oystein Grovlen's avatar
      Bug#57704 Cleanup code dies with void TABLE::set_keyread(bool): Assertion `file' failed. · a571802b
      Oystein Grovlen authored
      This bug was introduced in this revision: 
      kostja@sun.com-20100727102553-b4n2ojcyfj79l2x7
      ("A pre-requisite patch for the fix for Bug#52044.")
      
      It happens because close_thread_tables() is now called in
      open_and_lock_tables upon failure.  Hence, table is no longer
      open when optimizer tries to do cleanup.
      
      Fix: Make sure to do cleanup in st_select_lex_unit::prepare()
      upon failure. This way, cleanup() is called before tables are
      released.
      
      mysql-test/r/subselect.result:
        Added test case for Bug#57704.
      mysql-test/t/subselect.test:
        Added test case for Bug#57704.
      sql/sql_union.cc:
        st_select_lex_unit::prepare():  On failure, make sure cleanup()
        is called.
      a571802b
    • Dmitry Shulga's avatar
      null merge. · bcdc0f6d
      Dmitry Shulga authored
      bcdc0f6d
    • Dmitry Shulga's avatar
      Fixed bug#56619 - Assertion failed during · b2432ca4
      Dmitry Shulga authored
      ALTER TABLE RENAME, DISABLE KEYS.
      
      The code of ALTER TABLE RENAME, DISABLE KEYS could
      issue a commit while holding LOCK_open mutex.
      This is a regression introduced by the fix for
      Bug 54453.
      This failed an assert guarding us against a potential
      deadlock with connections trying to execute
      FLUSH TABLES WITH READ LOCK.
      
      The fix is to move acquisition of LOCK_open outside
      the section that issues ha_autocommit_or_rollback().
      LOCK_open is taken to protect against concurrent
      operations with .frms and the table definition
      cache, and doesn't need to cover the call to commit.
      
      A test case added to innodb_mysql.test.
      
      The patch is to be null-merged to 5.5, which
      already has 54453 null-merged to it.
      
      mysql-test/suite/innodb/r/innodb_mysql.result:
        Added test results for test for bug#56619.
      mysql-test/suite/innodb/t/innodb_mysql.test:
        Added test for bug#56619.
      sql/sql_table.cc:
        mysql_alter_table() modified: moved acquisition of LOCK_open
        after call to ha_autocommit_or_rollback.
      b2432ca4
    • Dmitry Shulga's avatar
      Auto-merge from 5.1-bugteam for bug#57386. · 8bb57cdd
      Dmitry Shulga authored
      8bb57cdd
    • Dmitry Shulga's avatar
      Fixed Bug#57386 - main.execution_constants segfault on MIPS64EL. · 37b8a3d7
      Dmitry Shulga authored
      sql/item_func.cc:
        Item_func::fix_fields modified: increased minimal required stack
        size in call to check_stack_overrun().
      37b8a3d7
  7. 09 Nov, 2010 4 commits
    • Davi Arnaut's avatar
      Bug#58080: Crash on failure to create a thread to handle a user connection · 4de6b09f
      Davi Arnaut authored
      The problem was that the scheduler function used to handle a
      new user connection could use the ER() macro without having a
      THD object bound to the current thread. The crash would happen
      whenever the function failed to create a new thread to handle a
      user connection. Thread creation can fail due to lack or limit
      of available resources.
      
      The solution is to simply use the ER_THD() macro instead and pass
      to it the THD object which would be bound to the connection.
      
      Fix was tested manually. In a test case, it is too cumbersome to
      inject a error in this context.
      
      sql/mysqld.cc:
        Use ER_THD and pass the object.
      4de6b09f
    • Davi Arnaut's avatar
      f74b6127
    • Davi Arnaut's avatar
      Bug#57210: remove pstack · 95a7c4bd
      Davi Arnaut authored
      Quoting from the bug report:
      
      The pstack library has been included in MySQL since version
      4.0.0. It's useless and should be removed.
      
      Details: According to its own documentation, pstack only works
      on Linux on x86 in 32 bit mode and requires LinuxThreads and a
      statically linked binary. It doesn't really support any Linux
      from 2003 or later and doesn't work on any other OS.
      
      The --enable-pstack option is thus deprecated and has no effect.
      95a7c4bd
    • Bjorn Munch's avatar
      null upmerge · ed75e54b
      Bjorn Munch authored
      ed75e54b