@@ -75,6 +75,47 @@ public void testCollection() {
7575 });
7676 }
7777
78+ @ Test
79+ public void testNullItemInCollection () {
80+ database .transaction (() -> {
81+ final Index index = database .getSchema ().getIndexByName (TYPE_NAME + "[keywords]" );
82+
83+ MutableVertex v = database .newVertex (TYPE_NAME );
84+ v .set ("id" , TOT +1 );
85+ v .set ("firstName" , "Mark" );
86+ v .set ("lastName" , "Zuck" );
87+
88+ final List <Object > list = new ArrayList <>();
89+ list .add (null );
90+ v .set ("keywords" , list );
91+
92+ v .save ();
93+
94+ IndexCursor cursor = index .get (new Object [] { list });
95+ Assertions .assertTrue (cursor .hasNext ());
96+ Assertions .assertEquals ("Zuck" , cursor .next ().asVertex ().getString ("lastName" ));
97+ Assertions .assertFalse (cursor .hasNext ());
98+ });
99+ }
100+
101+ // Issue https://github.com/ArcadeData/arcadedb/issues/812
102+ @ Test
103+ public void testUpdateCompositeKeyIndex () {
104+ VertexType type = database .getSchema ().createVertexType ("IndexedVertex" );
105+ type .createProperty ("counter" , Type .INTEGER );
106+ type .createProperty ("status" , Type .STRING );
107+ type .createTypeIndex (Schema .INDEX_TYPE .LSM_TREE , true , "status" , "counter" );
108+
109+ database .transaction (() -> {
110+ database .newVertex ("IndexedVertex" ).set ("id" , "test1" ).set ("status" , "on" ).set ("counter" , 1 ).save ();
111+ database .newVertex ("IndexedVertex" ).set ("id" , "test2" ).set ("status" , "on" ).set ("counter" , 2 ).save ();
112+ database .newVertex ("IndexedVertex" ).set ("id" , "test3" ).set ("status" , "on" ).set ("counter" , 3 ).save ();
113+
114+ database .command ("SQL" , "update IndexedVertex set status = 'off' where counter = 2" );
115+ database .command ("SQL" , "update IndexedVertex set status = 'off' where counter = 3" );
116+ });
117+ }
118+
78119 protected void beginTest () {
79120 database .transaction (() -> {
80121 Assertions .assertFalse (database .getSchema ().existsType (TYPE_NAME ));
@@ -115,22 +156,4 @@ protected void beginTest() {
115156 database .begin ();
116157 });
117158 }
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- }
136159}
0 commit comments