Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/TDengine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PackageId>TDengine.Connector</PackageId>
<PackageIcon>image\logo.jpg</PackageIcon>
<PackageReadmeFile>docs\README.md</PackageReadmeFile>
<Version>3.1.6</Version>
<Version>3.1.7</Version>
<Authors>taosdata</Authors>
<Company>https://tdengine.com/</Company>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
63 changes: 35 additions & 28 deletions test/Driver.Test/Function.Test/FetchFields.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using Test.Utils;
using TDengine.Driver;
using System.Collections.Generic;
using Xunit;
using Test.Utils.ResultSet;
using Test.Fixture;
using TDengine.Driver;
using Test.Case.Attributes;
using Test.Fixture;
using Test.Utils;
using Test.Utils.ResultSet;
using Xunit;
using Xunit.Abstractions;

namespace Function.Test.Taosc
Expand All @@ -21,21 +21,23 @@ public FetchFieldCases(DatabaseFixture fixture, ITestOutputHelper output)
{
this._database = fixture;
this._output = output;

}

/// <author>xiaolei</author>
/// <Name>FetchFieldsCases.TestFetchFieldsJsonTag</Name>
/// <describe>test taos_fetch_fields(), check the meta data</describe>
/// <filename>FetchFields.cs</filename>
/// <result>pass or failed </result>
[Fact(DisplayName = "FetchFieldsCases.TestFetchFieldJsonTag()"), TestExeOrder(1), Trait("Category", "FetchFieldJsonTag")]
[Fact(DisplayName = "FetchFieldsCases.TestFetchFieldJsonTag()"), TestExeOrder(1),
Trait("Category", "FetchFieldJsonTag")]
public void TestFetchFieldJsonTag()
{
IntPtr conn = _database.Conn;
Assert.NotEqual(conn, IntPtr.Zero);
IntPtr _res = IntPtr.Zero;
string tableName = "fetch_fields";
var expectResMeta = new List<TDengineMeta> {
var expectResMeta = new List<TDengineMeta>
{
Tools.ConstructTDengineMeta("ts", "timestamp"),
Tools.ConstructTDengineMeta("b", "bool"),
Tools.ConstructTDengineMeta("v1", "tinyint"),
Expand All @@ -49,29 +51,33 @@ public void TestFetchFieldJsonTag()
Tools.ConstructTDengineMeta("u4", "int unsigned"),
Tools.ConstructTDengineMeta("u8", "bigint unsigned"),
Tools.ConstructTDengineMeta("bin", "binary(200)"),
Tools.ConstructTDengineMeta("blob", "nchar(200)"),
Tools.ConstructTDengineMeta("c_nchar", "nchar(200)"),
Tools.ConstructTDengineMeta("jsontag", "json"),
};
var expectResData = new List<String> { "1637064040000", "true", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "XI", "XII", "{\"k1\": \"v1\"}" };
var expectResData = new List<String>
{
"1637064040000", "true", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "XI", "XII",
"{\"k1\": \"v1\"}"
};
String dropTb = "drop table if exists " + tableName;
string createTb = $"create stable {tableName}" +
"(ts timestamp" +
",b bool" +
",v1 tinyint" +
",v2 smallint" +
",v4 int" +
",v8 bigint" +
",f4 float" +
",f8 double" +
",u1 tinyint unsigned" +
",u2 smallint unsigned" +
",u4 int unsigned" +
",u8 bigint unsigned" +
",bin binary(200)" +
",blob nchar(200)" +
")" +
"tags" +
"(jsontag json);";
"(ts timestamp" +
",b bool" +
",v1 tinyint" +
",v2 smallint" +
",v4 int" +
",v8 bigint" +
",f4 float" +
",f8 double" +
",u1 tinyint unsigned" +
",u2 smallint unsigned" +
",u4 int unsigned" +
",u8 bigint unsigned" +
",bin binary(200)" +
",c_nchar nchar(200)" +
")" +
"tags" +
"(jsontag json);";

String insertSql = $"insert into {tableName}_t1 using {tableName} " +
" tags('{\"k1\": \"v1\"}') " +
Expand All @@ -93,7 +99,8 @@ public void TestFetchFieldJsonTag()
Assert.Equal(expectResMeta[i].type, actualMeta[i].type);
Assert.Equal(expectResMeta[i].size, actualMeta[i].size);
}

_output.WriteLine("FetchFieldsCases.TestFetchFieldJsonTag() pass");
}
}
}
}
12 changes: 6 additions & 6 deletions test/Driver.Test/Function.Test/InsertCn.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;
using Test.Utils;
using TDengine.Driver;
using Xunit;
using System.Collections.Generic;
using System.Text;
using Test.Utils.ResultSet;
using TDengine.Driver;
using Test.Case.Attributes;
using Test.Fixture;
using Test.Utils;
using Test.Utils.ResultSet;
using Xunit;
using Xunit.Abstractions;

namespace Function.Test.Taosc
Expand Down Expand Up @@ -183,7 +183,7 @@ public void TestInsertMultiNTable()

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));";
$"create table if not exists {tableName} (ts timestamp,v4 int,c_nchar nchar(200),location nchar(200),city binary(100),coutry binary(200));";
String insertSql = Tools.ConstructInsertSql(tableName, "", colData, null, 9);
String selectSql = "select * from " + tableName;
String dropSql = "drop table " + tableName;
Expand Down Expand Up @@ -258,7 +258,7 @@ public void TestInsertMultiSTable()
String dropTb = "drop table if exists " + tableName;
String createTb = $"create table if not exists {tableName} (ts timestamp," +
$"v4 int," +
$"blob nchar(200)," +
$"c_nchar nchar(200)," +
$"locate nchar(200)," +
$"country nchar(200)," +
$"city nchar(50)" +
Expand Down