未验证 提交 c81acbc6 编写于 作者: X xiaolei li 提交者: GitHub

<fix>[driver]:csharp change close() return type to void (#11340)

上级 28b86d12
...@@ -161,14 +161,12 @@ namespace Sample.UtilsTools ...@@ -161,14 +161,12 @@ namespace Sample.UtilsTools
ExecuteUpdate(conn, $"drop database if exists {globalDbName}"); ExecuteUpdate(conn, $"drop database if exists {globalDbName}");
if (conn != IntPtr.Zero) if (conn != IntPtr.Zero)
{ {
if (TDengine.Close(conn) == 0) TDengine.Close(conn);
{ Console.WriteLine("close connection success");
Console.WriteLine("close connection success"); }
} else
else {
{ throw new Exception("connection if already null");
Console.WriteLine("close Connection failed");
}
} }
} }
public static List<TDengineMeta> GetResField(IntPtr res) public static List<TDengineMeta> GetResField(IntPtr res)
......
...@@ -280,7 +280,7 @@ namespace TDengineDriver ...@@ -280,7 +280,7 @@ namespace TDengineDriver
static extern public IntPtr FreeResult(IntPtr res); static extern public IntPtr FreeResult(IntPtr res);
[DllImport("taos", EntryPoint = "taos_close", CallingConvention = CallingConvention.Cdecl)] [DllImport("taos", EntryPoint = "taos_close", CallingConvention = CallingConvention.Cdecl)]
static extern public int Close(IntPtr taos); static extern public void Close(IntPtr taos);
//get precision of restultset //get precision of restultset
[DllImport("taos", EntryPoint = "taos_result_precision", CallingConvention = CallingConvention.Cdecl)] [DllImport("taos", EntryPoint = "taos_result_precision", CallingConvention = CallingConvention.Cdecl)]
......
...@@ -53,15 +53,9 @@ namespace Test.Fixture ...@@ -53,15 +53,9 @@ namespace Test.Fixture
{ {
if ((res = TDengine.Query(conn, $"drop database if exists {db}")) != IntPtr.Zero) if ((res = TDengine.Query(conn, $"drop database if exists {db}")) != IntPtr.Zero)
{ {
if (TDengine.Close(conn) == 0) TDengine.Close(conn);
{ Console.WriteLine("close connection success");
Console.WriteLine("close connection success");
}
else
{
throw new Exception("close connection failed");
}
} }
else else
{ {
......
...@@ -158,14 +158,12 @@ namespace Test.UtilsTools ...@@ -158,14 +158,12 @@ namespace Test.UtilsTools
ExecuteUpdate(conn, "drop database if exists csharp"); ExecuteUpdate(conn, "drop database if exists csharp");
if (conn != IntPtr.Zero) if (conn != IntPtr.Zero)
{ {
if (TDengine.Close(conn) == 0) TDengine.Close(conn);
{ Console.WriteLine("close connection success");
Console.WriteLine("close connection success"); }
} else
else {
{ throw new Exception("connection if already null");
Console.WriteLine("close Connection failed");
}
} }
} }
public static List<TDengineMeta> GetResField(IntPtr res) public static List<TDengineMeta> GetResField(IntPtr res)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册