mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-29 23:45:51 +00:00
refactor: re-order PRAGMA statements (#5140)
The page_size will soon be made configurable with #5135, making this re-ordering necessary. When opening SQLite connection, there are specific pragmas set with commonPragmas. In particular, PRAGMA journal_mode creates journal file and locks the page_size; as of this commit, this sets the page size to the default value of 4096. Coincidentally, the hardcoded page_size was also 4096, so no issue was noticed.
This commit is contained in:
@@ -206,6 +206,12 @@ private:
|
|||||||
{
|
{
|
||||||
open(*session_, "sqlite", pPath.string());
|
open(*session_, "sqlite", pPath.string());
|
||||||
|
|
||||||
|
for (auto const& p : pragma)
|
||||||
|
{
|
||||||
|
soci::statement st = session_->prepare << p;
|
||||||
|
st.execute(true);
|
||||||
|
}
|
||||||
|
|
||||||
if (commonPragma)
|
if (commonPragma)
|
||||||
{
|
{
|
||||||
for (auto const& p : *commonPragma)
|
for (auto const& p : *commonPragma)
|
||||||
@@ -214,11 +220,7 @@ private:
|
|||||||
st.execute(true);
|
st.execute(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (auto const& p : pragma)
|
|
||||||
{
|
|
||||||
soci::statement st = session_->prepare << p;
|
|
||||||
st.execute(true);
|
|
||||||
}
|
|
||||||
for (auto const& sql : initSQL)
|
for (auto const& sql : initSQL)
|
||||||
{
|
{
|
||||||
soci::statement st = session_->prepare << sql;
|
soci::statement st = session_->prepare << sql;
|
||||||
|
|||||||
Reference in New Issue
Block a user