未验证 提交 76ef544c 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #2946 from taosdata/jdbc_tests_fix

fix jdbc failed tests
......@@ -42,7 +42,8 @@ public class AsyncSubscribeTest extends BaseTest {
long ts = System.currentTimeMillis();
for (int i = 0; i < 2; i++) {
ts += i;
statement.executeUpdate("insert into \" + dbName + \".\" + tName + \" values (" + ts + ", " + (100 + i) + ", " + i + ")");
String sql = "insert into " + dbName + "." + tName + " values (" + ts + ", " + (100 + i) + ", " + i + ")";
statement.executeUpdate(sql);
}
}
......
......@@ -71,7 +71,7 @@ public class ResultSetTest extends BaseTest {
}
try {
statement.executeQuery("select * from " + dbName + "." + tName);
statement.executeQuery("select * from " + dbName + "." + tName + " where ts = " + ts);
resSet = statement.getResultSet();
System.out.println(((TSDBResultSet) resSet).getRowData());
while (resSet.next()) {
......@@ -806,9 +806,9 @@ public class ResultSetTest extends BaseTest {
@Test
public void testBatch() throws SQLException {
String[] sqls = new String[]{"insert into test.t0 values (1496732686001,2147483600,1496732687000,3.1415925,3.1415926\n" +
"535897,\"涛思数据,强~!\",12,12,\"TDengine is powerful\")", "insert into test.t0 values (1496732686002,2147483600,1496732687000,3.1415925,3.1415926\n" +
"535897,\"涛思数据,强~!\",12,12,\"TDengine is powerful\")"};
String[] sqls = new String[]{"insert into test.t0 values (1496732686001,2147483600,1496732687000,3.1415925,3.1415926535897," +
"'涛思数据,强~',12,0,'TDengine is powerful')", "insert into test.t0 values (1496732686002,2147483600,1496732687000,3.1415925,3.1415926535897," +
"'涛思数据,强~',12,1,'TDengine is powerful')"};
for (String sql : sqls) {
statement.addBatch(sql);
}
......@@ -816,7 +816,6 @@ public class ResultSetTest extends BaseTest {
assertEquals(res.length, 2);
statement.clearBatch();
}
@AfterClass
public static void close() throws Exception {
statement.executeUpdate("drop database " + dbName);
......
......@@ -41,7 +41,8 @@ public class SubscribeTest extends BaseTest {
long ts = System.currentTimeMillis();
for (int i = 0; i < 2; i++) {
ts += i;
statement.executeUpdate("insert into \" + dbName + \".\" + tName + \" values (" + ts + ", " + (100 + i) + ", " + i + ")");
String sql = "insert into " + dbName + "." + tName + " values (" + ts + ", " + (100 + i) + ", " + i + ")";
statement.executeUpdate(sql);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册