On Sep 15, Weldon Whipple wrote:
> I'm in the process of reworking the per-DB binlogging that I mentioned
> a few days ago. Because my project is now focusing on creating one
> binary log per database (rather than for all databases owned by a
> user), I've tried several syntaxes and have come up with the following
> possibilities. I would appreciate any feedback, especially if these
> are in conflict with any SQL conventions, taboos, etc. I have modified
> sql/sql_yacc.yy to work with them:
> 1. START BINLOG FOR DATABASE dbname;
> (Is BINLOG appropriate? Should it be BINLOGGING?)
> This is the command that starts writing a binlog for the specified database.
> 2. FLUSH TABLES WITH READ LOCK FOR DATABASE dbname;
> (I just added an optional 'FOR DATABASE dbname' to the already
> existing command--which still works, BTW. Is this a misuse of the word
> This is the command that locks the tables before someone (some
> program) dumps/copies the tables that will be moved to another server.
> It flushes and locks only one database.
This would be difficult to implement.
FLUSH TABLES WITH READ LOCK is not implemented in a way that can be
generalized to support per-database locks :(
Besides, I personally wouldn't worry much about the syntax. It's
something you can easily change anytime - e.g. replace BINLOG with
BINLOGGING or FOR with something else.