From 097ab3c37b7cff8b4060241a8ed8c963d2b81c83 Mon Sep 17 00:00:00 2001 From: Ben Osheroff Date: Fri, 15 May 2015 15:55:46 -0700 Subject: [PATCH 1/2] v0.7.1 --- docs/docs/quickstart.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/quickstart.md b/docs/docs/quickstart.md index 548071a82..05f3cf531 100644 --- a/docs/docs/quickstart.md +++ b/docs/docs/quickstart.md @@ -23,9 +23,9 @@ mysql> GRANT SELECT, REPLICATION CLIENT, REPLICATION SLAVE on *.* to 'maxwell'@' You'll need a version 7 of a JVM. ``` -curl -sLo - https://github.com/zendesk/maxwell/releases/download/v0.7.0/maxwell-0.7.0.tar.gz \ +curl -sLo - https://github.com/zendesk/maxwell/releases/download/v0.7.1/maxwell-0.7.1.tar.gz \ | tar zxvf - -cd maxwell-0.7.0 +cd maxwell-0.7.1 ``` diff --git a/pom.xml b/pom.xml index 38c2eae7d..699420b8c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.zendesk maxwell - 0.7.0 + 0.7.1 jar maxwell From 8e0db3499d876b7ecbc9129510501fb5af7fb15d Mon Sep 17 00:00:00 2001 From: Ben Osheroff Date: Tue, 26 May 2015 08:56:37 -0700 Subject: [PATCH 2/2] handle sql line comments so much to know about sql syntax! --- src/main/antlr4/imports/mysql_idents.g4 | 1 + .../java/com/zendesk/maxwell/schema/ddl/DDLParserTest.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/main/antlr4/imports/mysql_idents.g4 b/src/main/antlr4/imports/mysql_idents.g4 index bd0c41fcc..73da304aa 100644 --- a/src/main/antlr4/imports/mysql_idents.g4 +++ b/src/main/antlr4/imports/mysql_idents.g4 @@ -10,6 +10,7 @@ integer: INTEGER_LITERAL; charset_name: (IDENT | STRING_LITERAL | QUOTED_IDENT); SQL_COMMENT: '/*' (.)*? '*/' -> skip; +SQL_LINE_COMMENT: ('#' | '--') (~'\n')* ('\n' | EOF) -> skip; STRING_LITERAL: TICK ('\\\'' | '\'\'' | ~('\''))* TICK; diff --git a/src/test/java/com/zendesk/maxwell/schema/ddl/DDLParserTest.java b/src/test/java/com/zendesk/maxwell/schema/ddl/DDLParserTest.java index 868ca1b1c..a58a4f4a9 100644 --- a/src/test/java/com/zendesk/maxwell/schema/ddl/DDLParserTest.java +++ b/src/test/java/com/zendesk/maxwell/schema/ddl/DDLParserTest.java @@ -346,6 +346,12 @@ public void testCommentSyntax() { assertThat(changes.size(), is(1)); } + @Test + public void testCommentSyntax2() { + List changes = parse("CREATE DATABASE if not exists `foo` -- inline comment!\n default character # another one\nset='latin1' --one at the end"); + assertThat(changes.size(), is(1)); + } + @Test public void testCurrentTimestamp() { List changes = parse("CREATE TABLE `foo` ( `id` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP )");