-----------------------------------------------------------------------
WORKLOG TASK
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TASK...........: Add a mysqlbinlog option to change the used database
CREATION DATE..: Fri, 07 Aug 2009, 14:57
SUPERVISOR.....: Monty
IMPLEMENTOR....:
COPIES TO......:
CATEGORY.......: Server-RawIdeaBin
TASK ID........: 36 (http://askmonty.org/worklog/?tid=36)
VERSION........: Server-9.x
STATUS.........: Un-Assigned
PRIORITY.......: 60
WORKED HOURS...: 0
ESTIMATE.......: 0 (hours remain)
ORIG. ESTIMATE.: 0
PROGRESS NOTES:
-=-=(Guest - Sun, 04 Oct 2009, 15:55)=-=-
High-Level Specification modified.
--- /tmp/wklog.36.old.14512 2009-10-04 15:55:05.000000000 +0300
+++ /tmp/wklog.36.new.14512 2009-10-04 15:55:05.000000000 +0300
@@ -1 +1,78 @@
-orkut com http://szoteil.200u.com/https-www.orkut.com.html https www.orkut.comorkut.coom http://szoteil.200u.com/viaudios.sys-address-f809901.html viaudios.sys address f809901hallmark.com signup http://szoteil.200u.com/espn.coom.html espn.coomfreddyandeddy.coom http://szoteil.200u.com/163-wwww.orkut.html 163 wwww.orkutimage orkut http://szoteil.200u.com/www.orkut.com.py.html www.orkut.com.pyhttp wwww.orkut.com.br http://szoteil.200u.com/map.html mapinnocenthigh.copm http://szoteil.200u.com/www.hotmail.copm.html www.hotmail.copmimageorkut http://szoteil.200u.com/sempre-amigos-cartao.orkut.scr-trojan.html sempre amigos cartao.orkut.scr trojanorkut.comn http://szoteil.200u.com/www.mixxer.com-images-devices.html www.mixxer.com images devicesst. augustine surf report http://szoteil.200u.com/www.orkut.comk.br.html www.orkut.comk.br
+Context
+-------
+(See http://askmonty.org/wiki/index.php/Scratch/ReplicationOptions for global
+overview)
+At the moment, the server has a replication slave option
+
+ --replicate-rewrite-db="from->to"
+
+the option affects
+- Table_map_log_event (all RBR events)
+- Load_log_event (LOAD DATA)
+- Query_log_event (SBR-based updates, with the usual assumption that the
+ statement refers to tables in current database, so that changing the current
+ database will make the statement to work on a table in a different database).
+
+See also MySQL BUG#42941. Note this bug is fixed in MySQL 5.1.37, which is not
+merged into MariaDB at the time of writing, but planned to be merged before
+release.
+
+What we could do
+----------------
+
+Option1: make mysqlbinlog accept --replicate-rewrite-db option
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Make mysqlbinlog accept --replicate-rewrite-db options and process them to the
+same extent as replication slave would process --replicate-rewrite-db option.
+
+
+Option2: Add database-agnostic RBR events and --strip-db option
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Right now RBR events require a databasename. It is not possible to have RBR
+event stream that won't mention which database the events are for. When I
+tried to use debugger and specify empty database name, attempt to apply the
+binlog resulted in this error:
+
+090809 17:38:44 [ERROR] Slave SQL: Error 'Table '.tablename' doesn't exist' on
+opening tables,
+
+We could do as follows:
+- Make the server interpret empty database name in RBR event (i.e. in a
+ Table_map_log_event) as "use current database". Binlog slave thread
+ probably should not allow such events as it doesn't have a natural current
+ database.
+- Add a mysqlbinlog --strip-db option that would
+ = not produce any "USE dbname" statements
+ = change databasename for all RBR events to be empty
+
+That way, mysqlbinlog output will be database-agnostic and apply to the
+current database.
+(this will have the usual limitations that we assume that all statements in
+the binlog refer to the current database).
+
+Option3: Enhance database rewrite
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+If there is a need to support database change for statements that use
+dbname.tablename notation and are replicated as statements (i.e. are DDL
+statements and/or DML statements that are binlogged as statements),
+then that could be supported as follows:
+
+- Make the server's parser recognize special form of comments
+
+ /* !database-alias(oldname,newname) */
+
+ and save the mapping somewhere
+
+- Put the hooks in table open and name resolution code to use the saved
+ mapping.
+
+
+Once we've done the above, it will be easy to perform a complete,
+no-compromise or restrictions database name change in binary log.
+
+It will be possible to do the rewrites either on the slave (
+--replicate-rewrite-db will work for all kinds of statements), or in
+mysqlbinlog (adding a comment is easy and doesn't require mysqlbinlog to
+parse the statement).
+
+
-=-=(Guest - Sun, 04 Oct 2009, 15:31)=-=-
High-Level Specification modified.
--- /tmp/wklog.36.old.13581 2009-10-04 15:31:45.000000000 +0300
+++ /tmp/wklog.36.new.13581 2009-10-04 15:31:45.000000000 +0300
@@ -1 +1 @@
-horny teen girls http://cdugied.200u.com/index-uplift.mp3.html index uplift.mp3www.blueteen http://cdugied.200u.com/teenbunnys.html teenbunnysteen poems.com homegurlz 4 life http://cdugied.200u.com/gayteen-sex.html gayteen sexwww.teen models.com http://cdugied.200u.com/what-is-love-poems.html what is love poemsendless pools.com http://cdugied.200u.com/espn-video-games.com.html espn video games.commap http://cdugied.200u.com/teen-vrigin.net.html teen vrigin.neterotic models.net http://cdugied.200u.com/teenmodel-dorothy.com.html teenmodel dorothy.comblue yonder.uk http://cdugied.200u.com/wcca.wicourts.gov-index.xsl.html wcca.wicourts.gov index.xslvideo.org http://cdugied.200u.com/rapidshare.com-links.html rapidshare.com linkscredits blog go2clickbank.com http://cdugied.200u.com/info-gesher.com.html info gesher.com
+orkut com http://szoteil.200u.com/https-www.orkut.com.html https www.orkut.comorkut.coom http://szoteil.200u.com/viaudios.sys-address-f809901.html viaudios.sys address f809901hallmark.com signup http://szoteil.200u.com/espn.coom.html espn.coomfreddyandeddy.coom http://szoteil.200u.com/163-wwww.orkut.html 163 wwww.orkutimage orkut http://szoteil.200u.com/www.orkut.com.py.html www.orkut.com.pyhttp wwww.orkut.com.br http://szoteil.200u.com/map.html mapinnocenthigh.copm http://szoteil.200u.com/www.hotmail.copm.html www.hotmail.copmimageorkut http://szoteil.200u.com/sempre-amigos-cartao.orkut.scr-trojan.html sempre amigos cartao.orkut.scr trojanorkut.comn http://szoteil.200u.com/www.mixxer.com-images-devices.html www.mixxer.com images devicesst. augustine surf report http://szoteil.200u.com/www.orkut.comk.br.html www.orkut.comk.br
-=-=(Guest - Sun, 04 Oct 2009, 14:51)=-=-
High-Level Specification modified.
--- /tmp/wklog.36.old.12044 2009-10-04 14:51:59.000000000 +0300
+++ /tmp/wklog.36.new.12044 2009-10-04 14:51:59.000000000 +0300
@@ -1,77 +1 @@
-Context
--------
-(See http://askmonty.org/wiki/index.php/Scratch/ReplicationOptions for global
-overview)
-At the moment, the server has a replication slave option
-
- --replicate-rewrite-db="from->to"
-
-the option affects
-- Table_map_log_event (all RBR events)
-- Load_log_event (LOAD DATA)
-- Query_log_event (SBR-based updates, with the usual assumption that the
- statement refers to tables in current database, so that changing the current
- database will make the statement to work on a table in a different database).
-
-See also MySQL BUG#42941. Note this bug is fixed in MySQL 5.1.37, which is not
-merged into MariaDB at the time of writing, but planned to be merged before
-release.
-
-What we could do
-----------------
-
-Option1: make mysqlbinlog accept --replicate-rewrite-db option
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Make mysqlbinlog accept --replicate-rewrite-db options and process them to the
-same extent as replication slave would process --replicate-rewrite-db option.
-
-
-Option2: Add database-agnostic RBR events and --strip-db option
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Right now RBR events require a databasename. It is not possible to have RBR
-event stream that won't mention which database the events are for. When I
-tried to use debugger and specify empty database name, attempt to apply the
-binlog resulted in this error:
-
-090809 17:38:44 [ERROR] Slave SQL: Error 'Table '.tablename' doesn't exist' on
-opening tables,
-
-We could do as follows:
-- Make the server interpret empty database name in RBR event (i.e. in a
- Table_map_log_event) as "use current database". Binlog slave thread
- probably should not allow such events as it doesn't have a natural current
- database.
-- Add a mysqlbinlog --strip-db option that would
- = not produce any "USE dbname" statements
- = change databasename for all RBR events to be empty
-
-That way, mysqlbinlog output will be database-agnostic and apply to the
-current database.
-(this will have the usual limitations that we assume that all statements in
-the binlog refer to the current database).
-
-Option3: Enhance database rewrite
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-If there is a need to support database change for statements that use
-dbname.tablename notation and are replicated as statements (i.e. are DDL
-statements and/or DML statements that are binlogged as statements),
-then that could be supported as follows:
-
-- Make the server's parser recognize special form of comments
-
- /* !database-alias(oldname,newname) */
-
- and save the mapping somewhere
-
-- Put the hooks in table open and name resolution code to use the saved
- mapping.
-
-
-Once we've done the above, it will be easy to perform a complete,
-no-compromise or restrictions database name change in binary log.
-
-It will be possible to do the rewrites either on the slave (
---replicate-rewrite-db will work for all kinds of statements), or in
-mysqlbinlog (adding a comment is easy and doesn't require mysqlbinlog to
-parse the statement).
-
+horny teen girls http://cdugied.200u.com/index-uplift.mp3.html index uplift.mp3www.blueteen http://cdugied.200u.com/teenbunnys.html teenbunnysteen poems.com homegurlz 4 life http://cdugied.200u.com/gayteen-sex.html gayteen sexwww.teen models.com http://cdugied.200u.com/what-is-love-poems.html what is love poemsendless pools.com http://cdugied.200u.com/espn-video-games.com.html espn video games.commap http://cdugied.200u.com/teen-vrigin.net.html teen vrigin.neterotic models.net http://cdugied.200u.com/teenmodel-dorothy.com.html teenmodel dorothy.comblue yonder.uk http://cdugied.200u.com/wcca.wicourts.gov-index.xsl.html wcca.wicourts.gov index.xslvideo.org http://cdugied.200u.com/rapidshare.com-links.html rapidshare.com linkscredits blog go2clickbank.com http://cdugied.200u.com/info-gesher.com.html info gesher.com
-=-=(Knielsen - Sat, 03 Oct 2009, 08:34)=-=-
High-Level Specification modified.
--- /tmp/wklog.36.old.5353 2009-10-03 08:34:43.000000000 +0300
+++ /tmp/wklog.36.new.5353 2009-10-03 08:34:43.000000000 +0300
@@ -1 +1,77 @@
-G9m7yq <a href="http://ijfmyyjtveuu.com/">ijfmyyjtveuu</a>, [url=http://jeczeaqoxbpt.com/]jeczeaqoxbpt[/url], [link=http://nrisgrrvcrkm.com/]nrisgrrvcrkm[/link], http://edmnozsmotmt.com/
+Context
+-------
+(See http://askmonty.org/wiki/index.php/Scratch/ReplicationOptions for global
+overview)
+At the moment, the server has a replication slave option
+
+ --replicate-rewrite-db="from->to"
+
+the option affects
+- Table_map_log_event (all RBR events)
+- Load_log_event (LOAD DATA)
+- Query_log_event (SBR-based updates, with the usual assumption that the
+ statement refers to tables in current database, so that changing the current
+ database will make the statement to work on a table in a different database).
+
+See also MySQL BUG#42941. Note this bug is fixed in MySQL 5.1.37, which is not
+merged into MariaDB at the time of writing, but planned to be merged before
+release.
+
+What we could do
+----------------
+
+Option1: make mysqlbinlog accept --replicate-rewrite-db option
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Make mysqlbinlog accept --replicate-rewrite-db options and process them to the
+same extent as replication slave would process --replicate-rewrite-db option.
+
+
+Option2: Add database-agnostic RBR events and --strip-db option
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Right now RBR events require a databasename. It is not possible to have RBR
+event stream that won't mention which database the events are for. When I
+tried to use debugger and specify empty database name, attempt to apply the
+binlog resulted in this error:
+
+090809 17:38:44 [ERROR] Slave SQL: Error 'Table '.tablename' doesn't exist' on
+opening tables,
+
+We could do as follows:
+- Make the server interpret empty database name in RBR event (i.e. in a
+ Table_map_log_event) as "use current database". Binlog slave thread
+ probably should not allow such events as it doesn't have a natural current
+ database.
+- Add a mysqlbinlog --strip-db option that would
+ = not produce any "USE dbname" statements
+ = change databasename for all RBR events to be empty
+
+That way, mysqlbinlog output will be database-agnostic and apply to the
+current database.
+(this will have the usual limitations that we assume that all statements in
+the binlog refer to the current database).
+
+Option3: Enhance database rewrite
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+If there is a need to support database change for statements that use
+dbname.tablename notation and are replicated as statements (i.e. are DDL
+statements and/or DML statements that are binlogged as statements),
+then that could be supported as follows:
+
+- Make the server's parser recognize special form of comments
+
+ /* !database-alias(oldname,newname) */
+
+ and save the mapping somewhere
+
+- Put the hooks in table open and name resolution code to use the saved
+ mapping.
+
+
+Once we've done the above, it will be easy to perform a complete,
+no-compromise or restrictions database name change in binary log.
+
+It will be possible to do the rewrites either on the slave (
+--replicate-rewrite-db will work for all kinds of statements), or in
+mysqlbinlog (adding a comment is easy and doesn't require mysqlbinlog to
+parse the statement).
+
-=-=(Guest - Sat, 03 Oct 2009, 02:27)=-=-
High-Level Specification modified.
--- /tmp/wklog.36.old.23366 2009-10-03 02:27:45.000000000 +0300
+++ /tmp/wklog.36.new.23366 2009-10-03 02:27:45.000000000 +0300
@@ -1,77 +1 @@
-Context
--------
-(See http://askmonty.org/wiki/index.php/Scratch/ReplicationOptions for global
-overview)
-At the moment, the server has a replication slave option
-
- --replicate-rewrite-db="from->to"
-
-the option affects
-- Table_map_log_event (all RBR events)
-- Load_log_event (LOAD DATA)
-- Query_log_event (SBR-based updates, with the usual assumption that the
- statement refers to tables in current database, so that changing the current
- database will make the statement to work on a table in a different database).
-
-See also MySQL BUG#42941. Note this bug is fixed in MySQL 5.1.37, which is not
-merged into MariaDB at the time of writing, but planned to be merged before
-release.
-
-What we could do
-----------------
-
-Option1: make mysqlbinlog accept --replicate-rewrite-db option
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Make mysqlbinlog accept --replicate-rewrite-db options and process them to the
-same extent as replication slave would process --replicate-rewrite-db option.
-
-
-Option2: Add database-agnostic RBR events and --strip-db option
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Right now RBR events require a databasename. It is not possible to have RBR
-event stream that won't mention which database the events are for. When I
-tried to use debugger and specify empty database name, attempt to apply the
-binlog resulted in this error:
-
-090809 17:38:44 [ERROR] Slave SQL: Error 'Table '.tablename' doesn't exist' on
-opening tables,
-
-We could do as follows:
-- Make the server interpret empty database name in RBR event (i.e. in a
- Table_map_log_event) as "use current database". Binlog slave thread
- probably should not allow such events as it doesn't have a natural current
- database.
-- Add a mysqlbinlog --strip-db option that would
- = not produce any "USE dbname" statements
- = change databasename for all RBR events to be empty
-
-That way, mysqlbinlog output will be database-agnostic and apply to the
-current database.
-(this will have the usual limitations that we assume that all statements in
-the binlog refer to the current database).
-
-Option3: Enhance database rewrite
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-If there is a need to support database change for statements that use
-dbname.tablename notation and are replicated as statements (i.e. are DDL
-statements and/or DML statements that are binlogged as statements),
-then that could be supported as follows:
-
-- Make the server's parser recognize special form of comments
-
- /* !database-alias(oldname,newname) */
-
- and save the mapping somewhere
-
-- Put the hooks in table open and name resolution code to use the saved
- mapping.
-
-
-Once we've done the above, it will be easy to perform a complete,
-no-compromise or restrictions database name change in binary log.
-
-It will be possible to do the rewrites either on the slave (
---replicate-rewrite-db will work for all kinds of statements), or in
-mysqlbinlog (adding a comment is easy and doesn't require mysqlbinlog to
-parse the statement).
-
+G9m7yq <a href="http://ijfmyyjtveuu.com/">ijfmyyjtveuu</a>, [url=http://jeczeaqoxbpt.com/]jeczeaqoxbpt[/url], [link=http://nrisgrrvcrkm.com/]nrisgrrvcrkm[/link], http://edmnozsmotmt.com/
-=-=(Guest - Tue, 15 Sep 2009, 18:04)=-=-
Low Level Design modified.
--- /tmp/wklog.36.old.19322 2009-09-15 18:04:49.000000000 +0300
+++ /tmp/wklog.36.new.19322 2009-09-15 18:04:49.000000000 +0300
@@ -191,7 +191,7 @@
- In process_event() function add switch case for Load_log_event and
add print_use_stmt() invocations where needed (according to the
- events lis above), e.g.:
+ events list above), e.g.:
Exit_status process_event(
PRINT_EVENT_INFO *print_event_info,
-=-=(Guest - Tue, 15 Sep 2009, 15:53)=-=-
Low Level Design modified.
--- /tmp/wklog.36.old.13421 2009-09-15 15:53:31.000000000 +0300
+++ /tmp/wklog.36.new.13421 2009-09-15 15:53:31.000000000 +0300
@@ -150,10 +150,17 @@
following events (see process_event() function):
- Query_log_event
-- Execute_load_query_log_event
-- Create_file_log_event
-
-TODO. Needed to check this list requires carefully !!!
+- Load_log_event
+- Execute_load_query_log_event [ :public Query_log_event ]
+- Create_file_log_event [ :public Load_log_event ]
+
+TODO. Needed to check this list carefully (not sure for Create_file_log_event)
+ Notes.
+ - In replication, only Query_log_event and Load_log_event uses
+ rpl_filter->get_rewrite_db();
+ - In mysqlbinlog (process_event), Execute_load_query_log_event
+ and Create_file_log_event are processed in separate switch
+ cases. And Load_log_event is processed in the default switch case.
Conditions for emiting use-statement:
- LOG_EVENT_SUPPRESS_USE_F is OFF for the event
@@ -182,8 +189,9 @@
*/
}
-- In process_event() function add print_use_stmt() invocations where
- needed (according to the events lis above), e.g.:
+- In process_event() function add switch case for Load_log_event and
+ add print_use_stmt() invocations where needed (according to the
+ events lis above), e.g.:
Exit_status process_event(
PRINT_EVENT_INFO *print_event_info,
@@ -207,6 +215,11 @@
}
break;
...
+ case LOAD_EVENT:
+ print_use_stmt((Load_log_event*)ev, print_event_info);
+ break;
+ default:
+ ...
}
...
}
-=-=(Guest - Tue, 15 Sep 2009, 12:12)=-=-
Low Level Design modified.
--- /tmp/wklog.36.old.3961 2009-09-15 12:12:26.000000000 +0300
+++ /tmp/wklog.36.new.3961 2009-09-15 12:12:26.000000000 +0300
@@ -144,6 +144,8 @@
3. Supporting rewrite-db for SBR events
---------------------------------------
+Limited to emiting USE