See Section 14.11.7, “Inno DB and FOREIGN KEY Constraints”. Records not matching the equijoin from table2 are marked with null.
There is a page in the online documentation that explains safe mode entitled 'safe Server Startup Script'.
Suppose you have a table where each row is associated with a certain group (For example, orders are associated with the customers placing them) where each item WITHIN the group has a distinct number (For example, each person my have a sequence of competition results - each person, therefore, has a 1st, 2nd, 3rd... If you would like to renumber items within their group so that each has the same baseline (say 0), here is an example way to proceed: Create TEMPORARY Table Groups (Id INTEGER AUTO_INCREMENT PRIMARY KEY, Name VARCHAR(31), Group Id VARCHAR(31), Val Within Group INTEGER); INSERT INTO Groups VALUES (null, "Davy", "Boy", 2); INSERT INTO Groups VALUES (null, "Mary", "Girl", 2); INSERT INTO Groups VALUES (null, "Bill", "Boy", 5); INSERT INTO Groups VALUES (null, "Jill", "Girl", -3); INSERT INTO Groups VALUES (null, "Fred", "Boy", 3);# Find the lowest value for each group CREATE TEMPORARY TABLE Group Sum AS SELECT Group Id, MIN(Val Within Group) AS base Val FROM Groups GROUP BY Group Id;# create an index so my SQL can efficiently match ALTER TABLE Group Sum ADD UNIQUE (Group Id);# finally, make the baseline adjustment UPDATE Groups LEFT JOIN Group Sum USING (Group Id) SET Val Within Group=Val Within Group-base Val; SELECT * FROM Groups;# 1 Davy Boy 0# 2 Mary Girl 5# 3 Bill Boy 3# 4 Jill Girl 0# 5 Fred Boy 1#Each group ("Boy", "Girl") now has a (lowest) Val Within Group entry of 0.
Notes: That index addition is necessary because on larger tables my SQL would rather die than figure to (internally) index a single column join.
PDF (US Ltr) - 26.7Mb PDF (A4) - 26.7Mb PDF (RPM) - 25.9Mb EPUB - 6.7Mb HTML Download (TGZ) - 6.5Mb HTML Download (Zip) - 6.5Mb HTML Download (RPM) - 5.6Mb Eclipse Doc Plugin (TGZ) - 7.1Mb Eclipse Doc Plugin (Zip) - 8.8Mb Man Pages (TGZ) - 166.0Kb Man Pages (Zip) - 271.7Kb Info (Gzip) - 2.5Mb Info (Zip) - 2.5Mb My SQL Backup and Recovery My SQL Cluster NDB 7.2 My SQL Globalization My SQL Information Schema My SQL Installation Guide My SQL and Linux/Unix My SQL and OS X My SQL Partitioning My SQL Performance Schema My SQL Replication My SQL Restrictions and Limitations Security in My SQL My SQL and Solaris Building My SQL from Source Starting and Stopping My SQL My SQL Tutorial My SQL and Windows clause, are flagged as unsafe for statement-based replication.
(This is because the order in which the rows are updated determines which rows are ignored.) With this change, such statements produce a warning in the log when using statement-based mode and are logged using the row-based format when using mode.
(Bug #11758262, Bug #50439) See Section 18.104.22.168, “Determination of Safe and Unsafe Statements in Binary Logging”, for more information.
If you access a column from the table to be updated in an expression, assignments are generally evaluated from left to right.
For multiple-table updates, there is no guarantee that assignments are carried out in any particular order.
If you set a column to the value it currently has, My SQL notices this and does not update it.