1. 29 Jul, 2010 13 commits
    • Alexander Nozdrin's avatar
      Fix build failure. · ca4c0282
      Alexander Nozdrin authored
      ca4c0282
    • Alexander Nozdrin's avatar
      Auto-merge from mysql-trunk-merge. · 32f3ab79
      Alexander Nozdrin authored
      32f3ab79
    • Konstantin Osipov's avatar
      d85c6281
    • Vasil Dimov's avatar
      279896c2
    • Vasil Dimov's avatar
      ca090321
    • Vasil Dimov's avatar
      Merge mysql-5.1-bugteam -> mysql-trunk-merge · 6bd182e9
      Vasil Dimov authored
      This is a null merge of the InnoDB changesets which get to trunk
      by manual porting and committing into mysql-trunk-innodb and then
      merging into mysql-trunk-bugfixing.
      6bd182e9
    • Vasil Dimov's avatar
      Merge mysql-5.1-bugteam -> mysql-trunk-merge · d07c0afe
      Vasil Dimov authored
      d07c0afe
    • Vasil Dimov's avatar
      Merge mysql-5.1-innodb -> mysql-5.1-bugteam · 060db3d3
      Vasil Dimov authored
      060db3d3
    • Vasil Dimov's avatar
      Merge mysql-5.1-bugteam -> mysql-5.1-innodb · c110066b
      Vasil Dimov authored
      c110066b
    • Konstantin Osipov's avatar
      Fix a Windows failure of main.merge test introduced by · dd135df6
      Konstantin Osipov authored
      the precursor patch for Bug#52044.
      When passing the TABLE instance for invalidation to the
      query cache, we didn't always have a valid share
      (in case of error).
      Make sure we invalidate the table using TABLE_LIST, not
      TABLE, object.
      
      sql/sql_table.cc:
        Make sure we invalidate the table using TABLE_LIST, not
        TABLE, object.
      dd135df6
    • Alexander Barkov's avatar
      Postfix for BUG#45012. · 6f6a3e52
      Alexander Barkov authored
      Problem: The original patch didn't compile on debug_werror
      due to wrong format in printf("%d") for size_t variables.
      
      Fix: Adding cast to (int).
      6f6a3e52
    • unknown's avatar
      Manual merge · cb63e6d0
      unknown authored
      cb63e6d0
    • unknown's avatar
      BUG#49124 Security issue with /*!-versioned */ SQL statements on Slave · 2124538d
      unknown authored
      /*![:version:] Query Code */, where [:version:] is a sequence of 5 
      digits representing the mysql server version(e.g /*!50200 ... */),
      is a special comment that the query in it can be executed on those 
      servers whose versions are larger than the version appearing in the 
      comment. It leads to a security issue when slave's version is larger 
      than master's. A malicious user can improve his privileges on slaves. 
      Because slave SQL thread is running with SUPER privileges, so it can
      execute queries that he/she does not have privileges on master.
      
      This bug is fixed with the logic below: 
      - To replace '!' with ' ' in the magic comments which are not applied on
        master. So they become common comments and will not be applied on slave.
      
      - Example:
        'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /*!99999 ,(3)*/
        will be binlogged as
        'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /* 99999 ,(3)*/
      
      mysql-test/suite/rpl/t/rpl_conditional_comments.test:
        Test the patch for this bug.
      sql/mysql_priv.h:
        Rename inBuf as rawBuf and remove the const limitation.
      sql/sql_lex.cc:
        To replace '!' with ' ' in the magic comments which are not applied on
        master.
      sql/sql_lex.h:
        Remove the const limitation on parameter buff, as it can be modified in the function since
        this patch.
        Add member function yyUnput for Lex_input_stream. It set a character back the query buff.
      sql/sql_parse.cc:
        Rename inBuf as rawBuf and remove the const limitation.
      sql/sql_partition.cc:
        Remove the const limitation on parameter part_buff, as it can be modified in the function since
        this patch.
      sql/sql_partition.h:
        Remove the const limitation on parameter part_buff, as it can be modified in the function since
        this patch.
      sql/table.h:
        Remove the const limitation on variable partition_info, as it can be modified since
        this patch.
      2124538d
  2. 28 Jul, 2010 6 commits
  3. 27 Jul, 2010 4 commits
    • Konstantin Osipov's avatar
      c4c678f6
    • Davi Arnaut's avatar
      Bug#52261: 64 bit atomic operations do not work on Solaris i386 .. · 8ee568cd
      Davi Arnaut authored
      Workaround a interface problem with the atomic macros that was
      causing warnings. The correct type is retrieved using typeof if
      compiling with GCC.
      8ee568cd
    • Konstantin Osipov's avatar
      Implement WL#5502 Remove dead 5.0 class Sensitive_cursor. · 740c0d3a
      Konstantin Osipov authored
      Remove dead and unused code.
      Update to reflect the code review requests.
      
      include/thr_lock.h:
        Remove declarations for THR_LOCK_OWNER,
        added along with the patch for sensitive cursors.
      mysys/thr_lock.c:
        Remove support for multiple thr_lock requestors
        per THD.
      sql/lock.cc:
        Revert the patch that added support for sensitive cursors.
      sql/sp_rcontext.cc:
        Updated the use of mysql_open_cursor().
      sql/sql_class.cc:
        Move the instance of Server_side_cursor
        from class Prepared_statement to class Statement.
      sql/sql_class.h:
        Move the isntance of Server_side_cursor
        from class Prepared_statement to class
        Statement.
        Remove multiple lock_ids of thr_lock.
      sql/sql_cursor.cc:
        Remove Sensitive_cursor implementation.
      sql/sql_cursor.h:
        Remove declarations for sensitive cursors.
      sql/sql_prepare.cc:
        Move the declaration of instance of Server_side_cursor
        from class Statement to class Prepared_statement, 
        where it's used.
      sql/sql_select.cc:
        Remove sensitive cursor support.
      sql/sql_select.h:
        Remove sensitive cursor support.
      sql/sql_union.cc:
        Remove sensitive cursor support.
      740c0d3a
    • Konstantin Osipov's avatar
      A pre-requisite patch for the fix for Bug#52044. · 36290c09
      Konstantin Osipov authored
      This patch also fixes Bug#55452 "SET PASSWORD is
      replicated twice in RBR mode".
      
      The goal of this patch is to remove the release of 
      metadata locks from close_thread_tables().
      This is necessary to not mistakenly release
      the locks in the course of a multi-step
      operation that involves multiple close_thread_tables()
      or close_tables_for_reopen().
      
      On the same token, move statement commit outside 
      close_thread_tables().
      
      Other cleanups:
      Cleanup COM_FIELD_LIST.
      Don't call close_thread_tables() in COM_SHUTDOWN -- there
      are no open tables there that can be closed (we leave
      the locked tables mode in THD destructor, and this
      close_thread_tables() won't leave it anyway).
      
      Make open_and_lock_tables() and open_and_lock_tables_derived()
      call close_thread_tables() upon failure.
      Remove the calls to close_thread_tables() that are now
      unnecessary.
      
      Simplify the back off condition in Open_table_context.
      
      Streamline metadata lock handling in LOCK TABLES 
      implementation.
      
      Add asserts to ensure correct life cycle of 
      statement transaction in a session.
      
      Remove a piece of dead code that has also become redundant
      after the fix for Bug 37521.
      
      mysql-test/r/variables.result:
        Update results: set @@autocommit and statement transaction/
        prelocked mode.
      mysql-test/r/view.result:
        A harmless change in CHECK TABLE <view> status for a broken view.
        If previously a failure to prelock all functions used in a view 
        would leave the connection in LTM_PRELOCKED mode, now we call
        close_thread_tables() from open_and_lock_tables()
        and leave prelocked mode, thus some check in mysql_admin_table() that
        works only in prelocked/locked tables mode is no longer activated.
      mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result:
        Fixed Bug#55452 "SET PASSWORD is replicated twice in
        RBR mode": extra binlog events are gone from the
        binary log.
      mysql-test/t/variables.test:
        Add a test case: set autocommit and statement transaction/prelocked
        mode.
      sql/event_data_objects.cc:
        Simplify code in Event_job_data::execute().
        Move sp_head memory management to lex_end().
      sql/event_db_repository.cc:
        Move the release of metadata locks outside
        close_thread_tables().
        Make sure we call close_thread_tables() when
        open_and_lock_tables() fails and remove extra
        code from the events data dictionary.
        Use close_mysql_tables(), a new internal
        function to properly close mysql.* tables
        in the data dictionary.
        Contract Event_db_repository::drop_events_by_field,
        drop_schema_events into one function.
        When dropping all events in a schema,
        make sure we don't mistakenly release all
        locks acquired by DROP DATABASE. These
        include locks on the database name
        and the global intention exclusive
        metadata lock.
      sql/event_db_repository.h:
        Function open_event_table() does not require an instance 
        of Event_db_repository.
      sql/events.cc:
        Use close_mysql_tables() instead of close_thread_tables()
        to bootstrap events, since the latter no longer
        releases metadata locks.
      sql/ha_ndbcluster.cc:
        - mysql_rm_table_part2 no longer releases
        acquired metadata locks. Do it in the caller.
      sql/ha_ndbcluster_binlog.cc:
        Deploy the new protocol for closing thread
        tables in run_query() and ndb_binlog_index
        code.
      sql/handler.cc:
        Assert that we never call ha_commit_trans/
        ha_rollback_trans in sub-statement, which
        is now the case.
      sql/handler.h:
        Add an accessor to check whether THD_TRANS object
        is empty (has no transaction started).
      sql/log.cc:
        Update a comment.
      sql/log_event.cc:
        Since now we commit/rollback statement transaction in 
        mysql_execute_command(), we need a mechanism to communicate
        from Query_log_event::do_apply_event() to mysql_execute_command()
        that the statement transaction should be rolled back, not committed.
        Ideally it would be a virtual method of THD. I hesitate
        to make THD a virtual base class in this already large patch.
        Use a thd->variables.option_bits for now.
        
        Remove a call to close_thread_tables() from the slave IO
        thread. It doesn't open any tables, and the protocol
        for closing thread tables is more complicated now.
        
        Make sure we properly close thread tables, however, 
        in Load_data_log_event, which doesn't
        follow the standard server execution procedure
        with mysql_execute_command().
        @todo: this piece should use Server_runnable
        framework instead.
        Remove an unnecessary call to mysql_unlock_tables().
      sql/rpl_rli.cc:
        Update Relay_log_info::slave_close_thread_tables()
        to follow the new close protocol.
      sql/set_var.cc:
        Remove an unused header.
      sql/slave.cc:
        Remove an unnecessary call to
        close_thread_tables().
      sql/sp.cc:
        Remove unnecessary calls to close_thread_tables()
        from SP DDL implementation. The tables will
        be closed by the caller, in mysql_execute_command().
        When dropping all routines in a database, make sure
        to not mistakenly drop all metadata locks acquired
        so far, they include the scoped lock on the schema.
      sql/sp_head.cc:
        Correct the protocol that closes thread tables
        in an SP instruction.
        Clear lex->sphead before cleaning up lex
        with lex_end to make sure that we don't
        delete the sphead twice. It's considered
        to be "cleaner" and more in line with
        future changes than calling delete lex->sphead
        in other places that cleanup the lex.
      sql/sp_head.h:
        When destroying m_lex_keeper of an instruction,
        don't delete the sphead that all lex objects
        share. 
        @todo: don't store a reference to routine's sp_head
        instance in instruction's lex.
      sql/sql_acl.cc:
        Don't call close_thread_tables() where the caller will
        do that for us.
        Fix Bug#55452 "SET PASSWORD is replicated twice in RBR 
        mode" by disabling RBR replication in change_password()
        function.
        Use close_mysql_tables() in bootstrap and ACL reload
        code to make sure we release all metadata locks.
      sql/sql_base.cc:
        This is the main part of the patch:
        - remove manipulation with thd->transaction
        and thd->mdl_context from close_thread_tables().
        Now this function is only responsible for closing
        tables, nothing else.
        This is necessary to be able to easily use
        close_thread_tables() in procedures, that
        involve multiple open/close tables, which all
        need to be protected continuously by metadata
        locks.
        Add asserts ensuring that TABLE object
        is only used when is protected by a metadata lock.
        Simplify the back off condition of Open_table_context,
        we no longer need to look at the autocommit mode.
        Make open_and_lock_tables() and open_normal_and_derived_tables()
        close thread tables and release metadata locks acquired so-far 
        upon failure. This simplifies their usage.
        Implement close_mysql_tables().
      sql/sql_base.h:
        Add declaration for close_mysql_tables().
      sql/sql_class.cc:
        Remove a piece of dead code that has also become redundant
        after the fix for Bug 37521.
        The code became dead when my_eof() was made a non-protocol method,
        but a method that merely modifies the diagnostics area.
        The code became redundant with the fix for Bug#37521, when 
        we started to cal close_thread_tables() before
        Protocol::end_statement().
      sql/sql_do.cc:
        Do nothing in DO if inside a substatement
        (the assert moved out of trans_rollback_stmt).
      sql/sql_handler.cc:
        Add comments.
      sql/sql_insert.cc:
        Remove dead code. 
        Release metadata locks explicitly at the
        end of the delayed insert thread.
      sql/sql_lex.cc:
        Add destruction of lex->sphead to lex_end(),
        lex "reset" method called at the end of each statement.
      sql/sql_parse.cc:
        Move close_thread_tables() and other related
        cleanups to mysql_execute_command()
        from dispatch_command(). This has become
        possible after the fix for Bug#37521.
        Mark federated SERVER statements as DDL.
        
        Next step: make sure that we don't store
        eof packet in the query cache, and move
        the query cache code outside mysql_parse.
        
        Brush up the code of COM_FIELD_LIST.
        Remove unnecessary calls to close_thread_tables().
        
        When killing a query, don't report "OK"
        if it was a suicide.
      sql/sql_parse.h:
        Remove declaration of a function that is now static.
      sql/sql_partition.cc:
        Remove an unnecessary call to close_thread_tables().
      sql/sql_plugin.cc:
        open_and_lock_tables() will clean up
        after itself after a failure.
        Move close_thread_tables() above
        end: label, and replace with close_mysql_tables(),
        which will also release the metadata lock
        on mysql.plugin.
      sql/sql_prepare.cc:
        Now that we no longer release locks in close_thread_tables()
        statement prepare code has become more straightforward.
        Remove the now redundant check for thd->killed() (used
        only by the backup project) from Execute_server_runnable.
        Reorder code to take into account that now mysql_execute_command()
        performs lex->unit.cleanup() and close_thread_tables().
      sql/sql_priv.h:
        Add a new option to server options to interact
        between the slave SQL thread and execution
        framework (hack). @todo: use a virtual
        method of class THD instead.
      sql/sql_servers.cc:
        Due to Bug 25705 replication of 
        DROP/CREATE/ALTER SERVER is broken.
        Make sure at least we do not attempt to 
        replicate these statements using RBR,
        as this violates the assert in close_mysql_tables().
      sql/sql_table.cc:
        Do not release metadata locks in mysql_rm_table_part2,
        this is done by the caller.
        Do not call close_thread_tables() in mysql_create_table(),
        this is done by the caller. 
        Fix a bug in DROP TABLE under LOCK TABLES when,
        upon error in wait_while_table_is_used() we would mistakenly
        release the metadata lock on a non-dropped table.
        Explicitly release metadata locks when doing an implicit
        commit.
      sql/sql_trigger.cc:
        Now that we delete lex->sphead in lex_end(),
        zero the trigger's sphead in lex after loading
        the trigger, to avoid double deletion.
      sql/sql_udf.cc:
        Use close_mysql_tables() instead of close_thread_tables().
      sql/sys_vars.cc:
        Remove code added in scope of WL#4284 which would
        break when we perform set @@session.autocommit along
        with setting other variables and using tables or functions.
        A test case added to variables.test.
      sql/transaction.cc:
        Add asserts.
      sql/tztime.cc:
        Use close_mysql_tables() rather than close_thread_tables().
      36290c09
  4. 26 Jul, 2010 4 commits
  5. 28 Jul, 2010 1 commit
  6. 26 Jul, 2010 7 commits
  7. 25 Jul, 2010 1 commit
    • Vladislav Vaintroub's avatar
      Cleanup after bild team push. · 568c2663
      Vladislav Vaintroub authored
      * Fixed obvious errors (HAVE_BROKEN_PREAD is not true for on any
      of systems we use, definitely not on HPUX)
      
      * Remove other junk flags for OSX and HPUX
      
      * Avoid checking type sizes in universal builds on OSX, again 
      (CMake2.8.0 fails is different architectures return different results)
      
      * Do not compile template instantiation stuff unless 
      EXPLICIT_TEMPLATE_INSTANTIATION is used.
      
      * Some cleanup (make gen_lex_hash simpler, avoid dependencies)
      
      * Exclude some unused files from compilation (strtol.c etc)
      568c2663
  8. 24 Jul, 2010 4 commits
    • Vladislav Vaintroub's avatar
      Bug#55169: Installer does not preserve user's settings in custom mode · 212b26d1
      Vladislav Vaintroub authored
      Fix some issues with WiX packaging, particularly 
      major upgrade and change scenarios.
      
      * remember binary location and data location
      (for major upgrade)
      
      * use custom UI, which is WiX Mondo extended 
      for major upgrade dialog (no feature selection
      screen shown on major upgrade, only upgrade
      confirmation). This is necessary to prevent
      changing installation path during upgrade
      (services are not reregistered, so they would 
      have invalid binary path is it is changed)
      
      * Hide datafiles that are installed into 
      ProgramFiles, show ones that are installed
      in ProgramData
      
      * Make MSI buildable with nmake
      
      * Fix autotools "make dist"
      
      
      
      
      Makefile.am:
        Fix autotools "make dist"
      configure.in:
        Fix autotools "make dist"
      packaging/Makefile.am:
        Fix autotools "make dist"
      packaging/WiX/CMakeLists.txt:
        Use custom UI, for major upgrades
      packaging/WiX/CPackWixConfig.cmake:
        Show user editable datafiles in feature selection dialog, 
        not datafiles installed into ProgramFiles directory
      packaging/WiX/create_msi.cmake.in:
        Use custom UI, fix nmake build for installer
      packaging/WiX/custom_ui.wxs:
        Use custom UI
      packaging/WiX/extra.wxs.in:
        Show user editable datafiles in feature selection dialog, 
        not datafiles installed into ProgramFiles directory
      packaging/WiX/mysql_server.wxs.in:
        Remember install locations of binaries and 
        user editable datafiles.
      212b26d1
    • Davi Arnaut's avatar
      Add a maintainer target to the warning-mode of the build scripts. · 8011a429
      Davi Arnaut authored
      Fix assorted warnings in order for the warning-mode to be effective.
      8011a429
    • Davi Arnaut's avatar
    • Davi Arnaut's avatar
      Bug#42733: Type-punning warnings when compiling MySQL · 7f80eb46
      Davi Arnaut authored
      Post-merge fix: remove remaining casts which are now
      unnecessary and are actually causing warnings.
      7f80eb46