Author: paul
Date: 2006-05-03 06:29:35 +0200 (Wed, 03 May 2006)
New Revision: 2003
Log:
r10055@frost: paul | 2006-05-02 23:28:34 -0500
Fix bad merge.
Modified:
trunk/
trunk/refman-5.0/replication.xml
trunk/refman-5.1/replication.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:7186
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:10040
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:4886
c493bd56-8c02-0410-a43f-aded7e9288fb:/trunk:5
+ 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:7186
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:10055
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:4886
Modified: trunk/refman-5.0/replication.xml
===================================================================
--- trunk/refman-5.0/replication.xml 2006-05-03 04:17:38 UTC (rev 2002)
+++ trunk/refman-5.0/replication.xml 2006-05-03 04:29:35 UTC (rev 2003)
@@ -5082,144 +5082,56 @@
<itemizedlist>
- <section id="replication-auto-increment">
-
- <title>&title-replication-auto-increment;</title>
-
+ <listitem>
+ <para>
+ <literal>auto_increment_increment</literal> controls the
+ increment between successive <literal>AUTO_INCREMENT</literal>
+ values.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>auto_increment_offset</literal> determines the
+ starting point for <literal>AUTO_INCREMENT</literal> column
+ values.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
<para>
- When multiple servers are configured as replication masters,
- special steps must be taken to prevent key collisions when using
- auto_inrement, otherwise multiple masters may attempt to use the
- same auto_increment value when inserting rows.
+ By choosing non-conflicting values for these variables on
+ different masters, servers in a multiple-master configuration will
+ not use conflicting <literal>AUTO_INCREMENT</literal> values when
+ inserting new rows into the same table. To set up
+ <replaceable>N</replaceable> master servers, set the variables
+ like this:
</para>
-
- <para>
- To accommodate multi-master replication with auto_increment, two
- new server variables were introduced with MySQL 5.0.2:
- <literal>auto_increment_increment</literal> and
- <literal>auto_increment_offset</literal>. These variables have a
- default (and mimimum) value of 1 and a maximum value of 65,535.
- </para>
-
- <para>
- By setting non-conflicting values for these variables, servers in
- a multi-master configuration will not use conflicting
- auto_increment values when inserting new rows into the same table.
- </para>
-
- <para>
- These two variables effect <literal>AUTO_INCREMENT</literal>
- column behavior as follows:
- </para>
<itemizedlist>
<listitem>
<para>
- <literal>auto_increment_increment</literal> controls the
- interval by which the column value is incremented. For
- example:
+ Set <literal>auto_increment_increment</literal> to
+ <replaceable>N</replaceable> on each master.
</para>
-
- <programlisting>
- mysql> SHOW VARIABLES LIKE 'auto_inc%';
- +--------------------------+-------+
- | Variable_name | Value |
- +--------------------------+-------+
- | auto_increment_increment | 1 |
- | auto_increment_offset | 1 |
- +--------------------------+-------+
- 2 rows in set (0.00 sec)
-
- mysql> CREATE TABLE autoinc1 (col INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
- Query OK, 0 rows affected (0.04 sec)
-
- mysql> SET @auto_increment_increment=10;
- Query OK, 0 rows affected (0.00 sec)
-
- mysql> SHOW VARIABLES LIKE 'auto_inc%';
- +--------------------------+-------+
- | Variable_name | Value |
- +--------------------------+-------+
- | auto_increment_increment | 10 |
- | auto_increment_offset | 1 |
- +--------------------------+-------+
- 2 rows in set (0.01 sec)
-
- mysql> INSERT INTO autoinc1 VALUES (NULL), (NULL), (NULL), (NULL);
- Query OK, 4 rows affected (0.00 sec)
- Records: 4 Duplicates: 0 Warnings: 0
-
- mysql> SELECT col FROM autoinc1;
- +-----+
- | col |
- +-----+
- | 1 |
- | 11 |
- | 21 |
- | 31 |
- +-----+
- 4 rows in set (0.00 sec)
- </programlisting>
-
- <para>
- (Note how <literal>SHOW VARIABLES</literal> is used here to
- obtain the current values for these variables.)
- </para>
</listitem>
<listitem>
<para>
- <literal>auto_increment_offset</literal> determines the
- starting point for the <literal>AUTO_INCREMENT</literal>
- column value. This affects how many masters you can have in
- your replication setup (i.e. setting this value to 10 means
- your setup can support up to ten servers).
+ Set each of the <replaceable>N</replaceable> masters to have a
+ different <literal>auto_increment_offset</literal>, using the
+ values 1, 2, …, <replaceable>N</replaceable>.
</para>
-
- <para>
- Consider the following, assuming that these commands are
- executed during the same session as the previous example:
- </para>
-
- <programlisting>
- mysql> SET @auto_increment_offset=5;
- Query OK, 0 rows affected (0.00 sec)
-
- mysql> SHOW VARIABLES LIKE 'auto_inc%';
- +--------------------------+-------+
- | Variable_name | Value |
- +--------------------------+-------+
- | auto_increment_increment | 10 |
- | auto_increment_offset | 5 |
- +--------------------------+-------+
- 2 rows in set (0.00 sec)
-
- mysql> CREATE TABLE autoinc2 (col INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
- Query OK, 0 rows affected (0.06 sec)
-
- mysql> INSERT INTO autoinc2 VALUES (NULL), (NULL), (NULL), (NULL);
- Query OK, 4 rows affected (0.00 sec)
- Records: 4 Duplicates: 0 Warnings: 0
-
- mysql> SELECT col FROM autoinc2;
- +-----+
- | col |
- +-----+
- | 5 |
- | 15 |
- | 25 |
- | 35 |
- +-----+
- 4 rows in set (0.02 sec)
-
- </programlisting>
</listitem>
</itemizedlist>
<para>
- For additional information see
+ For additional information about
+ <literal>auto_increment_increment</literal> and
+ <literal>auto_increment_offset</literal>, see
<xref linkend="server-system-variables" />.
</para>
Modified: trunk/refman-5.1/replication.xml
===================================================================
--- trunk/refman-5.1/replication.xml 2006-05-03 04:17:38 UTC (rev 2002)
+++ trunk/refman-5.1/replication.xml 2006-05-03 04:29:35 UTC (rev 2003)
@@ -5737,144 +5737,56 @@
<itemizedlist>
- <section id="replication-auto-increment">
-
- <title>&title-replication-auto-increment;</title>
-
+ <listitem>
+ <para>
+ <literal>auto_increment_increment</literal> controls the
+ increment between successive <literal>AUTO_INCREMENT</literal>
+ values.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>auto_increment_offset</literal> determines the
+ starting point for <literal>AUTO_INCREMENT</literal> column
+ values.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
<para>
- When multiple servers are configured as replication masters,
- special steps must be taken to prevent key collisions when using
- auto_inrement, otherwise multiple masters may attempt to use the
- same auto_increment value when inserting rows.
+ By choosing non-conflicting values for these variables on
+ different masters, servers in a multiple-master configuration will
+ not use conflicting <literal>AUTO_INCREMENT</literal> values when
+ inserting new rows into the same table. To set up
+ <replaceable>N</replaceable> master servers, set the variables
+ like this:
</para>
-
- <para>
- To accommodate multi-master replication with auto_increment, two
- new server variables were introduced with MySQL 5.0.2:
- <literal>auto_increment_increment</literal> and
- <literal>auto_increment_offset</literal>. These variables have a
- default (and mimimum) value of 1 and a maximum value of 65,535.
- </para>
-
- <para>
- By setting non-conflicting values for these variables, servers in
- a multi-master configuration will not use conflicting
- auto_increment values when inserting new rows into the same table.
- </para>
-
- <para>
- These two variables effect <literal>AUTO_INCREMENT</literal>
- column behavior as follows:
- </para>
<itemizedlist>
<listitem>
<para>
- <literal>auto_increment_increment</literal> controls the
- interval by which the column value is incremented. For
- example:
+ Set <literal>auto_increment_increment</literal> to
+ <replaceable>N</replaceable> on each master.
</para>
-
- <programlisting>
- mysql> SHOW VARIABLES LIKE 'auto_inc%';
- +--------------------------+-------+
- | Variable_name | Value |
- +--------------------------+-------+
- | auto_increment_increment | 1 |
- | auto_increment_offset | 1 |
- +--------------------------+-------+
- 2 rows in set (0.00 sec)
-
- mysql> CREATE TABLE autoinc1 (col INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
- Query OK, 0 rows affected (0.04 sec)
-
- mysql> SET @auto_increment_increment=10;
- Query OK, 0 rows affected (0.00 sec)
-
- mysql> SHOW VARIABLES LIKE 'auto_inc%';
- +--------------------------+-------+
- | Variable_name | Value |
- +--------------------------+-------+
- | auto_increment_increment | 10 |
- | auto_increment_offset | 1 |
- +--------------------------+-------+
- 2 rows in set (0.01 sec)
-
- mysql> INSERT INTO autoinc1 VALUES (NULL), (NULL), (NULL), (NULL);
- Query OK, 4 rows affected (0.00 sec)
- Records: 4 Duplicates: 0 Warnings: 0
-
- mysql> SELECT col FROM autoinc1;
- +-----+
- | col |
- +-----+
- | 1 |
- | 11 |
- | 21 |
- | 31 |
- +-----+
- 4 rows in set (0.00 sec)
- </programlisting>
-
- <para>
- (Note how <literal>SHOW VARIABLES</literal> is used here to
- obtain the current values for these variables.)
- </para>
</listitem>
<listitem>
<para>
- <literal>auto_increment_offset</literal> determines the
- starting point for the <literal>AUTO_INCREMENT</literal>
- column value. This affects how many masters you can have in
- your replication setup (i.e. setting this value to 10 means
- your setup can support up to ten servers).
+ Set each of the <replaceable>N</replaceable> masters to have a
+ different <literal>auto_increment_offset</literal>, using the
+ values 1, 2, …, <replaceable>N</replaceable>.
</para>
-
- <para>
- Consider the following, assuming that these commands are
- executed during the same session as the previous example:
- </para>
-
- <programlisting>
- mysql> SET @auto_increment_offset=5;
- Query OK, 0 rows affected (0.00 sec)
-
- mysql> SHOW VARIABLES LIKE 'auto_inc%';
- +--------------------------+-------+
- | Variable_name | Value |
- +--------------------------+-------+
- | auto_increment_increment | 10 |
- | auto_increment_offset | 5 |
- +--------------------------+-------+
- 2 rows in set (0.00 sec)
-
- mysql> CREATE TABLE autoinc2 (col INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
- Query OK, 0 rows affected (0.06 sec)
-
- mysql> INSERT INTO autoinc2 VALUES (NULL), (NULL), (NULL), (NULL);
- Query OK, 4 rows affected (0.00 sec)
- Records: 4 Duplicates: 0 Warnings: 0
-
- mysql> SELECT col FROM autoinc2;
- +-----+
- | col |
- +-----+
- | 5 |
- | 15 |
- | 25 |
- | 35 |
- +-----+
- 4 rows in set (0.02 sec)
-
- </programlisting>
</listitem>
</itemizedlist>
<para>
- For additional information see
+ For additional information about
+ <literal>auto_increment_increment</literal> and
+ <literal>auto_increment_offset</literal>, see
<xref linkend="server-system-variables" />.
</para>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r2003 - in trunk: . refman-5.0 refman-5.1 | paul | 3 May |