提交 4e402502 编写于 作者: F freemine

1. bugFix: memory leakage

2. satisfy CI
上级 e5a36038
...@@ -679,7 +679,9 @@ SQLRETURN SQL_API SQLExecDirectW(SQLHSTMT hstmt, SQLWCHAR *szSqlStr, SQLINTEGER ...@@ -679,7 +679,9 @@ SQLRETURN SQL_API SQLExecDirectW(SQLHSTMT hstmt, SQLWCHAR *szSqlStr, SQLINTEGER
{ {
size_t bytes = 0; size_t bytes = 0;
SQLCHAR *utf8 = wchars_to_chars(szSqlStr, cbSqlStr, &bytes); SQLCHAR *utf8 = wchars_to_chars(szSqlStr, cbSqlStr, &bytes);
return SQLExecDirect(hstmt, utf8, bytes); SQLRETURN r = SQLExecDirect(hstmt, utf8, bytes);
if (utf8) free(utf8);
return r;
} }
static SQLRETURN doSQLNumResultCols(SQLHSTMT StatementHandle, static SQLRETURN doSQLNumResultCols(SQLHSTMT StatementHandle,
...@@ -2224,9 +2226,7 @@ static SQLRETURN doSQLDescribeCol(SQLHSTMT StatementHandle, ...@@ -2224,9 +2226,7 @@ static SQLRETURN doSQLDescribeCol(SQLHSTMT StatementHandle,
if (NameLength) { if (NameLength) {
*NameLength = strnlen(field->name, sizeof(field->name)); *NameLength = strnlen(field->name, sizeof(field->name));
} }
if (ColumnSize) { if (ColumnSize) *ColumnSize = field->bytes;
*ColumnSize = field->bytes;
}
if (DecimalDigits) *DecimalDigits = 0; if (DecimalDigits) *DecimalDigits = 0;
if (DataType) { if (DataType) {
...@@ -2260,12 +2260,9 @@ static SQLRETURN doSQLDescribeCol(SQLHSTMT StatementHandle, ...@@ -2260,12 +2260,9 @@ static SQLRETURN doSQLDescribeCol(SQLHSTMT StatementHandle,
} break; } break;
case TSDB_DATA_TYPE_TIMESTAMP: { case TSDB_DATA_TYPE_TIMESTAMP: {
// *DataType = SQL_TIMESTAMP;
// *ColumnSize = 30;
// *DecimalDigits = 3;
*DataType = SQL_TIMESTAMP; *DataType = SQL_TIMESTAMP;
*ColumnSize = sizeof(SQL_TIMESTAMP_STRUCT); if (ColumnSize) *ColumnSize = sizeof(SQL_TIMESTAMP_STRUCT);
*DecimalDigits = 0; if (DecimalDigits) *DecimalDigits = 0;
} break; } break;
case TSDB_DATA_TYPE_NCHAR: { case TSDB_DATA_TYPE_NCHAR: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册