Correct missing semicolons on sql statements

This commit is contained in:
seelabs
2015-03-20 14:03:23 -07:00
committed by Tom Ritchford
parent 836dfb6503
commit ac84e44161
4 changed files with 23 additions and 23 deletions

View File

@@ -122,7 +122,7 @@ public:
// Check values in db
std::vector<std::string> stringResult (20 * stringData.size ());
std::vector<int> intResult (20 * intData.size ());
s << "SELECT StringData, IntData FROM SociTestTable",
s << "SELECT StringData, IntData FROM SociTestTable;",
soci::into (stringResult), soci::into (intResult);
expect (stringResult.size () == stringData.size () &&
intResult.size () == intData.size ());
@@ -205,7 +205,7 @@ public:
std::uint32_t uig = 0;
std::int64_t big = 0;
std::uint64_t ubig = 0;
s << "SELECT I, UI, BI, UBI from STT", soci::into (ig),
s << "SELECT I, UI, BI, UBI from STT;", soci::into (ig),
soci::into (uig), soci::into (big), soci::into (ubig);
expect (ig == id[0] && uig == uid[0] && big == bid[0] &&
ubig == ubid[0]);
@@ -220,7 +220,7 @@ public:
boost::optional<std::uint32_t> uig;
boost::optional<std::int64_t> big;
boost::optional<std::uint64_t> ubig;
s << "SELECT I, UI, BI, UBI from STT", soci::into (ig),
s << "SELECT I, UI, BI, UBI from STT;", soci::into (ig),
soci::into (uig), soci::into (big), soci::into (ubig);
expect (*ig == id[0] && *uig == uid[0] && *big == bid[0] &&
*ubig == ubid[0]);

View File

@@ -366,10 +366,10 @@ public:
auto db = getApp().getWalletDB ().checkoutDb ();
*db << str (
boost::format ("DELETE FROM SeedNodes WHERE PublicKey=%s") %
boost::format ("DELETE FROM SeedNodes WHERE PublicKey=%s;") %
sqlEscape (naNodePublic.humanNodePublic ()));
*db << str (
boost::format ("DELETE FROM TrustedNodes WHERE PublicKey=%s") %
boost::format ("DELETE FROM TrustedNodes WHERE PublicKey=%s;") %
sqlEscape (naNodePublic.humanNodePublic ()));
}
@@ -390,7 +390,7 @@ public:
{
auto db = getApp().getWalletDB ().checkoutDb ();
*db << str (boost::format ("DELETE FROM SeedDomains WHERE Domain=%s") % sqlEscape (strDomain));
*db << str (boost::format ("DELETE FROM SeedDomains WHERE Domain=%s;") % sqlEscape (strDomain));
}
// YYY Only dirty on successful delete.
@@ -404,8 +404,8 @@ public:
{
auto db = getApp().getWalletDB ().checkoutDb ();
*db << "DELETE FROM SeedDomains";
*db << "DELETE FROM SeedNodes";
*db << "DELETE FROM SeedDomains;";
*db << "DELETE FROM SeedNodes;";
}
fetchDirty ();

View File

@@ -72,7 +72,7 @@ public:
"SELECT "
" address, "
" valence "
"FROM PeerFinder_BootstrapCache "
"FROM PeerFinder_BootstrapCache;"
, soci::into (s)
, soci::into (valence)
);
@@ -103,7 +103,7 @@ public:
{
soci::transaction tr (m_session);
m_session <<
"DELETE FROM PeerFinder_BootstrapCache";
"DELETE FROM PeerFinder_BootstrapCache;";
if (!v.empty ())
{
@@ -145,7 +145,7 @@ public:
"SELECT "
" version "
"FROM SchemaVersion WHERE "
" name = 'PeerFinder'"
" name = 'PeerFinder';"
, soci::into (vO)
;
@@ -189,7 +189,7 @@ public:
std::size_t count;
m_session <<
"SELECT COUNT(*) FROM PeerFinder_BootstrapCache "
"SELECT COUNT(*) FROM PeerFinder_BootstrapCache;"
, soci::into (count)
;
@@ -203,7 +203,7 @@ public:
"SELECT "
" address, "
" valence "
"FROM PeerFinder_BootstrapCache "
"FROM PeerFinder_BootstrapCache;"
, soci::into (s)
, soci::into (valence)
);
@@ -254,14 +254,14 @@ public:
}
m_session <<
"DROP TABLE IF EXISTS PeerFinder_BootstrapCache";
"DROP TABLE IF EXISTS PeerFinder_BootstrapCache;";
m_session <<
"DROP INDEX IF EXISTS PeerFinder_BootstrapCache_Index";
"DROP INDEX IF EXISTS PeerFinder_BootstrapCache_Index;";
m_session <<
"ALTER TABLE PeerFinder_BootstrapCache_Next "
" RENAME TO PeerFinder_BootstrapCache";
" RENAME TO PeerFinder_BootstrapCache;";
m_session <<
"CREATE INDEX IF NOT EXISTS "
@@ -280,16 +280,16 @@ public:
//
m_session <<
"DROP TABLE IF EXISTS LegacyEndpoints";
"DROP TABLE IF EXISTS LegacyEndpoints;";
m_session <<
"DROP TABLE IF EXISTS PeerFinderLegacyEndpoints";
"DROP TABLE IF EXISTS PeerFinderLegacyEndpoints;";
m_session <<
"DROP TABLE IF EXISTS PeerFinder_LegacyEndpoints";
"DROP TABLE IF EXISTS PeerFinder_LegacyEndpoints;";
m_session <<
"DROP TABLE IF EXISTS PeerFinder_LegacyEndpoints_Index";
"DROP TABLE IF EXISTS PeerFinder_LegacyEndpoints_Index;";
}
{
@@ -300,7 +300,7 @@ public:
" ,version "
") VALUES ( "
" 'PeerFinder', :version "
")"
");"
, soci::use (version);
}
@@ -311,7 +311,7 @@ private:
void init ()
{
soci::transaction tr (m_session);
m_session << "PRAGMA encoding=\"UTF-8\"";
m_session << "PRAGMA encoding=\"UTF-8\";";
m_session <<
"CREATE TABLE IF NOT EXISTS SchemaVersion ( "

View File

@@ -45,7 +45,7 @@ Json::Value doTxHistory (RPC::Context& context)
std::string sql =
boost::str (boost::format (
"SELECT LedgerSeq, Status, RawTxn "
"FROM Transactions ORDER BY LedgerSeq desc LIMIT %u,20")
"FROM Transactions ORDER BY LedgerSeq desc LIMIT %u,20;")
% startIndex);
{