summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-12-21 18:07:58 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-12-21 18:07:58 +0000
commit1f167034c574b60611d2cf0a7b8a7531c5efa81c (patch)
tree2f7ddfe4527c05fb6482f585e713801347b4bde5
parentRemove flto cos I'm sick of it randomly breaking stuff (diff)
downloadlibdbpp-1f167034c574b60611d2cf0a7b8a7531c5efa81c.tar.bz2
libdbpp-1f167034c574b60611d2cf0a7b8a7531c5efa81c.tar.xz
libdbpp-1f167034c574b60611d2cf0a7b8a7531c5efa81c.zip
Fix and test for rogue ; in MySQL dumps
-rw-r--r--libdbpp/sqlParse.ll4
-rw-r--r--libdbpp/unittests/parseTest.sql3
2 files changed, 7 insertions, 0 deletions
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());
}
+<INITIAL>{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 */;