Author: paul
Date: 2008-09-05 23:09:04 +0200 (Fri, 05 Sep 2008)
New Revision: 11685
Log:
r33662@frost: paul | 2008-09-05 15:22:20 -0500
Modified:
trunk/refman-5.0/functions-core.xml
trunk/refman-5.1/functions-core.xml
trunk/refman-5.1/sql-syntax-data-manipulation.xml
trunk/refman-6.0/sql-syntax-data-manipulation.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:33661
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:32972
+ 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:35828
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:33662
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:32972
Modified: trunk/refman-5.0/functions-core.xml
===================================================================
--- trunk/refman-5.0/functions-core.xml 2008-09-05 21:08:57 UTC (rev 11684)
+++ trunk/refman-5.0/functions-core.xml 2008-09-05 21:09:04 UTC (rev 11685)
Changed blocks: 1, Lines Added: 9, Lines Deleted: 0; 949 bytes
@@ -15077,6 +15077,15 @@
</programlisting>
<para>
+ if a table contains an <literal>AUTO_INCREMENT</literal>
+ column and <literal>INSERT ... ON DUPLICATE KEY
+ UPDATE</literal> updates (rather than inserts) a row, the
+ value of <function role="sql">LAST_INSERT_ID()</function> is
+ not meaningful. For a workaround, see
+ <xref linkend="insert-on-duplicate"/>.
+ </para>
+
+ <para>
The currently executing statement does not affect the value
of <function role="sql">LAST_INSERT_ID()</function>. Suppose
that you generate an <literal>AUTO_INCREMENT</literal> value
Modified: trunk/refman-5.1/functions-core.xml
===================================================================
--- trunk/refman-5.1/functions-core.xml 2008-09-05 21:08:57 UTC (rev 11684)
+++ trunk/refman-5.1/functions-core.xml 2008-09-05 21:09:04 UTC (rev 11685)
Changed blocks: 1, Lines Added: 9, Lines Deleted: 0; 971 bytes
@@ -16351,6 +16351,15 @@
</para>
<para>
+ if a table contains an <literal>AUTO_INCREMENT</literal>
+ column and <literal>INSERT ... ON DUPLICATE KEY
+ UPDATE</literal> updates (rather than inserts) a row, the
+ value of <function role="sql">LAST_INSERT_ID()</function> is
+ not meaningful prior to MySQL 5.1.12. For a workaround, see
+ <xref linkend="insert-on-duplicate"/>.
+ </para>
+
+ <para>
The currently executing statement does not affect the value
of <function role="sql">LAST_INSERT_ID()</function>. Suppose
that you generate an <literal>AUTO_INCREMENT</literal> value
Modified: trunk/refman-5.1/sql-syntax-data-manipulation.xml
===================================================================
--- trunk/refman-5.1/sql-syntax-data-manipulation.xml 2008-09-05 21:08:57 UTC (rev 11684)
+++ trunk/refman-5.1/sql-syntax-data-manipulation.xml 2008-09-05 21:09:04 UTC (rev 11685)
Changed blocks: 1, Lines Added: 2, Lines Deleted: 1; 851 bytes
@@ -1771,7 +1771,8 @@
returns the <literal>AUTO_INCREMENT</literal> value. If the
statement updates a row instead,
<function role="sql">LAST_INSERT_ID()</function> is not
- meaningful. However, you can work around this by using
+ meaningful prior to MySQL 5.1.12. However, you can work around
+ this by using
<function role="sql">LAST_INSERT_ID(<replaceable>expr</replaceable>)</function>.
Suppose that <literal>id</literal> is the
<literal>AUTO_INCREMENT</literal> column. To make
Modified: trunk/refman-6.0/sql-syntax-data-manipulation.xml
===================================================================
--- trunk/refman-6.0/sql-syntax-data-manipulation.xml 2008-09-05 21:08:57 UTC (rev 11684)
+++ trunk/refman-6.0/sql-syntax-data-manipulation.xml 2008-09-05 21:09:04 UTC (rev 11685)
Changed blocks: 1, Lines Added: 2, Lines Deleted: 16; 1497 bytes
@@ -1764,24 +1764,10 @@
<para>
If a table contains an <literal>AUTO_INCREMENT</literal> column
and <literal>INSERT ... ON DUPLICATE KEY UPDATE</literal>
- inserts a row, the
+ inserts or updates a row, the
<function role="sql">LAST_INSERT_ID()</function> function
- returns the <literal>AUTO_INCREMENT</literal> value. If the
- statement updates a row instead,
- <function role="sql">LAST_INSERT_ID()</function> is not
- meaningful. However, you can work around this by using
- <function role="sql">LAST_INSERT_ID(<replaceable>expr</replaceable>)</function>.
- Suppose that <literal>id</literal> is the
- <literal>AUTO_INCREMENT</literal> column. To make
- <function role="sql">LAST_INSERT_ID()</function> meaningful for
- updates, insert rows as follows:
- </para>
+ returns the <literal>AUTO_INCREMENT</literal> value.
-<programlisting>
-INSERT INTO table (a,b,c) VALUES (1,2,3)
- ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id), c=3;
-</programlisting>
-
<para>
The <literal>DELAYED</literal> option is ignored when you use
<literal>ON DUPLICATE KEY UPDATE</literal>.
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r11685 - in trunk: . refman-5.0 refman-5.1 refman-6.0 | paul.dubois | 5 Sep |