From f5219bb2977dc6e9a30970069bf6e71e153c26f6 Mon Sep 17 00:00:00 2001 From: freemine Date: Fri, 30 Oct 2020 22:24:04 +0800 Subject: [PATCH] add test cases --- src/connector/odbc/src/install.sh | 1 + src/connector/odbc/tests/create_data.stmts | 12 ++++++++++++ src/connector/odbc/tests/query_data.stmts | 1 + 3 files changed, 14 insertions(+) create mode 100644 src/connector/odbc/tests/create_data.stmts create mode 100644 src/connector/odbc/tests/query_data.stmts diff --git a/src/connector/odbc/src/install.sh b/src/connector/odbc/src/install.sh index b8c04677c7..6f45ce4357 100755 --- a/src/connector/odbc/src/install.sh +++ b/src/connector/odbc/src/install.sh @@ -19,6 +19,7 @@ Description=Connection to TAOS Driver=TAOS EOF +# better remove first ? sudo odbcinst -i -d -f "${BLD_DIR}/template.ini" && odbcinst -i -s -f "${BLD_DIR}/template.dsn" && echo "odbc install done" diff --git a/src/connector/odbc/tests/create_data.stmts b/src/connector/odbc/tests/create_data.stmts new file mode 100644 index 0000000000..549cb583d8 --- /dev/null +++ b/src/connector/odbc/tests/create_data.stmts @@ -0,0 +1,12 @@ +P:drop database if exists m; +P:create database m; +P:use m; + +P:drop table if exists t; +P:create table t (ts timestamp, b bool, v1 tinyint, v2 smallint, v4 int, v8 bigint, f4 float, f8 double, blob binary(3), name nchar(1)); +P:insert into t (ts, blob, name) values('2020-10-10 00:00:00', 0, 1); +P:insert into t (ts, blob, name) values('2020-10-10 00:00:00.001', 1, 2); +P:insert into t (ts, blob, name) values('2020-10-10 00:00:00.002', '你', '好'); +P:insert into t (ts, blob, name) values('2020-10-10 00:00:00.003', 'abc', 'd'); +P:select * from t; + diff --git a/src/connector/odbc/tests/query_data.stmts b/src/connector/odbc/tests/query_data.stmts new file mode 100644 index 0000000000..b0e9ea27ea --- /dev/null +++ b/src/connector/odbc/tests/query_data.stmts @@ -0,0 +1 @@ +P:select * from m.t; -- GitLab