If the server is started with --binlog-do-db=sales, the following UPDATE statement is logged even though prices were not included when setting --binlog-do-db:
mysql> USE sales;mysql> UPDATE prices.discounts SET percentage = percentage + 10;
Because sales is the default database when the UPDATE statement is issued, the UPDATE is logged.
In row-based logging, it is restricted to database db_name. Only changes to tables belonging to db_name are logged; the default database has no effect on this.
Another important difference in --binlog-do-db handling for statement-based logging, as opposed to the row-based logging, occurs with regard to statements that refer to multiple databases. Suppose that the server is started with --binlog-do-db=db1 ...