1. 28 Aug, 2007 6 commits
  2. 27 Aug, 2007 20 commits
    • unknown's avatar
      Merge quant.(none):/ext/mysql/bkroot/mysql-5.1-target-5.1.22 · 05d3b8d6
      unknown authored
      into  quant.(none):/ext/mysql/bk/mysql-5.1-bug21842-5.1.22-merge
      
      
      05d3b8d6
    • unknown's avatar
      Bug #30389: connection_id() always return 0 in embedded server · 61e988e7
      unknown authored
        
      Initialize thd->variables.pseudo_thread_id when a new embedded
      thd is created.
      
      
      libmysqld/lib_sql.cc:
        Add comment regarding duplication of code in create_embedded_thd()
        vs. create_new_thread() and prepare_new_connection_state().  This
        was a cause for not properly initializing the pseudo_thread_id variable.
      mysql-test/r/func_misc.result:
        Add test case to ensure connection_id() returns a sane value
      mysql-test/t/func_misc.test:
        Add test case to ensure connection_id() returns a sane value
      sql/mysqld.cc:
        Add comment warning of the duplication of code between create_new_thread()
        and create_embedded_thd()
      sql/sql_connect.cc:
        Add comment warning of the duplication of code between
        prepare_new_connection_state() and create_embedded_thd()
      61e988e7
    • unknown's avatar
      Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22 · ad4ee206
      unknown authored
      into  ramayana.hindu.god:/home/tsmith/m/bk/51-target22-X
      
      
      sql/ha_partition.cc:
        Auto merged
      ad4ee206
    • unknown's avatar
      Bug #30412 and Bug #30413 · 048775df
      unknown authored
      Update some tests in the "parts" suite, so they're skipped if the
      requisite plugins are not present in the mysqld.
      
      
      mysql-test/suite/parts/t/partition_char_innodb.test:
        Skip if mysqld doesn't include InnoDB support
      mysql-test/suite/parts/t/partition_datetime_innodb.test:
        Skip if mysqld doesn't include InnoDB support
      mysql-test/suite/parts/t/partition_decimal_innodb.test:
        Skip if mysqld doesn't include InnoDB support
      mysql-test/suite/parts/t/partition_float_innodb.test:
        Skip if mysqld doesn't include InnoDB support
      mysql-test/suite/parts/t/partition_int_innodb.test:
        Skip if mysqld doesn't include InnoDB support
      mysql-test/suite/parts/t/partition_special_innodb.test:
        Skip if mysqld doesn't include InnoDB support
      mysql-test/suite/parts/t/rpl_partition.test:
        Skip if mysqld doesn't include partition support
      048775df
    • unknown's avatar
      Fixes for the following bugs: · bfed329e
      unknown authored
      Bug #30316: Some "parts" tests fail because the server uses "--secure-file-priv"
      Bug #30341: Test suite "parts" needs to be adapted to the new rules disallowing many functio
      Bug #30408: Suite "parts" needs bug numbers updated
      Bug #30411: Suite "parts" needs bug numbers updated: ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
      Bug #30576: part_supported_sql_func_innodb.test tries to LOAD DATA outside of var dir
      Bug #30581: partition_value tests use disallowed CAST() function
      
      Included are some general fixes to allow the "parts" test suite to be run
      successfully.  This includes disabling a few tests or parts of tests,
      cleaning up the test cases and their results, etc.  Basically, these tests
      have not been run for some time, and had suffered some bit rot.
      
      The bugs were fixed as a single changeset, because in some ways they depend
      on each other.  I couldn't be sure I'd updated all the error codes (for
      bugs 30408 and 30411) without also adapting to the new allowed functions
      rules (bug 30341), and vice versa.
      
      
      mysql-test/include/partition_layout.inc:
        Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
      mysql-test/suite/parts/inc/part_blocked_sql_funcs_main.inc:
        Add ASCII(), ORD() and WEEKOFYEAR() as blocked functions (they depend
        too much on character set, etc.).
        
        Remove DATEDIFF() as a blocked function (it is implemented in terms
        of TO_DAYS() and the minus operator).
      mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc:
        Remove ASCII(), ORD() and WEEKOFYEAR(), which are not allowed functions.
        
        Remove uses of CAST() in partitioning functions - it is not allowed.
        
        Disable testing of FLOOR() and CEILING on non-integer fields, due to
        Bug 30577.
        
        Test MOD() with an integer field instead of floating point (it has a
        hybrid result type, like FLOOR() and CEILING(), but makes sense to use
        with an integer field).
        
        Add DATEDIFF() as an allowed function, because it is implemented in
        terms of TO_DAYS() and the minus operator.
      mysql-test/suite/parts/inc/partition_alter3.inc:
        Remove use of disallowed CAST() function in partitioning
      mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc:
        The blocked functions are actually blocked now, so expect errors.
        
        This is a result of the fix for bug 18198.
      mysql-test/suite/parts/inc/partition_date.inc:
        Remove uses of CAST() in partitioning functions - it is not allowed.
      mysql-test/suite/parts/inc/partition_datetime.inc:
        Remove uses of CAST() in partitioning functions - it is not allowed.
      mysql-test/suite/parts/inc/partition_decimal.inc:
        Remove uses of CAST() in partitioning functions - it is not allowed.
        
        Disable testing of FLOOR() and CEILING(), due to Bug 30577.
      mysql-test/suite/parts/inc/partition_directory.inc:
        Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
      mysql-test/suite/parts/inc/partition_double.inc:
        Remove uses of CAST() in partitioning functions - it is not allowed.
        
        Disable testing of FLOOR() and CEILING(), due to Bug 30577.
      mysql-test/suite/parts/inc/partition_enum.inc:
        Remove use of CAST(), which is disallowed.
        
        Remove test which relies on CAST().
      mysql-test/suite/parts/inc/partition_float.inc:
        Remove uses of CAST() in partitioning functions - it is not allowed.
        
        Disable testing of FLOOR() and CEILING(), due to Bug 30577.
      mysql-test/suite/parts/inc/partition_layout_check1.inc:
        Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
      mysql-test/suite/parts/inc/partition_layout_check2.inc:
        Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
      mysql-test/suite/parts/inc/partition_methods1.inc:
        Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
      mysql-test/suite/parts/inc/partition_set.inc:
        Remove test which relies on CAST(), which is disallowed.
      mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc:
        Fix Bug #30576: part_supported_sql_func_innodb.test tries to LOAD DATA outside of var dir
        
        Move data files into std_data/parts/*, so they can be used with LOAD
        DATA INFILE '../std_data_ln/parts/*' while --secure-file-priv is in
        force.
      mysql-test/suite/parts/inc/partition_syntax.inc:
        Remove use of CAST(), which is disallowed.
      mysql-test/suite/parts/inc/partition_time.inc:
        Remove use of CAST(), which is disallowed.
      mysql-test/suite/parts/inc/partition_timestamp.inc:
        Remove use of CAST(), which is disallowed.
      mysql-test/suite/parts/inc/partition_value.inc:
        Disable this entire test file, because it relies on using CAST() as
        a partitioning function, which is disallowed.  See Bug 30581,
        "partition_value tests use disallowed CAST() function".
      mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result:
        Update test case results
      mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result:
        Update test case results
      mysql-test/suite/parts/r/part_supported_sql_func_innodb.result:
        Update test case results
      mysql-test/suite/parts/r/part_supported_sql_func_myisam.result:
        Update test case results
      mysql-test/suite/parts/r/partition_alter3_innodb.result:
        Update test case results
      mysql-test/suite/parts/r/partition_alter3_myisam.result:
        Update test case results
      mysql-test/suite/parts/r/partition_basic_innodb.result:
        Update test case results
      mysql-test/suite/parts/r/partition_basic_myisam.result:
        Update test case results
      mysql-test/suite/parts/r/partition_datetime_innodb.result:
        Update test case results
      mysql-test/suite/parts/r/partition_datetime_myisam.result:
        Update test case results
      mysql-test/suite/parts/r/partition_decimal_innodb.result:
        Update test case results
      mysql-test/suite/parts/r/partition_decimal_myisam.result:
        Update test case results
      mysql-test/suite/parts/r/partition_float_myisam.result:
        Update test case results
      mysql-test/suite/parts/r/partition_syntax_innodb.result:
        Update test case results
      mysql-test/suite/parts/r/partition_syntax_myisam.result:
        Update test case results
      mysql-test/suite/parts/t/disabled.def:
        Mark several more tests as disabled: partition_value_myisam,
        partition_value_innodb, part_supported_sql_func_ndb,
        rpl_ndb_dd_partitions, and partition_float_innodb
      mysql-test/std_data/parts/part_supported_sql_funcs_int_ch1.inc:
        Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_ch1.inc
      mysql-test/std_data/parts/part_supported_sql_funcs_int_date.inc:
        Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_date.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_date.inc
      mysql-test/std_data/parts/part_supported_sql_funcs_int_float.inc:
        Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_float.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_float.inc
      mysql-test/std_data/parts/part_supported_sql_funcs_int_int.inc:
        Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_int.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_int.inc
      mysql-test/std_data/parts/part_supported_sql_funcs_int_time.inc:
        Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_time.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_time.inc
      mysql-test/suite/parts/inc/partition_alter_1.inc:
        Correct expected error codes, which changed due to bug 29245.
      mysql-test/suite/parts/inc/partition_check.inc:
        Correct expected error codes, which changed due to bug 29245.
      mysql-test/suite/parts/inc/partition_syntax_1.inc:
        Correct expected error codes, which changed due to bug 29245.
      bfed329e
    • unknown's avatar
      Merge quant.(none):/ext/mysql/bk/mysql-5.1-bug21842-5.1.22 · 76cf8367
      unknown authored
      into  quant.(none):/ext/mysql/bk/mysql-5.1-bug21842-5.1.22-merge
      
      
      76cf8367
    • unknown's avatar
      BUG#21842: There was an inconsistency in the use of table->record[0] and · cd7d837b
      unknown authored
      table->record[1] buffers inside Rows_log_event::find_row() function. 
      The patch fixes this.
      
      
      sql/log_event.cc:
        Use table->record[0] to read records from table and table->record[1] to
        store a copy of the original record for comparisons.
      cd7d837b
    • unknown's avatar
      Bug #30648: Partition handler may not initialize variable used w/ autoincrement · 41c849dd
      unknown authored
      A local variable may be used uninitialized in 
      ha_partition::get_auto_increment().  Initialize it properly.
      
      
      sql/ha_partition.cc:
        Initialize first_value_part in ha_partition::get_auto_increment() with *first_value before
        it's used in the underlying table handler.  Thanks to Antony for digging up this fix.
      41c849dd
    • unknown's avatar
      Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22 · 66262046
      unknown authored
      into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22
      
      
      sql/field.cc:
        Auto merged
      66262046
    • unknown's avatar
      Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue · 2bf5b1aa
      unknown authored
      
      sql/field.cc:
        - always pack in little endian, irrespective of starage engine native format
        - always unpack as if it is atored in little endian, and unpack it to storage engine native format
      2bf5b1aa
    • unknown's avatar
      Merge bk-internal:/home/bk/mysql-5.1-target-5.1.22 · 75fe12a1
      unknown authored
      into  magare.gmz:/home/kgeorge/mysql/work/mysql-5.1-target-5.1.22-joro
      
      
      75fe12a1
    • unknown's avatar
      portation fixes for bug 29536 and 29325 in · 2ed51552
      unknown authored
      re-pushing for 5.1.22.
      
      
      mysql-test/suite/rpl/t/rpl_timezone.test:
        typo fixed in re-pushing bug 29536
      sql/mysqld.cc:
        portation fixes ->5.1 for bug 29325
      2ed51552
    • unknown's avatar
      Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22 · 0e7c9704
      unknown authored
      into  trift2.:/MySQL/M51/target-5.1.22
      
      
      0e7c9704
    • unknown's avatar
      Merge trift2.:/MySQL/M51/netware3-5.1 · c749a21a
      unknown authored
      into  trift2.:/MySQL/M51/target-5.1.22
      
      
      configure.in:
        Auto merged
      c749a21a
    • unknown's avatar
      More cleanup / fixing for NetWare: · d7774462
      unknown authored
      1) "test_db.sql" is a plaintext file, no binary;
      2) do not try to strip the binaries, it will not work.
      
      
      configure.in:
        For NetWare, we cannot strip the binaries, so there is no use in attempting it.
      scripts/make_binary_distribution.sh:
        Get rid of a typing error, introduced when a following file name was deleted.
      d7774462
    • unknown's avatar
      Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22 · b1e78d13
      unknown authored
      into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22
      
      
      b1e78d13
    • unknown's avatar
      repair some rpl_ndb test cases · 3abd50cb
      unknown authored
      
      BitKeeper/deleted/.del-rpl_ndb_myisam2ndb-master.opt:
        Delete: mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt
      mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result:
        BitKeeper file /home/tomas/mysql-5.1-target-5.1.22/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result:
        BitKeeper file /home/tomas/mysql-5.1-target-5.1.22/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result
      3abd50cb
    • unknown's avatar
      re-push of Bug 29536 for 5.1.22: timestamp inconsistent in replication around 1970 · af9f7a23
      unknown authored
        
      MySQL replicates the time zone only when operations that involve
      it are performed. This is controlled by a flag. But this flag
      is set only on successful operation.
      The flag must be set also when there is an error that involves
      a timezone (so the master would replicate the error to the slaves).
      
      
      mysql-test/suite/rpl/r/rpl_timezone.result:
        repush of Bug 29536 for 5.1.22 tree: test case
      mysql-test/suite/rpl/t/rpl_timezone.test:
        repush of Bug 29536 for 5.1.22 tree: test case
      sql/field.cc:
        re-push of Bug 29536 for 5.1.22: move setting of the flag before the operation
        (so it apples to errors as well).
      sql/time.cc:
        re-push of Bug 29536 for 5.1.22: move setting of the flag before the operation
        (so it apples to errors as well).
      af9f7a23
    • unknown's avatar
      recommit of Bug 25228 for 5.1.22: rpl_relayspace.test fails on powermacg5, vm-win2003-32-a · 9b49c3cb
      unknown authored
        
        A test case was waiting for a fixed number of seconds for a specific 
        state of the slave IO thread to take place.
        Fixed by waiting in a loop for that specific thread state instead 
        (or timeout).
      
      
      mysql-test/suite/rpl/t/rpl_relayspace.test:
        recommit of Bug 25228 for 5.1.22: fixed test case
      9b49c3cb
    • unknown's avatar
      recommit of Addendum to bug #29325 to 5.1.22 tree · 77808ac9
      unknown authored
      keep_files_on_create made a startup option
      
      
      77808ac9
  3. 26 Aug, 2007 1 commit
    • unknown's avatar
      BUG#21842 (Cluster fails to replicate to innodb or myisam with err 134 · 642eda22
      unknown authored
      using TPC-B):
       
      Problem: A RBR event can contain incomplete row data (only key value and
      fields which have been changed). In that case, when the row is unpacked
      into record and written to a table, the missing fields get incorrect NULL
      values leading to master-slave inconsistency.
       
      Solution: Use values found in slave's table for columns which are not given
      in the rows event. The code for writing a single row uses the following 
      algorithm: 
      
      1. unpack row_data into table->record[0],
      2. try to insert record,
      3. if duplicate record found, fetch it into table->record[0],
      4. unpack row_data into table->record[0],
      5. write table->record[0] into the table.
      
      Where row_data is the row as stored in the data area of a rows event. 
      Thus:
      
      a) unpacking of row_data happens at the time when row is written into 
       a table,
      
      b) when unpacking (in step 4), only columns present in row_data are 
       overwritten - all other columns remain as they were found in the table.
       
      Since all data needed for the above algorithm is stored inside 
      Rows_log_event class, functions which locate and write rows are turned 
      into methods of that class.
      
      replace_record()     -> Rows_log_event::write_row()
      find_and_fetch_row() -> Rows_log_event::find_row()
      
      Both methods take row data from event's data buffer - the row being 
      processed is pointed by m_curr_row. They unpack the data as needed into 
      table's record buffers record[0] or record[1]. When row is unpacked, 
      m_curr_row_end is set to point at next row in the data buffer.
      
      Other changes introduced in this changeset:
      
      - Change signature of unpack_row(): don't report errors and don't
      setup table's rw_set here. Errors can happen only when setting default 
      values in prepare_record() function and are detected there.
       
      - In Rows_log_event and derived classes, don't pass arguments to
      the execution primitives (do_...() member functions) but use class
      members instead.
      
      - Move old row handling code into log_event_old.cc to be used by 
      *_rows_log_event_old classes.
      
      Also, a new test rpl_ndb_2other is added which tests basic replication 
      from master using ndb tables to slave storing the same tables using 
      (possibly) different engine (myisam,innodb).
        
      Test is based on existing tests rpl_ndb_2myisam and rpl_ndb_2innodb. 
      However, these tests doesn't work for various reasons and currently are 
      disabled (see BUG#19227).
        
      The new test differs from the ones it is based on as follows:
        
      1. Single test tests replication with different storage engines on slave 
      (myisam, innodb, ndb).
        
      2. Include file extra/rpl_tests/rpl_ndb_2multi_eng.test containing 
      original tests is replaced by extra/rpl_tests/rpl_ndb_2multi_basic.test 
      which doesn't contain tests using partitioned tables as these don't work 
      currently. Instead, it tests replication to a slave which has more or 
      less columns than master.
        
      3. Include file include/rpl_multi_engine3.inc is replaced with 
      include/rpl_multi_engine2.inc. The later differs by performing slightly 
      different operations (updating more than one row in the table) and 
      clearing table with "TRUNCATE TABLE" statement instead of "DELETE FROM" 
      as replication of "DELETE" doesn't work well in this setting.
        
      4. Slave must use option --log-slave-updates=0 as otherwise execution of 
      replication events generated by ndb fails if table uses a different 
      storage engine on slave (see BUG#29569).
      
      
      sql/log_event.cc:
        - Initialization of new Rows_log_event members.
        - Fixing some typos in documentation.
        
        In Rows_log_event::do_apply_event:
        - Set COMPLETE_ROWS_F flag (when master and slave have the same number of 
        columns and all colums are present in the row)
        - Move initialization of tables write/read sets here, outside the rows
        processing loop (and out of unpack_row() function).
        - Remove calls to do_prepare_row() - no longer needed.
        - Add code managing m_curr_row and m_curr_row_end pointers.
        
        - Change signatures of row processing methods of Rows_log_event and it
        descendants - now most arguments are taken from class members.
        - Remove do_prepare_row() methods which are no longer used.
        - The auto_afree_ptr template is moved to rpl_utility.h (so that it can
        be used in log_event_old.cc).
        - Removed copy_extra_fields() function - no longer used.
        
        In Rows_log_event::write_row (former replace_record):
        - The old code is moved to log_event_old.cc.
        - Use prepare_record() and non-destructive unpack_current_row() to fill record
        with data.
        - In case a record being inserted already exists on slave and row data is 
        incomplete use the record found and non-destructive unpack_current_row() to 
        combine new column values with existing ones.
        - More debug info added.
        
        In Rows_log_event::find_row (former find_and_fetch_row function):
        - The old code is moved to log_event_old.cc.
        - Unpacking of the row is moved here.
        - In case of search using PK, the key data is prepared here.
        - More debug info added.
        
        - Remove initialization of Rows_log_event::m_after_image buffer which is no
        longer used. 
        - Use new row unpacking methods in Update_rows_log_event::do_exec_row() to 
        create before and after image.
        
        Note: all existing code used by Rows_log_event::do_apply_event() has been moved
        to log_event_old.cc to be used by *_rows_log_event_old classes.
      sql/log_event.h:
        - Add new COMPLETE_ROWS_F flag in Rows_log_event.
        - Add Rows_log_event members describing the row being processed.
        - Add a pointer to key buffer which is used in derived classes.
        - Add new methods: find__row(), write_row() and unpack_current_row().
        - Change signatures of do_...() methods (replace method arguments by
        class members).
        - Remove do_prepare_row() method which is no longer used.
        - Update method documentation.
        - Add Old_rows_log_event class, which contains the old row processing code, as
        a friend of Rows_log_event so that it can access all members of an event 
        instance.
      sql/log_event_old.cc:
        Move here old implementation of Rows_log_event::do_apply_event() and 
        helper methods.
      sql/log_event_old.h:
        - Define new class Old_rows_log_event encapsulating old version of
        Rows_log_event::do_apply_event() and the helper methods.
        - Add the Old_rows_log_event class as a base for *_old versions of RBR event
        classes, ensure that the old version of do_apply_event() is called.
        - For *_old classes, declare the helper methods used in the old version of
        do_apply_event().
      sql/rpl_record.cc:
        - Make unpack_row non-destructive for columns not present in the row.
        - Don't fill read/write set here as it is done outside these functions.
        - Move initialization of a record with default values to a separate
        function prepare_record().
      sql/rpl_record.h:
        - Change signature of unpack_row().
        - Declare function prepare_record().
      sql/rpl_utility.cc:
        Make tabe_def::calc_field_size() a const method.
      sql/rpl_utility.h:
        Make table_def::calc_field_size() a const method.
        
        Move auto_afree_ptr template here so that it can be re-used (currently
        in log_event.cc and log_event_old.cc). Similar with DBUG_PRINT_BITSET 
        macro.
      mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test:
        Modification of rpl_ndb_2multi_eng test. Tests with partitioned tables 
        are removed and a setup with slave having different number of columns 
        than master is added.
      mysql-test/include/rpl_multi_engine2.inc:
        Modification of rpl_multi_engine3.inc which operates on more rows and
        replaces "DELETE FROM t1" with "TRUNCATE TABLE t1" as the first form
        doesn't replicate in NDB -> non-NDB setting (BUG#28538).
      mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result:
        Results of the test.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt:
        Test options. --log-slave-updates=0 is compulsory as otherwise non-NDB 
        slave applying row events from NDB master will fail when trying to log
        them.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test:
        Test replication of NDB table to slave using other engine. The main test
        is in extra/rpl_tests/rpl_ndb_2multi_basic.test. It is included here
        several times with different settings of default storage engine on slave.
      642eda22
  4. 25 Aug, 2007 2 commits
    • unknown's avatar
      Apply InnoDB snapshot innodb-5.1-ss1751. · a859c594
      unknown authored
      Bug #16979: AUTO_INC lock in InnoDB works a table level lock
        Add a table level counter that tracks the number of AUTOINC locks that are
        pending and/or granted on a table. We peek at this value to determine whether
        a transaction doing a simple INSERT in innodb_autoinc_lock_mode = 1, needs to
        acquire the AUTOINC lock or not. This change is related to Bug# 16979.
      Bug #27950: Duplicate entry error in auto-inc after mysqld restart
        We check whether the AUTOINC sub-system has been initialized (first) by
        holding the AUTOINC mutex and if initialization is required then we
        initialize using our normal procedure.
      
      
      storage/innobase/dict/dict0boot.c:
        Apply InnoDB snapshot innodb-5.1-ss1751.
      storage/innobase/dict/dict0crea.c:
        Apply InnoDB snapshot innodb-5.1-ss1751.
      storage/innobase/dict/dict0load.c:
        Apply InnoDB snapshot innodb-5.1-ss1751.
      storage/innobase/dict/dict0mem.c:
        Apply InnoDB snapshot innodb-5.1-ss1751.
        
        Revision r1749:
        Add a table level counter that tracks the number of AUTOINC locks that are
        pending and/or granted on a table. We peek at this value to determine whether
        a transaction doing a simple INSERT in innodb_autoinc_lock_mode = 1, needs to
        acquire the AUTOINC lock or not. This change is related to Bug# 16979.
      storage/innobase/handler/ha_innodb.cc:
        Apply InnoDB snapshot innodb-5.1-ss1751.
        
        Revision r1735:
        Add variable "innodb_autoinc_lock_mode"  to control the behavior of the
        AUTOINC locking. There are three modes, 0 for backward compatibility, 1 for the
        new style locking (default, safe for statement-based replication) and
        2 for no AUTOINC locking (unsafe for statement-based replication).
        
        
        Revision r1750:
        We check whether the AUTOINC sub-system has been initialized (first) by
        holding the AUTOINC mutex and if initialization is required then we
        initialize using our normal procedure. This change is related to Bug#27950.
        
        
        Revision r1746:
        Remove some code from ha_innodb.cc that was already enclosed in #if 0.
        The code was related to replication and group commit, and it was
        unreachable already as of MySQL 5.0.
        
        Approved by Heikki
        
        
        Revision r1749:
        Add a table level counter that tracks the number of AUTOINC locks that are
        pending and/or granted on a table. We peek at this value to determine whether
        a transaction doing a simple INSERT in innodb_autoinc_lock_mode = 1, needs to
        acquire the AUTOINC lock or not. This change is related to Bug# 16979.
      storage/innobase/include/dict0mem.h:
        Apply InnoDB snapshot innodb-5.1-ss1751.
        
        Revision r1749:
        Add a table level counter that tracks the number of AUTOINC locks that are
        pending and/or granted on a table. We peek at this value to determine whether
        a transaction doing a simple INSERT in innodb_autoinc_lock_mode = 1, needs to
        acquire the AUTOINC lock or not. This change is related to Bug# 16979.
        
        
        
        Revision r1747:
        Correct an outdated comment about dict_table_t:col_names that should have
        been adjusted in r1719, or r1264 in branches/zip.
      storage/innobase/include/mem0mem.ic:
        Apply InnoDB snapshot innodb-5.1-ss1751.
        
        Revision r1744:
        Merge r1739 from branches/zip:
        
        mem_heap_free_heap_top(): Declare the memory freed with UNIV_MEM_FREE().
        Before this change, the memory freed by mem_heap_empty() was not completely
        flagged free in UNIV_DEBUG_VALGRIND builds.  After this change, Valgrind
        will hopefully catch all errors caught by UNIV_MEM_DEBUG.
      storage/innobase/include/sync0rw.ic:
        Apply InnoDB snapshot innodb-5.1-ss1751.
        
        Revision r1751:
        rw_lock_s_lock_func(): Correct a typo in a comment.
      storage/innobase/include/trx0trx.h:
        Apply InnoDB snapshot innodb-5.1-ss1751.
        
        Revision r1742:
        Remove some unused fields of trx_t: mysql_master_log_file_name,
        mysql_master_log_pos, repl_wait_binlog_name, repl_wait_binlog_pos.
        
        Approved by Heikki.
      storage/innobase/lock/lock0lock.c:
        Apply InnoDB snapshot innodb-5.1-ss1751.
        
        Revision r1749:
        Add a table level counter that tracks the number of AUTOINC locks that are
        pending and/or granted on a table. We peek at this value to determine whether
        a transaction doing a simple INSERT in innodb_autoinc_lock_mode = 1, needs to
        acquire the AUTOINC lock or not. This change is related to Bug# 16979.
      storage/innobase/mtr/mtr0log.c:
        Apply InnoDB snapshot innodb-5.1-ss1751.
      storage/innobase/pars/pars0pars.c:
        Apply InnoDB snapshot innodb-5.1-ss1751.
      storage/innobase/srv/srv0srv.c:
        Apply InnoDB snapshot innodb-5.1-ss1751.
      storage/innobase/trx/trx0sys.c:
        Apply InnoDB snapshot innodb-5.1-ss1751.
        
        Revision r1743:
        trx_sys_print_mysql_binlog_offset_from_page(): Enclose the definition
        in #ifdef UNIV_HOTBACKUP, to match the function declaration.
      storage/innobase/trx/trx0trx.c:
        Apply InnoDB snapshot innodb-5.1-ss1751.
        
        Revision r1742:
        Remove some unused fields of trx_t: mysql_master_log_file_name,
        mysql_master_log_pos, repl_wait_binlog_name, repl_wait_binlog_pos.
        
        Approved by Heikki.
      a859c594
    • unknown's avatar
      Apply InnoDB snapshot innodb-5.1-ss1726. · 6d4b3c58
      unknown authored
      Bug #16979: AUTO_INC lock in InnoDB works a table level lock
        - this is a major change in InnoDB auto-inc handling.
      Bug #27950: Duplicate entry error in auto-inc after mysqld restart
        - Init AUTOINC from delete_row().
      Bug #28781: InnoDB increments auto-increment value incorrectly with ON DUPLICATE KEY UPDATE
        - Use value specified by MySQL, in update_row().
      
      
      mysql-test/r/innodb.result:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1655:
        Fix the innodb.test failure mentioned in r1654.
      storage/innobase/dict/dict0dict.c:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1645:
        Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
        is one test that fails as of this commit. The updated test case should be
        part of the snapshot from MySQL shortly.
        
        Fix for bug# 27950 - Init AUTOINC from delete_row().
        
        Fix for bug# 28781 - Use value specified by MySQL, in update_row().
        
        Summary of structural changes:
        ==============================
        InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
        the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
        for simple INSERT statements (including multi-value inserts), we try and avoid
        acquiring the special AUTOINC table level lock unless another transaction has
        already reserved the AUTOINC table level lock, in which case we fall back
        to the old behavior of acquiring the AUTOINC table level lock.
        
        The max AUTOINC value is now read directly using the low level interface
        of InnoDB.
        
        
        Revision r1719:
        Merge r1264 from branches/zip: Avoid memory fragmentation when
        adding column definitions to tables.
        
        dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
        allocation.  Allow it and "name" to be NULL.  These parameters are NULL
        when creating dummy indexes.
        
        dict_add_col_name(): Remove calls to ut_malloc() and ut_free().
        
        dict_table_get_col_name(): Allow table->col_names to be NULL.
        
        dict_table_add_system_columns(), dict_table_add_to_cache():
        Add the parameter "heap".
        ---
        Additional changes that had to be merged from branches/zip:
        
        dict_table_add_system_columns(): New function, factored out from
        dict_table_add_to_cache().
        
        mlog_parse_index(): Add some consistency checks, and make use of
        dict_table_add_system_columns().
      storage/innobase/dict/dict0mem.c:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1645:
        Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
        is one test that fails as of this commit. The updated test case should be
        part of the snapshot from MySQL shortly.
        
        Fix for bug# 27950 - Init AUTOINC from delete_row().
        
        Fix for bug# 28781 - Use value specified by MySQL, in update_row().
        
        Summary of structural changes:
        ==============================
        InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
        the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
        for simple INSERT statements (including multi-value inserts), we try and avoid
        acquiring the special AUTOINC table level lock unless another transaction has
        already reserved the AUTOINC table level lock, in which case we fall back
        to the old behavior of acquiring the AUTOINC table level lock.
        
        The max AUTOINC value is now read directly using the low level interface
        of InnoDB.
        
        
        Revision r1719:
        Merge r1264 from branches/zip: Avoid memory fragmentation when
        adding column definitions to tables.
        
        dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
        allocation.  Allow it and "name" to be NULL.  These parameters are NULL
        when creating dummy indexes.
        
        dict_add_col_name(): Remove calls to ut_malloc() and ut_free().
        
        dict_table_get_col_name(): Allow table->col_names to be NULL.
        
        dict_table_add_system_columns(), dict_table_add_to_cache():
        Add the parameter "heap".
        ---
        Additional changes that had to be merged from branches/zip:
        
        dict_table_add_system_columns(): New function, factored out from
        dict_table_add_to_cache().
        
        mlog_parse_index(): Add some consistency checks, and make use of
        dict_table_add_system_columns().
      storage/innobase/handler/ha_innodb.cc:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1645:
        Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
        is one test that fails as of this commit. The updated test case should be
        part of the snapshot from MySQL shortly.
        
        Fix for bug# 27950 - Init AUTOINC from delete_row().
        
        Fix for bug# 28781 - Use value specified by MySQL, in update_row().
        
        Summary of structural changes:
        ==============================
        InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
        the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
        for simple INSERT statements (including multi-value inserts), we try and avoid
        acquiring the special AUTOINC table level lock unless another transaction has
        already reserved the AUTOINC table level lock, in which case we fall back
        to the old behavior of acquiring the AUTOINC table level lock.
        
        The max AUTOINC value is now read directly using the low level interface
        of InnoDB.
        
        
        Revision r1718:
        Replace mysql_byte with uchar and remove the #define mysql_byte from
        ha_innodb.cc.  This cleanup was made possible as of r1550:
        
        
        Revision r1658:
        check_trx_exists(): Remove a redundant function call and assignment that
        was added by someone at MySQL.
        
        
        Revision r1656:
        
        
        Revision r1719:
        Merge r1264 from branches/zip: Avoid memory fragmentation when
        adding column definitions to tables.
        
        dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
        allocation.  Allow it and "name" to be NULL.  These parameters are NULL
        when creating dummy indexes.
        
        dict_add_col_name(): Remove calls to ut_malloc() and ut_free().
        
        dict_table_get_col_name(): Allow table->col_names to be NULL.
        
        dict_table_add_system_columns(), dict_table_add_to_cache():
        Add the parameter "heap".
        ---
        Additional changes that had to be merged from branches/zip:
        
        dict_table_add_system_columns(): New function, factored out from
        dict_table_add_to_cache().
        
        mlog_parse_index(): Add some consistency checks, and make use of
        dict_table_add_system_columns().
        
        
        Revision r1654:
        
        One test case in innodb.test fails because of auto-increment
        changes in r1562:1653:
        
        $diff innodb.result innodb.reject
        504c504
        < 3	test2		this will work
        ---
        > 4	test2		this will work
      storage/innobase/handler/ha_innodb.h:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1645:
        Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
        is one test that fails as of this commit. The updated test case should be
        part of the snapshot from MySQL shortly.
        
        Fix for bug# 27950 - Init AUTOINC from delete_row().
        
        Fix for bug# 28781 - Use value specified by MySQL, in update_row().
        
        Summary of structural changes:
        ==============================
        InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
        the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
        for simple INSERT statements (including multi-value inserts), we try and avoid
        acquiring the special AUTOINC table level lock unless another transaction has
        already reserved the AUTOINC table level lock, in which case we fall back
        to the old behavior of acquiring the AUTOINC table level lock.
        
        The max AUTOINC value is now read directly using the low level interface
        of InnoDB.
        
        
        Revision r1654:
        
        One test case in innodb.test fails because of auto-increment
        changes in r1562:1653:
        
        $diff innodb.result innodb.reject
        504c504
        < 3	test2		this will work
        ---
        > 4	test2		this will work
      storage/innobase/ibuf/ibuf0ibuf.c:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1715:
        ibuf0ibuf.c: Remove the unused prototype for dict_index_print_low()
        that was inadvertently added in r832.
        
        
        Revision r1719:
        Merge r1264 from branches/zip: Avoid memory fragmentation when
        adding column definitions to tables.
        
        dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
        allocation.  Allow it and "name" to be NULL.  These parameters are NULL
        when creating dummy indexes.
        
        dict_add_col_name(): Remove calls to ut_malloc() and ut_free().
        
        dict_table_get_col_name(): Allow table->col_names to be NULL.
        
        dict_table_add_system_columns(), dict_table_add_to_cache():
        Add the parameter "heap".
        ---
        Additional changes that had to be merged from branches/zip:
        
        dict_table_add_system_columns(): New function, factored out from
        dict_table_add_to_cache().
        
        mlog_parse_index(): Add some consistency checks, and make use of
        dict_table_add_system_columns().
      storage/innobase/include/dict0dict.h:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1645:
        Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
        is one test that fails as of this commit. The updated test case should be
        part of the snapshot from MySQL shortly.
        
        Fix for bug# 27950 - Init AUTOINC from delete_row().
        
        Fix for bug# 28781 - Use value specified by MySQL, in update_row().
        
        Summary of structural changes:
        ==============================
        InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
        the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
        for simple INSERT statements (including multi-value inserts), we try and avoid
        acquiring the special AUTOINC table level lock unless another transaction has
        already reserved the AUTOINC table level lock, in which case we fall back
        to the old behavior of acquiring the AUTOINC table level lock.
        
        The max AUTOINC value is now read directly using the low level interface
        of InnoDB.
        
        
        Revision r1719:
        Merge r1264 from branches/zip: Avoid memory fragmentation when
        adding column definitions to tables.
        
        dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
        allocation.  Allow it and "name" to be NULL.  These parameters are NULL
        when creating dummy indexes.
        
        dict_add_col_name(): Remove calls to ut_malloc() and ut_free().
        
        dict_table_get_col_name(): Allow table->col_names to be NULL.
        
        dict_table_add_system_columns(), dict_table_add_to_cache():
        Add the parameter "heap".
        ---
        Additional changes that had to be merged from branches/zip:
        
        dict_table_add_system_columns(): New function, factored out from
        dict_table_add_to_cache().
        
        mlog_parse_index(): Add some consistency checks, and make use of
        dict_table_add_system_columns().
      storage/innobase/include/dict0mem.h:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1645:
        Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
        is one test that fails as of this commit. The updated test case should be
        part of the snapshot from MySQL shortly.
        
        Fix for bug# 27950 - Init AUTOINC from delete_row().
        
        Fix for bug# 28781 - Use value specified by MySQL, in update_row().
        
        Summary of structural changes:
        ==============================
        InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
        the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
        for simple INSERT statements (including multi-value inserts), we try and avoid
        acquiring the special AUTOINC table level lock unless another transaction has
        already reserved the AUTOINC table level lock, in which case we fall back
        to the old behavior of acquiring the AUTOINC table level lock.
        
        The max AUTOINC value is now read directly using the low level interface
        of InnoDB.
        
        
        Revision r1719:
        Merge r1264 from branches/zip: Avoid memory fragmentation when
        adding column definitions to tables.
        
        dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
        allocation.  Allow it and "name" to be NULL.  These parameters are NULL
        when creating dummy indexes.
        
        dict_add_col_name(): Remove calls to ut_malloc() and ut_free().
        
        dict_table_get_col_name(): Allow table->col_names to be NULL.
        
        dict_table_add_system_columns(), dict_table_add_to_cache():
        Add the parameter "heap".
        ---
        Additional changes that had to be merged from branches/zip:
        
        dict_table_add_system_columns(): New function, factored out from
        dict_table_add_to_cache().
        
        mlog_parse_index(): Add some consistency checks, and make use of
        dict_table_add_system_columns().
      storage/innobase/include/lock0lock.h:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1664:
        lock_number_of_rows_locked(): Fix a typo in comment, and make the comments
        in lock0lock.c and lock0lock.h identical.  The typo was incorrectly fixed in
        r1623.
      storage/innobase/include/row0mysql.h:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1645:
        Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
        is one test that fails as of this commit. The updated test case should be
        part of the snapshot from MySQL shortly.
        
        Fix for bug# 27950 - Init AUTOINC from delete_row().
        
        Fix for bug# 28781 - Use value specified by MySQL, in update_row().
        
        Summary of structural changes:
        ==============================
        InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
        the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
        for simple INSERT statements (including multi-value inserts), we try and avoid
        acquiring the special AUTOINC table level lock unless another transaction has
        already reserved the AUTOINC table level lock, in which case we fall back
        to the old behavior of acquiring the AUTOINC table level lock.
        
        The max AUTOINC value is now read directly using the low level interface
        of InnoDB.
      storage/innobase/include/row0sel.h:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1645:
        Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
        is one test that fails as of this commit. The updated test case should be
        part of the snapshot from MySQL shortly.
        
        Fix for bug# 27950 - Init AUTOINC from delete_row().
        
        Fix for bug# 28781 - Use value specified by MySQL, in update_row().
        
        Summary of structural changes:
        ==============================
        InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
        the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
        for simple INSERT statements (including multi-value inserts), we try and avoid
        acquiring the special AUTOINC table level lock unless another transaction has
        already reserved the AUTOINC table level lock, in which case we fall back
        to the old behavior of acquiring the AUTOINC table level lock.
        
        The max AUTOINC value is now read directly using the low level interface
        of InnoDB.
      storage/innobase/include/trx0trx.h:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1645:
        Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
        is one test that fails as of this commit. The updated test case should be
        part of the snapshot from MySQL shortly.
        
        Fix for bug# 27950 - Init AUTOINC from delete_row().
        
        Fix for bug# 28781 - Use value specified by MySQL, in update_row().
        
        Summary of structural changes:
        ==============================
        InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
        the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
        for simple INSERT statements (including multi-value inserts), we try and avoid
        acquiring the special AUTOINC table level lock unless another transaction has
        already reserved the AUTOINC table level lock, in which case we fall back
        to the old behavior of acquiring the AUTOINC table level lock.
        
        The max AUTOINC value is now read directly using the low level interface
        of InnoDB.
      storage/innobase/include/ut0mem.h:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1713:
        Fix typo in comment.
      storage/innobase/log/log0recv.c:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1657:
        recv_init_crash_recovery(): remove trailing white space
      storage/innobase/row/row0mysql.c:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1645:
        Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
        is one test that fails as of this commit. The updated test case should be
        part of the snapshot from MySQL shortly.
        
        Fix for bug# 27950 - Init AUTOINC from delete_row().
        
        Fix for bug# 28781 - Use value specified by MySQL, in update_row().
        
        Summary of structural changes:
        ==============================
        InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
        the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
        for simple INSERT statements (including multi-value inserts), we try and avoid
        acquiring the special AUTOINC table level lock unless another transaction has
        already reserved the AUTOINC table level lock, in which case we fall back
        to the old behavior of acquiring the AUTOINC table level lock.
        
        The max AUTOINC value is now read directly using the low level interface
        of InnoDB.
      storage/innobase/row/row0sel.c:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1645:
        Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
        is one test that fails as of this commit. The updated test case should be
        part of the snapshot from MySQL shortly.
        
        Fix for bug# 27950 - Init AUTOINC from delete_row().
        
        Fix for bug# 28781 - Use value specified by MySQL, in update_row().
        
        Summary of structural changes:
        ==============================
        InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
        the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
        for simple INSERT statements (including multi-value inserts), we try and avoid
        acquiring the special AUTOINC table level lock unless another transaction has
        already reserved the AUTOINC table level lock, in which case we fall back
        to the old behavior of acquiring the AUTOINC table level lock.
        
        The max AUTOINC value is now read directly using the low level interface
        of InnoDB.
      storage/innobase/trx/trx0trx.c:
        Apply InnoDB snapshot innodb-5.1-ss1726.
        
        Revision r1645:
        Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
        is one test that fails as of this commit. The updated test case should be
        part of the snapshot from MySQL shortly.
        
        Fix for bug# 27950 - Init AUTOINC from delete_row().
        
        Fix for bug# 28781 - Use value specified by MySQL, in update_row().
        
        Summary of structural changes:
        ==============================
        InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
        the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
        for simple INSERT statements (including multi-value inserts), we try and avoid
        acquiring the special AUTOINC table level lock unless another transaction has
        already reserved the AUTOINC table level lock, in which case we fall back
        to the old behavior of acquiring the AUTOINC table level lock.
        
        The max AUTOINC value is now read directly using the low level interface
        of InnoDB.
      6d4b3c58
  5. 24 Aug, 2007 6 commits
  6. 23 Aug, 2007 5 commits
    • unknown's avatar
      Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22 · 7cd836b6
      unknown authored
      into  gleb.loc:/home/uchum/work/bk/target-5.1.22/mysql-5.1-target-5.1.22
      
      
      7cd836b6
    • unknown's avatar
      Fixed bug #30396. · d55f22fe
      unknown authored
      Recommit to 5.1.22.
      The bug caused memory corruption for some queries with top OR level
      in the WHERE condition if they contained equality predicates and 
      other sargable predicates in disjunctive parts of the condition.
      
      The corruption happened because the upper bound of the memory
      allocated for KEY_FIELD and SARGABLE_PARAM internal structures
      containing info about potential lookup keys was calculated incorrectly
      in some cases. In particular it was calculated incorrectly when the
      WHERE condition was an OR formula with disjuncts being AND formulas
      including equalities and other sargable predicates.
      
      
      mysql-test/r/select.result:
        Added a test case for bug #30396.
        Recommit to 5.1.22.
      mysql-test/t/select.test:
        Added a test case for bug #30396.
        Recommit to 5.1.22.
      sql/item_cmpfunc.h:
        Removed max_members from the COND_EQUAL class as not useful anymore. 
        Recommit to 5.1.22.
      sql/sql_base.cc:
        Added the max_equal_elems field to the st_select_lex structure.
        Recommit to 5.1.22.
      sql/sql_lex.cc:
        Added the max_equal_elems field to the st_select_lex structure.
        Recommit to 5.1.22.
      sql/sql_lex.h:
        Added the max_equal_elems field to the st_select_lex structure.
        The field contains the maximal number of elements in multiple equalities
        built for the query conditions.
        Recommit to 5.1.22.
      sql/sql_select.cc:
        Fixed bug #30396.
        Recommit to 5.1.22.
        The bug caused memory corruption for some queries with top OR level
        in the WHERE condition if they contained equality predicates and 
        other sargable predicates in disjunctive parts of the condition.
        
        The corruption happened because the upper bound of the memory
        allocated for KEY_FIELD and SARGABLE_PARAM internal structures
        containing info about potential lookup keys was calculated incorrectly
        in some cases. In particular it was calculated incorrectly when the
        WHERE condition was an OR formula with disjuncts being AND formulas
        including equalities and other sargable predicates.
         
        The max_equal_elems field to the st_select_lex structure is used now
        to calculate the above mentioned upper bound. The field contains the
        maximal number of elements in multiple equalities built for the query
        conditions.
      d55f22fe
    • unknown's avatar
      Fixed bug #30201. · 6d409e8f
      unknown authored
      Recommit to 5.1.22.
      Killing a SELECT query with KILL QUERY or KILL CONNECTION
      causes a server crash if the query cache is enabled.
      
      Normal evaluation of a query may be interrupted by the
      KILL QUERY/CONNECTION statement, in this case the mysql_execute_command
      function returns TRUE, and the thd->killed flag has true value.
      In this case the result of the query may
      be cached incompletely (omitting call to query_cache_insert inside
      the net_real_write function), and next call to query_cache_end_of_result
      may lead to server crash.
      Thus, the query_cache_end_of_result function has been modified to abort
      query cache in the case of killed thread.
      
      
      
      sql/sql_cache.cc:
        Fixed bug #30201.
        Recommit to 5.1.22.
        The  query_cache_end_of_result function has been modified to abort query
        cache in the case of query execution failure. Also this function has been
        modified to remove incomplete query block.
      6d409e8f
    • unknown's avatar
      Fixed bug #30287. · 380cc93c
      unknown authored
      Recommit to 5.1.22.
      The server created temporary tables for filesort in the working directory
      instead of the specified tmpdir directory.
      
      
      sql/item.cc:
        Fixed bug #30287.
        Recommit to 5.1.22.
        The Item_field::set_field method has been modified to reset the any_privileges
        flag to false in case of system temporary table. This modification prevents the
        server from unnecessary checking of user privileges to access system temporary
        tables.
      sql/sql_select.cc:
        Fixed bug #30287.
        Recommit to 5.1.22.
        Bugfix for #29015 has been removed: TABLE_SHARE::table_name of system
        temporary tables contains full path to table file basename again.
      sql/sql_view.cc:
        Fixed bug #30287.
        Recommit to 5.1.22.
        Commentary has been added.
      380cc93c
    • unknown's avatar
      Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22 · 42bd0a4a
      unknown authored
      into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22
      
      
      42bd0a4a