diff --git a/pom.xml b/pom.xml index 7c77cb977..628fd2b33 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.zendesk maxwell - 0.10.0-RC4 + 0.11.0-PRE1 jar maxwell diff --git a/src/main/java/com/zendesk/maxwell/MaxwellParser.java b/src/main/java/com/zendesk/maxwell/MaxwellParser.java index 39d9b78c4..5cae5c4d0 100644 --- a/src/main/java/com/zendesk/maxwell/MaxwellParser.java +++ b/src/main/java/com/zendesk/maxwell/MaxwellParser.java @@ -187,10 +187,17 @@ private LinkedList getTransactionEvents() throws Excep break; case MySQLConstants.QUERY_EVENT: QueryEvent qe = (QueryEvent) v4Event; - // TODO: need to handle this case. - // The MySQL guys say some storage engines will output a "COMMIT" QUERY_EVENT at the - // end of the stream. - throw new RuntimeException("Unhandled QueryEvent: " + qe); + + if ( qe.getSql().toString().equals("COMMIT") ) { + // some storage engines(?) will output a "COMMIT" QUERY_EVENT instead of a XID_EVENT. + // not sure exactly how to trigger this. + if ( !list.isEmpty() ) + list.getLast().setTXCommit(); + + return list; + } else { + throw new RuntimeException("Unhandled QueryEvent: " + qe); + } case MySQLConstants.XID_EVENT: XidEvent xe = (XidEvent) v4Event; for ( MaxwellAbstractRowsEvent e : list )