An error occurred fetching the project authors.
  1. 04 Mar, 2010 1 commit
    • Mattias Jonsson's avatar
      Bug#50392: insert_id is not reset for partitioned tables · 1f77c7b4
      Mattias Jonsson authored
      auto_increment on duplicate entry
      
      The bug was that when INSERT_ID was used and the storage
      engine was told to release any reserved but not used
      auto_increment values, it set the highest auto_increment
      value to INSERT_ID.
      
      The fix was to check if the auto_increment value was forced
      by user (INSERT_ID) or by slave-thread, i.e. not auto-
      generated. So that it is only allowed to release generated
      values.
      
      mysql-test/r/partition_error.result:
        Bug#50392: insert_id is not reset for partitioned tables
        auto_increment on duplicate entry
        
        updated result
      mysql-test/suite/parts/inc/partition_auto_increment.inc:
        Bug#50392: insert_id is not reset for partitioned tables
        auto_increment on duplicate entry
        
        Added test
      mysql-test/suite/parts/r/partition_auto_increment_archive.result:
        Bug#50392: insert_id is not reset for partitioned tables
        auto_increment on duplicate entry
        
        Added result, note that archive does only allow increasing
        auto_increment values
      mysql-test/suite/parts/r/partition_auto_increment_blackhole.result:
        Bug#50392: insert_id is not reset for partitioned tables
        auto_increment on duplicate entry
        
        Added result, note that blackhole accepts all inserts :)
      mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
        Bug#50392: insert_id is not reset for partitioned tables
        auto_increment on duplicate entry
        
        Added result, note that innodb rolls back inserts on error,
        but keeps the auto_increment value.
      mysql-test/suite/parts/r/partition_auto_increment_memory.result:
        Bug#50392: insert_id is not reset for partitioned tables
        auto_increment on duplicate entry
        
        Added result, note that memory and myisam inserts all rows
        before the error.
      mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
        Bug#50392: insert_id is not reset for partitioned tables
        auto_increment on duplicate entry
        
        Added result, note that memory and myisam inserts all rows
        before the error.
      mysql-test/suite/parts/r/partition_auto_increment_ndb.result:
        Bug#50392: insert_id is not reset for partitioned tables
        auto_increment on duplicate entry
        
        Added result, note that NDB does not seem to handle
        INSERT_ID as other engines. (Martin will look into it).
      mysql-test/t/partition_error.test:
        Bug#50392: insert_id is not reset for partitioned tables
        auto_increment on duplicate entry
        
        Added test
      sql/ha_partition.cc:
        Bug#50392: insert_id is not reset for partitioned tables
        auto_increment on duplicate entry
        
        If the next_insert_id comes from non generated (i.e
        forced by INSERT_ID or slave-thread) then we cannot
        lower the reserved auto_increment value, since it have
        not reserved any values.
      1f77c7b4
  2. 04 Sep, 2009 1 commit
    • V Narayanan's avatar
      Bug#45823 Assertion failure in file row/row0mysql.c line 1386 · 9776b6f9
      V Narayanan authored
      Inserting a negative value in the autoincrement column of a
      partitioned innodb table was causing the value of the auto
      increment counter to wrap around into a very large positive
      value. The consequences are the same as if a very large positive
      value was inserted into a column, e.g. reduced autoincrement
      range, failure to read autoincrement counter.
      
      The current patch ensures that before calculating the next
      auto increment value, the current value is within the positive
      maximum allowed limit.
      
      mysql-test/suite/parts/inc/partition_auto_increment.inc:
        Bug#45823 Assertion failure in file row/row0mysql.c line 1386
        
        Adds tests for performing insert,update and delete on a partition
        table with negative auto_increment values.
      mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
        Bug#45823 Assertion failure in file row/row0mysql.c line 1386
        
        Result file for the innodb engine.
      mysql-test/suite/parts/r/partition_auto_increment_memory.result:
        Bug#45823 Assertion failure in file row/row0mysql.c line 1386
        
        Result file for the memory engine.
      mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
        Bug#45823 Assertion failure in file row/row0mysql.c line 1386
        
        Result file for the myisam engine.
      mysql-test/suite/parts/r/partition_auto_increment_ndb.result:
        Bug#45823 Assertion failure in file row/row0mysql.c line 1386
        
        Result file for the ndb engine.
      mysql-test/suite/parts/t/partition_auto_increment_archive.test:
        Bug#45823 Assertion failure in file row/row0mysql.c line 1386
        
        Adds a variable that allows the Archive engine to skip tests
        that involve insertion of negative auto increment values.
      mysql-test/suite/parts/t/partition_auto_increment_blackhole.test:
        Bug#45823 Assertion failure in file row/row0mysql.c line 1386
        
        Adds a variable that allows the Blackhole engine to skip tests
        that involve insertion of negative auto increment values.
      sql/ha_partition.cc:
        Bug#45823 Assertion failure in file row/row0mysql.c line 1386
        
        Ensures that the current value is lesser than the upper limit
        for the type of the field before setting the next auto increment
        value to be calculated.
      sql/ha_partition.h:
        Bug#45823 Assertion failure in file row/row0mysql.c line 1386
        
        Modifies the set_auto_increment_if_higher function, to take
        into account negative auto increment values when doing a
        comparison.
      9776b6f9
  3. 18 Feb, 2009 1 commit
  4. 05 Feb, 2009 1 commit
  5. 23 Oct, 2008 1 commit
    • Mattias Jonsson's avatar
      Bug#40176: update as first partitioning statement · 620d955e
      Mattias Jonsson authored
      breaks auto increment
      
      The auto_increment value was not initialized if
      the first statement after opening a table was
      an 'UPDATE'.
      
      solution was to check initialize if it was not,
      before trying to increase it in update.
      
      mysql-test/suite/parts/inc/partition_auto_increment.inc:
        Bug#40176: update as first partitioning statement
        breaks auto increment
        
        Added tests for verifying the bug and show some more
        auto_increment flaws
      mysql-test/suite/parts/r/partition_auto_increment_archive.result:
        Bug#40176: update as first partitioning statement
        breaks auto increment
        
        Updated test results, due to added tests
      mysql-test/suite/parts/r/partition_auto_increment_blackhole.result:
        Bug#40176: update as first partitioning statement
        breaks auto increment
        
        Updated test results, due to added tests
      mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
        Bug#40176: update as first partitioning statement
        breaks auto increment
        
        Updated test results, due to added tests
      mysql-test/suite/parts/r/partition_auto_increment_memory.result:
        Bug#40176: update as first partitioning statement
        breaks auto increment
        
        Updated test results, due to added tests
      mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
        Bug#40176: update as first partitioning statement
        breaks auto increment
        
        Updated test results, due to added tests
      mysql-test/suite/parts/r/partition_auto_increment_ndb.result:
        Bug#40176: update as first partitioning statement
        breaks auto increment
        
        Updated test results, due to added tests
      sql/ha_partition.cc:
        Bug#40176: update as first partitioning statement
        breaks auto increment
        
        make sure that the auto_increment value is initialized
        before updating it.
        
        (missed initializing in mysql_update_row).
      sql/ha_partition.h:
        Bug#40176: update as first partitioning statement
        breaks auto increment
        
        Assert that it is initialized, before updating
        the auto_increment value
      620d955e
  6. 08 Sep, 2008 1 commit
    • Mattias Jonsson's avatar
      Bug#38804: Query deadlock causes all tables to be inaccessible. · be63f0af
      Mattias Jonsson authored
      Problem was a mutex added in bug n 27405 for solving a problem
      with auto_increment in partitioned innodb tables.
      (in ha_partition::write_row over partitions file->ha_write_row)
      
      Solution is to use the patch for bug#33479, which refines the
      usage of mutexes for auto_increment.
      
      Backport of bug-33479 from 6.0:
      
      Bug-33479: auto_increment failures in partitioning
      
      Several problems with auto_increment in partitioning
      (with MyISAM, InnoDB. Locking issues, not handling
      multi-row INSERTs properly etc.)
      
      Changed the auto_increment handling for partitioning:
      Added a ha_data variable in table_share for storage engine specific data
      such as auto_increment value handling in partitioning, also see WL 4305
      and using the ha_data->mutex to lock around read + update.
      
      The idea is this:
      Store the table's reserved auto_increment value in
      the TABLE_SHARE and use a mutex to, lock it for reading and updating it
      and unlocking it, in one block. Only accessing all partitions
      when it is not initialized.
      Also allow reservations of ranges, and if no one has done a reservation
      afterwards, lower the reservation to what was actually used after
      the statement is done (via release_auto_increment from WL 3146).
      The lock is kept from the first reservation if it is statement based
      replication and a multi-row INSERT statement where the number of
      candidate rows to insert is not known in advance (like INSERT SELECT,
      LOAD DATA, unlike INSERT VALUES (row1), (row2),,(rowN)).
      
      This should also lead to better concurrancy (no need to have a mutex
      protection around write_row in all cases)
      and work with any local storage engine.
      
      mysql-test/suite/parts/inc/partition_auto_increment.inc:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        Test source file for testing auto_increment
      mysql-test/suite/parts/r/partition_auto_increment_archive.result:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        result file for testing auto_increment
      mysql-test/suite/parts/r/partition_auto_increment_blackhole.result:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        result file for testing auto_increment
      mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        result file for testing auto_increment
      mysql-test/suite/parts/r/partition_auto_increment_memory.result:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        result file for testing auto_increment
      mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        result file for testing auto_increment
      mysql-test/suite/parts/r/partition_auto_increment_ndb.result:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        result file for testing auto_increment
      mysql-test/suite/parts/t/partition_auto_increment_archive.test:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        test file for testing auto_increment
      mysql-test/suite/parts/t/partition_auto_increment_blackhole.test:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        test file for testing auto_increment
      mysql-test/suite/parts/t/partition_auto_increment_innodb.test:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        test file for testing auto_increment
      mysql-test/suite/parts/t/partition_auto_increment_memory.test:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        test file for testing auto_increment
      mysql-test/suite/parts/t/partition_auto_increment_myisam.test:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        test file for testing auto_increment
      mysql-test/suite/parts/t/partition_auto_increment_ndb.test:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        test file for testing auto_increment
      sql/ha_partition.cc:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: Failures using auto_increment and partitioning
        
        Changed ha_partition::get_auto_increment from file->get_auto_increment
        to file->info(HA_AUTO_STATUS), since it is works better with InnoDB
        (InnoDB can have issues with partitioning and auto_increment,
        where get_auto_increment sometimes can return a non updated value.)
        
        Using the new table_share->ha_data for keeping the auto_increment
        value, shared by all instances of the same table.
        It is read+updated when holding a auto_increment specific mutex.
        Also added release_auto_increment to decrease gaps if possible.
        And a lock for multi-row INSERT statements where the number of candidate
        rows to insert is not known in advance (like INSERT SELECT, LOAD DATA;
        Unlike INSERT INTO (row1),(row2),,(rowN)).
        Fixed a small bug, copied++ to (*copied)++ and the same for deleted.
        Changed from current_thd, to ha_thd()
      sql/ha_partition.h:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: Failures using auto_increment and partitioning
        
        Added a new struct HA_DATA_PARTITION to be used in table_share->ha_data
        Added a private function to set auto_increment values if needed
        Removed the restore_auto_increment (the hander version is better)
        Added lock/unlock functions for auto_increment handling.
        Changed copied/deleted to const.
      sql/handler.h:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: auto_increment failures in partitioning
        
        Added const for changed_partitions
        Added comments about SQLCOM_TRUNCATE for delete_all_rows
      sql/table.h:
        Bug#38804: Query deadlock causes all tables to be inaccessible.
        Backporting from 6.0 of:
        Bug-33479: Failures using auto_increment and partitioning
        
        Added a variable in table_share: ha_data for storage of storage engine
        specific data (such as auto_increment handling in partitioning).
      be63f0af