Invalid SplitDocType
Add ignored test
@@ -40,6 +40,7 @@ import org.apache.jackrabbit.oak.plugins.document.UpdateOp;
import org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.RDBTableMetaData;
import org.apache.jackrabbit.oak.plugins.document.util.Utils;
import org.junit.Assume;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
@@ -262,6 +263,45 @@ public class RDBDocumentStoreSchemaUpgradeTest {
}
}
+ @Ignore("OAK-7855")
+ @Test
+ public void init12fail() {
+ LogCustomizer logCustomizer = LogCustomizer.forLogger(RDBDocumentStore.class.getName()).enable(Level.INFO)
+ .contains("Attempted to upgrade").create();
+ logCustomizer.starting();
+
+ Assume.assumeTrue(ds instanceof RDBDataSourceWrapper);
+ RDBDataSourceWrapper wds = (RDBDataSourceWrapper)ds;
+ wds.setFailAlterTableAddColumnStatements(true);
+
+ RDBOptions op = new RDBOptions().tablePrefix("T12F").initialSchema(1).upgradeToSchema(2).dropTablesOnClose(true);
+ RDBDocumentStore rdb = null;
+ try {
+ rdb = new RDBDocumentStore(this.ds, new DocumentMK.Builder(), op);
+ RDBTableMetaData meta = rdb.getTable(Collection.NODES);
+ assertEquals(op.getTablePrefix() + "_NODES", meta.getName());
+ assertTrue(meta.hasVersion());
+ assertEquals("unexpected # of log entries: " + logCustomizer.getLogs(), RDBDocumentStore.getTableNames().size() * 4,
+ logCustomizer.getLogs().size());
+ String id = Utils.getIdFromPath("/foo");
+ UpdateOp testInsert = new UpdateOp(id, true);
+ assertTrue(rdb.create(Collection.NODES, Collections.singletonList(testInsert)));
+ UpdateOp testUpdate = new UpdateOp(id, false);
+ testUpdate.set("p", 42);
+ assertNotNull(rdb.findAndUpdate(Collection.NODES, testUpdate));
+ rdb.getNodeDocumentCache().invalidate(id);
+ NodeDocument doc = rdb.find(Collection.NODES, id);
+ assertNotNull(doc);
+ assertEquals(SplitDocType.NONE, doc.getSplitDocType());
+ } finally {
+ wds.setFailAlterTableAddColumnStatements(false);
+ logCustomizer.finished();
+ if (rdb != null) {
+ rdb.dispose();
+ }
+ }
+ }
+
@Test
public void testVersionGCOnOldDB() {
RDBOptions op = new RDBOptions().tablePrefix("T11").initialSchema(1).upgradeToSchema(1).dropTablesOnClose(true);
