QueryShell: Use SchemaFactory for underlying ReviewDb

This command is specifically for accessing the traditional SQL
database, so it should be able to bypass the NoteDb-related wrappers.
This potentially allows admins to edit change data in a way that messes
with the migration process, or that simply won't be reflected in a
NoteDb-only site, but that's an inherent risk of hand-editing the
database.

Bug: Issue 7467
Change-Id: I871c6f32b1c7df7f5dbfb36fc2f229913759406f
This commit is contained in:
Dave Borowitz
2017-10-17 15:43:31 -07:00
parent 315f8c2458
commit 2ebea91df4

View File

@@ -20,6 +20,7 @@ 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.gerrit.server.schema.ReviewDbFactory;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gwtorm.jdbc.JdbcSchema;
@@ -68,7 +69,7 @@ public class QueryShell {
@Inject
QueryShell(
final SchemaFactory<ReviewDb> dbFactory,
@ReviewDbFactory final SchemaFactory<ReviewDb> dbFactory,
@Assisted final InputStream in,
@Assisted final OutputStream out) {
this.dbFactory = dbFactory;