未验证 提交 c4b0fe41 编写于 作者: X Xiangdong Huang 提交者: GitHub

Merge pull request #76 from apache/fix_27

[IOTDB-27]Bug fix: the writer of LocalTextModificationAccessor is not recycled 
......@@ -87,6 +87,7 @@ public class LocalTextModificationAccessor implements ModificationReader, Modifi
public void close() throws IOException {
if (writer != null) {
writer.close();
writer = null;
}
}
......
......@@ -20,6 +20,7 @@
package org.apache.iotdb.db.integration;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import java.sql.Connection;
import java.sql.DriverManager;
......@@ -147,6 +148,31 @@ public class IoTDBDeletionIT {
cleanData();
}
@Test
public void testDelAfterFlush() throws SQLException {
Connection connection = DriverManager
.getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root",
"root");
Statement statement = connection.createStatement();
statement.execute("SET STORAGE GROUP TO root.ln.wf01.wt01");
statement.execute("CREATE TIMESERIES root.ln.wf01.wt01.status WITH DATATYPE=BOOLEAN,"
+ " ENCODING=PLAIN");
statement.execute("INSERT INTO root.ln.wf01.wt01(timestamp,status) "
+ "values(1509465600000,true)");
statement.execute("INSERT INTO root.ln.wf01.wt01(timestamp,status) VALUES(NOW(), false)");
statement.execute("delete from root.ln.wf01.wt01.status where time < NOW()");
statement.execute("flush");
statement.execute("delete from root.ln.wf01.wt01.status where time < NOW()");
ResultSet resultSet = statement.executeQuery("select status from root.ln.wf01.wt01");
assertFalse(resultSet.next());
statement.close();
connection.close();
}
private static void prepareSeries() throws SQLException {
Connection connection = null;
try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册