How Servers Evaluate Replication Filtering Rules • No.   Ignore the statement and exit. 3. There is a default database. Are there any  --binlog-do-db  options? • Yes.   Do any of them match the database? • Yes.   Log the statement and exit. • No.   Ignore the statement and exit. • No.   Continue to step 4. 4. Do any of the  --binlog-ignore-db  options match the database? • Yes.   Ignore the statement and exit. • No.   Log the statement and exit. •No matching database options were found. •One or more database options were found, and were evaluated to arrive at an “execute”  condition according to the rules described in the previous section (see Section 17.2.5.1, “Evaluation of Database- Level Replication and Binary Logging Options” ). Having reached this point, if there are no table options, the replica simply executes all events. If there are any  --replicate-do-table  or  --replicate-wild-do-table  options, the event must match one of For statement-based replication, replication events represent statements (all changes making up a given event are associated with a single SQL statement); for row-based replication, each event represents a change in a single table row (thus a single statement such as  UPDATE mytable SET mycol = 1  may yield many row-based events). When viewed in terms of events, the process of checking table options is the same for both row-based and statement-based replication. First, as a preliminary condition, the replica checks whether statement-based replication is enabled. If so, and the statement occurs within a stored function, the replica executes the statement and exits. If row- based replication is enabled, the replica does not know whether a statement occurred within a stored function on the source, so this condition does not apply. The replica checks for and evaluates table options only if either of the following two conditions is true: --binlog-do-db  can sometimes mean “ignore other databases” . For example, when using statement- based logging, a server running with only  --binlog-do-db=sales  does not write to the binary log statements for which the default database differs from  sales . When using row-based logging with the same option, the server logs only those updates that change data in  sales . For statement-based logging, an exception is made in the rules just given for the CREATE DATABASE ,  ALTER DATABASE , and  DROP DATABASE  statements. In those cases, the database being  created, altered, or dropped  replaces the default database when determining whether to log or ignore updates. Important 17.2.5.2 Evaluation of Table-Level Replication Options Note 3608