1. 14 May, 2010 1 commit
    • Konstantin Osipov's avatar
      Committing on behalf of Valdislav Vaintroub (reviewed and · ac2c6ba1
      Konstantin Osipov authored
      approved):
      
      3161 Vladislav Vaintroub       2010-04-29                 
       Bug#53196 : CMake builds don't support 'make tags' and 
      'make ctags' targets.  
         - Added tags and ctags targets
      
      
      CMakeLists.txt:
        Add tags and ctags targets.
      cmake/Makefile.am:
        Add a cmake file to build tags.
      cmake/tags.cmake:
        Build tags and ctags.
      ac2c6ba1
  2. 13 May, 2010 3 commits
  3. 07 May, 2010 1 commit
  4. 05 May, 2010 8 commits
    • Konstantin Osipov's avatar
      Clean-up, give better names, add comments to · 25d83b75
      Konstantin Osipov authored
      thd->in_multi_stmt_transaction() and thd->active_transaction().
      
      
      include/mysql_com.h:
        Comment SERVER_STATUS_IN_TRANS flag.
      sql/ha_ndbcluster.cc:
        Rename: thd->in_multi_stmt_transaction() -> 
        thd->in_multi_stmt_transaction_mode().
      sql/handler.cc:
        Add comments.
      sql/log.cc:
        Rename: thd->in_multi_stmt_transaction() -> 
        thd->in_multi_stmt_transaction_mode().
      sql/log_event.cc:
        Rename: thd->in_multi_stmt_transaction() -> 
        thd->in_multi_stmt_transaction_mode().
      sql/sql_base.cc:
        Rename: thd->in_multi_stmt_transaction() -> 
        thd->in_multi_stmt_transaction_mode().
      sql/sql_cache.cc:
        Rename: thd->active_transaction() ->
        thd->in_active_multi_stmt_transaction().
      sql/sql_class.cc:
        Rename: thd->in_multi_stmt_transaction() -> 
        thd->in_multi_stmt_transaction_mode().
      sql/sql_class.h:
        Rename and comment two transaction processing- related methods.
      sql/sql_parse.cc:
        Rename: thd->in_multi_stmt_transaction() -> 
        thd->in_multi_stmt_transaction_mode().
        Rename: thd->active_transaction() ->
        thd->in_active_multi_stmt_transaction().
      sql/sql_prepare.cc:
        Rename: thd->in_multi_stmt_transaction() -> 
        thd->in_multi_stmt_transaction_mode().
      sql/sql_rename.cc:
        Rename: thd->active_transaction() ->
        thd->in_active_multi_stmt_transaction().
      sql/sql_table.cc:
        Rename: thd->active_transaction() ->
        thd->in_active_multi_stmt_transaction().
      sql/sys_vars.cc:
        Rename: thd->active_transaction() ->
        thd->in_active_multi_stmt_transaction().
      sql/transaction.cc:
        Rename: thd->in_multi_stmt_transaction() -> 
        thd->in_multi_stmt_transaction_mode().
        Rename: thd->active_transaction() ->
        thd->in_active_multi_stmt_transaction().
      25d83b75
    • Magne Mahre's avatar
      Bug#49193 CREATE TABLE reacts differently depending on whether · c9f32d90
      Magne Mahre authored
                data is selected or not
      
      Temporary and permanent tables should live in different 
      namespaces.  In this case, resolving a permanent table
      name gave the temporary table, resulting in a name
      collision.
      c9f32d90
    • Alexander Nozdrin's avatar
      Patch for Bug#50511 (Sometimes wrong handling of user variables containing NULL). · 11dcb13c
      Alexander Nozdrin authored
            
      The bug happened under the following condition:
        - there was a user variable of type REAL, containing NULL value
        - there was a table with a NOT_NULL column of any type but REAL, having
          default value (or auto increment);
        - a row was inserted into the table with the user variable as value.
          A warning was emitted here.
      
      The problem was that handling of NULL values of REAL type was not properly
      implemented: it didn't expect that REAL NULL value can be assigned to other
      data type.
      
      Basically, the problem was that set_field_to_null() was used instead of
      set_field_to_null_with_conversions().
      
      The fix is to use the right function, or more generally, to allow conversion of
      REAL NULL values to other data types.
      11dcb13c
    • Alexander Barkov's avatar
      Bug#51571 load xml infile causes server crash · f311e6f0
      Alexander Barkov authored
        
        Problem:
        item->name was NULL for Item_user_var_as_out_param
        which made strcmp(something, item->name) crash in the LOAD XML code.
        
        Fix:
        - item_func.h: Adding set_name() in constuctor for Item_user_var_as_out_param
        - sql_load.cc: Changing the condition in write_execute_load_query_log_event() which
        distiguished between Item_user_var_as_out_param and Item_field
        from
          if (item->name == NULL)
        to
          if (item->type() == Item::FIELD_ITEM)
        - loadxml.result, loadxml.test: adding tests
      f311e6f0
    • Magne Mahre's avatar
      Bug#48800 CREATE TABLE t...SELECT fails if t is a temporary · e8b0dc70
      Magne Mahre authored
                table
      
      If a temporary table A exists, and a (permanent) table 
      with the same name is attempted created with 
      "CREATE TABLE ... AS SELECT", the create would fail with 
      an error.
         1050: Table 'A' already exists
      
      The error occured in MySQL 5.1 releases, but is not
      present in MySQL 5.5.   This patch adds a regression
      test to ensure that the problem does not reoccur.
      e8b0dc70
    • Alexander Barkov's avatar
      Bug#52849 [Com]: datetime index not work · b41c8186
      Alexander Barkov authored
      Problem: after introduction of "WL#2649 Number-to-string conversions"
      
      This query:
        SET NAMES cp850; -- Or any other non-latin1 ASCII-based character set
        SELECT * FROM t1
        WHERE datetime_column='2010-01-01 00:00:00'
      started to add extra character set conversion: 
        SELECT * FROM t1
        WHERE CONVERT(datetime_column USING cp850)='2010-01-01 00:00:00';
      
      so index on DATETIME column was not used anymore.
      Fix:
        avoid convertion of NUMERIC/DATETIME items
        (i.e. those with derivation DERIVATION_NUMERIC).
      b41c8186
    • Horst.Hunger's avatar
      Patch for 47759 to trunk-bugfixing. · 7f30f576
      Horst.Hunger authored
      7f30f576
    • Jon Olav Hauglid's avatar
      merge from mysql-trunk-bugfixing · 6e2784a4
      Jon Olav Hauglid authored
      6e2784a4
  5. 04 May, 2010 5 commits
  6. 30 Apr, 2010 1 commit
    • Alexander Nozdrin's avatar
      Patch for Bug#52356: query_cache_debug fails on Linux. · 82956fff
      Alexander Nozdrin authored
      There were two problems here:
        1. misleading error message
        2. abusing KILL QUERY in the test case
      
      1. The server reported "'DELETE FROM t1' failed: 1689: Wait on a lock was
      aborted due to a pending exclusive lock", while the proper error message
      should be "'DELETE FROM t1' failed: 1317: Query execution was interrupted".
      
      The problem is that the server has two different flags for
      signalling that a query is being killed: THD::killed and
      mysys_var::abort. The test case triggers a race: sometimes
      mysys_var::abort is set earlier than THD::killed. That leads
      to the following situation:
      
        - thr_lock() checks mysys_var::abort and returns error status,
          since mysys_var::abort is set;
      
        - the caller (mysql_lock_tables()) gets an error from thr_lock(),
          but THD::killed is not set, so it decides that thr_lock() couldn't
          get a lock due to a pending exclusive lock.
      
      This is a known issue with the server and it's not going to be fixed soon.
      
      5.5 differs from 5.1 here as follows: when thr_lock() returns an error:
        - 5.1 continues trying thr_lock() until success;
        - 5.5 propagates the error
      
      2. The test case uses KILL QUERY is a highly concurent environment.
      
      The fix is to wait for the dying statement to rest in peace before
      executing another DELETE FROM t1.
      82956fff
  7. 29 Apr, 2010 1 commit
  8. 28 Apr, 2010 4 commits
    • Konstantin Osipov's avatar
      Bug#46947 "Embedded SELECT without FOR UPDATE is causing a lock" · 633225d1
      Konstantin Osipov authored
      Update the result file to minor tweaks of the comments in the
      test case.
      633225d1
    • Sven Sandberg's avatar
      BUG#50670: Slave stops with error code 1644 · fc4a8a5e
      Sven Sandberg authored
      Clarified error messages related to unsafe statements:
       - avoid the internal technical term "row injection"
       - use 'binary log' instead of 'binlog'
       - avoid the word 'unsafeness'
      
      
      mysql-test/extra/binlog_tests/blackhole.test:
        updated suppression pattern
      mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
        updated suppression pattern
      mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test:
        updated suppression pattern
      mysql-test/extra/rpl_tests/rpl_insert_id.test:
        updated suppression pattern
      mysql-test/extra/rpl_tests/rpl_loaddata.test:
        updated suppression pattern
      mysql-test/extra/rpl_tests/rpl_mixing_engines.test:
        updated suppression pattern
      mysql-test/extra/rpl_tests/rpl_start_stop_slave.test:
        updated suppression pattern
      mysql-test/extra/rpl_tests/rpl_stm_000001.test:
        updated suppression pattern
      mysql-test/extra/rpl_tests/rpl_stop_middle_group.test:
        updated suppression pattern
      mysql-test/r/archive.result:
        updated result file
      mysql-test/r/commit_1innodb.result:
        updated result file
      mysql-test/r/ctype_cp932_binlog_stm.result:
        updated result file
      mysql-test/r/partition_innodb_stmt.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_innodb.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_killed.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_multi_engine.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_stm_do_db.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_stm_ps.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_stm_row.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_unsafe.result:
        updated result file
      mysql-test/suite/binlog/t/binlog_killed.test:
        updated suppression pattern
      mysql-test/suite/binlog/t/binlog_multi_engine.test:
        updated suppression pattern
      mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test:
        updated suppression pattern
      mysql-test/suite/binlog/t/binlog_stm_ps.test:
        updated suppression pattern
      mysql-test/suite/binlog/t/binlog_stm_row.test:
        updated suppression pattern
      mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test:
        updated suppression pattern
      mysql-test/suite/binlog/t/binlog_tmp_table.test:
        updated suppression pattern
      mysql-test/suite/binlog/t/binlog_unsafe.test:
        updated suppression pattern
      mysql-test/suite/ndb/r/ndb_binlog_format.result:
        updated result file
      mysql-test/suite/ndb/t/ndb_binlog_format.test:
        updated suppression pattern
      mysql-test/suite/perfschema/r/binlog_stmt.result:
        updated result file
      mysql-test/suite/perfschema/t/binlog_stmt.test:
        updated suppression pattern
      mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_blackhole.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_concurrency_error.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_get_lock.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_insert_id.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_insert_ignore.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_misc_functions.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_mysql_upgrade.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_read_only.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_row_mixing_engines.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_slow_query_log.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_sp.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_stm_000001.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_stm_loadfile.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_temp_temporary.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_variables_stm.result:
        updated result file
      mysql-test/suite/rpl/t/rpl000013.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_blackhole.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_concurrency_error.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_err_ignoredtable.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_get_lock.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_insert.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_insert_id.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_insert_ignore.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_invoked_features.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_misc_functions.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_mysql_upgrade.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_optimize.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_read_only.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_semi_sync.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_semi_sync_event.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_session_var.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_slow_query_log.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_sp.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_stm_found_rows.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_stm_loadfile.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_temp_table.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_temp_temporary.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_temporary.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_timezone.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_trigger.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_udf.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_user_variables.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_variables_stm.test:
        updated suppression pattern
      mysql-test/suite/rpl/t/rpl_view_multi.test:
        updated suppression pattern
      mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result:
        updated result file
      mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test:
        updated suppression pattern
      mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test:
        updated suppression pattern
      mysql-test/suite/sys_vars/t/rpl_init_slave_func.test:
        updated suppression pattern
      mysql-test/t/archive.test:
        updated suppression pattern
      mysql-test/t/commit_1innodb.test:
        updated suppression pattern
      mysql-test/t/create_select_tmp.test:
        updated suppression pattern
      mysql-test/t/ctype_cp932_binlog_stm.test:
        updated suppression pattern
      mysql-test/t/lock_sync.test:
        updated suppression pattern
      mysql-test/t/mysqlbinlog.test:
        updated suppression pattern
      mysql-test/t/mysqldump.test:
        updated suppression pattern
      mysql-test/t/sp_trans.test:
        updated suppression pattern
      sql/log_event.cc:
        Clarified error message.
      sql/share/errmsg-utf8.txt:
        Clarified error messages.
      fc4a8a5e
    • Konstantin Osipov's avatar
      Committing on behalf or Dmitry Lenev: · 08472b0f
      Konstantin Osipov authored
      Fix for bug #46947 "Embedded SELECT without FOR UPDATE is
      causing a lock", with after-review fixes.
      
      SELECT statements with subqueries referencing InnoDB tables
      were acquiring shared locks on rows in these tables when they
      were executed in REPEATABLE-READ mode and with statement or
      mixed mode binary logging turned on.
      
      This was a regression which were introduced when fixing
      bug 39843.
      
      The problem was that for tables belonging to subqueries
      parser set TL_READ_DEFAULT as a lock type. In cases when
      statement/mixed binary logging at open_tables() time this
      type of lock was converted to TL_READ_NO_INSERT lock at
      open_tables() time and caused InnoDB engine to acquire
      shared locks on reads from these tables. Although in some
      cases such behavior was correct (e.g. for subqueries in
      DELETE) in case of SELECT it has caused unnecessary locking.
      
      This patch tries to solve this problem by rethinking our
      approach to how we handle locking for SELECT and subqueries.
      Now we always set TL_READ_DEFAULT lock type for all cases
      when we read data. When at open_tables() time this lock
      is interpreted as TL_READ_NO_INSERT or TL_READ depending
      on whether this statement as a whole or call to function
      which uses particular table should be written to the
      binary log or not (if yes then statement should be properly
      serialized with concurrent statements and stronger lock
      should be acquired).
      
      Test coverage is added for both InnoDB and MyISAM.
      
      This patch introduces an "incompatible" change in locking
      scheme for subqueries used in SELECT ... FOR UPDATE and
      SELECT .. IN SHARE MODE.
      In 4.1 the server would use a snapshot InnoDB read for 
      subqueries in SELECT FOR UPDATE and SELECT .. IN SHARE MODE
      statements, regardless of whether the binary log is on or off.
      If the user required a different type of read (i.e. locking read),
      he/she could request so explicitly by providing FOR UPDATE/IN SHARE MODE
      clause for each individual subquery.
      On of the patches for 5.0 broke this behaviour (which was not documented
      or tested), and started to use locking reads fora all subqueries in SELECT ... 
      FOR UPDATE/IN SHARE MODE. This patch restored 4.1 behaviour.
      
      mysql-test/include/check_concurrent_insert.inc:
        Added auxiliary script which allows to check if statement
        reading table allows concurrent inserts in it.
      mysql-test/include/check_no_concurrent_insert.inc:
        Added auxiliary script which allows to check that statement
        reading table doesn't allow concurrent inserts in it.
      mysql-test/include/check_no_row_lock.inc:
        Added auxiliary script which allows to check if statement
        reading table doesn't take locks on its rows.
      mysql-test/include/check_shared_row_lock.inc:
        Added auxiliary script which allows to check if statement
        reading table takes shared locks on some of its rows.
      mysql-test/r/bug39022.result:
        After bug #46947 'Embedded SELECT without FOR UPDATE is
        causing a lock' was fixed test case for bug 39022 has to
        be adjusted in order to trigger execution path on which
        original problem was encountered.
      mysql-test/r/innodb_mysql_lock2.result:
        Added coverage for handling of locking in various cases when
        we read data from InnoDB tables (includes test case for
        bug #46947 'Embedded SELECT without FOR UPDATE is causing a
        lock').
      mysql-test/r/lock_sync.result:
        Added coverage for handling of locking in various cases when
        we read data from MyISAM tables.
      mysql-test/t/bug39022.test:
        After bug #46947 'Embedded SELECT without FOR UPDATE is
        causing a lock' was fixed test case for bug 39022 has to
        be adjusted in order to trigger execution path on which
        original problem was encountered.
      mysql-test/t/innodb_mysql_lock2.test:
        Added coverage for handling of locking in various cases when
        we read data from InnoDB tables (includes test case for
        bug #46947 'Embedded SELECT without FOR UPDATE is causing a
        lock').
      mysql-test/t/lock_sync.test:
        Added coverage for handling of locking in various cases when
        we read data from MyISAM tables.
      sql/log_event.cc:
        Since LEX::lock_option member was removed we no longer can
        rely on its value in Load_log_event::print_query() to
        determine that log event correponds to LOAD DATA CONCURRENT
        statement (this was not correct in all situations anyway).
        A new Load_log_event's member was introduced as a replacement.
        It is initialized at event object construction time and
        explicitly indicates whether LOAD DATA was concurrent.
      sql/log_event.h:
        Since LEX::lock_option member was removed we no longer can
        rely on its value in Load_log_event::print_query() to
        determine that log event correponds to LOAD DATA CONCURRENT
        statement (this was not correct in all situations anyway).
        A new Load_log_event's member was introduced as a replacement.
        It is initialized at event object construction time and
        explicitly indicates whether LOAD DATA was concurrent.
      sql/sp_head.cc:
        sp_head::reset_lex():
          Before parsing substatement reset part of parser state
          which needs this (e.g. set Yacc_state::m_lock_type to
          default value).
      sql/sql_acl.cc:
        Since LEX::reset_n_backup_query_tables_list() now also
        resets LEX::sql_command member (as it became part of
        Query_tables_list class) we have to restore it in cases
        when while working with proxy Query_table_list we assume
        that LEX::sql_command still corresponds to original SQL
        command being executed (for example, when we are logging
        statement to the binary log while having Query_tables_list
        reset and backed up).
      sql/sql_base.cc:
        Changed read_lock_type_for_table() to return a weak TL_READ
        type of lock in cases when we are executing statement which
        won't update tables directly and table doesn't belong to
        statement's prelocking list and thus can't be used by a
        stored function. It is OK to do so since in this case table
        won't be used by statement or function call which will be
        written to the binary log, so serializability requirements
        for it can be relaxed.
        One of results from this change is that SELECTs on InnoDB
        tables no longer takes shared row locks for tables which
        are used in subqueries (i.e. bug #46947 is fixed).
        Another result is that for similar SELECTs on MyISAM tables
        concurrent inserts are allowed.
        In order to implement this change signature of
        read_lock_type_for_table() function was changed to take
        pointers to Query_tables_list and TABLE_LIST objects.
      sql/sql_base.h:
        - Function read_lock_type_for_table() now takes pointers
          to Query_tables_list and TABLE_LIST elements as its
          arguments since to correctly determine lock type it needs
          to know what statement is being performed and whether table
          element for which lock type to be determined belongs to
          prelocking list.
      sql/sql_lex.cc:
        - Removed LEX::lock_option and st_select_lex::lock_option
          members. Places in parser that were using them now use
          Yacc_state::m_lock_type instead.
        - To emphasize that LEX::sql_command member is used during
          process of opening and locking of tables it was moved to
          Query_tables_list class. It is now reset by
          Query_tables_list::reset_query_tables_list() method.
      sql/sql_lex.h:
        - Removed st_select_lex::lock_option member as there is no
          real need for per-SELECT lock type (HIGH_PRIORITY option
          should apply to the whole statement. FOR UPDATE/LOCK IN
          SHARE MODE clauses can be handled without this member).
          The main effect which was achieved by introduction of this
          member, i.e. using TL_READ_DEFAULT lock type for
          subqueries, is now achieved by setting LEX::lock_option
          (or rather its replacement - Yacc_state::m_lock_type) to
          TL_READ_DEFAULT in almost all cases.
        - To emphasize that LEX::sql_command member is used during
          process of opening and locking of tables it was moved to
          Query_tables_list class.
        - Replaced LEX::lock_option with Yacc_state::m_lock_type
          in order to emphasize that this value is relevant only
          during parsing. Unlike for LEX::lock_option the default
          value for Yacc_state::m_lock_type is TL_READ_DEFAULT.
          Note that for cases when it is OK to take a "weak" read
          lock (e.g. simple SELECT) this lock type will be converted
          to TL_READ at open_tables() time. So this change won't
          cause negative change in behavior for such statements.
          OTOH this change ensures that, for example, for SELECTs
          which are used in stored functions TL_READ_NO_INSERT lock
          is taken when necessary and as result calls to such stored
          functions can be written to the binary log with correct
          serialization.
      sql/sql_load.cc:
        Load_log_event constructor now requires a parameter that
        indicates whether LOAD DATA is concurrent.
      sql/sql_parse.cc:
        LEX::lock_option was replaced with Yacc_state::m_lock_type.
        And instead of resetting the latter implicitly in
        mysql_init_multi_delete() we do it explicitly in the
        places in parser which call this function.
      sql/sql_priv.h:
        - To be able more easily distinguish high-priority SELECTs
          in st_select_lex::print() method added flag for
          HIGH_PRIORITY option.
      sql/sql_select.cc:
        Changed code not to rely on LEX::lock_option to determine
        that it is high-priority SELECT. It was replaced with
        Yacc_state::m_lock_type which is accessible only at
        parse time. So instead of LEX::lock_option we now rely
        on a newly introduced flag for st_select_lex::options -
        SELECT_HIGH_PRIORITY.
      sql/sql_show.cc:
        Since LEX::reset_n_backup_query_tables_list() now also
        resets LEX::sql_command member (as it became part of
        Query_tables_list class) we have to restore it in cases
        when while working with proxy Query_table_list we assume
        that LEX::sql_command still corresponds to original SQL
        command being executed.
      sql/sql_table.cc:
        Since LEX::reset_query_tables_list() now also resets
        LEX::sql_command member (as it became part of
        Query_tables_list class) we have to restore value of this
        member when this method is called by mysql_admin_table(),
        to make this code safe for re-execution.
      sql/sql_trigger.cc:
        Since LEX::reset_n_backup_query_tables_list() now also
        resets LEX::sql_command member (as it became part of
        Query_tables_list class) we have to restore it in cases
        when while working with proxy Query_table_list we assume
        that LEX::sql_command still corresponds to original SQL
        command being executed (for example, when we are logging
        statement to the binary log while having Query_tables_list
        reset and backed up).
      sql/sql_update.cc:
        Function read_lock_type_for_table() now takes pointers
        to Query_tables_list and TABLE_LIST elements as its
        arguments since to correctly determine lock type it needs
        to know what statement is being performed and whether table
        element for which lock type to be determined belongs to
        prelocking list.
      sql/sql_yacc.yy:
        - Removed st_select_lex::lock_option member as there is no
          real need for per-SELECT lock type (HIGH_PRIORITY option
          should apply to the whole statement. FOR UPDATE/LOCK IN
          SHARE MODE clauses can be handled without this member).
          The main effect which was achieved by introduction of this
          member, i.e. using TL_READ_DEFAULT lock type for
          subqueries, is now achieved by setting LEX::lock_option
          (or rather its replacement - Yacc_state::m_lock_type) to
          TL_READ_DEFAULT in almost all cases.
        - Replaced LEX::lock_option with Yacc_state::m_lock_type
          in order to emphasize that this value is relevant only
          during parsing. Unlike for LEX::lock_option the default
          value for Yacc_state::m_lock_type is TL_READ_DEFAULT.
          Note that for cases when it is OK to take a "weak" read
          lock (e.g. simple SELECT) this lock type will be converted
          to TL_READ at open_tables() time. So this change won't
          cause negative change in behavior for such statements.
          OTOH this change ensures that, for example, for SELECTs
          which are used in stored functions TL_READ_NO_INSERT lock
          is taken when necessary and as result calls to such stored
          functions can be written to the binary log with correct
          serialization.
        - To be able more easily distinguish high-priority SELECTs
          in st_select_lex::print() method we now use new flag
          in st_select_lex::options bit-field.
      08472b0f
    • unknown's avatar
      Bug #51839 mixup of DDL causes slave to stop · 1daed852
      unknown authored
      Stored routine DDL statements use statement-based replication
      regardless of the current binlog format. The problem here was
      that if a DDL statement failed during metadata lock acquisition
      or opening of mysql.proc, the binlog format would not be reset
      before returning. So the following DDL or DML statements are 
      binlogged with a wrong binlog format, which causes the slave 
      to stop.
      
      The problem can be resolved by grabbing an exclusive MDL lock firstly
      instead of clearing the current binlog format. So that the binlog
      format will not be affected when the lock grab returns directly with
      an error. The same way is taken to open a proc table for update.
      
      
      mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result:
        Test Result for bug#51839
      mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test:
        Added test to make sure the binlog format is not changed
        after a execution of DDL with a table locked.
      sql/sp.cc:
        Grab an exclusive MDL lock and open a proc table for update firstly
        instead of clearing the current binlog format.
      1daed852
  9. 27 Apr, 2010 5 commits
  10. 26 Apr, 2010 5 commits
  11. 22 Apr, 2010 2 commits
    • Alexander Nozdrin's avatar
      Patch for Bug#53022: Compilation of "embedded" is broken. · 995c2556
      Alexander Nozdrin authored
      The bug was a side effect of WL#5030 (fix header files) and
      WL#5161 (CMake).
      
      The problem was that CMake-generated config.h (and my_config.h
      as a copy of it) had a header guard. GNU autotools-generated
      [my_]config.h did not. During WL#5030 the order of header files
      was changed, so the following started to happen (using GNU autotools,
      in embedded server):
        - my_config.h included, defining HAVE_OPENSSL
        - my_global.h included, un-defining  HAVE_OPENSSL
        - zlib.h included, including config.h,
          defining HAVE_OPENSSL again.
      
      The fix is to check HAVE_OPENSSL in conjuction with EMBEDDED_LIBRARY.
      More common fix would be to define a macros as HAVE_OPENSSL && !EMBEDDED_LIBRARY
      and use it instead of HAVE_OPENSSL.
      995c2556
    • Jon Olav Hauglid's avatar
      merge from mysql-trunk-bugfixing · 069e69b0
      Jon Olav Hauglid authored
      069e69b0
  12. 21 Apr, 2010 4 commits
    • Alexander Nozdrin's avatar
      45a93758
    • Alexander Nozdrin's avatar
      Patch for Bug#53022: Compilation of "embedded" is broken. · f0f066ba
      Alexander Nozdrin authored
      The bug was a side effect of WL#5030 (fix header files) and
      WL#5161 (CMake).
      
      The problem was that CMake-generated config.h (and my_config.h
      as a copy of it) had a header guard. GNU autotools-generated
      [my_]config.h did not. During WL#5030 the order of header files
      was changed, so the following started to happen (using GNU autotools,
      in embedded server):
        - my_config.h included, defining HAVE_OPENSSL
        - my_global.h included, un-defining  HAVE_OPENSSL
        - zlib.h included, including config.h,
          defining HAVE_OPENSSL again.
      
      The fix is to change the order of header file, moving zlib.h
      to the top of the header list. More proper fix would be to wrap
      unguarded auto-generated [my_]config.h by guarded non-generated
      header file.
      f0f066ba
    • Alfranio Correia's avatar
      BUG#51894 Replication failure with SBR on DROP TEMPORARY TABLE inside a · e2328781
      Alfranio Correia authored
                transaction
      BUG#52616 Temp table prevents switch binlog format from STATEMENT to ROW
      
      Post-merge fixes.
      
      
      mysql-test/include/commit.inc:
        Changed the test case as drop temporary is now written to the binary log in row mode.
      mysql-test/r/commit_1innodb.result:
        Changed the test case as drop temporary is now written to the binary log in row mode.
      mysql-test/r/ctype_cp932_binlog_stm.result:
        Disabled warning messages because the test runs in both statement and mixed modes.
      mysql-test/t/ctype_cp932_binlog_stm.test:
        Disabled warning messages because the test runs in both statement and mixed modes.
      mysql-test/t/mysqlbinlog.test:
        Removed the --short-form due to BUG#18337 what was suppressing the
        select * from t5 /* must be (1),(1) */ in row format.
      e2328781
    • Jon Olav Hauglid's avatar
      merge from mysql-trunk-runtime · 18b9157f
      Jon Olav Hauglid authored
      18b9157f