Unwrap db in ssh.commands.QueryShell

If NoteDb reads are enabled then the gsql ssh commands fails with

fatal: internal server error

due to DisabledChangesReviewDbWrapper (see Issue 4247).

As not all tables are migrated yet, it makes sense to still allow
low-level access to the db.

Bug: Issue 4247
Change-Id: Icebe51f470010d913f387bb98f7319616dd89aba
This commit is contained in:
Björn Pedersen
2016-07-11 17:29:21 +02:00
parent be0d2d89d1
commit 484bf3cae1

View File

@@ -19,6 +19,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.gerrit.common.TimeUtil;
import com.google.gerrit.common.Version;
import com.google.gerrit.reviewdb.server.ReviewDb;
import com.google.gerrit.reviewdb.server.ReviewDbUtil;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gwtorm.jdbc.JdbcSchema;
@@ -78,7 +79,7 @@ public class QueryShell {
public void run() {
try {
db = dbFactory.open();
db = ReviewDbUtil.unwrapDb(dbFactory.open());
try {
connection = ((JdbcSchema) db).getConnection();
connection.setAutoCommit(true);