Author: paul
Date: 2008-06-12 19:51:57 +0200 (Thu, 12 Jun 2008)
New Revision: 10945
Log:
r31986@frost: paul | 2008-06-12 12:52:21 -0500
LOCK TABLE revisions.
Modified:
trunk/it/refman-5.1/sql-syntax.xml
trunk/pt/refman-5.1/sql-syntax.xml
trunk/refman-4.1/sql-syntax.xml
trunk/refman-5.0/sql-syntax.xml
trunk/refman-5.1/sql-syntax.xml
trunk/refman-6.0/lock-tables-tmp.xml
trunk/refman-6.0/sql-syntax.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:35828
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:31981
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:31653
+ 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:35828
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:31986
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:31653
Modified: trunk/it/refman-5.1/sql-syntax.xml
===================================================================
--- trunk/it/refman-5.1/sql-syntax.xml 2008-06-12 16:53:20 UTC (rev 10944)
+++ trunk/it/refman-5.1/sql-syntax.xml 2008-06-12 17:51:57 UTC (rev 10945)
Changed blocks: 2, Lines Added: 9, Lines Deleted: 3; 1251 bytes
@@ -14945,6 +14945,14 @@
</para>
<para>
+ This discussion applies only to non-<literal>TEMPORARY</literal>
+ tables. It is allowable (but unnecessary) to lock a
+ <literal>TEMPORARY</literal> table because the table can be
+ accessed freely by the session within which it was created,
+ regardless of what other locking may be in effect.
+ </para>
+
+ <para>
The following general rules apply to acquisition and release of
locks by a given thread:
</para>
@@ -15058,9 +15066,7 @@
by the statement. Because <literal>LOCK TABLES</literal> will
not lock views, if the operation that you are performing uses
any views, you must also lock all base tables on which those
- views depend. (An exception is that you need not lock
- <literal>TEMPORARY</literal> tables, and you can access them
- even while holding locks for other tables.)
+ views depend.
</para>
<para>
Modified: trunk/pt/refman-5.1/sql-syntax.xml
===================================================================
--- trunk/pt/refman-5.1/sql-syntax.xml 2008-06-12 16:53:20 UTC (rev 10944)
+++ trunk/pt/refman-5.1/sql-syntax.xml 2008-06-12 17:51:57 UTC (rev 10945)
Changed blocks: 2, Lines Added: 9, Lines Deleted: 3; 1251 bytes
@@ -14945,6 +14945,14 @@
</para>
<para>
+ This discussion applies only to non-<literal>TEMPORARY</literal>
+ tables. It is allowable (but unnecessary) to lock a
+ <literal>TEMPORARY</literal> table because the table can be
+ accessed freely by the session within which it was created,
+ regardless of what other locking may be in effect.
+ </para>
+
+ <para>
The following general rules apply to acquisition and release of
locks by a given thread:
</para>
@@ -15058,9 +15066,7 @@
by the statement. Because <literal>LOCK TABLES</literal> will
not lock views, if the operation that you are performing uses
any views, you must also lock all base tables on which those
- views depend. (An exception is that you need not lock
- <literal>TEMPORARY</literal> tables, and you can access them
- even while holding locks for other tables.)
+ views depend.
</para>
<para>
Modified: trunk/refman-4.1/sql-syntax.xml
===================================================================
--- trunk/refman-4.1/sql-syntax.xml 2008-06-12 16:53:20 UTC (rev 10944)
+++ trunk/refman-4.1/sql-syntax.xml 2008-06-12 17:51:57 UTC (rev 10945)
Changed blocks: 2, Lines Added: 9, Lines Deleted: 3; 1256 bytes
@@ -11467,6 +11467,14 @@
</para>
<para>
+ This discussion applies only to non-<literal>TEMPORARY</literal>
+ tables. It is allowable (but unnecessary) to lock a
+ <literal>TEMPORARY</literal> table because the table can be
+ accessed freely by the session within which it was created,
+ regardless of what other locking may be in effect.
+ </para>
+
+ <para>
The following general rules apply to acquisition and release of
locks by a given thread:
</para>
@@ -11577,9 +11585,7 @@
tables that you are going to use in your statements. While the
locks obtained with a <literal>LOCK TABLES</literal> statement
are in effect, you cannot access any tables that were not locked
- by the statement. (An exception is that you need not lock
- <literal>TEMPORARY</literal> tables, and you can access them
- even while holding locks for other tables.)
+ by the statement.
</para>
<para>
Modified: trunk/refman-5.0/sql-syntax.xml
===================================================================
--- trunk/refman-5.0/sql-syntax.xml 2008-06-12 16:53:20 UTC (rev 10944)
+++ trunk/refman-5.0/sql-syntax.xml 2008-06-12 17:51:57 UTC (rev 10945)
Changed blocks: 2, Lines Added: 9, Lines Deleted: 3; 1242 bytes
@@ -12367,6 +12367,14 @@
</para>
<para>
+ This discussion applies only to non-<literal>TEMPORARY</literal>
+ tables. It is allowable (but unnecessary) to lock a
+ <literal>TEMPORARY</literal> table because the table can be
+ accessed freely by the session within which it was created,
+ regardless of what other locking may be in effect.
+ </para>
+
+ <para>
The following general rules apply to acquisition and release of
locks by a given thread:
</para>
@@ -12480,9 +12488,7 @@
by the statement. Because <literal>LOCK TABLES</literal> will
not lock views, if the operation that you are performing uses
any views, you must also lock all base tables on which those
- views depend. (An exception is that you need not lock
- <literal>TEMPORARY</literal> tables, and you can access them
- even while holding locks for other tables.)
+ views depend.
</para>
<para>
Modified: trunk/refman-5.1/sql-syntax.xml
===================================================================
--- trunk/refman-5.1/sql-syntax.xml 2008-06-12 16:53:20 UTC (rev 10944)
+++ trunk/refman-5.1/sql-syntax.xml 2008-06-12 17:51:57 UTC (rev 10945)
Changed blocks: 2, Lines Added: 9, Lines Deleted: 3; 1242 bytes
@@ -14945,6 +14945,14 @@
</para>
<para>
+ This discussion applies only to non-<literal>TEMPORARY</literal>
+ tables. It is allowable (but unnecessary) to lock a
+ <literal>TEMPORARY</literal> table because the table can be
+ accessed freely by the session within which it was created,
+ regardless of what other locking may be in effect.
+ </para>
+
+ <para>
The following general rules apply to acquisition and release of
locks by a given thread:
</para>
@@ -15058,9 +15066,7 @@
by the statement. Because <literal>LOCK TABLES</literal> will
not lock views, if the operation that you are performing uses
any views, you must also lock all base tables on which those
- views depend. (An exception is that you need not lock
- <literal>TEMPORARY</literal> tables, and you can access them
- even while holding locks for other tables.)
+ views depend.
</para>
<para>
Modified: trunk/refman-6.0/lock-tables-tmp.xml
===================================================================
--- trunk/refman-6.0/lock-tables-tmp.xml 2008-06-12 16:53:20 UTC (rev 10944)
+++ trunk/refman-6.0/lock-tables-tmp.xml 2008-06-12 17:51:57 UTC (rev 10945)
Changed blocks: 6, Lines Added: 30, Lines Deleted: 26; 5111 bytes
@@ -40,19 +40,16 @@
</programlisting>
<para>
- [TODO: Discuss name locks in optimizer chapter? It's not true that
- you cannot access any non-locked table while you hold locks: You can
- access TEMPORARY tables. LOCK TABLES appears to lock TEMPORARY
- tables, but there is no need: Only the thread that created the table
- can access it.
+ [TODO: Discuss name locks in optimizer chapter? Non-locking of views
+ now is lock-type specific.]
</para>
<remark role="help-description-begin"/>
<para>
- <literal>LOCK TABLES</literal> explicity acquires table locks for
- the current thread. This applies both to non-transactional and
- transactional locks. It locks base tables but not views. To use
+ <literal>LOCK TABLES</literal> explicitly acquires table locks for
+ the current client session. This applies both to non-transactional
+ and transactional locks. It locks base tables but not views. To use
<literal>LOCK TABLES</literal>, you must have the <literal>LOCK
TABLES</literal> privilege, and the <literal>SELECT</literal>
privilege for each table to be locked.
@@ -60,7 +57,7 @@
<para>
<literal>UNLOCK TABLES</literal> explicitly releases
- non-transactional table locks held by the current thread.
+ non-transactional table locks held by the current session.
Transactional table locks are released when the current transaction
ends.
</para>
@@ -83,34 +80,35 @@
<listitem>
<para>
- <literal>READ [LOCAL]</literal>: Locks a table for reading.
- Multiple clients can acquire a <literal>READ</literal> lock for
- a table simultaneously. The <literal>LOCAL</literal> modifier
- enables concurrent inserts by other threads to proceed while the
- lock is held.
+ <literal>READ [LOCAL]</literal>: Locks a table for reading by
+ the current session. Multiple sessions can acquire a
+ <literal>READ</literal> lock for a table simultaneously. The
+ <literal>LOCAL</literal> modifier enables concurrent inserts by
+ other sessions to proceed while the lock is held.
</para>
</listitem>
<listitem>
<para>
<literal>[LOW_PRIORITY] WRITE</literal>: Locks a table for
- writing. The holder of the lock can also read the table. Only
- one client at a time can acquire a <literal>WRITE</literal> lock
- for a table. The <literal>LOW_PRIORITY</literal> modifier
- affects lock scheduling if the <literal>WRITE</literal> lock
- request must wait.
+ writing by the current session. The holder of the lock can also
+ read the table. Only one session at a time can acquire a
+ <literal>WRITE</literal> lock for a table. The
+ <literal>LOW_PRIORITY</literal> modifier affects lock scheduling
+ if the <literal>WRITE</literal> lock request must wait.
</para>
</listitem>
</itemizedlist>
<para>
- A thread cannot use non-transactional locks and transactions at the
+ A session cannot use non-transactional locks and transactions at the
same time. Acquisition of a non-transactional lock implicitly
- commits any active transaction, and beginning a transaction
- implicitly releases any non-transactional lock. (Additional
- information about the interaction between table locking and
- transactions is given later in this section.)
+ commits any active transaction for the current session, and
+ beginning a transaction implicitly releases any non-transactional
+ locks held by the session. (Additional information about the
+ interaction between table locking and transactions is given later in
+ this section.)
</para>
<para>
@@ -140,6 +138,12 @@
</itemizedlist>
<para>
+ Transactional locks can be acquired for base tables or views.
+ Wherever the following discussion says <quote>table</quote> in
+ relation to transactional locks, read it as also applying to views.
+ </para>
+
+ <para>
For transactional locks, the <literal>NOWAIT</literal> modifier can
be given. The intent of this modifier is that the lock request will
fail with an error if the lock cannot be acquired immediately.
@@ -147,7 +151,7 @@
</para>
<para>
- [VERIFY] Transactional locks can be acquired only while autocommit
+ Transactional locks can be acquired only while autocommit
is disabled. If autocommit is enabled, requests are converted to
READ/WRITE requests, or an error occurs if strict SQL mode is
enabled (strict mode prevents request conversion). [If conversion
@@ -170,7 +174,7 @@
<listitem>
<para>
- By default, if the <literal>LOCK TABLES</literal> statement must
+ If the <literal>LOCK TABLES</literal> statement must
wait due to locks held by other threads on any of the tables, it
blocks until all locks can be acquired.
Modified: trunk/refman-6.0/sql-syntax.xml
===================================================================
--- trunk/refman-6.0/sql-syntax.xml 2008-06-12 16:53:20 UTC (rev 10944)
+++ trunk/refman-6.0/sql-syntax.xml 2008-06-12 17:51:57 UTC (rev 10945)
Changed blocks: 2, Lines Added: 9, Lines Deleted: 3; 1242 bytes
@@ -15416,6 +15416,14 @@
</para>
<para>
+ This discussion applies only to non-<literal>TEMPORARY</literal>
+ tables. It is allowable (but unnecessary) to lock a
+ <literal>TEMPORARY</literal> table because the table can be
+ accessed freely by the session within which it was created,
+ regardless of what other locking may be in effect.
+ </para>
+
+ <para>
The following general rules apply to acquisition and release of
locks by a given thread:
</para>
@@ -15540,9 +15548,7 @@
by the statement. Because <literal>LOCK TABLES</literal> will
not lock views, if the operation that you are performing uses
any views, you must also lock all base tables on which those
- views depend. (An exception is that you need not lock
- <literal>TEMPORARY</literal> tables, and you can access them
- even while holding locks for other tables.)
+ views depend.
</para>
<para>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r10945 - in trunk: . it/refman-5.1 pt/refman-5.1 refman-4.1 refman-5.0 refman-5.1 refman-6.0 | paul | 12 Jun |