diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBStatement.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBStatement.java index 1cf024f30e..777eef53d1 100644 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBStatement.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBStatement.java @@ -158,9 +158,9 @@ public class TSDBStatement implements Statement { throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL)); } else if (resultSetPointer == TSDBConstants.JNI_NULL_POINTER) { // no result set is retrieved + this.connecter.freeResultSet(pSql); res = false; } - this.connecter.freeResultSet(pSql); return res; } diff --git a/src/connector/jdbc/src/test/java/TestAsyncTSDBSubscribe.java b/src/connector/jdbc/src/test/java/TestAsyncTSDBSubscribe.java index 03a4761b91..6d4c6b1e94 100644 --- a/src/connector/jdbc/src/test/java/TestAsyncTSDBSubscribe.java +++ b/src/connector/jdbc/src/test/java/TestAsyncTSDBSubscribe.java @@ -42,12 +42,14 @@ public class TestAsyncTSDBSubscribe { long subscribId = 0; try { Class.forName("com.taosdata.jdbc.TSDBDriver"); + Properties properties = new Properties(); - properties.setProperty(TSDBDriver.PROPERTY_KEY_HOST, host); - properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); - properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); - properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); - properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); + properties.setProperty(TSDBDriver.PROPERTY_KEY_HOST, host); + properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); + properties.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); + properties.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); + properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); + connection = DriverManager.getConnection("jdbc:TAOS://" + host + ":0/" + dbName + "?user=root&password=taosdata", properties); String rawSql = "select * from " + tName + ";"; TSDBSubscribe subscribe = ((TSDBConnection) connection).createSubscribe(); diff --git a/src/query/src/qFill.c b/src/query/src/qFill.c index ac44feb576..d28d99ceb8 100644 --- a/src/query/src/qFill.c +++ b/src/query/src/qFill.c @@ -131,7 +131,7 @@ void taosFillCopyInputDataFromOneFilePage(SFillInfo* pFillInfo, tFilePage* pInpu assert(pFillInfo->numOfRows == pInput->num); int32_t t = 0; - for(int32_t i = 0; i < pFillInfo->numOfCols; ++i) { + for(int32_t i = 0; i < pFillInfo->numOfCols && t < pFillInfo->numOfTags; ++i) { SFillColInfo* pCol = &pFillInfo->pFillCol[i]; char* s = pInput->data + pCol->col.offset * pInput->num; diff --git a/tests/script/general/parser/lastrow_query.sim b/tests/script/general/parser/lastrow_query.sim index 72e8b4de95..9f52e45b80 100644 --- a/tests/script/general/parser/lastrow_query.sim +++ b/tests/script/general/parser/lastrow_query.sim @@ -51,7 +51,14 @@ if $data09 != NCHAR then return -1 endi +# regression test case 1 sql select count(*) from lr_tb1 where ts>'2018-09-18 08:45:00.1' and ts<'2018-09-18 08:45:00.2' if $row != 0 then return -1 endi + +# regression test case 2 +sql select count(*) from lr_db0.lr_stb0 where ts>'2018-9-18 8:00:00' and ts<'2018-9-18 14:00:00' interval(1s) fill(NULL); +if $row != 21600 then + return -1 +endi \ No newline at end of file