Skip to content

Commit

Permalink
Merge pull request #84 from zendesk/ignore_binary_patch
Browse files Browse the repository at this point in the history
ignore the BINARY flag in string column creation
  • Loading branch information
Ben Osheroff committed Aug 31, 2015
2 parents 3b7713b + bf3083f commit 99ce8bb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/main/antlr4/com/zendesk/maxwell/schema/ddl/mysql.g4
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ create_table:
| create_like_tbl
);

// TODO: support if-not-exists
create_table_preamble: CREATE TEMPORARY? TABLE (IF NOT EXISTS)? table_name;
create_specifications: '(' create_specification (',' create_specification)* ')';

Expand Down
4 changes: 3 additions & 1 deletion src/main/antlr4/imports/column_definitions.g4
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ signed_type: // we need the UNSIGNED flag here
string_type: // getting the encoding here
col_type=(CHAR | VARCHAR)
length?
BINARY?
charset_def?
| col_type=(TINYTEXT | TEXT | MEDIUMTEXT | LONGTEXT)
| col_type=(TINYTEXT | TEXT | MEDIUMTEXT | LONGTEXT)
BINARY?
charset_def?
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,4 +358,9 @@ public void testCurrentTimestamp() {
assertThat(changes.size(), is(1));
}

@Test
public void testBinaryChar() {
List<SchemaChange> changes = parse("CREATE TABLE `foo` ( `id` char(16) BINARY character set 'utf8' )");
assertThat(changes.size(), is(1));
}
}

0 comments on commit 99ce8bb

Please sign in to comment.