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

[TD-13947]<fix>:csharp connector fix typo (#10701)

* [TD-13947]<fix>:csharp connector fix typo

* [TD-13947]<fix>:fix unmanaged type variable name
上级 8ba840ab
...@@ -14,11 +14,11 @@ namespace Sample.UtilsTools ...@@ -14,11 +14,11 @@ namespace Sample.UtilsTools
static string db = ""; static string db = "";
static short port = 0; static short port = 0;
static string globalDbName = "csharp_example_db"; static string globalDbName = "csharp_example_db";
//get a tdengine connection //get a TDengine connection
public static IntPtr TDConnection() public static IntPtr TDConnection()
{ {
TDengine.Options((int)TDengineInitOption.TDDB_OPTION_CONFIGDIR, GetConfigPath()); TDengine.Options((int)TDengineInitOption.TSDB_OPTION_CONFIGDIR, GetConfigPath());
TDengine.Options((int)TDengineInitOption.TDDB_OPTION_SHELL_ACTIVITY_TIMER, "60"); TDengine.Options((int)TDengineInitOption.TSDB_OPTION_SHELL_ACTIVITY_TIMER, "60");
TDengine.Init(); TDengine.Init();
IntPtr conn = TDengine.Connect(ip, user, password, db, port); IntPtr conn = TDengine.Connect(ip, user, password, db, port);
...@@ -100,18 +100,18 @@ namespace Sample.UtilsTools ...@@ -100,18 +100,18 @@ namespace Sample.UtilsTools
ExitProgram(); ExitProgram();
} }
List<TDengineMeta> metas = GetResField(res); List<TDengineMeta> metaList = GetResField(res);
int fieldCount = metas.Count; int fieldCount = metaList.Count;
// metas.ForEach((item) => { Console.Write("{0} ({1}) \t|\t", item.name, item.size); }); // metaList.ForEach((item) => { Console.Write("{0} ({1}) \t|\t", item.name, item.size); });
List<Object> datas = QueryRes(res, metas); List<Object> dataList = QueryRes(res, metaList);
for (int index = 0; index < datas.Count; index++) for (int index = 0; index < dataList.Count; index++)
{ {
if (index % fieldCount == 0 && index != 0) if (index % fieldCount == 0 && index != 0)
{ {
Console.WriteLine(""); Console.WriteLine("");
} }
Console.Write("{0} \t|\t", datas[index].ToString()); Console.Write("{0} \t|\t", dataList[index].ToString());
} }
Console.WriteLine(""); Console.WriteLine("");
...@@ -127,10 +127,10 @@ namespace Sample.UtilsTools ...@@ -127,10 +127,10 @@ namespace Sample.UtilsTools
ExitProgram(); ExitProgram();
} }
List<TDengineMeta> metas = GetResField(res); List<TDengineMeta> meta = GetResField(res);
result.Add(colName); result.Add(colName);
dataRaw = QueryRes(res, metas); dataRaw = QueryRes(res, meta);
result.Add(dataRaw); result.Add(dataRaw);
if (TDengine.ErrorNo(res) != 0) if (TDengine.ErrorNo(res) != 0)
...@@ -161,7 +161,7 @@ namespace Sample.UtilsTools ...@@ -161,7 +161,7 @@ namespace Sample.UtilsTools
{ {
if (TDengine.Close(conn) == 0) if (TDengine.Close(conn) == 0)
{ {
Console.WriteLine("close connection sucess"); Console.WriteLine("close connection success");
} }
else else
{ {
...@@ -171,8 +171,8 @@ namespace Sample.UtilsTools ...@@ -171,8 +171,8 @@ namespace Sample.UtilsTools
} }
public static List<TDengineMeta> GetResField(IntPtr res) public static List<TDengineMeta> GetResField(IntPtr res)
{ {
List<TDengineMeta> metas = TDengine.FetchFields(res); List<TDengineMeta> meta = TDengine.FetchFields(res);
return metas; return meta;
} }
public static void ExitProgram() public static void ExitProgram()
{ {
...@@ -187,16 +187,16 @@ namespace Sample.UtilsTools ...@@ -187,16 +187,16 @@ namespace Sample.UtilsTools
{ {
ExitProgram(); ExitProgram();
} }
List<TDengineMeta> metas = GetResField(res); List<TDengineMeta> meta = GetResField(res);
dataRaw = QueryRes(res, metas); dataRaw = QueryRes(res, meta);
return dataRaw; return dataRaw;
} }
private static List<Object> QueryRes(IntPtr res, List<TDengineMeta> metas) private static List<Object> QueryRes(IntPtr res, List<TDengineMeta> meta)
{ {
IntPtr taosRow; IntPtr taosRow;
List<Object> dataRaw = new List<Object>(); List<Object> dataRaw = new List<Object>();
int fieldCount = metas.Count; int fieldCount = meta.Count;
while ((taosRow = TDengine.FetchRows(res)) != IntPtr.Zero) while ((taosRow = TDengine.FetchRows(res)) != IntPtr.Zero)
{ {
dataRaw.AddRange(FetchRow(taosRow,res)); dataRaw.AddRange(FetchRow(taosRow,res));
...@@ -295,7 +295,7 @@ namespace Sample.UtilsTools ...@@ -295,7 +295,7 @@ namespace Sample.UtilsTools
dataRaw.Add(v16); dataRaw.Add(v16);
break; break;
default: default:
dataRaw.Add("nonsupport data type value"); dataRaw.Add("nonsupport data type");
break; break;
} }
......
...@@ -44,8 +44,8 @@ namespace TDengineDriver ...@@ -44,8 +44,8 @@ namespace TDengineDriver
TSDB_OPTION_LOCALE = 0, TSDB_OPTION_LOCALE = 0,
TSDB_OPTION_CHARSET = 1, TSDB_OPTION_CHARSET = 1,
TSDB_OPTION_TIMEZONE = 2, TSDB_OPTION_TIMEZONE = 2,
TDDB_OPTION_CONFIGDIR = 3, TSDB_OPTION_CONFIGDIR = 3,
TDDB_OPTION_SHELL_ACTIVITY_TIMER = 4 TSDB_OPTION_SHELL_ACTIVITY_TIMER = 4
} }
enum TaosField enum TaosField
{ {
...@@ -147,7 +147,7 @@ namespace TDengineDriver ...@@ -147,7 +147,7 @@ namespace TDengineDriver
/// <summary> /// <summary>
/// User defined callback function for interface "QueryAsync()" /// User defined callback function for interface "QueryAsync()"
/// ,actually is a delegate in .Net. /// ,actually is a delegate in .Net.
/// This function aim to handel the taoRes which points to /// This function aim to handle the taoRes which points to
/// the caller method's sql resultset. /// the caller method's sql resultset.
/// </summary> /// </summary>
/// <param name="param"> This parameter will sent by caller method (QueryAsync()).</param> /// <param name="param"> This parameter will sent by caller method (QueryAsync()).</param>
...@@ -234,10 +234,10 @@ namespace TDengineDriver ...@@ -234,10 +234,10 @@ namespace TDengineDriver
{ {
// const int fieldSize = 68; // const int fieldSize = 68;
List<TDengineMeta> metas = new List<TDengineMeta>(); List<TDengineMeta> metaList = new List<TDengineMeta>();
if (res == IntPtr.Zero) if (res == IntPtr.Zero)
{ {
return metas; return metaList;
} }
int fieldCount = FieldCount(res); int fieldCount = FieldCount(res);
...@@ -250,11 +250,11 @@ namespace TDengineDriver ...@@ -250,11 +250,11 @@ namespace TDengineDriver
meta.name = Marshal.PtrToStringAnsi(fieldsPtr + offset); meta.name = Marshal.PtrToStringAnsi(fieldsPtr + offset);
meta.type = Marshal.ReadByte(fieldsPtr + offset + (int)TaosField.TYPE_OFFSET); meta.type = Marshal.ReadByte(fieldsPtr + offset + (int)TaosField.TYPE_OFFSET);
meta.size = Marshal.ReadInt16(fieldsPtr + offset + (int)TaosField.BYTES_OFFSET); meta.size = Marshal.ReadInt16(fieldsPtr + offset + (int)TaosField.BYTES_OFFSET);
metas.Add(meta); metaList.Add(meta);
} }
return metas; return metaList;
} }
[DllImport("taos", EntryPoint = "taos_fetch_row", CallingConvention = CallingConvention.Cdecl)] [DllImport("taos", EntryPoint = "taos_fetch_row", CallingConvention = CallingConvention.Cdecl)]
...@@ -430,7 +430,7 @@ namespace TDengineDriver ...@@ -430,7 +430,7 @@ namespace TDengineDriver
/// returned in this API is unknown. /// returned in this API is unknown.
/// </summary> /// </summary>
/// <param name="stmt">could be the value returned by 'StmtInit', that may be a valid object or NULL.</param> /// <param name="stmt">could be the value returned by 'StmtInit', that may be a valid object or NULL.</param>
/// <returns>piont the error message</returns> /// <returns>point the error message</returns>
[DllImport("taos", EntryPoint = "taos_stmt_errstr", CallingConvention = CallingConvention.Cdecl)] [DllImport("taos", EntryPoint = "taos_stmt_errstr", CallingConvention = CallingConvention.Cdecl)]
static extern private IntPtr StmtErrPtr(IntPtr stmt); static extern private IntPtr StmtErrPtr(IntPtr stmt);
...@@ -452,9 +452,9 @@ namespace TDengineDriver ...@@ -452,9 +452,9 @@ namespace TDengineDriver
// Async Query // Async Query
/// <summary> /// <summary>
/// This API uses non-blocking call mode. /// This API uses non-blocking call mode.
/// Application can open mutilple tables and manipulate(query or insert) opened table concurrently. /// Application can open multiple tables and manipulate(query or insert) opened table concurrently.
/// So applications must ensure that opetations on the same table is compeletly serialized. /// So applications must ensure that opetations on the same table is completely serialized.
/// Becuase that will cause some query and insert operations cannot be performed. /// Because that will cause some query and insert operations cannot be performed.
/// </summary> /// </summary>
/// <param name="taos"> A taos connection return by Connect()</param> /// <param name="taos"> A taos connection return by Connect()</param>
/// <param name="sql">sql command need to execute</param> /// <param name="sql">sql command need to execute</param>
...@@ -575,7 +575,7 @@ namespace TDengineDriver ...@@ -575,7 +575,7 @@ namespace TDengineDriver
/// </param> /// </param>
/// <param name="param">First parameter provide by application for callback usage. /// <param name="param">First parameter provide by application for callback usage.
/// While callback,this parameter is provided to the application.</param> /// While callback,this parameter is provided to the application.</param>
/// <param name="callback2">The second callback function which will be caled when the continuous query /// <param name="callback2">The second callback function which will be called when the continuous query
/// stop automatically.</param> /// stop automatically.</param>
/// <returns> Return null indicate creation failed, not null for success.</returns> /// <returns> Return null indicate creation failed, not null for success.</returns>
[DllImport("taos", EntryPoint = "taos_open_stream", CallingConvention = CallingConvention.Cdecl)] [DllImport("taos", EntryPoint = "taos_open_stream", CallingConvention = CallingConvention.Cdecl)]
......
...@@ -17,17 +17,17 @@ namespace TDengineDriver ...@@ -17,17 +17,17 @@ namespace TDengineDriver
TAOS_BIND bind = new TAOS_BIND(); TAOS_BIND bind = new TAOS_BIND();
byte[] boolByteArr = BitConverter.GetBytes(val); byte[] boolByteArr = BitConverter.GetBytes(val);
int boolByteArrSize = Marshal.SizeOf(boolByteArr[0]) * boolByteArr.Length; int boolByteArrSize = Marshal.SizeOf(boolByteArr[0]) * boolByteArr.Length;
IntPtr bo = Marshal.AllocHGlobal(1); IntPtr c_bool = Marshal.AllocHGlobal(1);
Marshal.Copy(boolByteArr, 0, bo, boolByteArr.Length); Marshal.Copy(boolByteArr, 0, c_bool, boolByteArr.Length);
int length = sizeof(Boolean); int length = sizeof(Boolean);
IntPtr lengPtr = Marshal.AllocHGlobal(sizeof(int)); IntPtr lengthPtr = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(lengPtr, length); Marshal.WriteInt32(lengthPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_BOOL; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_BOOL;
bind.buffer = bo; bind.buffer = c_bool;
bind.buffer_length = length; bind.buffer_length = length;
bind.length = lengPtr; bind.length = lengthPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
return bind; return bind;
...@@ -38,17 +38,17 @@ namespace TDengineDriver ...@@ -38,17 +38,17 @@ namespace TDengineDriver
byte[] tinyIntByteArr = BitConverter.GetBytes(val); byte[] tinyIntByteArr = BitConverter.GetBytes(val);
int tinyIntByteArrSize = Marshal.SizeOf(tinyIntByteArr[0]) * tinyIntByteArr.Length; int tinyIntByteArrSize = Marshal.SizeOf(tinyIntByteArr[0]) * tinyIntByteArr.Length;
IntPtr uManageTinyInt = Marshal.AllocHGlobal(tinyIntByteArrSize); IntPtr c_tinyint = Marshal.AllocHGlobal(tinyIntByteArrSize);
Marshal.Copy(tinyIntByteArr, 0, uManageTinyInt, tinyIntByteArr.Length); Marshal.Copy(tinyIntByteArr, 0, c_tinyint, tinyIntByteArr.Length);
int length = sizeof(sbyte); int length = sizeof(sbyte);
IntPtr lengPtr = Marshal.AllocHGlobal(sizeof(int)); IntPtr lengthPtr = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(lengPtr, length); Marshal.WriteInt32(lengthPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_TINYINT; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_TINYINT;
bind.buffer = uManageTinyInt; bind.buffer = c_tinyint;
bind.buffer_length = length; bind.buffer_length = length;
bind.length = lengPtr; bind.length = lengthPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
return bind; return bind;
...@@ -58,17 +58,17 @@ namespace TDengineDriver ...@@ -58,17 +58,17 @@ namespace TDengineDriver
{ {
TAOS_BIND bind = new TAOS_BIND(); TAOS_BIND bind = new TAOS_BIND();
IntPtr uManageSmallInt = Marshal.AllocHGlobal(sizeof(short)); IntPtr c_smallint = Marshal.AllocHGlobal(sizeof(short));
Marshal.WriteInt16(uManageSmallInt, val); Marshal.WriteInt16(c_smallint, val);
int length = sizeof(short); int length = sizeof(short);
IntPtr lengPtr = Marshal.AllocHGlobal(sizeof(int)); IntPtr lengthPtr = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(lengPtr, length); Marshal.WriteInt32(lengthPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_SMALLINT; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_SMALLINT;
bind.buffer = uManageSmallInt; bind.buffer = c_smallint;
bind.buffer_length = length; bind.buffer_length = length;
bind.length = lengPtr; bind.length = lengthPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
return bind; return bind;
...@@ -77,17 +77,17 @@ namespace TDengineDriver ...@@ -77,17 +77,17 @@ namespace TDengineDriver
public static TAOS_BIND BindInt(int val) public static TAOS_BIND BindInt(int val)
{ {
TAOS_BIND bind = new TAOS_BIND(); TAOS_BIND bind = new TAOS_BIND();
IntPtr uManageInt = Marshal.AllocHGlobal(sizeof(int)); IntPtr c_int = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(uManageInt, val); Marshal.WriteInt32(c_int, val);
int length = sizeof(int); int length = sizeof(int);
IntPtr lengPtr = Marshal.AllocHGlobal(sizeof(int)); IntPtr lengthPtr = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(lengPtr, length); Marshal.WriteInt32(lengthPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_INT; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_INT;
bind.buffer = uManageInt; bind.buffer = c_int;
bind.buffer_length = length; bind.buffer_length = length;
bind.length = lengPtr; bind.length = lengthPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
return bind; return bind;
...@@ -97,17 +97,17 @@ namespace TDengineDriver ...@@ -97,17 +97,17 @@ namespace TDengineDriver
{ {
TAOS_BIND bind = new TAOS_BIND(); TAOS_BIND bind = new TAOS_BIND();
IntPtr uManageBigInt = Marshal.AllocHGlobal(sizeof(long)); IntPtr c_bigint = Marshal.AllocHGlobal(sizeof(long));
Marshal.WriteInt64(uManageBigInt, val); Marshal.WriteInt64(c_bigint, val);
int length = sizeof(long); int length = sizeof(long);
IntPtr lengPtr = Marshal.AllocHGlobal(sizeof(int)); IntPtr lengthPtr = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(lengPtr, length); Marshal.WriteInt32(lengthPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_BIGINT; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_BIGINT;
bind.buffer = uManageBigInt; bind.buffer = c_bigint;
bind.buffer_length = length; bind.buffer_length = length;
bind.length = lengPtr; bind.length = lengthPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
return bind; return bind;
...@@ -117,17 +117,17 @@ namespace TDengineDriver ...@@ -117,17 +117,17 @@ namespace TDengineDriver
{ {
TAOS_BIND bind = new TAOS_BIND(); TAOS_BIND bind = new TAOS_BIND();
IntPtr uManageTinyInt = Marshal.AllocHGlobal(sizeof(byte)); IntPtr c_unsigned_tinyint = Marshal.AllocHGlobal(sizeof(byte));
Marshal.WriteByte(uManageTinyInt, val); Marshal.WriteByte(c_unsigned_tinyint, val);
int length = sizeof(byte); int length = sizeof(byte);
IntPtr lengPtr = Marshal.AllocHGlobal(sizeof(int)); IntPtr lengthPtr = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(lengPtr, length); Marshal.WriteInt32(lengthPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_UTINYINT; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_UTINYINT;
bind.buffer = uManageTinyInt; bind.buffer = c_unsigned_tinyint;
bind.buffer_length = length; bind.buffer_length = length;
bind.length = lengPtr; bind.length = lengthPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
return bind; return bind;
...@@ -139,17 +139,17 @@ namespace TDengineDriver ...@@ -139,17 +139,17 @@ namespace TDengineDriver
byte[] uSmallIntByteArr = BitConverter.GetBytes(val); byte[] uSmallIntByteArr = BitConverter.GetBytes(val);
int usmallSize = Marshal.SizeOf(uSmallIntByteArr[0]) * uSmallIntByteArr.Length; int usmallSize = Marshal.SizeOf(uSmallIntByteArr[0]) * uSmallIntByteArr.Length;
IntPtr uManageUnsignSmallInt = Marshal.AllocHGlobal(usmallSize); IntPtr c_unsigned_smallint = Marshal.AllocHGlobal(usmallSize);
Marshal.Copy(uSmallIntByteArr, 0, uManageUnsignSmallInt, uSmallIntByteArr.Length); Marshal.Copy(uSmallIntByteArr, 0, c_unsigned_smallint, uSmallIntByteArr.Length);
int length = sizeof(UInt16); int length = sizeof(UInt16);
IntPtr lengPtr = Marshal.AllocHGlobal(sizeof(int)); IntPtr lengthPtr = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(lengPtr, length); Marshal.WriteInt32(lengthPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_USMALLINT; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_USMALLINT;
bind.buffer = uManageUnsignSmallInt; bind.buffer = c_unsigned_smallint;
bind.buffer_length = length; bind.buffer_length = length;
bind.length = lengPtr; bind.length = lengthPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
return bind; return bind;
...@@ -159,19 +159,19 @@ namespace TDengineDriver ...@@ -159,19 +159,19 @@ namespace TDengineDriver
{ {
TAOS_BIND bind = new TAOS_BIND(); TAOS_BIND bind = new TAOS_BIND();
byte[] uManageIntByteArr = BitConverter.GetBytes(val); byte[] byteArr = BitConverter.GetBytes(val);
int usmallSize = Marshal.SizeOf(uManageIntByteArr[0]) * uManageIntByteArr.Length; int usmallSize = Marshal.SizeOf(byteArr[0]) * byteArr.Length;
IntPtr uManageInt = Marshal.AllocHGlobal(usmallSize); IntPtr c_unsigned_int = Marshal.AllocHGlobal(usmallSize);
Marshal.Copy(uManageIntByteArr, 0, uManageInt, uManageIntByteArr.Length); Marshal.Copy(byteArr, 0, c_unsigned_int, byteArr.Length);
int length = sizeof(uint); int length = sizeof(uint);
IntPtr lengPtr = Marshal.AllocHGlobal(sizeof(int)); IntPtr lengthPtr = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(lengPtr, length); Marshal.WriteInt32(lengthPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_UINT; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_UINT;
bind.buffer = uManageInt; bind.buffer = c_unsigned_int;
bind.buffer_length = length; bind.buffer_length = length;
bind.length = lengPtr; bind.length = lengthPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
return bind; return bind;
...@@ -181,19 +181,19 @@ namespace TDengineDriver ...@@ -181,19 +181,19 @@ namespace TDengineDriver
{ {
TAOS_BIND bind = new TAOS_BIND(); TAOS_BIND bind = new TAOS_BIND();
byte[] uManageBigIntByteArr = BitConverter.GetBytes(val); byte[] byteArr = BitConverter.GetBytes(val);
int usmallSize = Marshal.SizeOf(uManageBigIntByteArr[0]) * uManageBigIntByteArr.Length; int usmallSize = Marshal.SizeOf(byteArr[0]) * byteArr.Length;
IntPtr uManageBigInt = Marshal.AllocHGlobal(usmallSize); IntPtr c_unsigned_bigint = Marshal.AllocHGlobal(usmallSize);
Marshal.Copy(uManageBigIntByteArr, 0, uManageBigInt, uManageBigIntByteArr.Length); Marshal.Copy(byteArr, 0, c_unsigned_bigint, byteArr.Length);
int length = sizeof(ulong); int length = sizeof(ulong);
IntPtr lengPtr = Marshal.AllocHGlobal(sizeof(int)); IntPtr lengthPtr = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(lengPtr, length); Marshal.WriteInt32(lengthPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_UBIGINT; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_UBIGINT;
bind.buffer = uManageBigInt; bind.buffer = c_unsigned_bigint;
bind.buffer_length = length; bind.buffer_length = length;
bind.length = lengPtr; bind.length = lengthPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
return bind; return bind;
...@@ -203,19 +203,19 @@ namespace TDengineDriver ...@@ -203,19 +203,19 @@ namespace TDengineDriver
{ {
TAOS_BIND bind = new TAOS_BIND(); TAOS_BIND bind = new TAOS_BIND();
byte[] floatByteArr = BitConverter.GetBytes(val); byte[] byteArr = BitConverter.GetBytes(val);
int floatByteArrSize = Marshal.SizeOf(floatByteArr[0]) * floatByteArr.Length; int floatByteArrSize = Marshal.SizeOf(byteArr[0]) * byteArr.Length;
IntPtr uManageFloat = Marshal.AllocHGlobal(floatByteArrSize); IntPtr c_float = Marshal.AllocHGlobal(floatByteArrSize);
Marshal.Copy(floatByteArr, 0, uManageFloat, floatByteArr.Length); Marshal.Copy(byteArr, 0, c_float, byteArr.Length);
int length = sizeof(float); int length = sizeof(float);
IntPtr lengPtr = Marshal.AllocHGlobal(sizeof(int)); IntPtr lengthPtr = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(lengPtr, length); Marshal.WriteInt32(lengthPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_FLOAT; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_FLOAT;
bind.buffer = uManageFloat; bind.buffer = c_float;
bind.buffer_length = length; bind.buffer_length = length;
bind.length = lengPtr; bind.length = lengthPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
return bind; return bind;
...@@ -225,19 +225,19 @@ namespace TDengineDriver ...@@ -225,19 +225,19 @@ namespace TDengineDriver
{ {
TAOS_BIND bind = new TAOS_BIND(); TAOS_BIND bind = new TAOS_BIND();
byte[] doubleByteArr = BitConverter.GetBytes(val); byte[] byteArr = BitConverter.GetBytes(val);
int doubleByteArrSize = Marshal.SizeOf(doubleByteArr[0]) * doubleByteArr.Length; int doubleByteArrSize = Marshal.SizeOf(byteArr[0]) * byteArr.Length;
IntPtr uManageDouble = Marshal.AllocHGlobal(doubleByteArrSize); IntPtr c_double = Marshal.AllocHGlobal(doubleByteArrSize);
Marshal.Copy(doubleByteArr, 0, uManageDouble, doubleByteArr.Length); Marshal.Copy(byteArr, 0, c_double, byteArr.Length);
int length = sizeof(Double); int length = sizeof(Double);
IntPtr lengPtr = Marshal.AllocHGlobal(sizeof(int)); IntPtr lengthPtr = Marshal.AllocHGlobal(sizeof(int));
Marshal.WriteInt32(lengPtr, length); Marshal.WriteInt32(lengthPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_DOUBLE; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_DOUBLE;
bind.buffer = uManageDouble; bind.buffer = c_double;
bind.buffer_length = length; bind.buffer_length = length;
bind.length = lengPtr; bind.length = lengthPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
return bind; return bind;
...@@ -247,17 +247,17 @@ namespace TDengineDriver ...@@ -247,17 +247,17 @@ namespace TDengineDriver
{ {
TAOS_BIND bind = new TAOS_BIND(); TAOS_BIND bind = new TAOS_BIND();
// IntPtr umanageBinary = Marshal.StringToHGlobalAnsi(val); // IntPtr unmanagedBinary = Marshal.StringToHGlobalAnsi(val);
IntPtr umanageBinary = Marshal.StringToCoTaskMemUTF8(val); IntPtr c_str = Marshal.StringToCoTaskMemUTF8(val);
var strToBytes = System.Text.Encoding.UTF8.GetBytes(val); var strToBytes = System.Text.Encoding.UTF8.GetBytes(val);
int leng = strToBytes.Length; int length = strToBytes.Length;
IntPtr lenPtr = Marshal.AllocHGlobal(sizeof(ulong)); IntPtr lenPtr = Marshal.AllocHGlobal(sizeof(ulong));
Marshal.WriteInt64(lenPtr, leng); Marshal.WriteInt64(lenPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_BINARY; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_BINARY;
bind.buffer = umanageBinary; bind.buffer = c_str;
bind.buffer_length = leng; bind.buffer_length = length;
bind.length = lenPtr; bind.length = lenPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
...@@ -267,17 +267,17 @@ namespace TDengineDriver ...@@ -267,17 +267,17 @@ namespace TDengineDriver
{ {
TAOS_BIND bind = new TAOS_BIND(); TAOS_BIND bind = new TAOS_BIND();
var strToBytes = System.Text.Encoding.UTF8.GetBytes(val); var strToBytes = System.Text.Encoding.UTF8.GetBytes(val);
// IntPtr umanageNchar = (IntPtr)Marshal.StringToHGlobalAnsi(val); // IntPtr unmanagedNchar = (IntPtr)Marshal.StringToHGlobalAnsi(val);
IntPtr umanageNchar = (IntPtr)Marshal.StringToCoTaskMemUTF8(val); IntPtr c_str = (IntPtr)Marshal.StringToCoTaskMemUTF8(val);
int leng = strToBytes.Length; int length = strToBytes.Length;
IntPtr lenPtr = Marshal.AllocHGlobal(sizeof(ulong)); IntPtr lenPtr = Marshal.AllocHGlobal(sizeof(ulong));
Marshal.WriteInt64(lenPtr, leng); Marshal.WriteInt64(lenPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_NCHAR; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_NCHAR;
bind.buffer = umanageNchar; bind.buffer = c_str;
bind.buffer_length = leng; bind.buffer_length = length;
bind.length = lenPtr; bind.length = lenPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
...@@ -301,17 +301,17 @@ namespace TDengineDriver ...@@ -301,17 +301,17 @@ namespace TDengineDriver
{ {
TAOS_BIND bind = new TAOS_BIND(); TAOS_BIND bind = new TAOS_BIND();
IntPtr uManageTs = Marshal.AllocHGlobal(sizeof(long)); IntPtr c_long = Marshal.AllocHGlobal(sizeof(long));
Marshal.WriteInt64(uManageTs, ts); Marshal.WriteInt64(c_long, ts);
int length = sizeof(long); int length = sizeof(long);
IntPtr lengPtr = Marshal.AllocHGlobal(4); IntPtr lengthPtr = Marshal.AllocHGlobal(4);
Marshal.WriteInt32(lengPtr, length); Marshal.WriteInt32(lengthPtr, length);
bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_TIMESTAMP; bind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_TIMESTAMP;
bind.buffer = uManageTs; bind.buffer = c_long;
bind.buffer_length = length; bind.buffer_length = length;
bind.length = lengPtr; bind.length = lengthPtr;
bind.is_null = IntPtr.Zero; bind.is_null = IntPtr.Zero;
return bind; return bind;
......
...@@ -17,7 +17,7 @@ namespace TDengineDriver ...@@ -17,7 +17,7 @@ namespace TDengineDriver
int byteSize = sizeof(byte); int byteSize = sizeof(byte);
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr unmanagedBoolArr = Marshal.AllocHGlobal(elementCount * typeSize); IntPtr c_bool_ptr = Marshal.AllocHGlobal(elementCount * typeSize);
//TAOS_MULTI_BIND.length //TAOS_MULTI_BIND.length
IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount); IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount);
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
...@@ -26,7 +26,7 @@ namespace TDengineDriver ...@@ -26,7 +26,7 @@ namespace TDengineDriver
for (int i = 0; i < elementCount; i++) for (int i = 0; i < elementCount; i++)
{ {
//set TAOS_MULTI_BIND.buffer //set TAOS_MULTI_BIND.buffer
Marshal.WriteByte(unmanagedBoolArr, typeSize * i, Convert.ToByte(arr[i] ?? false)); Marshal.WriteByte(c_bool_ptr, typeSize * i, Convert.ToByte(arr[i] ?? false));
//set TAOS_MULTI_BIND.length //set TAOS_MULTI_BIND.length
Marshal.WriteInt32(lengthArr, intSize * i, typeSize); Marshal.WriteInt32(lengthArr, intSize * i, typeSize);
//set TAOS_MULTI_BIND.is_null //set TAOS_MULTI_BIND.is_null
...@@ -34,7 +34,7 @@ namespace TDengineDriver ...@@ -34,7 +34,7 @@ namespace TDengineDriver
} }
//config TAOS_MULTI_BIND //config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_BOOL; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_BOOL;
multiBind.buffer = unmanagedBoolArr; multiBind.buffer = c_bool_ptr;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
...@@ -53,7 +53,7 @@ namespace TDengineDriver ...@@ -53,7 +53,7 @@ namespace TDengineDriver
int intSize = sizeof(int); int intSize = sizeof(int);
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr unmanagedTintIntArr = Marshal.AllocHGlobal(elementCount); IntPtr c_tinyint_ptr = Marshal.AllocHGlobal(elementCount);
//TAOS_MULTI_BIND.length //TAOS_MULTI_BIND.length
IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount); IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount);
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
...@@ -64,7 +64,7 @@ namespace TDengineDriver ...@@ -64,7 +64,7 @@ namespace TDengineDriver
Byte[] toByteArr = BitConverter.GetBytes(arr[i] ?? sbyte.MinValue); Byte[] toByteArr = BitConverter.GetBytes(arr[i] ?? sbyte.MinValue);
//set TAOS_MULTI_BIND.buffer //set TAOS_MULTI_BIND.buffer
Marshal.WriteByte(unmanagedTintIntArr, typeSize * i, toByteArr[0]); Marshal.WriteByte(c_tinyint_ptr, typeSize * i, toByteArr[0]);
//set TAOS_MULTI_BIND.length //set TAOS_MULTI_BIND.length
Marshal.WriteInt32(lengthArr, intSize * i, typeSize); Marshal.WriteInt32(lengthArr, intSize * i, typeSize);
//set TAOS_MULTI_BIND.is_null //set TAOS_MULTI_BIND.is_null
...@@ -73,7 +73,7 @@ namespace TDengineDriver ...@@ -73,7 +73,7 @@ namespace TDengineDriver
//config TAOS_MULTI_BIND //config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_TINYINT; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_TINYINT;
multiBind.buffer = unmanagedTintIntArr; multiBind.buffer = c_tinyint_ptr;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
...@@ -92,7 +92,7 @@ namespace TDengineDriver ...@@ -92,7 +92,7 @@ namespace TDengineDriver
int byteSize = sizeof(byte); int byteSize = sizeof(byte);
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr unmanagedSmallIntArr = Marshal.AllocHGlobal(elementCount * typeSize); IntPtr c_smallint_ptr = Marshal.AllocHGlobal(elementCount * typeSize);
//TAOS_MULTI_BIND.length //TAOS_MULTI_BIND.length
IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount); IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount);
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
...@@ -101,7 +101,7 @@ namespace TDengineDriver ...@@ -101,7 +101,7 @@ namespace TDengineDriver
for (int i = 0; i < elementCount; i++) for (int i = 0; i < elementCount; i++)
{ {
//set TAOS_MULTI_BIND.buffer //set TAOS_MULTI_BIND.buffer
Marshal.WriteInt16(unmanagedSmallIntArr, typeSize * i, arr[i] ?? short.MinValue); Marshal.WriteInt16(c_smallint_ptr, typeSize * i, arr[i] ?? short.MinValue);
//set TAOS_MULTI_BIND.length //set TAOS_MULTI_BIND.length
Marshal.WriteInt32(lengthArr, intSize * i, typeSize); Marshal.WriteInt32(lengthArr, intSize * i, typeSize);
//set TAOS_MULTI_BIND.is_null //set TAOS_MULTI_BIND.is_null
...@@ -110,7 +110,7 @@ namespace TDengineDriver ...@@ -110,7 +110,7 @@ namespace TDengineDriver
} }
//config TAOS_MULTI_BIND //config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_SMALLINT; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_SMALLINT;
multiBind.buffer = unmanagedSmallIntArr; multiBind.buffer = c_smallint_ptr;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
...@@ -127,7 +127,7 @@ namespace TDengineDriver ...@@ -127,7 +127,7 @@ namespace TDengineDriver
int byteSize = sizeof(byte); int byteSize = sizeof(byte);
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr intBuff = Marshal.AllocHGlobal(typeSize * elementCount); IntPtr c_int_ptr = Marshal.AllocHGlobal(typeSize * elementCount);
//TAOS_MULTI_BIND.length //TAOS_MULTI_BIND.length
IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount); IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount);
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
...@@ -136,7 +136,7 @@ namespace TDengineDriver ...@@ -136,7 +136,7 @@ namespace TDengineDriver
for (int i = 0; i < elementCount; i++) for (int i = 0; i < elementCount; i++)
{ {
//set TAOS_MULTI_BIND.buffer //set TAOS_MULTI_BIND.buffer
Marshal.WriteInt32(intBuff, typeSize * i, arr[i] ?? int.MinValue); Marshal.WriteInt32(c_int_ptr, typeSize * i, arr[i] ?? int.MinValue);
//set TAOS_MULTI_BIND.length //set TAOS_MULTI_BIND.length
Marshal.WriteInt32(lengthArr, intSize * i, typeSize); Marshal.WriteInt32(lengthArr, intSize * i, typeSize);
//set TAOS_MULTI_BIND.is_null //set TAOS_MULTI_BIND.is_null
...@@ -145,7 +145,7 @@ namespace TDengineDriver ...@@ -145,7 +145,7 @@ namespace TDengineDriver
} }
//config TAOS_MULTI_BIND //config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_INT; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_INT;
multiBind.buffer = intBuff; multiBind.buffer = c_int_ptr;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
...@@ -162,7 +162,7 @@ namespace TDengineDriver ...@@ -162,7 +162,7 @@ namespace TDengineDriver
int byteSize = sizeof(byte); int byteSize = sizeof(byte);
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr intBuff = Marshal.AllocHGlobal(typeSize * elementCount); IntPtr c_long_ptr = Marshal.AllocHGlobal(typeSize * elementCount);
//TAOS_MULTI_BIND.length //TAOS_MULTI_BIND.length
IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount); IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount);
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
...@@ -171,7 +171,7 @@ namespace TDengineDriver ...@@ -171,7 +171,7 @@ namespace TDengineDriver
for (int i = 0; i < elementCount; i++) for (int i = 0; i < elementCount; i++)
{ {
//set TAOS_MULTI_BIND.buffer //set TAOS_MULTI_BIND.buffer
Marshal.WriteInt64(intBuff, typeSize * i, arr[i] ?? long.MinValue); Marshal.WriteInt64(c_long_ptr, typeSize * i, arr[i] ?? long.MinValue);
//set TAOS_MULTI_BIND.length //set TAOS_MULTI_BIND.length
Marshal.WriteInt32(lengthArr, intSize * i, typeSize); Marshal.WriteInt32(lengthArr, intSize * i, typeSize);
//set TAOS_MULTI_BIND.is_null //set TAOS_MULTI_BIND.is_null
...@@ -181,7 +181,7 @@ namespace TDengineDriver ...@@ -181,7 +181,7 @@ namespace TDengineDriver
} }
//config TAOS_MULTI_BIND //config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_BIGINT; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_BIGINT;
multiBind.buffer = intBuff; multiBind.buffer = c_long_ptr;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
...@@ -200,7 +200,7 @@ namespace TDengineDriver ...@@ -200,7 +200,7 @@ namespace TDengineDriver
float[] arrTmp = new float[elementCount]; float[] arrTmp = new float[elementCount];
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr floatBuff = Marshal.AllocHGlobal(typeSize * elementCount); IntPtr c_float_ptr = Marshal.AllocHGlobal(typeSize * elementCount);
//TAOS_MULTI_BIND.length //TAOS_MULTI_BIND.length
IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount); IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount);
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
...@@ -216,11 +216,11 @@ namespace TDengineDriver ...@@ -216,11 +216,11 @@ namespace TDengineDriver
Marshal.WriteByte(nullArr, byteSize * i, Convert.ToByte(arr[i].Equals(null) ? 1 : 0)); Marshal.WriteByte(nullArr, byteSize * i, Convert.ToByte(arr[i].Equals(null) ? 1 : 0));
} }
//set TAOS_MULTI_BIND.buffer //set TAOS_MULTI_BIND.buffer
Marshal.Copy(arrTmp, 0, floatBuff, elementCount); Marshal.Copy(arrTmp, 0, c_float_ptr, elementCount);
//config TAOS_MULTI_BIND //config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_FLOAT; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_FLOAT;
multiBind.buffer = floatBuff; multiBind.buffer = c_float_ptr;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
...@@ -239,7 +239,7 @@ namespace TDengineDriver ...@@ -239,7 +239,7 @@ namespace TDengineDriver
double[] arrTmp = new double[elementCount]; double[] arrTmp = new double[elementCount];
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr doubleBuff = Marshal.AllocHGlobal(typeSize * elementCount); IntPtr c_double_ptr = Marshal.AllocHGlobal(typeSize * elementCount);
//TAOS_MULTI_BIND.length //TAOS_MULTI_BIND.length
IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount); IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount);
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
...@@ -255,11 +255,11 @@ namespace TDengineDriver ...@@ -255,11 +255,11 @@ namespace TDengineDriver
Marshal.WriteByte(nullArr, byteSize * i, Convert.ToByte(arr[i].Equals(null) ? 1 : 0)); Marshal.WriteByte(nullArr, byteSize * i, Convert.ToByte(arr[i].Equals(null) ? 1 : 0));
} }
//set TAOS_MULTI_BIND.buffer //set TAOS_MULTI_BIND.buffer
Marshal.Copy(arrTmp, 0, doubleBuff, elementCount); Marshal.Copy(arrTmp, 0, c_double_ptr, elementCount);
//config TAOS_MULTI_BIND //config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_DOUBLE; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_DOUBLE;
multiBind.buffer = doubleBuff; multiBind.buffer = c_double_ptr;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
...@@ -277,7 +277,7 @@ namespace TDengineDriver ...@@ -277,7 +277,7 @@ namespace TDengineDriver
//used to replace null //used to replace null
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr uTinyIntBuff = Marshal.AllocHGlobal(typeSize * elementCount); IntPtr c_unsigned_tinyint_ptr = Marshal.AllocHGlobal(typeSize * elementCount);
//TAOS_MULTI_BIND.length //TAOS_MULTI_BIND.length
IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount); IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount);
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
...@@ -287,7 +287,7 @@ namespace TDengineDriver ...@@ -287,7 +287,7 @@ namespace TDengineDriver
for (int i = 0; i < elementCount; i++) for (int i = 0; i < elementCount; i++)
{ {
//set TAOS_MULTI_BIND.buffer //set TAOS_MULTI_BIND.buffer
Marshal.WriteByte(uTinyIntBuff, typeSize * i, arr[i] ?? byte.MaxValue); Marshal.WriteByte(c_unsigned_tinyint_ptr, typeSize * i, arr[i] ?? byte.MaxValue);
//set TAOS_MULTI_BIND.length //set TAOS_MULTI_BIND.length
Marshal.WriteInt32(lengthArr, intSize * i, typeSize); Marshal.WriteInt32(lengthArr, intSize * i, typeSize);
//set TAOS_MULTI_BIND.is_null //set TAOS_MULTI_BIND.is_null
...@@ -297,7 +297,7 @@ namespace TDengineDriver ...@@ -297,7 +297,7 @@ namespace TDengineDriver
//config TAOS_MULTI_BIND //config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_UTINYINT; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_UTINYINT;
multiBind.buffer = uTinyIntBuff; multiBind.buffer = c_unsigned_tinyint_ptr;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
...@@ -315,7 +315,7 @@ namespace TDengineDriver ...@@ -315,7 +315,7 @@ namespace TDengineDriver
//used to replace null //used to replace null
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr uSmallIntBuff = Marshal.AllocHGlobal(typeSize * elementCount); IntPtr c_unsigned_smallint_ptr = Marshal.AllocHGlobal(typeSize * elementCount);
//TAOS_MULTI_BIND.length //TAOS_MULTI_BIND.length
IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount); IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount);
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
...@@ -328,7 +328,7 @@ namespace TDengineDriver ...@@ -328,7 +328,7 @@ namespace TDengineDriver
for (int j = 0; j < byteArr.Length; j++) for (int j = 0; j < byteArr.Length; j++)
{ {
//set TAOS_MULTI_BIND.buffer //set TAOS_MULTI_BIND.buffer
Marshal.WriteByte(uSmallIntBuff, typeSize * i + j * byteSize, byteArr[j]); Marshal.WriteByte(c_unsigned_smallint_ptr, typeSize * i + j * byteSize, byteArr[j]);
} }
//set TAOS_MULTI_BIND.length //set TAOS_MULTI_BIND.length
Marshal.WriteInt32(lengthArr, intSize * i, typeSize); Marshal.WriteInt32(lengthArr, intSize * i, typeSize);
...@@ -339,7 +339,7 @@ namespace TDengineDriver ...@@ -339,7 +339,7 @@ namespace TDengineDriver
//config TAOS_MULTI_BIND //config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_USMALLINT; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_USMALLINT;
multiBind.buffer = uSmallIntBuff; multiBind.buffer = c_unsigned_smallint_ptr;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
...@@ -357,7 +357,7 @@ namespace TDengineDriver ...@@ -357,7 +357,7 @@ namespace TDengineDriver
//used to replace null //used to replace null
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr uIntBuff = Marshal.AllocHGlobal(typeSize * elementCount); IntPtr c_unsigned_int_ptr = Marshal.AllocHGlobal(typeSize * elementCount);
//TAOS_MULTI_BIND.length //TAOS_MULTI_BIND.length
IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount); IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount);
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
...@@ -370,7 +370,7 @@ namespace TDengineDriver ...@@ -370,7 +370,7 @@ namespace TDengineDriver
for (int j = 0; j < byteArr.Length; j++) for (int j = 0; j < byteArr.Length; j++)
{ {
//set TAOS_MULTI_BIND.buffer //set TAOS_MULTI_BIND.buffer
Marshal.WriteByte(uIntBuff, typeSize * i + j * byteSize, byteArr[j]); Marshal.WriteByte(c_unsigned_int_ptr, typeSize * i + j * byteSize, byteArr[j]);
} }
//set TAOS_MULTI_BIND.length //set TAOS_MULTI_BIND.length
Marshal.WriteInt32(lengthArr, intSize * i, typeSize); Marshal.WriteInt32(lengthArr, intSize * i, typeSize);
...@@ -381,7 +381,7 @@ namespace TDengineDriver ...@@ -381,7 +381,7 @@ namespace TDengineDriver
//config TAOS_MULTI_BIND //config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_UINT; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_UINT;
multiBind.buffer = uIntBuff; multiBind.buffer = c_unsigned_int_ptr;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
...@@ -399,7 +399,7 @@ namespace TDengineDriver ...@@ -399,7 +399,7 @@ namespace TDengineDriver
//used to replace null //used to replace null
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr uBigIntBuff = Marshal.AllocHGlobal(typeSize * elementCount); IntPtr c_unsigned_bigint_ptr = Marshal.AllocHGlobal(typeSize * elementCount);
//TAOS_MULTI_BIND.length //TAOS_MULTI_BIND.length
IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount); IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount);
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
...@@ -412,7 +412,7 @@ namespace TDengineDriver ...@@ -412,7 +412,7 @@ namespace TDengineDriver
for (int j = 0; j < byteArr.Length; j++) for (int j = 0; j < byteArr.Length; j++)
{ {
//set TAOS_MULTI_BIND.buffer //set TAOS_MULTI_BIND.buffer
Marshal.WriteByte(uBigIntBuff, typeSize * i + j * byteSize, byteArr[j]); Marshal.WriteByte(c_unsigned_bigint_ptr, typeSize * i + j * byteSize, byteArr[j]);
} }
//set TAOS_MULTI_BIND.length //set TAOS_MULTI_BIND.length
Marshal.WriteInt32(lengthArr, intSize * i, typeSize); Marshal.WriteInt32(lengthArr, intSize * i, typeSize);
...@@ -423,7 +423,7 @@ namespace TDengineDriver ...@@ -423,7 +423,7 @@ namespace TDengineDriver
//config TAOS_MULTI_BIND //config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_UBIGINT; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_UBIGINT;
multiBind.buffer = uBigIntBuff; multiBind.buffer = c_unsigned_bigint_ptr;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
...@@ -439,7 +439,7 @@ namespace TDengineDriver ...@@ -439,7 +439,7 @@ namespace TDengineDriver
//The size of the buffer is typeSize * elementCount //The size of the buffer is typeSize * elementCount
//This buffer is used to store TAOS_MULTI_BIND.buffer //This buffer is used to store TAOS_MULTI_BIND.buffer
int typeSize = MaxElementLength(arr); int typeSize = MaxElementLength(arr);
//This intSize is used to calcuate buffer size of the struct TAOS_MULTI_BIND's //This intSize is used to calculate buffer size of the struct TAOS_MULTI_BIND's
//length. The buffer is intSize * elementCount,which is used to store TAOS_MULTI_BIND.length //length. The buffer is intSize * elementCount,which is used to store TAOS_MULTI_BIND.length
int intSize = sizeof(int); int intSize = sizeof(int);
//This byteSize is used to calculate the buffer size of the struct TAOS_MULTI_BIND.is_null //This byteSize is used to calculate the buffer size of the struct TAOS_MULTI_BIND.is_null
...@@ -452,7 +452,7 @@ namespace TDengineDriver ...@@ -452,7 +452,7 @@ namespace TDengineDriver
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
IntPtr nullArr = Marshal.AllocHGlobal(byteSize * elementCount); IntPtr nullArr = Marshal.AllocHGlobal(byteSize * elementCount);
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr uNcharBuff = Marshal.AllocHGlobal(typeSize * elementCount); IntPtr c_char_prt = Marshal.AllocHGlobal(typeSize * elementCount);
for (int i = 0; i < elementCount; i++) for (int i = 0; i < elementCount; i++)
{ {
...@@ -464,7 +464,7 @@ namespace TDengineDriver ...@@ -464,7 +464,7 @@ namespace TDengineDriver
for (int j = 0; j < itemLength; j++) for (int j = 0; j < itemLength; j++)
{ {
//Read byte after byte //Read byte after byte
Marshal.WriteByte(uNcharBuff, i * typeSize + j, decodeByte[j]); Marshal.WriteByte(c_char_prt, i * typeSize + j, decodeByte[j]);
} }
} }
//Set TAOS_MULTI_BIND.length //Set TAOS_MULTI_BIND.length
...@@ -474,7 +474,7 @@ namespace TDengineDriver ...@@ -474,7 +474,7 @@ namespace TDengineDriver
} }
//Config TAOS_MULTI_BIND //Config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_BINARY; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_BINARY;
multiBind.buffer = uNcharBuff; multiBind.buffer = c_char_prt;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
...@@ -491,7 +491,7 @@ namespace TDengineDriver ...@@ -491,7 +491,7 @@ namespace TDengineDriver
//The size of the buffer is typeSize * elementCount //The size of the buffer is typeSize * elementCount
//This buffer is used to store TAOS_MULTI_BIND.buffer //This buffer is used to store TAOS_MULTI_BIND.buffer
int typeSize = MaxElementLength(arr); int typeSize = MaxElementLength(arr);
//This intSize is used to calcuate buffer size of the struct TAOS_MULTI_BIND's //This intSize is used to calculate buffer size of the struct TAOS_MULTI_BIND's
//length. The buffer is intSize * elementCount,which is used to store TAOS_MULTI_BIND.length //length. The buffer is intSize * elementCount,which is used to store TAOS_MULTI_BIND.length
int intSize = sizeof(int); int intSize = sizeof(int);
//This byteSize is used to calculate the buffer size of the struct TAOS_MULTI_BIND.is_null //This byteSize is used to calculate the buffer size of the struct TAOS_MULTI_BIND.is_null
...@@ -503,7 +503,7 @@ namespace TDengineDriver ...@@ -503,7 +503,7 @@ namespace TDengineDriver
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
IntPtr nullArr = Marshal.AllocHGlobal(byteSize * elementCount); IntPtr nullArr = Marshal.AllocHGlobal(byteSize * elementCount);
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr uNcharBuff = Marshal.AllocHGlobal(typeSize * elementCount); IntPtr c_char_prt = Marshal.AllocHGlobal(typeSize * elementCount);
for (int i = 0; i < elementCount; i++) for (int i = 0; i < elementCount; i++)
{ {
...@@ -515,7 +515,7 @@ namespace TDengineDriver ...@@ -515,7 +515,7 @@ namespace TDengineDriver
for (int j = 0; j < itemLength; j++) for (int j = 0; j < itemLength; j++)
{ {
//Read byte after byte //Read byte after byte
Marshal.WriteByte(uNcharBuff, i * typeSize + j, decodeByte[j]); Marshal.WriteByte(c_char_prt, i * typeSize + j, decodeByte[j]);
} }
} }
//Set TAOS_MULTI_BIND.length //Set TAOS_MULTI_BIND.length
...@@ -525,7 +525,7 @@ namespace TDengineDriver ...@@ -525,7 +525,7 @@ namespace TDengineDriver
} }
//Config TAOS_MULTI_BIND //Config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_NCHAR; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_NCHAR;
multiBind.buffer = uNcharBuff; multiBind.buffer = c_char_prt;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
...@@ -542,7 +542,7 @@ namespace TDengineDriver ...@@ -542,7 +542,7 @@ namespace TDengineDriver
int intSize = sizeof(int); int intSize = sizeof(int);
int byteSize = sizeof(byte); int byteSize = sizeof(byte);
//TAOS_MULTI_BIND.buffer //TAOS_MULTI_BIND.buffer
IntPtr unmanagedTsArr = Marshal.AllocHGlobal(typeSize * elementCount); IntPtr c_long_ptr = Marshal.AllocHGlobal(typeSize * elementCount);
//TAOS_MULTI_BIND.length //TAOS_MULTI_BIND.length
IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount); IntPtr lengthArr = Marshal.AllocHGlobal(intSize * elementCount);
//TAOS_MULTI_BIND.is_null //TAOS_MULTI_BIND.is_null
...@@ -551,7 +551,7 @@ namespace TDengineDriver ...@@ -551,7 +551,7 @@ namespace TDengineDriver
for (int i = 0; i < elementCount; i++) for (int i = 0; i < elementCount; i++)
{ {
//set TAOS_MULTI_BIND.buffer //set TAOS_MULTI_BIND.buffer
Marshal.WriteInt64(unmanagedTsArr, typeSize * i, arr[i]); Marshal.WriteInt64(c_long_ptr, typeSize * i, arr[i]);
//set TAOS_MULTI_BIND.length //set TAOS_MULTI_BIND.length
Marshal.WriteInt32(lengthArr, intSize * i, typeSize); Marshal.WriteInt32(lengthArr, intSize * i, typeSize);
//set TAOS_MULTI_BIND.is_null //set TAOS_MULTI_BIND.is_null
...@@ -560,7 +560,7 @@ namespace TDengineDriver ...@@ -560,7 +560,7 @@ namespace TDengineDriver
//config TAOS_MULTI_BIND //config TAOS_MULTI_BIND
multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_TIMESTAMP; multiBind.buffer_type = (int)TDengineDataType.TSDB_DATA_TYPE_TIMESTAMP;
multiBind.buffer = unmanagedTsArr; multiBind.buffer = c_long_ptr;
multiBind.buffer_length = (ulong)typeSize; multiBind.buffer_length = (ulong)typeSize;
multiBind.length = lengthArr; multiBind.length = lengthArr;
multiBind.is_null = nullArr; multiBind.is_null = nullArr;
......
...@@ -116,7 +116,7 @@ namespace Test.UtilsTools.DataSource ...@@ -116,7 +116,7 @@ namespace Test.UtilsTools.DataSource
} }
// Get the tag data within and string list // Get the tag data within and string list
// Which will be retrieved as a string List // Which will be retrieved as a string List
private static List<String> GetTagCnData() private static List<String> GetTagCNData()
{ {
List<String> tagData = new List<String>(); List<String> tagData = new List<String>();
tagData.Add(true.ToString()); tagData.Add(true.ToString());
...@@ -136,7 +136,7 @@ namespace Test.UtilsTools.DataSource ...@@ -136,7 +136,7 @@ namespace Test.UtilsTools.DataSource
} }
// A line of data that's without CN character. // A line of data that's without CN character.
// Which is construct as an TAOS_BIND array // Which is construct as an TAOS_BIND array
public static TAOS_BIND[] GetNtableCNRow() public static TAOS_BIND[] GetNTableCNRow()
{ {
TAOS_BIND[] binds = new TAOS_BIND[15]; TAOS_BIND[] binds = new TAOS_BIND[15];
binds[0] = TaosBind.BindTimestamp(1637064040000); binds[0] = TaosBind.BindTimestamp(1637064040000);
...@@ -157,7 +157,7 @@ namespace Test.UtilsTools.DataSource ...@@ -157,7 +157,7 @@ namespace Test.UtilsTools.DataSource
return binds; return binds;
} }
//Get and list data that will be insert into table //Get and list data that will be insert into table
public static List<String> GetNtableCNRowData() public static List<String> GetNTableCNRowData()
{ {
var data = new List<string>{ var data = new List<string>{
"1637064040000", "1637064040000",
...@@ -180,16 +180,16 @@ namespace Test.UtilsTools.DataSource ...@@ -180,16 +180,16 @@ namespace Test.UtilsTools.DataSource
} }
// Get the data value and tag values which have chinese characters // Get the data value and tag values which have chinese characters
// And retrieved as a string list.This is single Line. // And retrieved as a string list.This is single Line.
public static List<String> GetStableCNRowData() public static List<String> GetSTableCNRowData()
{ {
List<String> columnData = GetNtableCNRowData(); List<String> columnData = GetNTableCNRowData();
List<String> tagData = GetTagCnData(); List<String> tagData = GetTagCNData();
columnData.AddRange(tagData); columnData.AddRange(tagData);
return columnData; return columnData;
} }
// A line of data that's without CN character // A line of data that's without CN character
public static TAOS_BIND[] GetNtableRow() public static TAOS_BIND[] GetNTableRow()
{ {
TAOS_BIND[] binds = new TAOS_BIND[15]; TAOS_BIND[] binds = new TAOS_BIND[15];
binds[0] = TaosBind.BindTimestamp(1637064040000); binds[0] = TaosBind.BindTimestamp(1637064040000);
...@@ -209,8 +209,8 @@ namespace Test.UtilsTools.DataSource ...@@ -209,8 +209,8 @@ namespace Test.UtilsTools.DataSource
binds[14] = TaosBind.BindNil(); binds[14] = TaosBind.BindNil();
return binds; return binds;
} }
// A List of data ,use as expectResData. The value is equal to getNtableRow() // A List of data ,use as expectResData. The value is equal to getNTableRow()
public static List<String> GetNtableRowData() public static List<String> GetNTableRowData()
{ {
var data = new List<string>{ var data = new List<string>{
"1637064040000", "1637064040000",
...@@ -232,7 +232,7 @@ namespace Test.UtilsTools.DataSource ...@@ -232,7 +232,7 @@ namespace Test.UtilsTools.DataSource
return data; return data;
} }
// Five lines of data, that is construct as taos_mutli_bind array. // Five lines of data, that is construct as taos_multi_bind array.
// There aren't any CN character // There aren't any CN character
public static TAOS_MULTI_BIND[] GetMultiBindArr() public static TAOS_MULTI_BIND[] GetMultiBindArr()
{ {
...@@ -280,8 +280,8 @@ namespace Test.UtilsTools.DataSource ...@@ -280,8 +280,8 @@ namespace Test.UtilsTools.DataSource
} }
return rowData; return rowData;
} }
// Five lines of data, that is construct as taos_mutli_bind array. // Five lines of data, that is construct as taos_multi_bind array.
// There aren some CN characters and letters. // There are some CN characters and letters.
public static TAOS_MULTI_BIND[] GetMultiBindCNArr() public static TAOS_MULTI_BIND[] GetMultiBindCNArr()
{ {
TAOS_MULTI_BIND[] mBinds = new TAOS_MULTI_BIND[14]; TAOS_MULTI_BIND[] mBinds = new TAOS_MULTI_BIND[14];
...@@ -332,7 +332,7 @@ namespace Test.UtilsTools.DataSource ...@@ -332,7 +332,7 @@ namespace Test.UtilsTools.DataSource
public static List<String> GetMultiBindStableCNRowData() public static List<String> GetMultiBindStableCNRowData()
{ {
List<String> columnData = new List<string>(); List<String> columnData = new List<string>();
List<String> tagData = GetTagCnData(); List<String> tagData = GetTagCNData();
for (int i = 0; i < tsArr.Length; i++) for (int i = 0; i < tsArr.Length; i++)
{ {
columnData.Add(tsArr[i].ToString()); columnData.Add(tsArr[i].ToString());
...@@ -371,18 +371,18 @@ namespace Test.UtilsTools.DataSource ...@@ -371,18 +371,18 @@ namespace Test.UtilsTools.DataSource
TaosBind.FreeTaosBind(binds); TaosBind.FreeTaosBind(binds);
} }
public static void FreeTaosMBind(TAOS_MULTI_BIND[] mbinds) public static void FreeTaosMBind(TAOS_MULTI_BIND[] mBinds)
{ {
TaosMultiBind.FreeTaosBind(mbinds); TaosMultiBind.FreeTaosBind(mBinds);
} }
//Get the TDengineMeta list from the ddl either normal table or stable //Get the TDengineMeta list from the ddl either normal table or stable
public static List<TDengineMeta> GetMetaFromDLL(string dllStr) public static List<TDengineMeta> GetMetaFromDDL(string dllStr)
{ {
var expectResMeta = new List<TDengineMeta>(); var expectResMeta = new List<TDengineMeta>();
//"CREATE TABLE meters(ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS(location BINARY(30), groupId INT);"; //"CREATE TABLE meters(ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS(location BINARY(30), groupId INT);";
int bracetInd = dllStr.IndexOf("("); int bracketInd = dllStr.IndexOf("(");
//(ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS(location BINARY(30), groupId INT); //(ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS(location BINARY(30), groupId INT);
string subDllStr = dllStr.Substring(bracetInd); string subDllStr = dllStr.Substring(bracketInd);
String[] stableSeparators = new String[] { "tags", "TAGS" }; String[] stableSeparators = new String[] { "tags", "TAGS" };
//(ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) //(ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT)
......
...@@ -6,19 +6,19 @@ using Xunit; ...@@ -6,19 +6,19 @@ using Xunit;
using Test.UtilsTools.ResultSet; using Test.UtilsTools.ResultSet;
namespace Cases namespace Cases
{ {
public class FetchFieldCases public class FetchFieldsCases
{ {
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>FetchFieldCases.TestFetchFieldJsonTag</Name> /// <Name>FetchFieldsCases.TestFetchFieldsJsonTag</Name>
/// <describe>test taos_fetch_fields(), check the meta data</describe> /// <describe>test taos_fetch_fields(), check the meta data</describe>
/// <filename>TaosFeild.cs</filename> /// <filename>FetchFields.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact(DisplayName = "FetchFieldCases.TestFetchFieldJsonTag()")] [Fact(DisplayName = "FetchFieldsCases.TestFetchFieldsJsonTag()")]
public void TestFetchFieldJsonTag() public void TestFetchFieldsJsonTag()
{ {
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
IntPtr _res = IntPtr.Zero; IntPtr _res = IntPtr.Zero;
string tableName = "fetchfeilds"; string tableName = "fetch_fields";
var expectResMeta = new List<TDengineMeta> { var expectResMeta = new List<TDengineMeta> {
UtilsTools.ConstructTDengineMeta("ts", "timestamp"), UtilsTools.ConstructTDengineMeta("ts", "timestamp"),
UtilsTools.ConstructTDengineMeta("b", "bool"), UtilsTools.ConstructTDengineMeta("b", "bool"),
......
...@@ -7,15 +7,15 @@ using System.Collections.Generic; ...@@ -7,15 +7,15 @@ using System.Collections.Generic;
using Test.UtilsTools.ResultSet; using Test.UtilsTools.ResultSet;
namespace Cases namespace Cases
{ {
public class InsertCnCharacterCases public class InsertCNCases
{ {
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>InsertCnCharacterCases.TestInsertCnToNtable</Name> /// <Name>InsertCNCases.TestNTable</Name>
/// <describe>test insert Chinese character into normal table's nchar column</describe> /// <describe>Test insert Chinese characters into normal table's nchar column</describe>
/// <filename>InsertCn.cs</filename> /// <filename>InsertCn.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact(DisplayName = "InsertCnCharacterCases.TestInsertCnToNtable()")] [Fact(DisplayName = "InsertCNCases.TestNTable()")]
public void TestInsertCnToNtable() public void TestNTable()
{ {
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
IntPtr _res = IntPtr.Zero; IntPtr _res = IntPtr.Zero;
...@@ -37,7 +37,7 @@ namespace Cases ...@@ -37,7 +37,7 @@ namespace Cases
String insertSql = UtilsTools.ConstructInsertSql(tableName, "", colData, null, 9); String insertSql = UtilsTools.ConstructInsertSql(tableName, "", colData, null, 9);
String selectSql = "select * from " + tableName; String selectSql = "select * from " + tableName;
String dropSql = "drop table " + tableName; String dropSql = "drop table " + tableName;
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createTb); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createTb);
UtilsTools.ExecuteUpdate(conn, dropTb); UtilsTools.ExecuteUpdate(conn, dropTb);
UtilsTools.ExecuteUpdate(conn, createTb); UtilsTools.ExecuteUpdate(conn, createTb);
...@@ -64,12 +64,12 @@ namespace Cases ...@@ -64,12 +64,12 @@ namespace Cases
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>InsertCnCharacterCases.TestInsertCnToStable</Name> /// <Name>InsertCNCases.TestSTable</Name>
/// <describe>test insert Chinese character into stable's nchar column,both tag and column</describe> /// <describe>test insert Chinese character into stable's nchar column,both tag and column</describe>
/// <filename>InsertCn.cs</filename> /// <filename>InsertCn.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact(DisplayName = "InsertCnCharacterCases.TestInsertCnToStable()")] [Fact(DisplayName = "InsertCNCases.TestSTable()")]
public void TestInsertCnToStable() public void TestSTable()
{ {
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
IntPtr _res = IntPtr.Zero; IntPtr _res = IntPtr.Zero;
...@@ -84,15 +84,15 @@ namespace Cases ...@@ -84,15 +84,15 @@ namespace Cases
1637064047000,8,"8&涛思数据taos", 1637064047000,8,"8&涛思数据taos",
1637064048000,9,"&涛思数据taos9" 1637064048000,9,"&涛思数据taos9"
}; };
var tagData = new List<Object>{1,"涛思数据",}; var tagData = new List<Object> { 1, "涛思数据", };
String dropTb = "drop table if exists " + tableName; String dropTb = "drop table if exists " + tableName;
String createTb = $"create table {tableName} (ts timestamp,v4 int,blob nchar(200))tags(id int,name nchar(50));"; String createTb = $"create table {tableName} (ts timestamp,v4 int,blob nchar(200))tags(id int,name nchar(50));";
String insertSql = UtilsTools.ConstructInsertSql(tableName+"_sub1", tableName, colData, tagData, 9); String insertSql = UtilsTools.ConstructInsertSql(tableName + "_sub1", tableName, colData, tagData, 9);
String selectSql = "select * from " + tableName; String selectSql = "select * from " + tableName;
String dropSql = "drop table " + tableName; String dropSql = "drop table " + tableName;
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createTb); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createTb);
List<Object> expectResData = UtilsTools.CombineColAndTagData(colData,tagData,9); List<Object> expectResData = UtilsTools.CombineColAndTagData(colData, tagData, 9);
UtilsTools.ExecuteUpdate(conn, dropTb); UtilsTools.ExecuteUpdate(conn, dropTb);
UtilsTools.ExecuteUpdate(conn, createTb); UtilsTools.ExecuteUpdate(conn, createTb);
...@@ -118,12 +118,12 @@ namespace Cases ...@@ -118,12 +118,12 @@ namespace Cases
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>InsertCnCharacterCases.TestInsertMutilCnToNtable</Name> /// <Name>InsertCNCases.TestInsertMultiNTable</Name>
/// <describe>test insert Chinese character into normal table's multiple nchar columns</describe> /// <describe>test insert Chinese character into normal table's multiple nchar columns</describe>
/// <filename>InsertCn.cs</filename> /// <filename>InsertCn.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact(DisplayName = "InsertCnCharacterCases.TestInsertMutilCnToNtable()")] [Fact(DisplayName = "InsertCNCases.TestInsertMultiNTable()")]
public void TestInsertMutilCnToNtable() public void TestInsertMultiNTable()
{ {
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
IntPtr _res = IntPtr.Zero; IntPtr _res = IntPtr.Zero;
...@@ -140,11 +140,11 @@ namespace Cases ...@@ -140,11 +140,11 @@ namespace Cases
}; };
String dropTb = "drop table if exists " + tableName; String dropTb = "drop table if exists " + tableName;
String createTb = $"create table if not exists {tableName} (ts timestamp,v4 int,blob nchar(200),location nchar(200),city binary(100),coutry binary(200));"; String createTb = $"create table if not exists {tableName} (ts timestamp,v4 int,blob nchar(200),location nchar(200),city binary(100),country binary(200));";
String insertSql = UtilsTools.ConstructInsertSql(tableName, "", colData, null, 9); String insertSql = UtilsTools.ConstructInsertSql(tableName, "", colData, null, 9);
String selectSql = "select * from " + tableName; String selectSql = "select * from " + tableName;
String dropSql = "drop table " + tableName; String dropSql = "drop table " + tableName;
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createTb); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createTb);
UtilsTools.ExecuteUpdate(conn, dropTb); UtilsTools.ExecuteUpdate(conn, dropTb);
UtilsTools.ExecuteUpdate(conn, createTb); UtilsTools.ExecuteUpdate(conn, createTb);
...@@ -168,16 +168,16 @@ namespace Cases ...@@ -168,16 +168,16 @@ namespace Cases
Assert.Equal(colData[i].ToString(), actualResData[i]); Assert.Equal(colData[i].ToString(), actualResData[i]);
} }
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>InsertCnCharacterCases.TestInsertMutilCnToStable</Name> /// <Name>InsertCNCases.TestInsertMultiSTable</Name>
/// <describe>test insert Chinese character into stable's multiple nchar columns</describe> /// <describe>test insert Chinese character into stable's multiple nchar columns</describe>
/// <filename>InsertCn.cs</filename> /// <filename>InsertCn.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact(DisplayName = "InsertCnCharacterCases.TestInsertMutilCnToStable()")] [Fact(DisplayName = "InsertCNCases.TestInsertMultiSTable()")]
public void TestInsertMutilCnToStable() public void TestInsertMultiSTable()
{ {
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
IntPtr _res = IntPtr.Zero; IntPtr _res = IntPtr.Zero;
string tableName = "cn_multi_insert_nchar_stable"; string tableName = "cn_multi_insert_nchar_stable";
var colData = new List<Object>{1637064040000,1,"涛思数据","保利广场","Beijing","China", var colData = new List<Object>{1637064040000,1,"涛思数据","保利广场","Beijing","China",
...@@ -190,7 +190,7 @@ namespace Cases ...@@ -190,7 +190,7 @@ namespace Cases
1637064047000,8,"8&涛思数据taos","incluse阿斯顿发","NewYork","US", 1637064047000,8,"8&涛思数据taos","incluse阿斯顿发","NewYork","US",
1637064048000,9,"&涛思数据taos9","123黑化肥werq会挥……&¥%发!afsdfa","NewYork","US", 1637064048000,9,"&涛思数据taos9","123黑化肥werq会挥……&¥%发!afsdfa","NewYork","US",
}; };
var tagData = new List<Object>{1,"涛思数据","中国北方&南方长江黄河!49wq","tdengine"}; var tagData = new List<Object> { 1, "涛思数据", "中国北方&南方长江黄河!49wq", "tdengine" };
String dropTb = "drop table if exists " + tableName; String dropTb = "drop table if exists " + tableName;
String createTb = $"create table if not exists {tableName} (ts timestamp," + String createTb = $"create table if not exists {tableName} (ts timestamp," +
$"v4 int," + $"v4 int," +
...@@ -203,12 +203,12 @@ namespace Cases ...@@ -203,12 +203,12 @@ namespace Cases
$"name nchar(50)," + $"name nchar(50)," +
$"addr nchar(200)," + $"addr nchar(200)," +
$"en_name binary(200));"; $"en_name binary(200));";
String insertSql = UtilsTools.ConstructInsertSql(tableName+"_sub1", tableName, colData, tagData, 9); String insertSql = UtilsTools.ConstructInsertSql(tableName + "_sub1", tableName, colData, tagData, 9);
String selectSql = "select * from " + tableName; String selectSql = "select * from " + tableName;
String dropSql = "drop table " + tableName; String dropSql = "drop table " + tableName;
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createTb); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createTb);
List<Object> expectResData = UtilsTools.CombineColAndTagData(colData,tagData,9); List<Object> expectResData = UtilsTools.CombineColAndTagData(colData, tagData, 9);
UtilsTools.ExecuteUpdate(conn, dropTb); UtilsTools.ExecuteUpdate(conn, dropTb);
UtilsTools.ExecuteUpdate(conn, createTb); UtilsTools.ExecuteUpdate(conn, createTb);
......
using TDengineDriver; using TDengineDriver;
using Test.UtilsTools; using Test.UtilsTools;
using System; using System;
using System.Runtime.InteropServices;
using Xunit; using Xunit;
using System.Collections.Generic; using System.Collections.Generic;
using Test.UtilsTools.DataSource; using Test.UtilsTools.DataSource;
...@@ -47,7 +46,7 @@ namespace Cases ...@@ -47,7 +46,7 @@ namespace Cases
}; };
var tagData = new List<Object> { 1, "tag_one", "标签壹" }; var tagData = new List<Object> { 1, "tag_one", "标签壹" };
String insertSql = UtilsTools.ConstructInsertSql(tableName + "_s01", tableName, colData, tagData, 3); String insertSql = UtilsTools.ConstructInsertSql(tableName + "_s01", tableName, colData, tagData, 3);
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createSql); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createSql);
List<Object> expectResData = UtilsTools.CombineColAndTagData(colData, tagData, 3); List<Object> expectResData = UtilsTools.CombineColAndTagData(colData, tagData, 3);
var querySql = $"select * from {tableName}"; var querySql = $"select * from {tableName}";
...@@ -133,7 +132,7 @@ namespace Cases ...@@ -133,7 +132,7 @@ namespace Cases
var colDataActual = colData.GetRange(8, 8); var colDataActual = colData.GetRange(8, 8);
var tagData = new List<Object> { 1, "tag_one", "标签壹" }; var tagData = new List<Object> { 1, "tag_one", "标签壹" };
String insertSql = UtilsTools.ConstructInsertSql(tableName + "_s01", tableName, colData, tagData, 3); String insertSql = UtilsTools.ConstructInsertSql(tableName + "_s01", tableName, colData, tagData, 3);
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createSql); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createSql);
List<Object> expectResData = UtilsTools.CombineColAndTagData(colDataActual, tagData, 1); List<Object> expectResData = UtilsTools.CombineColAndTagData(colDataActual, tagData, 1);
colDataActual.ForEach((item) => { Console.Write("{0}\t", item); }); colDataActual.ForEach((item) => { Console.Write("{0}\t", item); });
...@@ -228,7 +227,7 @@ namespace Cases ...@@ -228,7 +227,7 @@ namespace Cases
String insertSql1 = UtilsTools.ConstructInsertSql(tableName + "_s01", tableName, colData1, tagData1, 3); String insertSql1 = UtilsTools.ConstructInsertSql(tableName + "_s01", tableName, colData1, tagData1, 3);
String insertSql2 = UtilsTools.ConstructInsertSql(tableName + "_s02", tableName, colData1, tagData2, 3); String insertSql2 = UtilsTools.ConstructInsertSql(tableName + "_s02", tableName, colData1, tagData2, 3);
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createSql); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createSql);
List<Object> expectResData = UtilsTools.CombineColAndTagData(colData1, tagData1, 3); List<Object> expectResData = UtilsTools.CombineColAndTagData(colData1, tagData1, 3);
UtilsTools.ExecuteUpdate(conn, dropSql); UtilsTools.ExecuteUpdate(conn, dropSql);
......
...@@ -10,14 +10,14 @@ namespace Cases ...@@ -10,14 +10,14 @@ namespace Cases
public class NormalTableStmtCases public class NormalTableStmtCases
{ {
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>NormalTableStmtCases.TestBindSingleLineCn</Name> /// <Name>NormalTableStmtCases.TestBindSingleLineCN</Name>
/// <describe>Test stmt insert single line of chinese character into normal table by column after column </describe> /// <describe>Test stmt insert single line of chinese character into normal table by column after column </describe>
/// <filename>StmtNormalTable.cs</filename> /// <filename>StmtNormalTable.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact(DisplayName = "NormalTableStmtCases.TestBindSingleLineCn()")] [Fact(DisplayName = "NormalTableStmtCases.TestBindSingleLineCN()")]
public void TestBindSingleLineCn() public void TestBindSingleLineCN()
{ {
string tableName = "normal_tablestmt_cases_test_bind_single_line_cn"; string tableName = "ntb_stmt_cases_test_bind_single_line_cn";
String createTb = $"create table if not exists {tableName} (" + String createTb = $"create table if not exists {tableName} (" +
"ts timestamp," + "ts timestamp," +
"tt tinyint," + "tt tinyint," +
...@@ -38,9 +38,9 @@ namespace Cases ...@@ -38,9 +38,9 @@ namespace Cases
string insertSql = "insert into ? values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; string insertSql = "insert into ? values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
string dropSql = $"drop table if exists {tableName}"; string dropSql = $"drop table if exists {tableName}";
string querySql = "select * from " + tableName; string querySql = "select * from " + tableName;
TAOS_BIND[] _valuesRow = DataSource.GetNtableCNRow(); TAOS_BIND[] _valuesRow = DataSource.GetNTableCNRow();
List<string> expectResData = DataSource.GetNtableCNRowData(); List<string> expectResData = DataSource.GetNTableCNRowData();
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createTb); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createTb);
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
UtilsTools.ExecuteUpdate(conn, dropSql); UtilsTools.ExecuteUpdate(conn, dropSql);
...@@ -76,14 +76,14 @@ namespace Cases ...@@ -76,14 +76,14 @@ namespace Cases
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>NormalTableStmtCases.TestBindColumnCn</Name> /// <Name>NormalTableStmtCases.TestBindColumnCN</Name>
/// <describe>Test stmt insert single line of chinese character into normal table by column after column </describe> /// <describe>Test stmt insert single line of chinese character into normal table by column after column </describe>
/// <filename>StmtNormalTable.cs</filename> /// <filename>StmtNormalTable.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact(DisplayName = "NormalTableStmtCases.TestBindColumnCn()")] [Fact(DisplayName = "NormalTableStmtCases.TestBindColumnCN()")]
public void TestBindColumnCn() public void TestBindColumnCN()
{ {
string tableName = "normal_tablestmt_cases_test_bind_column_cn"; string tableName = "ntb_stmt_cases_test_bind_column_cn";
String createTb = $"create table if not exists {tableName} " + String createTb = $"create table if not exists {tableName} " +
" (" + " (" +
"ts timestamp," + "ts timestamp," +
...@@ -104,8 +104,8 @@ namespace Cases ...@@ -104,8 +104,8 @@ namespace Cases
String insertSql = "insert into ? values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; String insertSql = "insert into ? values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
String dropSql = $"drop table if exists {tableName} "; String dropSql = $"drop table if exists {tableName} ";
List<string> expectResData = DataSource.GetMultiBindCNRowData(); List<string> expectResData = DataSource.GetMultiBindCNRowData();
TAOS_MULTI_BIND[] mbind = DataSource.GetMultiBindCNArr(); TAOS_MULTI_BIND[] mBind = DataSource.GetMultiBindCNArr();
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createTb); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createTb);
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
UtilsTools.ExecuteUpdate(conn, dropSql); UtilsTools.ExecuteUpdate(conn, dropSql);
...@@ -115,26 +115,26 @@ namespace Cases ...@@ -115,26 +115,26 @@ namespace Cases
StmtUtilTools.StmtPrepare(stmt, insertSql); StmtUtilTools.StmtPrepare(stmt, insertSql);
StmtUtilTools.SetTableName(stmt, tableName); StmtUtilTools.SetTableName(stmt, tableName);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[0], 0); StmtUtilTools.BindSingleParamBatch(stmt, mBind[0], 0);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[1], 1); StmtUtilTools.BindSingleParamBatch(stmt, mBind[1], 1);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[2], 2); StmtUtilTools.BindSingleParamBatch(stmt, mBind[2], 2);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[3], 3); StmtUtilTools.BindSingleParamBatch(stmt, mBind[3], 3);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[4], 4); StmtUtilTools.BindSingleParamBatch(stmt, mBind[4], 4);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[5], 5); StmtUtilTools.BindSingleParamBatch(stmt, mBind[5], 5);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[6], 6); StmtUtilTools.BindSingleParamBatch(stmt, mBind[6], 6);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[7], 7); StmtUtilTools.BindSingleParamBatch(stmt, mBind[7], 7);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[8], 8); StmtUtilTools.BindSingleParamBatch(stmt, mBind[8], 8);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[9], 9); StmtUtilTools.BindSingleParamBatch(stmt, mBind[9], 9);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[10], 10); StmtUtilTools.BindSingleParamBatch(stmt, mBind[10], 10);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[11], 11); StmtUtilTools.BindSingleParamBatch(stmt, mBind[11], 11);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[12], 12); StmtUtilTools.BindSingleParamBatch(stmt, mBind[12], 12);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[13], 13); StmtUtilTools.BindSingleParamBatch(stmt, mBind[13], 13);
StmtUtilTools.AddBatch(stmt); StmtUtilTools.AddBatch(stmt);
StmtUtilTools.StmtExecute(stmt); StmtUtilTools.StmtExecute(stmt);
StmtUtilTools.StmtClose(stmt); StmtUtilTools.StmtClose(stmt);
DataSource.FreeTaosMBind(mbind); DataSource.FreeTaosMBind(mBind);
string querySql = "select * from " + tableName; string querySql = "select * from " + tableName;
IntPtr res = UtilsTools.ExecuteQuery(conn, querySql); IntPtr res = UtilsTools.ExecuteQuery(conn, querySql);
...@@ -158,15 +158,15 @@ namespace Cases ...@@ -158,15 +158,15 @@ namespace Cases
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>NormalTableStmtCases.TestBindMultiLineCn</Name> /// <Name>NormalTableStmtCases.TestBindMultiLineCN</Name>
/// <describe>Test stmt insert single line of chinese character into normal table by column after column </describe> /// <describe>Test stmt insert single line of chinese character into normal table by column after column </describe>
/// <filename>StmtNormalTable.cs</filename> /// <filename>StmtNormalTable.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact(DisplayName = "NormalTableStmtCases.TestBindMultiLineCn()")] [Fact(DisplayName = "NormalTableStmtCases.TestBindMultiLineCN()")]
public void TestBindMultiLineCn() public void TestBindMultiLineCN()
{ {
string tableName = "normal_tablestmt_cases_test_bind_multi_lines_cn"; string tableName = "ntb_stmt_cases_test_bind_multi_lines_cn";
TAOS_MULTI_BIND[] mbind = DataSource.GetMultiBindCNArr(); TAOS_MULTI_BIND[] mBind = DataSource.GetMultiBindCNArr();
String createTb = $"create table if not exists {tableName} " + String createTb = $"create table if not exists {tableName} " +
" (" + " (" +
"ts timestamp," + "ts timestamp," +
...@@ -187,7 +187,7 @@ namespace Cases ...@@ -187,7 +187,7 @@ namespace Cases
String insertSql = "insert into ? values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; String insertSql = "insert into ? values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
String dropSql = $"drop table if exists {tableName} "; String dropSql = $"drop table if exists {tableName} ";
List<string> expectResData = DataSource.GetMultiBindCNRowData(); List<string> expectResData = DataSource.GetMultiBindCNRowData();
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createTb); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createTb);
IntPtr conn = UtilsTools.TDConnection(); ; IntPtr conn = UtilsTools.TDConnection(); ;
UtilsTools.ExecuteUpdate(conn, dropSql); UtilsTools.ExecuteUpdate(conn, dropSql);
...@@ -196,12 +196,12 @@ namespace Cases ...@@ -196,12 +196,12 @@ namespace Cases
IntPtr stmt = StmtUtilTools.StmtInit(conn); IntPtr stmt = StmtUtilTools.StmtInit(conn);
StmtUtilTools.StmtPrepare(stmt, insertSql); StmtUtilTools.StmtPrepare(stmt, insertSql);
StmtUtilTools.SetTableName(stmt, tableName); StmtUtilTools.SetTableName(stmt, tableName);
StmtUtilTools.BindParamBatch(stmt, mbind); StmtUtilTools.BindParamBatch(stmt, mBind);
StmtUtilTools.AddBatch(stmt); StmtUtilTools.AddBatch(stmt);
StmtUtilTools.StmtExecute(stmt); StmtUtilTools.StmtExecute(stmt);
StmtUtilTools.StmtClose(stmt); StmtUtilTools.StmtClose(stmt);
DataSource.FreeTaosMBind(mbind); DataSource.FreeTaosMBind(mBind);
string querySql = "select * from " + tableName; string querySql = "select * from " + tableName;
IntPtr res = UtilsTools.ExecuteQuery(conn, querySql); IntPtr res = UtilsTools.ExecuteQuery(conn, querySql);
...@@ -228,13 +228,13 @@ namespace Cases ...@@ -228,13 +228,13 @@ namespace Cases
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>NormalTableStmtCases.TestBindSingleLine</Name> /// <Name>NormalTableStmtCases.TestBindSingleLine</Name>
/// <describe>Test stmt insert sinle line data into normal table</describe> /// <describe>Test stmt insert single line data into normal table</describe>
/// <filename>StmtNormalTable.cs</filename> /// <filename>StmtNormalTable.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact(DisplayName = "NormalTableStmtCases.TestBindSingleLine")] [Fact(DisplayName = "NormalTableStmtCases.TestBindSingleLine")]
public void TestBindSingleLine() public void TestBindSingleLine()
{ {
string tableName = "normal_tablestmt_cases_test_bind_single_line"; string tableName = "ntb_stmt_cases_test_bind_single_line";
String createTb = $"create table if not exists {tableName} (" + String createTb = $"create table if not exists {tableName} (" +
"ts timestamp," + "ts timestamp," +
"tt tinyint," + "tt tinyint," +
...@@ -255,9 +255,9 @@ namespace Cases ...@@ -255,9 +255,9 @@ namespace Cases
string insertSql = "insert into ? values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; string insertSql = "insert into ? values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
string dropSql = $"drop table if exists {tableName}"; string dropSql = $"drop table if exists {tableName}";
string querySql = "select * from " + tableName; string querySql = "select * from " + tableName;
TAOS_BIND[] valuesRow = DataSource.GetNtableRow(); TAOS_BIND[] valuesRow = DataSource.GetNTableRow();
List<string> expectResData = DataSource.GetNtableRowData(); List<string> expectResData = DataSource.GetNTableRowData();
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createTb); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createTb);
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
UtilsTools.ExecuteQuery(conn, dropSql); UtilsTools.ExecuteQuery(conn, dropSql);
...@@ -296,7 +296,7 @@ namespace Cases ...@@ -296,7 +296,7 @@ namespace Cases
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>NtableMutipleLine.TestBindMultiLine</Name> /// <Name>NTableMultipleLine.TestBindMultiLine</Name>
/// <describe>Test stmt insert multiple rows of data into normal table</describe> /// <describe>Test stmt insert multiple rows of data into normal table</describe>
/// <filename>StmtNormalTable.cs</filename> /// <filename>StmtNormalTable.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
...@@ -324,8 +324,8 @@ namespace Cases ...@@ -324,8 +324,8 @@ namespace Cases
String insertSql = "insert into ? values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; String insertSql = "insert into ? values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
String dropSql = $"drop table if exists {tableName} "; String dropSql = $"drop table if exists {tableName} ";
List<string> expectResData = DataSource.GetMultiBindResData(); List<string> expectResData = DataSource.GetMultiBindResData();
TAOS_MULTI_BIND[] mbind = DataSource.GetMultiBindArr(); TAOS_MULTI_BIND[] mBind = DataSource.GetMultiBindArr();
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createTb); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createTb);
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
UtilsTools.ExecuteUpdate(conn, dropSql); UtilsTools.ExecuteUpdate(conn, dropSql);
...@@ -335,11 +335,11 @@ namespace Cases ...@@ -335,11 +335,11 @@ namespace Cases
IntPtr stmt = StmtUtilTools.StmtInit(conn); IntPtr stmt = StmtUtilTools.StmtInit(conn);
StmtUtilTools.StmtPrepare(stmt, insertSql); StmtUtilTools.StmtPrepare(stmt, insertSql);
StmtUtilTools.SetTableName(stmt, tableName); StmtUtilTools.SetTableName(stmt, tableName);
StmtUtilTools.BindParamBatch(stmt, mbind); StmtUtilTools.BindParamBatch(stmt, mBind);
StmtUtilTools.AddBatch(stmt); StmtUtilTools.AddBatch(stmt);
StmtUtilTools.StmtExecute(stmt); StmtUtilTools.StmtExecute(stmt);
StmtUtilTools.StmtClose(stmt); StmtUtilTools.StmtClose(stmt);
DataSource.FreeTaosMBind(mbind); DataSource.FreeTaosMBind(mBind);
string querySql = "select * from " + tableName; string querySql = "select * from " + tableName;
IntPtr res = UtilsTools.ExecuteQuery(conn, querySql); IntPtr res = UtilsTools.ExecuteQuery(conn, querySql);
...@@ -365,14 +365,14 @@ namespace Cases ...@@ -365,14 +365,14 @@ namespace Cases
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>NtableColumnByColumn.TestBindColumnCn</Name> /// <Name>NormalTableStmtCases.TestBindColumnCn</Name>
/// <describe>Test stmt insert multiple rows of data into normal table by column after column </describe> /// <describe>Test stmt insert multiple rows of data into normal table by column after column </describe>
/// <filename>StmtNormalTable.cs</filename> /// <filename>StmtNormalTable.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact(DisplayName = "NormalTableStmtCases.TestBindColumn()")] [Fact(DisplayName = "NormalTableStmtCases.TestBindColumn()")]
public void TestBindColumn() public void TestBindColumn()
{ {
string tableName = "normal_tablestmt_cases_test_bind_column_cn"; string tableName = "ntb_stmt_cases_test_bind_column_cn";
DataSource data = new DataSource(); DataSource data = new DataSource();
String createTb = $"create table if not exists {tableName} " + String createTb = $"create table if not exists {tableName} " +
" (" + " (" +
...@@ -394,8 +394,8 @@ namespace Cases ...@@ -394,8 +394,8 @@ namespace Cases
String insertSql = "insert into ? values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; String insertSql = "insert into ? values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
String dropSql = $"drop table if exists {tableName} "; String dropSql = $"drop table if exists {tableName} ";
List<string> expectResData = DataSource.GetMultiBindResData(); List<string> expectResData = DataSource.GetMultiBindResData();
TAOS_MULTI_BIND[] mbind = DataSource.GetMultiBindArr(); TAOS_MULTI_BIND[] mBinds = DataSource.GetMultiBindArr();
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createTb); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createTb);
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
...@@ -406,26 +406,26 @@ namespace Cases ...@@ -406,26 +406,26 @@ namespace Cases
StmtUtilTools.StmtPrepare(stmt, insertSql); StmtUtilTools.StmtPrepare(stmt, insertSql);
StmtUtilTools.SetTableName(stmt, tableName); StmtUtilTools.SetTableName(stmt, tableName);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[0], 0); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[0], 0);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[1], 1); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[1], 1);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[2], 2); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[2], 2);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[3], 3); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[3], 3);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[4], 4); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[4], 4);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[5], 5); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[5], 5);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[6], 6); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[6], 6);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[7], 7); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[7], 7);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[8], 8); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[8], 8);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[9], 9); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[9], 9);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[10], 10); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[10], 10);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[11], 11); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[11], 11);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[12], 12); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[12], 12);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[13], 13); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[13], 13);
StmtUtilTools.AddBatch(stmt); StmtUtilTools.AddBatch(stmt);
StmtUtilTools.StmtExecute(stmt); StmtUtilTools.StmtExecute(stmt);
StmtUtilTools.StmtClose(stmt); StmtUtilTools.StmtClose(stmt);
DataSource.FreeTaosMBind(mbind); DataSource.FreeTaosMBind(mBinds);
string querySql = "select * from " + tableName; string querySql = "select * from " + tableName;
IntPtr res = UtilsTools.ExecuteQuery(conn, querySql); IntPtr res = UtilsTools.ExecuteQuery(conn, querySql);
......
...@@ -5,7 +5,7 @@ using Test.UtilsTools.DataSource; ...@@ -5,7 +5,7 @@ using Test.UtilsTools.DataSource;
namespace Cases namespace Cases
{ {
public class StmtStableQuery public class StmtSTableQuery
{ {
public void Test(IntPtr conn, string tableName) public void Test(IntPtr conn, string tableName)
{ {
...@@ -26,7 +26,7 @@ namespace Cases ...@@ -26,7 +26,7 @@ namespace Cases
} }
} }
public class StmtNtableQuery public class StmtNTableQuery
{ {
public void Test(IntPtr conn, string tableName) public void Test(IntPtr conn, string tableName)
{ {
......
...@@ -11,14 +11,14 @@ namespace Cases ...@@ -11,14 +11,14 @@ namespace Cases
public class StableStmtCases public class StableStmtCases
{ {
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>StableStmtCases.TestBindSingleLineCn</Name> /// <Name>StableStmtCases.TestBindSingleLineCN</Name>
/// <describe>Test stmt insert single line of chinese character into stable by column after column </describe> /// <describe>Test stmt insert single line of chinese character into stable by column after column </describe>
/// <filename>StmtSTable.cs</filename> /// <filename>StmtSTable.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact(DisplayName = "StableStmtCases.TestBindSingleLineCn()")] [Fact(DisplayName = "StableStmtCases.TestBindSingleLineCN()")]
public void TestBindSingleLineCn() public void TestBindSingleLineCN()
{ {
string tableName = "stable_stmt_cases_test_bind_single_line_cn"; string tableName = "stb_stmt_cases_test_bind_single_line_cn";
String createSql = $"create stable if not exists {tableName} " + String createSql = $"create stable if not exists {tableName} " +
" (ts timestamp," + " (ts timestamp," +
"v1 tinyint," + "v1 tinyint," +
...@@ -52,10 +52,10 @@ namespace Cases ...@@ -52,10 +52,10 @@ namespace Cases
");"; ");";
String insertSql = $"insert into ? using {tableName} tags(?,?,?,?,?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; String insertSql = $"insert into ? using {tableName} tags(?,?,?,?,?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
String dropSql = $"drop table if exists {tableName} ;"; String dropSql = $"drop table if exists {tableName} ;";
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createSql); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createSql);
List<String> expectResData = DataSource.GetStableCNRowData(); List<String> expectResData = DataSource.GetSTableCNRowData();
TAOS_BIND[] tags = DataSource.GetCNTags(); TAOS_BIND[] tags = DataSource.GetCNTags();
TAOS_BIND[] binds = DataSource.GetNtableCNRow(); TAOS_BIND[] binds = DataSource.GetNTableCNRow();
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
UtilsTools.ExecuteUpdate(conn, dropSql); UtilsTools.ExecuteUpdate(conn, dropSql);
...@@ -95,14 +95,14 @@ namespace Cases ...@@ -95,14 +95,14 @@ namespace Cases
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>StableStmtCases.TestBindColumnCn</Name> /// <Name>StableStmtCases.TestBindColumnCN</Name>
/// <describe>Test stmt insert single line of chinese character into stable by column after column </describe> /// <describe>Test stmt insert single line of chinese character into stable by column after column </describe>
/// <filename>StmtSTable.cs</filename> /// <filename>StmtSTable.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact(DisplayName = "StableStmtCases.TestBindColumnCn()")] [Fact(DisplayName = "StableStmtCases.TestBindColumnCN()")]
public void TestBindColumnCn() public void TestBindColumnCN()
{ {
string tableName = "stable_stmt_cases_test_bindcolumn_cn"; string tableName = "stb_stmt_cases_test_bindcolumn_cn";
String createSql = $"create stable if not exists {tableName} " + String createSql = $"create stable if not exists {tableName} " +
"(ts timestamp," + "(ts timestamp," +
"b bool," + "b bool," +
...@@ -137,8 +137,8 @@ namespace Cases ...@@ -137,8 +137,8 @@ namespace Cases
String insertSql = "insert into ? using " + tableName + " tags(?,?,?,?,?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; String insertSql = "insert into ? using " + tableName + " tags(?,?,?,?,?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
String dropSql = $"drop table if exists {tableName};"; String dropSql = $"drop table if exists {tableName};";
TAOS_BIND[] tags = DataSource.GetCNTags(); TAOS_BIND[] tags = DataSource.GetCNTags();
TAOS_MULTI_BIND[] mbind = DataSource.GetMultiBindCNArr(); TAOS_MULTI_BIND[] mBinds = DataSource.GetMultiBindCNArr();
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createSql); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createSql);
List<String> expectResData = DataSource.GetMultiBindStableCNRowData(); List<String> expectResData = DataSource.GetMultiBindStableCNRowData();
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
...@@ -149,27 +149,27 @@ namespace Cases ...@@ -149,27 +149,27 @@ namespace Cases
StmtUtilTools.StmtPrepare(stmt, insertSql); StmtUtilTools.StmtPrepare(stmt, insertSql);
StmtUtilTools.SetTableNameTags(stmt, tableName + "_t1", tags); StmtUtilTools.SetTableNameTags(stmt, tableName + "_t1", tags);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[0], 0); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[0], 0);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[1], 1); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[1], 1);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[2], 2); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[2], 2);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[3], 3); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[3], 3);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[4], 4); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[4], 4);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[5], 5); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[5], 5);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[6], 6); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[6], 6);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[7], 7); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[7], 7);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[8], 8); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[8], 8);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[9], 9); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[9], 9);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[10], 10); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[10], 10);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[11], 11); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[11], 11);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[12], 12); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[12], 12);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[13], 13); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[13], 13);
StmtUtilTools.AddBatch(stmt); StmtUtilTools.AddBatch(stmt);
StmtUtilTools.StmtExecute(stmt); StmtUtilTools.StmtExecute(stmt);
StmtUtilTools.StmtClose(stmt); StmtUtilTools.StmtClose(stmt);
DataSource.FreeTaosBind(tags); DataSource.FreeTaosBind(tags);
DataSource.FreeTaosMBind(mbind); DataSource.FreeTaosMBind(mBinds);
string querySql = "select * from " + tableName; string querySql = "select * from " + tableName;
IntPtr res = UtilsTools.ExecuteQuery(conn, querySql); IntPtr res = UtilsTools.ExecuteQuery(conn, querySql);
...@@ -195,14 +195,14 @@ namespace Cases ...@@ -195,14 +195,14 @@ namespace Cases
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>StableStmtCases.TestBindMultiLineCn</Name> /// <Name>StableStmtCases.TestBindMultiLineCN</Name>
/// <describe>Test stmt insert single line of chinese character into stable by column after column </describe> /// <describe>Test stmt insert single line of chinese character into stable by column after column </describe>
/// <filename>StmtSTable.cs</filename> /// <filename>StmtSTable.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact(DisplayName = "StableStmtCases.TestBindMultiLineCn()")] [Fact(DisplayName = "StableStmtCases.TestBindMultiLineCN()")]
public void TestBindMultiLineCn() public void TestBindMultiLineCN()
{ {
string tableName = "stable_stmt_cases_test_bind_multi_line_cn"; string tableName = "stb_stmt_cases_test_bind_multi_line_cn";
String createSql = $"create stable if not exists {tableName} " + String createSql = $"create stable if not exists {tableName} " +
"(ts timestamp," + "(ts timestamp," +
"b bool," + "b bool," +
...@@ -237,8 +237,8 @@ namespace Cases ...@@ -237,8 +237,8 @@ namespace Cases
String insertSql = "insert into ? using " + tableName + " tags(?,?,?,?,?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; String insertSql = "insert into ? using " + tableName + " tags(?,?,?,?,?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
String dropSql = $"drop table if exists {tableName};"; String dropSql = $"drop table if exists {tableName};";
TAOS_BIND[] tags = DataSource.GetCNTags(); TAOS_BIND[] tags = DataSource.GetCNTags();
TAOS_MULTI_BIND[] mbind = DataSource.GetMultiBindCNArr(); TAOS_MULTI_BIND[] mBinds = DataSource.GetMultiBindCNArr();
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createSql); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createSql);
List<String> expectResData = DataSource.GetMultiBindStableCNRowData(); List<String> expectResData = DataSource.GetMultiBindStableCNRowData();
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
...@@ -248,13 +248,13 @@ namespace Cases ...@@ -248,13 +248,13 @@ namespace Cases
IntPtr stmt = StmtUtilTools.StmtInit(conn); IntPtr stmt = StmtUtilTools.StmtInit(conn);
StmtUtilTools.StmtPrepare(stmt, insertSql); StmtUtilTools.StmtPrepare(stmt, insertSql);
StmtUtilTools.SetTableNameTags(stmt, tableName + "_t1", tags); StmtUtilTools.SetTableNameTags(stmt, tableName + "_t1", tags);
StmtUtilTools.BindParamBatch(stmt, mbind); StmtUtilTools.BindParamBatch(stmt, mBinds);
StmtUtilTools.AddBatch(stmt); StmtUtilTools.AddBatch(stmt);
StmtUtilTools.StmtExecute(stmt); StmtUtilTools.StmtExecute(stmt);
StmtUtilTools.StmtClose(stmt); StmtUtilTools.StmtClose(stmt);
DataSource.FreeTaosBind(tags); DataSource.FreeTaosBind(tags);
DataSource.FreeTaosMBind(mbind); DataSource.FreeTaosMBind(mBinds);
string querySql = "select * from " + tableName; string querySql = "select * from " + tableName;
IntPtr res = UtilsTools.ExecuteQuery(conn, querySql); IntPtr res = UtilsTools.ExecuteQuery(conn, querySql);
...@@ -285,7 +285,7 @@ namespace Cases ...@@ -285,7 +285,7 @@ namespace Cases
[Fact(DisplayName = "StableStmtCases.TestBindMultiLine()")] [Fact(DisplayName = "StableStmtCases.TestBindMultiLine()")]
public void TestBindMultiLine() public void TestBindMultiLine()
{ {
string tableName = "stable_stmt_cases_test_bind_multi_line"; string tableName = "stb_stmt_cases_test_bind_multi_line";
string createSql = $"create stable if not exists {tableName} " + string createSql = $"create stable if not exists {tableName} " +
"(ts timestamp," + "(ts timestamp," +
"b bool," + "b bool," +
...@@ -320,8 +320,8 @@ namespace Cases ...@@ -320,8 +320,8 @@ namespace Cases
String insertSql = "insert into ? using " + tableName + " tags(?,?,?,?,?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; String insertSql = "insert into ? using " + tableName + " tags(?,?,?,?,?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
String dropSql = $"drop table if exists {tableName};"; String dropSql = $"drop table if exists {tableName};";
TAOS_BIND[] tags = DataSource.GetTags(); TAOS_BIND[] tags = DataSource.GetTags();
TAOS_MULTI_BIND[] mbind = DataSource.GetMultiBindArr(); TAOS_MULTI_BIND[] mBinds = DataSource.GetMultiBindArr();
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createSql); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createSql);
List<String> expectResData = DataSource.GetMultiBindStableRowData(); List<String> expectResData = DataSource.GetMultiBindStableRowData();
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
...@@ -331,13 +331,13 @@ namespace Cases ...@@ -331,13 +331,13 @@ namespace Cases
IntPtr stmt = StmtUtilTools.StmtInit(conn); IntPtr stmt = StmtUtilTools.StmtInit(conn);
StmtUtilTools.StmtPrepare(stmt, insertSql); StmtUtilTools.StmtPrepare(stmt, insertSql);
StmtUtilTools.SetTableNameTags(stmt, tableName + "_t1", tags); StmtUtilTools.SetTableNameTags(stmt, tableName + "_t1", tags);
StmtUtilTools.BindParamBatch(stmt, mbind); StmtUtilTools.BindParamBatch(stmt, mBinds);
StmtUtilTools.AddBatch(stmt); StmtUtilTools.AddBatch(stmt);
StmtUtilTools.StmtExecute(stmt); StmtUtilTools.StmtExecute(stmt);
StmtUtilTools.StmtClose(stmt); StmtUtilTools.StmtClose(stmt);
DataSource.FreeTaosBind(tags); DataSource.FreeTaosBind(tags);
DataSource.FreeTaosMBind(mbind); DataSource.FreeTaosMBind(mBinds);
string querySql = "select * from " + tableName; string querySql = "select * from " + tableName;
IntPtr res = UtilsTools.ExecuteQuery(conn, querySql); IntPtr res = UtilsTools.ExecuteQuery(conn, querySql);
...@@ -373,7 +373,7 @@ namespace Cases ...@@ -373,7 +373,7 @@ namespace Cases
[Fact(DisplayName = "StableStmtCases.TestBindColumn()")] [Fact(DisplayName = "StableStmtCases.TestBindColumn()")]
public void TestBindColumn() public void TestBindColumn()
{ {
string tableName = "stable_stmt_cases_test_bindcolumn"; string tableName = "stb_stmt_cases_test_bindcolumn";
string createSql = $"create stable if not exists {tableName} " + string createSql = $"create stable if not exists {tableName} " +
"(ts timestamp," + "(ts timestamp," +
"b bool," + "b bool," +
...@@ -408,8 +408,8 @@ namespace Cases ...@@ -408,8 +408,8 @@ namespace Cases
String insertSql = "insert into ? using " + tableName + " tags(?,?,?,?,?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; String insertSql = "insert into ? using " + tableName + " tags(?,?,?,?,?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
String dropSql = $"drop table if exists {tableName};"; String dropSql = $"drop table if exists {tableName};";
TAOS_BIND[] tags = DataSource.GetTags(); TAOS_BIND[] tags = DataSource.GetTags();
TAOS_MULTI_BIND[] mbind = DataSource.GetMultiBindArr(); TAOS_MULTI_BIND[] mBinds = DataSource.GetMultiBindArr();
List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDLL(createSql); List<TDengineMeta> expectResMeta = DataSource.GetMetaFromDDL(createSql);
List<String> expectResData = DataSource.GetMultiBindStableRowData(); List<String> expectResData = DataSource.GetMultiBindStableRowData();
IntPtr conn = UtilsTools.TDConnection(); IntPtr conn = UtilsTools.TDConnection();
...@@ -420,27 +420,27 @@ namespace Cases ...@@ -420,27 +420,27 @@ namespace Cases
StmtUtilTools.StmtPrepare(stmt, insertSql); StmtUtilTools.StmtPrepare(stmt, insertSql);
StmtUtilTools.SetTableNameTags(stmt, tableName + "_t1", tags); StmtUtilTools.SetTableNameTags(stmt, tableName + "_t1", tags);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[0], 0); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[0], 0);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[1], 1); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[1], 1);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[2], 2); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[2], 2);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[3], 3); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[3], 3);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[4], 4); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[4], 4);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[5], 5); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[5], 5);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[6], 6); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[6], 6);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[7], 7); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[7], 7);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[8], 8); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[8], 8);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[9], 9); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[9], 9);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[10], 10); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[10], 10);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[11], 11); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[11], 11);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[12], 12); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[12], 12);
StmtUtilTools.BindSingleParamBatch(stmt, mbind[13], 13); StmtUtilTools.BindSingleParamBatch(stmt, mBinds[13], 13);
StmtUtilTools.AddBatch(stmt); StmtUtilTools.AddBatch(stmt);
StmtUtilTools.StmtExecute(stmt); StmtUtilTools.StmtExecute(stmt);
StmtUtilTools.StmtClose(stmt); StmtUtilTools.StmtClose(stmt);
DataSource.FreeTaosBind(tags); DataSource.FreeTaosBind(tags);
DataSource.FreeTaosMBind(mbind); DataSource.FreeTaosMBind(mBinds);
string querySql = "select * from " + tableName; string querySql = "select * from " + tableName;
IntPtr res = UtilsTools.ExecuteQuery(conn, querySql); IntPtr res = UtilsTools.ExecuteQuery(conn, querySql);
......
using System; using System;
using TDengineDriver; using TDengineDriver;
using System.Runtime.InteropServices;
using System.Text;
using System.Collections.Generic; using System.Collections.Generic;
namespace Test.UtilsTools.ResultSet namespace Test.UtilsTools.ResultSet
{ {
...@@ -17,10 +15,10 @@ namespace Test.UtilsTools.ResultSet ...@@ -17,10 +15,10 @@ namespace Test.UtilsTools.ResultSet
resultData = UtilsTools.GetResData(res); resultData = UtilsTools.GetResData(res);
} }
public ResultSet(List<TDengineMeta> metas, List<String> datas) public ResultSet(List<TDengineMeta> meta, List<String> data)
{ {
resultMeta = metas; resultMeta = meta;
resultData = datas; resultData = data;
} }
public List<String> GetResultData() public List<String> GetResultData()
...@@ -35,5 +33,4 @@ namespace Test.UtilsTools.ResultSet ...@@ -35,5 +33,4 @@ namespace Test.UtilsTools.ResultSet
} }
} }
\ No newline at end of file
...@@ -31,12 +31,12 @@ namespace XUnit.Case.Orderers ...@@ -31,12 +31,12 @@ namespace XUnit.Case.Orderers
yield return testCase; yield return testCase;
} }
} }
private static TValue GetOrCreate<TKey, TValue>( private static TValue GetOrCreate<TKey, TValue>(
IDictionary<TKey, TValue> dictionary, TKey key) IDictionary<TKey, TValue> dictionary, TKey key)
where TKey : struct where TKey : struct
where TValue : new() => where TValue : new() =>
dictionary.TryGetValue(key, out TValue? result) dictionary.TryGetValue(key, out TValue result)
? result ? result
: (dictionary[key] = new TValue()); : (dictionary[key] = new TValue());
} }
......
...@@ -14,11 +14,11 @@ namespace Test.UtilsTools ...@@ -14,11 +14,11 @@ namespace Test.UtilsTools
static string password = "taosdata"; static string password = "taosdata";
static string db = ""; static string db = "";
static short port = 0; static short port = 0;
//get a tdengine connection //get a TDengine connection
public static IntPtr TDConnection() public static IntPtr TDConnection()
{ {
TDengine.Options((int)TDengineInitOption.TDDB_OPTION_CONFIGDIR, GetConfigPath()); TDengine.Options((int)TDengineInitOption.TSDB_OPTION_CONFIGDIR, GetConfigPath());
TDengine.Options((int)TDengineInitOption.TDDB_OPTION_SHELL_ACTIVITY_TIMER, "60"); TDengine.Options((int)TDengineInitOption.TSDB_OPTION_SHELL_ACTIVITY_TIMER, "60");
TDengine.Init(); TDengine.Init();
IntPtr conn = TDengine.Connect(ip, user, password, db, port); IntPtr conn = TDengine.Connect(ip, user, password, db, port);
// UtilsTools.ExecuteUpdate(conn, "drop database if exists csharp"); // UtilsTools.ExecuteUpdate(conn, "drop database if exists csharp");
...@@ -99,16 +99,16 @@ namespace Test.UtilsTools ...@@ -99,16 +99,16 @@ namespace Test.UtilsTools
ExitProgram(); ExitProgram();
} }
List<TDengineMeta> metas = GetResField(res); List<TDengineMeta> metaList = GetResField(res);
int fieldCount = metas.Count; int fieldCount = metaList.Count;
IntPtr rowdata; IntPtr rowdata;
List<string> datas = QueryRes(res, metas); List<string> dataList = QueryRes(res, metaList);
for (int i = 0; i < metas.Count; i++) for (int i = 0; i < metaList.Count; i++)
{ {
for (int j = 0; j < datas.Count; j++) for (int j = 0; j < dataList.Count; j++)
{ {
Console.Write(" {0} \t|", datas[j]); Console.Write(" {0} \t|", dataList[j]);
} }
Console.WriteLine(""); Console.WriteLine("");
} }
...@@ -125,10 +125,10 @@ namespace Test.UtilsTools ...@@ -125,10 +125,10 @@ namespace Test.UtilsTools
ExitProgram(); ExitProgram();
} }
List<TDengineMeta> metas = GetResField(res); List<TDengineMeta> metaList = GetResField(res);
result.Add(colName); result.Add(colName);
dataRaw = QueryRes(res, metas); dataRaw = QueryRes(res, metaList);
result.Add(dataRaw); result.Add(dataRaw);
if (TDengine.ErrorNo(res) != 0) if (TDengine.ErrorNo(res) != 0)
...@@ -159,7 +159,7 @@ namespace Test.UtilsTools ...@@ -159,7 +159,7 @@ namespace Test.UtilsTools
{ {
if (TDengine.Close(conn) == 0) if (TDengine.Close(conn) == 0)
{ {
Console.WriteLine("close connection sucess"); Console.WriteLine("close connection success");
} }
else else
{ {
...@@ -169,8 +169,8 @@ namespace Test.UtilsTools ...@@ -169,8 +169,8 @@ namespace Test.UtilsTools
} }
public static List<TDengineMeta> GetResField(IntPtr res) public static List<TDengineMeta> GetResField(IntPtr res)
{ {
List<TDengineMeta> metas = TDengine.FetchFields(res); List<TDengineMeta> metaList = TDengine.FetchFields(res);
return metas; return metaList;
} }
public static void AssertEqual(string expectVal, string actualVal) public static void AssertEqual(string expectVal, string actualVal)
{ {
...@@ -274,11 +274,11 @@ namespace Test.UtilsTools ...@@ -274,11 +274,11 @@ namespace Test.UtilsTools
return _meta; return _meta;
} }
private static List<string> QueryRes(IntPtr res, List<TDengineMeta> metas) private static List<string> QueryRes(IntPtr res, List<TDengineMeta> meta)
{ {
IntPtr taosRow; IntPtr taosRow;
List<string> dataRaw = new List<string>(); List<string> dataRaw = new List<string>();
int fieldCount = metas.Count; int fieldCount = meta.Count;
while ((taosRow = TDengine.FetchRows(res)) != IntPtr.Zero) while ((taosRow = TDengine.FetchRows(res)) != IntPtr.Zero)
{ {
dataRaw.AddRange(FetchRow(taosRow, res)); dataRaw.AddRange(FetchRow(taosRow, res));
...@@ -294,7 +294,7 @@ namespace Test.UtilsTools ...@@ -294,7 +294,7 @@ namespace Test.UtilsTools
// Generate insert sql for the with the coldata and tag data // Generate insert sql for the with the coldata and tag data
public static string ConstructInsertSql(string table, string stable, List<Object> colData, List<Object> tagData, int numOfRows) public static string ConstructInsertSql(string table, string stable, List<Object> colData, List<Object> tagData, int numOfRows)
{ {
int numofFileds = colData.Count / numOfRows; int numOfFields = colData.Count / numOfRows;
StringBuilder insertSql; StringBuilder insertSql;
if (stable == "") if (stable == "")
...@@ -339,7 +339,7 @@ namespace Test.UtilsTools ...@@ -339,7 +339,7 @@ namespace Test.UtilsTools
insertSql.Append(colData[i]); insertSql.Append(colData[i]);
} }
if ((i + 1) % numofFileds == 0 && (i + 1) != colData.Count) if ((i + 1) % numOfFields == 0 && (i + 1) != colData.Count)
{ {
insertSql.Append(")("); insertSql.Append(")(");
} }
...@@ -500,8 +500,8 @@ namespace Test.UtilsTools ...@@ -500,8 +500,8 @@ namespace Test.UtilsTools
{ {
ExitProgram(); ExitProgram();
} }
List<TDengineMeta> metas = GetResField(res); List<TDengineMeta> meta = GetResField(res);
dataRaw = QueryRes(res, metas); dataRaw = QueryRes(res, meta);
return dataRaw; return dataRaw;
} }
} }
......
...@@ -8,7 +8,7 @@ namespace TDengineDriver.Test ...@@ -8,7 +8,7 @@ namespace TDengineDriver.Test
{ {
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameBool</Name> /// <Name>TestTDengineMeta.TestTypeNameBool</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's bool meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's bool meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -24,7 +24,7 @@ namespace TDengineDriver.Test ...@@ -24,7 +24,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameTINYINT</Name> /// <Name>TestTDengineMeta.TestTypeNameTINYINT</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's TinnyInt's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's TinnyInt's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -40,7 +40,7 @@ namespace TDengineDriver.Test ...@@ -40,7 +40,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameSMALLINT</Name> /// <Name>TestTDengineMeta.TestTypeNameSMALLINT</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's SMALLINT's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's SMALLINT's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -56,7 +56,7 @@ namespace TDengineDriver.Test ...@@ -56,7 +56,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameINT</Name> /// <Name>TestTDengineMeta.TestTypeNameINT</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's INT's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's INT's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -72,7 +72,7 @@ namespace TDengineDriver.Test ...@@ -72,7 +72,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameBIGINT</Name> /// <Name>TestTDengineMeta.TestTypeNameBIGINT</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's BIGINT's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's BIGINT's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -88,7 +88,7 @@ namespace TDengineDriver.Test ...@@ -88,7 +88,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameUTINYINT</Name> /// <Name>TestTDengineMeta.TestTypeNameUTINYINT</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's TINYINT UNSIGNED's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's TINYINT UNSIGNED's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -104,7 +104,7 @@ namespace TDengineDriver.Test ...@@ -104,7 +104,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameUSMALLINT</Name> /// <Name>TestTDengineMeta.TestTypeNameUSMALLINT</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's SMALLINT UNSIGNED's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's SMALLINT UNSIGNED's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -120,7 +120,7 @@ namespace TDengineDriver.Test ...@@ -120,7 +120,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameUINT</Name> /// <Name>TestTDengineMeta.TestTypeNameUINT</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's INT UNSIGNED's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's INT UNSIGNED's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -136,7 +136,7 @@ namespace TDengineDriver.Test ...@@ -136,7 +136,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameUBIGINT</Name> /// <Name>TestTDengineMeta.TestTypeNameUBIGINT</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's BIGINT UNSIGNED's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's BIGINT UNSIGNED's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -152,7 +152,7 @@ namespace TDengineDriver.Test ...@@ -152,7 +152,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameFLOAT</Name> /// <Name>TestTDengineMeta.TestTypeNameFLOAT</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's FLOAT's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's FLOAT's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -168,7 +168,7 @@ namespace TDengineDriver.Test ...@@ -168,7 +168,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameDOUBLE</Name> /// <Name>TestTDengineMeta.TestTypeNameDOUBLE</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's DOUBLE's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's DOUBLE's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -184,7 +184,7 @@ namespace TDengineDriver.Test ...@@ -184,7 +184,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameSTRING</Name> /// <Name>TestTDengineMeta.TestTypeNameSTRING</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's BINARY's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's BINARY's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -200,7 +200,7 @@ namespace TDengineDriver.Test ...@@ -200,7 +200,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameTIMESTAMP</Name> /// <Name>TestTDengineMeta.TestTypeNameTIMESTAMP</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's TIMESTAMP's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's TIMESTAMP's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -216,7 +216,7 @@ namespace TDengineDriver.Test ...@@ -216,7 +216,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameNCHAR</Name> /// <Name>TestTDengineMeta.TestTypeNameNCHAR</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's NCHAR's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's NCHAR's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
...@@ -232,7 +232,7 @@ namespace TDengineDriver.Test ...@@ -232,7 +232,7 @@ namespace TDengineDriver.Test
} }
/// <author>xiaolei</author> /// <author>xiaolei</author>
/// <Name>TestTDengineMeta.TestTypeNameUndefined</Name> /// <Name>TestTDengineMeta.TestTypeNameUndefined</Name>
/// <describe>Unit test for oject TDengineDriver.TDengineMeta's undefine's meta info</describe> /// <describe>Unit test for object TDengineDriver.TDengineMeta's undefine's meta info</describe>
/// <filename>TestTDengineMeta.cs</filename> /// <filename>TestTDengineMeta.cs</filename>
/// <result>pass or failed </result> /// <result>pass or failed </result>
[Fact] [Fact]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册