Merge pull request #4164 from taosdata/hotfix/TD-1883
[TD-1883]<fix>: fix memory leak when resultSet pointer is null
This commit is contained in:
commit
bf7f70554b
|
@ -5,7 +5,7 @@
|
|||
|
||||
<groupId>com.taosdata.jdbc</groupId>
|
||||
<artifactId>taos-jdbcdriver</artifactId>
|
||||
<version>2.0.6</version>
|
||||
<version>2.0.9</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>JDBCDriver</name>
|
||||
|
|
|
@ -122,7 +122,7 @@ public class TSDBJNIConnector {
|
|||
pSql = this.executeQueryImp(sql.getBytes(TaosGlobalConfig.getCharset()), this.taos);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
this.freeResultSet(pSql);
|
||||
this.freeResultSetImp(this.taos, pSql);
|
||||
throw new SQLException(TSDBConstants.WrapErrMsg("Unsupported encoding"));
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ public class TSDBJNIConnector {
|
|||
affectedRows = -1;
|
||||
String msg = this.getErrMsg(pSql);
|
||||
|
||||
this.freeResultSet(pSql);
|
||||
this.freeResultSetImp(this.taos, pSql);
|
||||
throw new SQLException(TSDBConstants.WrapErrMsg(msg), "", code);
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ public class TSDBJNIConnector {
|
|||
private native long getResultSetImp(long connection, long pSql);
|
||||
|
||||
public boolean isUpdateQuery(long pSql) {
|
||||
return isUpdateQueryImp(this.taos, pSql) == 1? true:false;
|
||||
return isUpdateQueryImp(this.taos, pSql) == 1 ? true : false;
|
||||
}
|
||||
|
||||
private native long isUpdateQueryImp(long connection, long pSql);
|
||||
|
|
Loading…
Reference in New Issue