From 6a0d83e8983938c0028dcbc8f20813fb4ac2a7ea Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 27 Apr 2021 17:44:59 +0800 Subject: [PATCH 1/9] [TD-3988]add mac test on Appveyor --- .appveyor.yml | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index fe4816688b..00d585ea9b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,30 +1,49 @@ version: 1.0.{build} -os: Visual Studio 2015 +image: + - Visual Studio 2015 + - macos-mojave environment: matrix: - ARCH: amd64 - ARCH: x86 +matrix: + exclude: + - image: macos-mojave + ARCH: x86 +for: + - + matrix: + only: + - image: Visual Studio 2015 + clone_folder: c:\dev\TDengine + clone_depth: 1 -clone_folder: c:\dev\TDengine -clone_depth: 1 + init: + - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %ARCH% -init: - - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %ARCH% + before_build: + - cd c:\dev\TDengine + - md build -before_build: - - cd c:\dev\TDengine - - md build - -build_script: - - cd build - - cmake -G "NMake Makefiles" .. - - nmake install + build_script: + - cd build + - cmake -G "NMake Makefiles" .. + - nmake install + - + matrix: + only: + - image: macos-mojave + clone_depth: 1 + build_script: + - mkdir debug + - cd debug + - cmake .. > /dev/null + - make > /dev/null notifications: - provider: Email to: - sangshuduo@gmail.com - on_build_success: true on_build_failure: true on_build_status_changed: true From 5caee8ad177d016141d0ad0b2c97c269549c8dd3 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 27 Apr 2021 18:20:48 +0800 Subject: [PATCH 2/9] test for macos --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 00d585ea9b..40210a6cdc 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -32,7 +32,7 @@ for: - matrix: only: - - image: macos-mojave + - image: macos clone_depth: 1 build_script: From 25f5281687d8dadf8ae64d0f17db4ce3068528c2 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 27 Apr 2021 18:23:06 +0800 Subject: [PATCH 3/9] [TD-3987]add drone CI --- .drone.yml | 188 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000000..bafc8ef8b0 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,188 @@ +--- +kind: pipeline +name: test_amd64 + +platform: + os: linux + arch: amd64 + +steps: +- name: build + image: gcc + commands: + - apt-get update + - apt-get install -y cmake build-essential git + - mkdir debug + - cd debug + - cmake .. + - make + when: + branch: + - develop + - master + +- name: smoke_test + image: python:3.8 + commands: + - pip3 install psutil + - pip3 install guppy3 + - pip3 install src/connector/python/linux/python3/ + - cd tests + - ./test-all.sh smoke + when: + branch: + - develop + - master + + +- name: crash_gen + image: python:3.8 + commands: + - pip3 install requests + - pip3 install src/connector/python/linux/python3/ + - pip3 install psutil + - pip3 install guppy3 + - cd tests/pytest + - ./crash_gen.sh -a -p -t 4 -s 200 + when: + branch: + - develop + - master + + +--- +kind: pipeline +name: test_arm64 + +platform: + os: linux + arch: arm64 + +steps: +- name: build + image: gcc + commands: + - apt-get update + - apt-get install -y cmake build-essential + - mkdir debug + - cd debug + - cmake .. -DCPUTYPE=aarch64 > /dev/null + - make + when: + branch: + - develop + - master +--- +kind: pipeline +name: test_arm + +platform: + os: linux + arch: arm + +steps: +- name: build + image: gcc + commands: + - apt-get update + - apt-get install -y cmake build-essential + - mkdir debug + - cd debug + - cmake .. -DCPUTYPE=aarch32 > /dev/null + - make + when: + branch: + - develop + - master + +--- +kind: pipeline +name: build_trusty + +platform: + os: linux + arch: amd64 + +steps: +- name: build + image: ubuntu:trusty + commands: + - apt-get update + - apt-get install -y gcc cmake3 build-essential git binutils-2.26 + + - mkdir debug + - cd debug + - cmake .. + - make + when: + branch: + - develop + - master + +--- +kind: pipeline +name: build_xenial + +platform: + os: linux + arch: amd64 + +steps: +- name: build + image: ubuntu:xenial + commands: + - apt-get update + - apt-get install -y gcc cmake build-essential + - mkdir debug + - cd debug + - cmake .. + - make + when: + branch: + - develop + - master + +--- +kind: pipeline +name: build_bionic +platform: + os: linux + arch: amd64 + +steps: +- name: build + image: ubuntu:bionic + commands: + - apt-get update + - apt-get install -y gcc cmake build-essential + - mkdir debug + - cd debug + - cmake .. + - make + when: + branch: + - develop + - master + +--- +kind: pipeline +name: goodbye + +platform: + os: linux + arch: amd64 + +steps: +- name: 64-bit + image: alpine + commands: + - echo 64-bit is good + when: + branch: + - develop + - master + + +depends_on: +- test_arm64 +- test_amd64 \ No newline at end of file From 4d21403d3cbc3b7e85ead8c010994f506b95760d Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 27 Apr 2021 18:52:24 +0800 Subject: [PATCH 4/9] modify for mac --- .appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 40210a6cdc..ee1dc91767 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,14 +1,14 @@ version: 1.0.{build} image: - Visual Studio 2015 - - macos-mojave + - macos environment: matrix: - ARCH: amd64 - ARCH: x86 matrix: exclude: - - image: macos-mojave + - image: macos ARCH: x86 for: - From 2677b8867d31b9de560583a1029888da0c402358 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 27 Apr 2021 19:11:09 +0800 Subject: [PATCH 5/9] test for drone --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index bafc8ef8b0..2bf88a9022 100644 --- a/.drone.yml +++ b/.drone.yml @@ -176,7 +176,7 @@ steps: - name: 64-bit image: alpine commands: - - echo 64-bit is good + - echo 64-bit is good. when: branch: - develop From aa2e6abbe70e8f824519170feb35ff03173016d2 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Wed, 28 Apr 2021 09:34:03 +0800 Subject: [PATCH 6/9] modify case for crash_gen --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 2bf88a9022..4009b563b4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -43,7 +43,7 @@ steps: - pip3 install psutil - pip3 install guppy3 - cd tests/pytest - - ./crash_gen.sh -a -p -t 4 -s 200 + - ./crash_gen.sh -a -p -t 4 -s 2000 when: branch: - develop From 8a59bbfcf292359b4be9ffcc9b02925b76bb1d60 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Wed, 28 Apr 2021 09:48:34 +0800 Subject: [PATCH 7/9] add drone badges --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 45a955f458..cc413c400f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![Build Status](https://travis-ci.org/taosdata/TDengine.svg?branch=master)](https://travis-ci.org/taosdata/TDengine) +[![Build Status](https://cloud.drone.io/api/badges/taosdata/TDengine/status.svg)](https://cloud.drone.io/taosdata/TDengine) [![Build status](https://ci.appveyor.com/api/projects/status/kf3pwh2or5afsgl9/branch/master?svg=true)](https://ci.appveyor.com/project/sangshuduo/tdengine-2n8ge/branch/master) [![Coverage Status](https://coveralls.io/repos/github/taosdata/TDengine/badge.svg?branch=develop)](https://coveralls.io/github/taosdata/TDengine?branch=develop) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4201/badge)](https://bestpractices.coreinfrastructure.org/projects/4201) From 46fcd89aa3d02df78a00c1516c2fe40c23e285b7 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Wed, 28 Apr 2021 09:59:33 +0800 Subject: [PATCH 8/9] update badges --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index cc413c400f..78f902babe 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -[![Build Status](https://travis-ci.org/taosdata/TDengine.svg?branch=master)](https://travis-ci.org/taosdata/TDengine) -[![Build Status](https://cloud.drone.io/api/badges/taosdata/TDengine/status.svg)](https://cloud.drone.io/taosdata/TDengine) +[![Build Status](https://cloud.drone.io/api/badges/taosdata/TDengine/status.svg?ref=refs/heads/master)](https://cloud.drone.io/taosdata/TDengine) [![Build status](https://ci.appveyor.com/api/projects/status/kf3pwh2or5afsgl9/branch/master?svg=true)](https://ci.appveyor.com/project/sangshuduo/tdengine-2n8ge/branch/master) [![Coverage Status](https://coveralls.io/repos/github/taosdata/TDengine/badge.svg?branch=develop)](https://coveralls.io/github/taosdata/TDengine?branch=develop) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4201/badge)](https://bestpractices.coreinfrastructure.org/projects/4201) From 5f2f20cf1a1c76be386def7aeafe5621a74a5563 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Tue, 27 Apr 2021 14:49:41 +0800 Subject: [PATCH 9/9] [TD-3948]: insert syntax - specify columns after supertable tags --- src/client/src/tscParseInsert.c | 36 ++++++++++++++++++++++++ tests/script/general/parser/function.sim | 13 +++++++++ 2 files changed, 49 insertions(+) diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index ae6e2430b7..79ceb81cbc 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -928,6 +928,42 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC return tscSQLSyntaxErrMsg(pCmd->payload, ") expected", sToken.z); } + /* parse columns after super table tags values. + * insert into table_name using super_table(tag_name1, tag_name2) tags(tag_val1, tag_val2) + * (normal_col1, normal_col2) values(normal_col1_val, normal_col2_val); + * */ + index = 0; + sToken = tStrGetToken(sql, &index, false); + sql += index; + int numOfColsAfterTags = 0; + if (sToken.type == TK_LP) { + if (*boundColumn != NULL) { + return tscSQLSyntaxErrMsg(pCmd->payload, "bind columns again", sToken.z); + } else { + *boundColumn = &sToken.z[0]; + } + + while (1) { + index = 0; + sToken = tStrGetToken(sql, &index, false); + + if (sToken.type == TK_RP) { + break; + } + + sql += index; + ++numOfColsAfterTags; + } + + if (numOfColsAfterTags == 0 && (*boundColumn) != NULL) { + return TSDB_CODE_TSC_INVALID_SQL; + } + + sToken = tStrGetToken(sql, &index, false); + } + + sql = sToken.z; + if (tscValidateName(&tableToken) != TSDB_CODE_SUCCESS) { return tscInvalidSQLErrMsg(pCmd->payload, "invalid table name", *sqlstr); } diff --git a/tests/script/general/parser/function.sim b/tests/script/general/parser/function.sim index 9165b7e98e..65058333fb 100644 --- a/tests/script/general/parser/function.sim +++ b/tests/script/general/parser/function.sim @@ -393,6 +393,19 @@ if $rows != 24 then return -1 endi +print ========================> TD-3948 +sql drop table if exists meters +sql create stable meters (ts timestamp, current float, voltage int, phase float) tags (location binary(64), groupId int); +sql_error insert into td3948Err1(phase) using meters tags ("Beijng.Chaoyang", 2) (ts, current) values (now, 10.2); +sql_error insert into td3948Err2(phase, voltage) using meters tags ("Beijng.Chaoyang", 2) (ts, current) values (now, 10.2); +sql_error insert into td3948Err3(phase, current) using meters tags ("Beijng.Chaoyang", 2) (ts, current) values (now, 10.2); +sql insert into td3948 using meters tags ("Beijng.Chaoyang", 2) (ts, current) values (now, 10.2); +sql select count(ts) from td3948; +if $rows != 1 then + print expect 1, actual:$rows + return -1 +endi + print ========================> TD-2740 sql drop table if exists m1; sql create table m1(ts timestamp, k int) tags(a int);