summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-12-24 17:32:41 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-12-24 17:32:41 +0000
commit56f8b3a3700382ceac64f4537ae412b17b03e2ca (patch)
tree621a7998c829d4cdfe3c65e01ed2f9bb344c9f17
parentCheck stream state before execute (diff)
downloadlibdbpp-56f8b3a3700382ceac64f4537ae412b17b03e2ca.tar.bz2
libdbpp-56f8b3a3700382ceac64f4537ae412b17b03e2ca.tar.xz
libdbpp-56f8b3a3700382ceac64f4537ae412b17b03e2ca.zip
Support double quote strings
-rw-r--r--libdbpp/sqlParse.ll2
-rw-r--r--libdbpp/unittests/parseTest.sql3
-rw-r--r--libdbpp/unittests/testConnection.cpp2
3 files changed, 5 insertions, 2 deletions
diff --git a/libdbpp/sqlParse.ll b/libdbpp/sqlParse.ll
index 0661abc..684b996 100644
--- a/libdbpp/sqlParse.ll
+++ b/libdbpp/sqlParse.ll
@@ -22,7 +22,7 @@ comment ("--"{non_newline}*)
other .
term ;
any ({other}|{space})
-quote '
+quote ('|\")
quote_apos ''
quote_esc \\.
dolq_start [A-Za-z\200-\377_]
diff --git a/libdbpp/unittests/parseTest.sql b/libdbpp/unittests/parseTest.sql
index cfba78f..6a3df82 100644
--- a/libdbpp/unittests/parseTest.sql
+++ b/libdbpp/unittests/parseTest.sql
@@ -13,3 +13,6 @@ INSERT INTO name(t, i) VALUES('string', 3);
/*! comments with a ;*/;
/*! Because reasons */;
+SET @cmd="SET @broken_views = (select count(*) from information_schema.views"
+ " where table_schema='performance_schema')";
+
diff --git a/libdbpp/unittests/testConnection.cpp b/libdbpp/unittests/testConnection.cpp
index a40c5cc..159e5a2 100644
--- a/libdbpp/unittests/testConnection.cpp
+++ b/libdbpp/unittests/testConnection.cpp
@@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE( parse )
mock->executeScript(s, rootDir);
MockDb * mockdb = dynamic_cast<MockDb *>(mock);
BOOST_REQUIRE(mockdb);
- BOOST_REQUIRE_EQUAL(2, mockdb->executed.size());
+ BOOST_REQUIRE_EQUAL(3, mockdb->executed.size());
BOOST_REQUIRE_EQUAL("INSERT INTO name(t, i) VALUES('string', 3)", mockdb->executed[1]);
delete mock;
}