Skip to content

Commit

Permalink
fix: support release compile (#587)
Browse files Browse the repository at this point in the history
* fix: stringop-overflow compile error

* fix: merge with develop

* fix: make deps/toolscJson/src/toolscJson.c same as upstream
  • Loading branch information
sangshuduo authored Feb 21, 2023
1 parent 2942ca0 commit 61cbfd2
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/3.0-coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor'
ref: 'chore/sangshuduo/TD-22652-stringop-overflow'

- name: Change time zone
if:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-macos-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor'
ref: 'chore/sangshuduo/TD-22652-stringop-overflow'

- name: Change time zone
if: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-macos-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor'
ref: 'chore/sangshuduo/TD-22652-stringop-overflow'

- name: Change time zone
if: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-non-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
echo "clone TDengine 3.0 on ${{ steps.setup.outputs.uname }}"
git clone --branch fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor --depth 1 https://github.com/taosdata/TDengine > /dev/null || exit 1
git clone --branch chore/sangshuduo/TD-22652-stringop-overflow --depth 1 https://github.com/taosdata/TDengine > /dev/null || exit 1
echo "build TDengine 3.0 on ${{ steps.setup.outputs.uname }}"
cd TDengine || exit 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-taosBenchmark-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor'
ref: 'chore/sangshuduo/TD-22652-stringop-overflow'

- name: Change time zone
if: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-taosBenchmark-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor'
ref: 'chore/sangshuduo/TD-22652-stringop-overflow'

- name: Change time zone
if: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-taosdump-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor'
ref: 'chore/sangshuduo/TD-22652-stringop-overflow'

- name: Change time zone
if:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-taosdump-release-ws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor'
ref: 'chore/sangshuduo/TD-22652-stringop-overflow'

- name: Change time zone
if:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-taosdump-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor'
ref: 'chore/sangshuduo/TD-22652-stringop-overflow'

- name: Change time zone
if:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor'
ref: 'chore/sangshuduo/TD-22652-stringop-overflow'

- name: create debug directory
if: |
Expand Down
2 changes: 0 additions & 2 deletions deps/toolscJson/src/toolscJson.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,6 @@ static tools_cJSON_bool parse_number(tools_cJSON * const item, parse_buffer * co

input_buffer->offset += (size_t)(after_end - number_c_string);

strncpy(item->numberstring, (const char *)number_c_string, strlen((const char*)number_c_string));

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin
IF (CMAKE_C_COMPILER_ID MATCHES "GNU")
MESSAGE("Compiler is: ${CMAKE_C_COMPILER_ID}, version: ${CMAKE_C_COMPILER_VERSION}")
IF (CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.8.5)
SET(CMAKE_C_FLAGS "-Wall -Wshadow -std=c99 -std=gnu11 -O3 -DRELEASE -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation ${GCC_COVERAGE_COMPILE_FLAGS} ${TOOLS_SANITIZE_FLAG}")
SET(CMAKE_C_FLAGS "-Wall -Wshadow -std=c99 -std=gnu11 -O3 -DRELEASE -Werror -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation ${GCC_COVERAGE_COMPILE_FLAGS} ${TOOLS_SANITIZE_FLAG}")
ELSE ()
SET(CMAKE_C_FLAGS "-Wall -Wshadow -std=c99 -std=gnu11 -O3 -DRELEASE ${GCC_COVERAGE_COMPILE_FLAGS}")
ENDIF ()
Expand Down
6 changes: 3 additions & 3 deletions src/benchData.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ static int generateRandDataSQL(SSuperTable *stbInfo, char *sampleDataBuf,
continue;
}

int n;
int n = 0;
if (field->null) {
n = snprintf(sampleDataBuf + pos, bufLen - pos, "null,");
if (n < 0 || n >= bufLen - pos) {
Expand Down Expand Up @@ -616,7 +616,7 @@ static int generateRandDataStmt(
int fieldsSize = fields->size;
for (int i = 0; i < fieldsSize; ++i) {
Field * field = benchArrayGet(fields, i);
int n;
int n = 0;
switch (field->type) {
case TSDB_DATA_TYPE_BOOL: {
bool rand_bool = (taosRandom() % 2) & 1;
Expand Down Expand Up @@ -764,7 +764,7 @@ static int generateRandDataSmlTelnet(SSuperTable *stbInfo, char *sampleDataBuf,
}
for (int i = 0; i < fieldsSize; ++i) {
Field * field = benchArrayGet(fields, i);
int n;
int n = 0;
switch (field->type) {
case TSDB_DATA_TYPE_BOOL: {
bool rand_bool = (taosRandom() % 2) & 1;
Expand Down

0 comments on commit 61cbfd2

Please sign in to comment.