89457

89457



Replication and auto_increment

Statement-based replication of AUTO_INCREMENT, LAST_INSERT_ID () [1290],

and TIMESTAMP

values is done correctly, subject to the following exceptions:

•    When using statement-based replication prior to MySQL 5.6.10, AUTO_INCREMENT columns

in tables on the slave must match the same columns on the master; that is,

AUTO_INCREMENT

columns must be replicated to AUTO_INCREMENT columns. (Bug #12669186)

•    A statement invoking a trigger or function that causes an update to an

AUTO_INCREMENT column

is not replicated correctly using statement-based replication. In MySQL 5.6, such State ments are

marked as unsafe. (Bug #45677)

•    An INSERT into a table that has a composite primary key that includes an

AUTO_INCREMENT

column that is not the first column of this composite key is not safe for statement-based logging or

replication. Beginning with MySQL 5.6.6, such statements are marked as unsafe.

(Bug #11754117,

Bug #45670)

This issue does not affect tables using the InnoDB storage engine, sińce an InnoDB table with an

AUTOJNCREMENT column requires at least one key where the auto-increment column isthe only or leftmost column.

•    Adding an AUTO_INCREMENT column to a table with ALTER TABLE might not produce the same

ordering of the rows on the slave and the master. This occurs because the order in which the rows

are numbered depends on the specific storage engine used for the table and the order in which

the rows were inserted. If it is important to have the same order on the master and slave, the rows

must be ordered before assigning an AUTO_INCREMENT number. Assuming that you want to add an

AUTO_INCREMENT column to a table 11 that has columns coli and col2, the following statements

produce a newtable t2 identical to tl but with an AUTO_INCREMENT column:

CREATE TABLE t2 LIKE tl;

ALTER TABLE t2 ADD id INT AUTO_INCREHENT PRIMARY KEY;

INSERT INTO t2 SELECT * FROM tl ORDER BY coli, co!2;



Wyszukiwarka

Podobne podstrony:
Ask Me Everything 0 Art movements and techniąues Impressionism Paris-based movement of the 1870s and
Replication and limit Statement-based replication of LIMIT clauses in DELETE, UPDATE, and INSERT ...
Statement-based replication. When using statement-based replication, a simple rule of thumb to follo
Replication of Columns Having Different Data Types Corresponding columns on the master s and the sla
Replication of current_user() The foliowing statements support use of the CURRENTJJSER () [1287] fun
COMM1SSION STATEMENT ln view of the risks of carcinogens, mutagens and substances toxic to reproduct
Title: Analysis, Using and Understanding Financial Statements of the Firm Lecture hours: 20 Study
4.1.2. The Yiew and the Controller XML-based technologies are intensively used in the presentation l
About the SQL Tuning Advisor The SQL Tuning Advisor examines a givcn SQL statement or a set of SQL s
List of Figures 2.1    Comparison of Workflow Management and Business Process Managem
Tautology and contradiction A compound statement that is always true, regardless of what trułh value
23 (288) OR-split AND-join OR-split AND-join Figurę 1.8 An event-based description of a workflow pro
geologia matpom44 Plates and Platę Tectonics 23labie 2-2 - THE LAYERS OF THE EARTH _   &nb
image002 “There has never been a collection like this before” James Blish. . . and there hasn’t. Thi
zyberk0002 DAWKINS: tasks 1. How does Dawkins twist the statement .. the creation of life was God’s
00016 ?eb564a5f5b77c28047d13120a3d2db 15 An Overview and Perspective on Control Charting Types of C
00146 &5dd89e4c9f1d1c9b9ade934fbf44bb 147 Optimization and Sensitivity Analysis Table 10. Compariso
00393 cd07593964298da297f84c0cc7e26b8 397 Regret Indices and Capability Quantification Given finite

więcej podobnych podstron