+
+ if (indexes) {
+ size_t i;
+
+ ts->indexes = xmalloc(indexes->u.array.n * sizeof *ts->indexes);
+ for (i = 0; i < indexes->u.array.n; i++) {
+ struct ovsdb_column_set *index = &ts->indexes[i];
+ size_t j;
+
+ error = ovsdb_column_set_from_json(indexes->u.array.elems[i],
+ ts, index);
+ if (error) {
+ goto error;
+ }
+ if (index->n_columns == 0) {
+ error = ovsdb_syntax_error(json, NULL, "index must have "
+ "at least one column");
+ goto error;
+ }
+ ts->n_indexes++;
+
+ for (j = 0; j < index->n_columns; j++) {
+ const struct ovsdb_column *column = index->columns[j];
+
+ if (!column->persistent) {
+ error = ovsdb_syntax_error(json, NULL, "ephemeral columns "
+ "(such as %s) may not be "
+ "indexed", column->name);
+ goto error;
+ }
+ }
+ }
+ }
+