Skip to content

Commit

Permalink
Merge pull request #52 from zendesk/ben/inline_comments
Browse files Browse the repository at this point in the history
Ben/inline comments
  • Loading branch information
Ben Osheroff committed May 26, 2015
2 parents 246b702 + 8e0db34 commit 813f641
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```


Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.zendesk</groupId>
<artifactId>maxwell</artifactId>
<version>0.7.0</version>
<version>0.7.1</version>
<packaging>jar</packaging>

<name>maxwell</name>
Expand Down
1 change: 1 addition & 0 deletions src/main/antlr4/imports/mysql_idents.g4
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,12 @@ public void testCommentSyntax() {
assertThat(changes.size(), is(1));
}

@Test
public void testCommentSyntax2() {
List<SchemaChange> 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<SchemaChange> changes = parse("CREATE TABLE `foo` ( `id` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP )");
Expand Down

0 comments on commit 813f641

Please sign in to comment.