@@ -217,18 +217,19 @@ TEST_F(xapi, test_create_collection_index)
217
217
const char *schema_name = " cc_crud_test" ;
218
218
const char *coll_name = " index_test" ;
219
219
const char *json[] = {
220
- " {\" zip\" : \" 34239\" , \" zcount\" : \" 10\" , \" some_text\" : \" just some text\" }" ,
221
- " {\" zip\" : \" 30001 \" , \" zcount\" : \" 20\" , \" some_text\" : \" some more text\" }"
220
+ " {\" zip\" : [ \" 34239\" , \" 23456 \" ] , \" zcount\" : \" 10\" , \" some_text\" : \" just some text\" }" ,
221
+ " {\" zip\" : [ \" 00001 \" , \" 23456 \" ] , \" zcount\" : \" 20\" , \" some_text\" : \" some more text\" }"
222
222
};
223
223
224
224
const char *geo_json =
225
225
" {\" zip\" : \" 34239\" , \" coords\" : { \" type\" : \" Point\" , \" coordinates\" : [102.0, 0.0] }}" ;
226
226
227
227
const char *json_idx = " {" \
228
228
" \" fields\" : [" \
229
- " { \" field\" : \" $.zip\" , \" required\" : true , \" type\" : \" TEXT(10)\" }," \
229
+ " { \" field\" : \" $.zip\" , \" required\" : true , \" type\" : \" TEXT(10)\" }," \
230
230
" { \" field\" : \" $.zcount\" , \" type\" : \" INT UNSIGNED\" }]}" ;
231
231
232
+
232
233
const char *geo_json_idx = " {"
233
234
" \" type\" : \" SPATIAL\" ,"
234
235
" \" fields\" : [{"
@@ -284,6 +285,20 @@ TEST_F(xapi, test_create_collection_index)
284
285
285
286
EXPECT_EQ (RESULT_OK,
286
287
mysqlx_collection_drop_index (collection, " geo_idx1" ));
288
+
289
+ SKIP_IF_SERVER_VERSION_LESS (8 , 0 , 17 );
290
+
291
+ EXPECT_EQ (RESULT_OK, mysqlx_collection_drop (schema, coll_name));
292
+ EXPECT_EQ (RESULT_OK, mysqlx_collection_create (schema, coll_name));
293
+ collection = mysqlx_get_collection (schema, coll_name, 0 );
294
+
295
+ const char *multival_idx = " {" \
296
+ " \" fields\" : [" \
297
+ " { \" field\" : \" $.zip\" , \" type\" : \" CHAR(10)\" , \" array\" : true}]}" ;
298
+ printf (" \n Create multivalue index." );
299
+ EXPECT_EQ (RESULT_OK,
300
+ mysqlx_collection_create_index (collection, " multival_idx1" , multival_idx));
301
+ EXPECT_EQ (RESULT_OK, mysqlx_collection_drop (schema, coll_name));
287
302
}
288
303
289
304
0 commit comments