Replication Features and Issues
1499
can use
SET NAMES
or
SET CHARACTER SET
or can set variables such as
collation_client
or
collation_server
[444]
. However, clients are prevented from changing the global value of these
variables; as stated previously, the master and slave must always have identical global character set
values.
• If the master has databases with a character set different from the global
character_set_server
[443]
value, you should design your
CREATE TABLE
statements so that
they do not implicitly rely on the database default character set. A good workaround is to state the
character set and collation explicitly in
CREATE TABLE
statements.
16.4.1.3. Replication of
CREATE TABLE ... SELECT
Statements
This section discusses the rules that are applied when a
CREATE TABLE ... SELECT
statement is
replicated.
Note
CREATE TABLE ... SELECT
always performs an implicit commit
(
Section 13.3.3, “Statements That Cause an Implicit Commit”
).
Statement succeeds.
A successful
CREATE TABLE ... SELECT
is itself replicated.
Statement fails.
A failed
CREATE TABLE ... SELECT
replicates as follows:
• Statement does not use
IF NOT EXISTS
.
The statement has no effect. However, the implicit
commit caused by the statement is logged. This is true regardless of the storage engine used and
the reason for which the statement failed.
• Statement uses
IF NOT EXISTS
.
The
CREATE TABLE IF NOT EXISTS ... SELECT
is
logged with an error.
16.4.1.4. Replication of
DROP ... IF EXISTS
Statements
The
DROP DATABASE IF EXISTS
,
DROP TABLE IF EXISTS
, and
DROP VIEW IF EXISTS
statements are always replicated, even if the database, table, or view to be dropped does not exist on
the master. This is to ensure that the object to be dropped no longer exists on either the master or the
slave, once the slave has caught up with the master.
Beginning with MySQL 5.0.82,
DROP ... IF EXISTS
statements for stored programs (stored
procedures and functions, triggers, and events) are also replicated, even if the stored program to be
dropped does not exist on the master. (Bug #13684)
16.4.1.5. Replication and
DIRECTORY
Table Options
If a
DATA DIRECTORY
or
INDEX DIRECTORY
table option is used in a
CREATE TABLE
statement
on the master server, the table option is also used on the slave. This can cause problems if no
corresponding directory exists in the slave host file system or if it exists but is not accessible to the
slave server. This can be overridden by using the
NO_DIR_IN_CREATE
[537]
server SQL mode on
the slave, which causes the slave to ignore the
DATA DIRECTORY
and
INDEX DIRECTORY
table
options when replicating
CREATE TABLE
statements. The result is that
MyISAM
data and index files
are created in the table's database directory.
For more information, see
Section 5.1.7, “Server SQL Modes”
.
16.4.1.6. Replication and Floating-Point Values
With statement-based replication, values are converted from decimal to binary. Because conversions
between decimal and binary representations of them may be approximate, comparisons involving
floating-point values are inexact. This is true for operations that use floating-point values explicitly,
or that use values that are converted to floating-point implicitly. Comparisons of floating-point values
might yield different results on master and slave servers due to differences in computer architecture,
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...