|
23 | 23 | import com.arcadedb.query.sql.executor.ResultSet; |
24 | 24 | import com.arcadedb.schema.DocumentType; |
25 | 25 | import com.arcadedb.schema.Schema; |
| 26 | +import com.arcadedb.schema.Type; |
| 27 | +import com.arcadedb.schema.VertexType; |
26 | 28 | import org.junit.jupiter.api.Assertions; |
| 29 | +import org.junit.jupiter.api.Test; |
27 | 30 |
|
28 | 31 | import java.util.*; |
29 | 32 |
|
@@ -112,4 +115,22 @@ protected void beginTest() { |
112 | 115 | database.begin(); |
113 | 116 | }); |
114 | 117 | } |
| 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 | + } |
115 | 136 | } |
0 commit comments