From 1b8c5ff286be4597588998dd5522e081e1cd2c27 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Fri, 1 Apr 2016 16:05:54 +0200 Subject: [PATCH] preparing for db access --- go/binlog/gomysql_reader.go | 4 ++++ go/binlog/mysqlbinlog_reader_test.go | 2 +- go/mysql/inspect.go | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 go/mysql/inspect.go diff --git a/go/binlog/gomysql_reader.go b/go/binlog/gomysql_reader.go index 2aac7d3..3e6db9d 100644 --- a/go/binlog/gomysql_reader.go +++ b/go/binlog/gomysql_reader.go @@ -88,6 +88,10 @@ func (this *GoMySQLReader) ReadEntries(logFile string, startPos uint64, stopPos } else { ev.Dump(os.Stdout) } + // TODO : convert to entries + // need to parse multi-row entries + // insert & delete are just one row per db orw + // update: where-row_>values-row, repeating } } log.Debugf("done") diff --git a/go/binlog/mysqlbinlog_reader_test.go b/go/binlog/mysqlbinlog_reader_test.go index 0f75e82..81795bd 100644 --- a/go/binlog/mysqlbinlog_reader_test.go +++ b/go/binlog/mysqlbinlog_reader_test.go @@ -18,7 +18,7 @@ func init() { log.SetLevel(log.ERROR) } -func TestRBRSample0(t *testing.T) { +func __TestRBRSample0(t *testing.T) { testFile, err := os.Open("testdata/rbr-sample-0.txt") test.S(t).ExpectNil(err) defer testFile.Close() diff --git a/go/mysql/inspect.go b/go/mysql/inspect.go new file mode 100644 index 0000000..4ff848c --- /dev/null +++ b/go/mysql/inspect.go @@ -0,0 +1,6 @@ +/* + Copyright 2016 GitHub Inc. + See https://github.com/github/gh-osc/blob/master/LICENSE +*/ + +package mysql