From 1f167034c574b60611d2cf0a7b8a7531c5efa81c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 21 Dec 2015 18:07:58 +0000 Subject: Fix and test for rogue ; in MySQL dumps --- libdbpp/sqlParse.ll | 4 ++++ libdbpp/unittests/parseTest.sql | 3 +++ 2 files changed, 7 insertions(+) diff --git a/libdbpp/sqlParse.ll b/libdbpp/sqlParse.ll index 5ab7899..7649445 100644 --- a/libdbpp/sqlParse.ll +++ b/libdbpp/sqlParse.ll @@ -60,6 +60,10 @@ scriptdir "$SCRIPTDIR" Comment(YYText()); } +{term} { + // Random terminator +} + {other} { statement += YYText(); yy_push_state(STATEMENT); diff --git a/libdbpp/unittests/parseTest.sql b/libdbpp/unittests/parseTest.sql index 56eac57..cfba78f 100644 --- a/libdbpp/unittests/parseTest.sql +++ b/libdbpp/unittests/parseTest.sql @@ -9,4 +9,7 @@ INSERT INTO name(t, i) VALUES('string', 3); Multi line comment */ +/*! Stupid MySQL terminates */; +/*! comments with a ;*/; +/*! Because reasons */; -- cgit v1.2.3