Skip to content

Commit

Permalink
test: added test case for #812
Browse files Browse the repository at this point in the history
  • Loading branch information
lvca committed Jan 28, 2023
1 parent b2f44e1 commit 3969df8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ public void testAfterDelete() {
}
}

// Issue https://github.com/ArcadeData/arcadedb/issues/807
@Test
public void testBeforeCreateEmulateIncrement() {
final BeforeRecordCreateListener listener = record -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
import com.arcadedb.query.sql.executor.ResultSet;
import com.arcadedb.schema.DocumentType;
import com.arcadedb.schema.Schema;
import com.arcadedb.schema.Type;
import com.arcadedb.schema.VertexType;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.*;

Expand Down Expand Up @@ -112,4 +115,22 @@ protected void beginTest() {
database.begin();
});
}

// Issue https://github.com/ArcadeData/arcadedb/issues/812
@Test
public void testUpdateCompositeKeyIndex() {
VertexType type = database.getSchema().createVertexType("IndexedVertex");
type.createProperty("counter", Type.INTEGER);
type.createProperty("status", Type.STRING);
type.createTypeIndex(Schema.INDEX_TYPE.LSM_TREE, true, "status", "counter");

database.transaction(() -> {
database.newVertex("IndexedVertex").set("id", "test1").set("status", "on").set("counter", 1).save();
database.newVertex("IndexedVertex").set("id", "test2").set("status", "on").set("counter", 2).save();
database.newVertex("IndexedVertex").set("id", "test3").set("status", "on").set("counter", 3).save();

database.command("SQL", "update IndexedVertex set status = 'off' where counter = 2");
database.command("SQL", "update IndexedVertex set status = 'off' where counter = 3");
});
}
}

0 comments on commit 3969df8

Please sign in to comment.