• unknown's avatar
    Fixed a bug in UPDATE statement with no index column in where condition · 04ff81ae
    unknown authored
    locks all rows (BUG #3300). When using innobase_locks_unsafe_for_binlog
    option InnoDB does not take locks for those rows which do not
    belong to the result set or werent changed by the query. This fix removes
    unnecessary locks also from SELECT and DELETE queries.
    
    
    innobase/include/row0mysql.h:
      Added prototype for row_unlock_for_mysql() function which does an unlock of 
      a row for MySQL.
    innobase/include/trx0trx.h:
      Added a field trx_create_lock to a transaction structure. This field is
      TRUE if we have created a new lock for a record accessed.
    innobase/lock/lock0lock.c:
      Set lock create flag if lock is created and reset this flag before 
      transaction requests a lock.
    innobase/row/row0mysql.c:
      Add support for unlocking a row in InnoDB. If we are using 
      innobase_locks_unsafe_for_binlog option then all those record 
      locks obtained by SQL-query which do not belong to result set 
      or were not modified are unlocked i.e. we remove the lock from 
      those records.
    sql/ha_innodb.cc:
      Added support for a unlock_row interface in InnoDB.
    sql/ha_innodb.h:
      Added prototype for a function unlock_row().
    04ff81ae
row0mysql.c 88.3 KB