Skip to content

Commit 3969df8

Browse files
committed
test: added test case for #812
1 parent b2f44e1 commit 3969df8

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

engine/src/test/java/com/arcadedb/event/DatabaseEventsTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ public void testAfterDelete() {
246246
}
247247
}
248248

249+
// Issue https://github.com/ArcadeData/arcadedb/issues/807
249250
@Test
250251
public void testBeforeCreateEmulateIncrement() {
251252
final BeforeRecordCreateListener listener = record -> {

engine/src/test/java/com/arcadedb/index/MultipleTypesIndexTest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
import com.arcadedb.query.sql.executor.ResultSet;
2424
import com.arcadedb.schema.DocumentType;
2525
import com.arcadedb.schema.Schema;
26+
import com.arcadedb.schema.Type;
27+
import com.arcadedb.schema.VertexType;
2628
import org.junit.jupiter.api.Assertions;
29+
import org.junit.jupiter.api.Test;
2730

2831
import java.util.*;
2932

@@ -112,4 +115,22 @@ protected void beginTest() {
112115
database.begin();
113116
});
114117
}
118+
119+
// Issue https://github.com/ArcadeData/arcadedb/issues/812
120+
@Test
121+
public void testUpdateCompositeKeyIndex() {
122+
VertexType type = database.getSchema().createVertexType("IndexedVertex");
123+
type.createProperty("counter", Type.INTEGER);
124+
type.createProperty("status", Type.STRING);
125+
type.createTypeIndex(Schema.INDEX_TYPE.LSM_TREE, true, "status", "counter");
126+
127+
database.transaction(() -> {
128+
database.newVertex("IndexedVertex").set("id", "test1").set("status", "on").set("counter", 1).save();
129+
database.newVertex("IndexedVertex").set("id", "test2").set("status", "on").set("counter", 2).save();
130+
database.newVertex("IndexedVertex").set("id", "test3").set("status", "on").set("counter", 3).save();
131+
132+
database.command("SQL", "update IndexedVertex set status = 'off' where counter = 2");
133+
database.command("SQL", "update IndexedVertex set status = 'off' where counter = 3");
134+
});
135+
}
115136
}

0 commit comments

Comments
 (0)