Skip to content
Snippets Groups Projects
Commit ee54c32d authored by Stephen R. van den Berg's avatar Stephen R. van den Berg
Browse files

pgsql: Wait till completion on database connection reset.

parent 5527af46
Branches
Tags
No related merge requests found
...@@ -501,13 +501,15 @@ protected void destroy() { ...@@ -501,13 +501,15 @@ protected void destroy() {
resync(); resync();
} }
private void textquery(string q) { private .pgsql_util.Result textquery(string q) {
.pgsql_util.Result res;
#if 1 #if 1
foreach (q / ";"; ; string sq) foreach (q / ";"; ; string sq)
big_query(sq); res = big_query(sq);
#else // textqueries and portals do not mix well #else // textqueries and portals do not mix well
big_query(q, (["_text":1])); res = big_query(q, (["_text":1]));
#endif #endif
return res;
} }
private void resyncdone() { private void resyncdone() {
...@@ -518,7 +520,9 @@ private void resyncdone() { ...@@ -518,7 +520,9 @@ private void resyncdone() {
private void reset_dbsession() { private void reset_dbsession() {
proxy.statementsinflight->wait_till_drained(); proxy.statementsinflight->wait_till_drained();
error(1); error(1);
textquery("ROLLBACK;RESET ALL;CLOSE ALL;DISCARD TEMP"); .pgsql_util.Result res
= textquery("ROLLBACK;RESET ALL;CLOSE ALL;DISCARD TEMP");
while (res->fetch_row());
resyncdone(); resyncdone();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment