<< previous page   --   table of contents   --   next page >>
| | | | | | | |
  • Return to Table of Contents
  • Table of Contents

    1. General Information
    2. MySQL Installation
    3. Tutorial Introduction
    4. Database Administration
    5. MySQL Optimisation
    6. MySQL Language Reference
    7. MySQL Table Types
    8. MySQL APIs
    9. Extending MySQL

    522 MySQL Technical Reference for Version 4.0.3    DELETE FROM ... WHERE ... : sets an exclusive next-key lock on every record the search encounters.    If a  FOREIGN KEY  constraint is de ned on a table, any insert, update, or delete which requires checking of the constraint condition sets shared record level locks on the records it looks at to check the constraint.  Also in the case where the constraint fails, InnoDB sets these locks.    LOCK TABLES ...   :  sets table locks.  In the implementation the MySQL layer of code sets these locks.  The automatic deadlock detection of InnoDB cannot detect deadlocks where such table locks are involved:  see the following section.  Also, since MySQL does know about row level locks, it is possible that you get a table lock on a table where another user currently has row level locks.  But that does not put transaction integerity into danger.  See Section 7.5.14 [InnoDB restrictions], page 532. 7.5.8.5  Deadlock Detection and Rollback InnoDB  automatically  detects  a  deadlock  of  transactions  and  rolls  back  the  transaction whose lock request was the last one to build a deadlock,  that is,  a cycle in the waits-for graph  of  transactions.   InnoDB  cannot  detect  deadlocks  where  a  lock  set  by  a  MySQL LOCK TABLES  statement is involved, or if a lock set in another table handler than InnoDB is involved.  You have to resolve these situations using innodb_lock_wait_timeout set in `my.cnf'. When InnoDB performs a complete rollback of a transaction, all the locks of the transaction are released.  However, if just a single SQL statement is rolled back as a result of an error, some of the locks set by the SQL statement may be preserved.  This is because InnoDB stores row locks in a format where it cannot afterwards know which was set by which SQL statement. 7.5.8.6  An Example of How the Consistent Read Works in InnoDB When you issue a consistent read, that is, an ordinary SELECT statement, InnoDB will give your  transaction  a  timepoint  according  to  which  your  query  sees  the  database.   Thus,  if transaction B deletes a row and commits after your timepoint was assigned, then you will not see the row deleted.  Similarly with inserts and updates. You can advance your timepoint by committing your transaction and then doing another SELECT. This is called multi-versioned concurrency control. User A User B SET AUTOCOMMIT=0; SET AUTOCOMMIT=0; time | SELECT * FROM t; | empty set | INSERT INTO t VALUES (1, 2); |
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    MERCHANT ACCOUNTS
    DEDICATED SERVERS
    E-COMMERCE HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN
    REGISTRATION
    MANAGE
    YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    Corporate Info
    ABOUT US
    OUR NETWORK
    CONTACT US
    SITE MAP
    Copyright © 2002 Dyntex Group, Inc. All Rights Reserved
  • Return to Table of Contents
  • Back to top

  • Web Hosting: Manuals & FAQ's

    1. Unix-Based Web Hosting
    2. Unix Dedicated Servers
    3. Windows Dedicated Servers
    4. CuteFTP User’s Guide
    5. CuteHTML User’s Guide
    6. WS_FTP Pro User's Guide
    7. Miva Order User's Guide
    8. Miva Merchant User's Guide