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

[TD-13201]<test>:test cases for Node.js stmt (#10360)

* [TD-13201]<test>:test cases for Node.js stmt

* [TD-13201]<test>:update nodejs stmt test cases.

* [TD-13201]<test>:fix node.js test cases:replace blob to nchr

* [TD-13201]<test>nodejs remove useless case01
上级 6a767f85
...@@ -32,7 +32,7 @@ function stmtBindParamBatchSample() { ...@@ -32,7 +32,7 @@ function stmtBindParamBatchSample() {
`f32 float,` + `f32 float,` +
`d64 double,` + `d64 double,` +
`bnr binary(20),` + `bnr binary(20),` +
`blob nchar(20),` + `nchr nchar(20),` +
`u8 tinyint unsigned,` + `u8 tinyint unsigned,` +
`u16 smallint unsigned,` + `u16 smallint unsigned,` +
`u32 int unsigned,` + `u32 int unsigned,` +
...@@ -46,7 +46,7 @@ function stmtBindParamBatchSample() { ...@@ -46,7 +46,7 @@ function stmtBindParamBatchSample() {
`t_f32 float,` + `t_f32 float,` +
`t_d64 double,` + `t_d64 double,` +
`t_bnr binary(20),` + `t_bnr binary(20),` +
`t_blob nchar(20),` + `t_nchr nchar(20),` +
`t_u8 tinyint unsigned,` + `t_u8 tinyint unsigned,` +
`t_u16 smallint unsigned,` + `t_u16 smallint unsigned,` +
`t_u32 int unsigned,` + `t_u32 int unsigned,` +
...@@ -89,7 +89,7 @@ function stmtBindParamBatchSample() { ...@@ -89,7 +89,7 @@ function stmtBindParamBatchSample() {
tags.bindNchar('TDengine数据'); tags.bindNchar('TDengine数据');
tags.bindUTinyInt(254); tags.bindUTinyInt(254);
tags.bindUSmallInt(65534); tags.bindUSmallInt(65534);
tags.bindUInt(4294967290 / 2); tags.bindUInt(4294967290);
tags.bindUBigInt(164243520000011111n); tags.bindUBigInt(164243520000011111n);
cursor.stmtInit(); cursor.stmtInit();
......
...@@ -34,7 +34,7 @@ function stmtBindParamSample() { ...@@ -34,7 +34,7 @@ function stmtBindParamSample() {
`f32 float,` + `f32 float,` +
`d64 double,` + `d64 double,` +
`bnr binary(20),` + `bnr binary(20),` +
`blob nchar(20),` + `nchr nchar(20),` +
`u8 tinyint unsigned,` + `u8 tinyint unsigned,` +
`u16 smallint unsigned,` + `u16 smallint unsigned,` +
`u32 int unsigned,` + `u32 int unsigned,` +
......
...@@ -33,7 +33,7 @@ function stmtSingleParaBatchSample() { ...@@ -33,7 +33,7 @@ function stmtSingleParaBatchSample() {
`f32 float,` + `f32 float,` +
`d64 double,` + `d64 double,` +
`bnr binary(20),` + `bnr binary(20),` +
`blob nchar(20),` + `nchr nchar(20),` +
`u8 tinyint unsigned,` + `u8 tinyint unsigned,` +
`u16 smallint unsigned,` + `u16 smallint unsigned,` +
`u32 int unsigned,` + `u32 int unsigned,` +
......
...@@ -32,7 +32,7 @@ function stmtUseResultSample() { ...@@ -32,7 +32,7 @@ function stmtUseResultSample() {
`f32 float,` + `f32 float,` +
`d64 double,` + `d64 double,` +
`bnr binary(20),` + `bnr binary(20),` +
`blob nchar(20),` + `nchr nchar(20),` +
`u8 tinyint unsigned,` + `u8 tinyint unsigned,` +
`u16 smallint unsigned,` + `u16 smallint unsigned,` +
`u32 int unsigned,` + `u32 int unsigned,` +
......
...@@ -34,7 +34,7 @@ function stmtBindParamSample(){ ...@@ -34,7 +34,7 @@ function stmtBindParamSample(){
`f32 float,`+ `f32 float,`+
`d64 double,`+ `d64 double,`+
`bnr binary(20),`+ `bnr binary(20),`+
`blob nchar(20),`+ `nchr nchar(20),`+
`u8 tinyint unsigned,`+ `u8 tinyint unsigned,`+
`u16 smallint unsigned,`+ `u16 smallint unsigned,`+
`u32 int unsigned,`+ `u32 int unsigned,`+
......
...@@ -452,7 +452,8 @@ class TaosMultiBind { ...@@ -452,7 +452,8 @@ class TaosMultiBind {
if (element == null || element == undefined) { if (element == null || element == undefined) {
ref.set(mbindIsNullBuf, index * ref.types.char.size, 1, ref.types.char); ref.set(mbindIsNullBuf, index * ref.types.char.size, 1, ref.types.char);
} else { } else {
ref.writeInt64LE(mbindBufferBuf, index * ref.types.uint64.size, element.toString())
ref.writeUInt64LE(mbindBufferBuf, index * ref.types.uint64.size, element.toString())
ref.set(mbindIsNullBuf, index * ref.types.char.size, 0, ref.types.char); ref.set(mbindIsNullBuf, index * ref.types.char.size, 0, ref.types.char);
} }
......
...@@ -222,7 +222,7 @@ describe("test unsigned type", () => { ...@@ -222,7 +222,7 @@ describe("test unsigned type", () => {
",us2 smallint unsigned" + ",us2 smallint unsigned" +
",ui4 int unsigned" + ",ui4 int unsigned" +
",ubi8 bigint unsigned" + ",ubi8 bigint unsigned" +
",desc_blob nchar(200)" + ",desc_nchr nchar(200)" +
");"; ");";
executeUpdate(createSql); executeUpdate(createSql);
let expectResField = getFieldArr(getFeildsFromDll(createSql)); let expectResField = getFieldArr(getFeildsFromDll(createSql));
...@@ -268,7 +268,7 @@ describe("test unsigned type", () => { ...@@ -268,7 +268,7 @@ describe("test unsigned type", () => {
",us2 smallint unsigned" + ",us2 smallint unsigned" +
",ui4 int unsigned" + ",ui4 int unsigned" +
",ubi8 bigint unsigned" + ",ubi8 bigint unsigned" +
",desc_blob nchar(200)" + ",desc_nchr nchar(200)" +
");"; ");";
executeUpdate(createSql); executeUpdate(createSql);
let expectResField = getFieldArr(getFeildsFromDll(createSql)); let expectResField = getFieldArr(getFeildsFromDll(createSql));
...@@ -315,7 +315,7 @@ describe("test unsigned type", () => { ...@@ -315,7 +315,7 @@ describe("test unsigned type", () => {
",us2 smallint unsigned" + ",us2 smallint unsigned" +
",ui4 int unsigned" + ",ui4 int unsigned" +
",ubi8 bigint unsigned" + ",ubi8 bigint unsigned" +
",desc_blob nchar(200)" + ",desc_nchr nchar(200)" +
");"; ");";
executeUpdate(createSql); executeUpdate(createSql);
let expectResField = getFieldArr(getFeildsFromDll(createSql)); let expectResField = getFieldArr(getFeildsFromDll(createSql));
...@@ -384,7 +384,7 @@ describe("test cn character", () => { ...@@ -384,7 +384,7 @@ describe("test cn character", () => {
`desc:create,insert,query with cn characters;` + `desc:create,insert,query with cn characters;` +
`filename:${fileName};` + `filename:${fileName};` +
`result:${result}`, () => { `result:${result}`, () => {
createSql = "create table if not exists nchartest_s(ts timestamp,value int,text binary(200),detail nchar(200))tags(tag_bi binary(50),tag_blob nchar(50));" createSql = "create table if not exists nchartest_s(ts timestamp,value int,text binary(200),detail nchar(200))tags(tag_bi binary(50),tag_nchr nchar(50));"
executeUpdate(createSql); executeUpdate(createSql);
let expectResField = getFieldArr(getFeildsFromDll(createSql)); let expectResField = getFieldArr(getFeildsFromDll(createSql));
let colData = [1641827743305, 1, 'taosdata', 'tdengine' let colData = [1641827743305, 1, 'taosdata', 'tdengine'
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册