← Back to team overview

maria-developers team mailing list archive

Updated (by Psergey): Change BINLOG statement syntax to be human-readable (46)

 

-----------------------------------------------------------------------
                              WORKLOG TASK
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TASK...........: Change BINLOG statement syntax to be human-readable
CREATION DATE..: Sat, 15 Aug 2009, 23:42
SUPERVISOR.....: Monty
IMPLEMENTOR....: Psergey
COPIES TO......: 
CATEGORY.......: Server-RawIdeaBin
TASK ID........: 46 (http://askmonty.org/worklog/?tid=46)
VERSION........: WorkLog-3.4
STATUS.........: Un-Assigned
PRIORITY.......: 60
WORKED HOURS...: 0
ESTIMATE.......: 0 (hours remain)
ORIG. ESTIMATE.: 0

PROGRESS NOTES:

-=-=(Psergey - Sat, 15 Aug 2009, 23:43)=-=-
High-Level Specification modified.
--- /tmp/wklog.46.old.17742     2009-08-15 23:43:09.000000000 +0300
+++ /tmp/wklog.46.new.17742     2009-08-15 23:43:09.000000000 +0300
@@ -1 +1,28 @@
+Suggestion 1
+------------
+Original syntax suggestion by Kristian:
+
+  BINLOG
+    WITH TIMESTAMP xxx SERVER_ID 1 MASTER_POS 415 FLAGS 0x0
+    TABLE db1.table1 AS 1 COLUMNS (INT NOT NULL, BLOB, VARCHAR(100)) FLAGS 0x0
+    TABLE db2.table2 AS 2 COLUMNS (CHAR(10)) FLAGS 0x0
+  WRITE_ROW INTO db1.table1(1,3) VALUES (42, 'foobar'), (10, NULL) FLAGS 0x2
+  UPDATE_ROW INTO db2.table2 (1) (1) VALUES FROM ('beforeval') TO ('toval'),
+     FROM ('a') TO ('b') FLAGS 0x0
+  DELETE_ROW INTO db2.table2 (1) VALUES ('row_to_delete') FLAGS 0x0;
+
+  This is basically a dump of what is stored in the events, and would be an
+  alternative to BINLOG 'gwWEShMBAA...'.
+
+Feedback and other suggestions
+------------------------------
+* What is the need for WITH TIMESTAMP part? Can't one use a separate 
+  SET TIMESTAMP statement?
+
+* mysqlbinlog --base64-output=DECODE-ROWS --verbose  already produces something
+  that's close to readable SQL. Can we make it to be regular parseable SQL?
+  + This will be syntax that's familiar to our parser and to the users
+  - A stream of SQL statements will be slower to run than BINLOG statements
+    (due to locking, table open/close, etc). (TODO: is it really slower? we
+    haven't checked).
 



DESCRIPTION:

One of great things about mysqlbinlog was that its output was human-readable
SQL, so it was possible to edit it manually or with help of scripts. With RBR
events and BINLOG 'DpiGShMBAAAALQAAADcBAA...' statements this is no longer the 
case.

This WL task is about making BINLOG statements to be human-readable (either as
an option or by default


HIGH-LEVEL SPECIFICATION:



Suggestion 1
------------
Original syntax suggestion by Kristian:

  BINLOG
    WITH TIMESTAMP xxx SERVER_ID 1 MASTER_POS 415 FLAGS 0x0
    TABLE db1.table1 AS 1 COLUMNS (INT NOT NULL, BLOB, VARCHAR(100)) FLAGS 0x0
    TABLE db2.table2 AS 2 COLUMNS (CHAR(10)) FLAGS 0x0
  WRITE_ROW INTO db1.table1(1,3) VALUES (42, 'foobar'), (10, NULL) FLAGS 0x2
  UPDATE_ROW INTO db2.table2 (1) (1) VALUES FROM ('beforeval') TO ('toval'),
     FROM ('a') TO ('b') FLAGS 0x0
  DELETE_ROW INTO db2.table2 (1) VALUES ('row_to_delete') FLAGS 0x0;

  This is basically a dump of what is stored in the events, and would be an
  alternative to BINLOG 'gwWEShMBAA...'.

Feedback and other suggestions
------------------------------
* What is the need for WITH TIMESTAMP part? Can't one use a separate 
  SET TIMESTAMP statement?

* mysqlbinlog --base64-output=DECODE-ROWS --verbose  already produces something
  that's close to readable SQL. Can we make it to be regular parseable SQL?
  + This will be syntax that's familiar to our parser and to the users
  - A stream of SQL statements will be slower to run than BINLOG statements
    (due to locking, table open/close, etc). (TODO: is it really slower? we
    haven't checked).


ESTIMATED WORK TIME

ESTIMATED COMPLETION DATE
-----------------------------------------------------------------------
WorkLog (v3.5.9)