16.2.3.2 Evaluation of Table-Level Replication Options

The slave checks for and evaluates table options only if either of the following two conditions is true:

First, as a preliminary condition, the slave checks whether the statement occurs within a stored function, in which case the slave executes the statement and exits.

Having reached this point, if there are no table options, the slave simply executes all statements. If there are any --replicate-do-table or --replicate-wild-do-table options, the statement must match one of these if it is to be executed; otherwise, it is ignored. If there are any --replicate-ignore-table or --replicate-wild-ignore-table options, all statements are executed except those that match any of these options. This process is illustrated in the following diagram.

Evaluation of Table-Level Filtering Rules in Replication

The master.info file should be protected because it contains the password for connecting to the master. See Section 6.1.2.3, “Passwords and Logging”.

The following steps describe this evaluation in more detail:

  1. Are there any table options?

    • Yes.  Continue to step 2.

    • No.  Execute the statement and exit.

  2. Are there any --replicate-do-table options?

    • Yes.  Does the table match any of them?

      • Yes.  Execute the statement and exit.

      • No.  Continue to step 3.

    • No.  Continue to step 3.

  3. Are there any --replicate-ignore-table options?

    • Yes.  Does the table match any of them?

      • Yes.  Ignore the statement and exit.

      • No.  Continue to step 4.

    • No.  Continue to step 4.

  4. Are there any --replicate-wild-do-table options?

    • Yes.  Does the table match any of them?

      • Yes.  Execute the statement and exit.

      • No.  Continue to step 5.

    • No.  Continue to step 5.

  5. Are there any --replicate-wild-ignore-table options?

    • Yes.  Does the table match any of them?

      • Yes.  Ignore the statement and exit.

      • No.  Continue to step 6.

    • No.  Continue to step 6.

  6. Are there any --replicate-do-table or --replicate-wild-do-table options?

    • Yes.  Ignore the statement and exit.

    • No.  Execute the statement and exit.