From 56f8b3a3700382ceac64f4537ae412b17b03e2ca Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 24 Dec 2015 17:32:41 +0000 Subject: Support double quote strings --- libdbpp/sqlParse.ll | 2 +- libdbpp/unittests/parseTest.sql | 3 +++ libdbpp/unittests/testConnection.cpp | 2 +- 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(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; } -- cgit v1.2.3