execute("insert into quotes (id, quote, timestamp) values(?, ?, ?)",
new Object[]{4, "Now panic", 1395874800000L});
ensureGreen();
refresh();
SQLResponse response = execute("select partition_ident from information_schema.table_partitions " +
"where table_name='quotes' and schema_name='doc'" +
"order by partition_ident");
assertThat(response.rowCount(), is(3L));
assertThat((String)response.rows()[0][0], is(new PartitionName("parted", ImmutableList.of(new BytesRef("1395874800000"))).ident()));
assertThat((String)response.rows()[1][0], is(new PartitionName("parted", ImmutableList.of(new BytesRef("1395961200000"))).ident()));
assertThat((String)response.rows()[2][0], is(new PartitionName("parted", ImmutableList.of(new BytesRef("1396303200000"))).ident()));
execute("delete from quotes where quote = 'Don''t panic'");
refresh();
execute("select * from quotes where quote = 'Don''t panic'");
assertThat(this.response.rowCount(), is(0L));
// Test that no partitions were deleted
SQLResponse newResponse = execute("select partition_ident from information_schema.table_partitions " +
"where table_name='quotes' and schema_name='doc'" +
"order by partition_ident");
assertThat(newResponse.rows(), is(response.rows()));
}