未验证 提交 3907637d 编写于 作者: wafwerar's avatar wafwerar 提交者: GitHub

[TD-11063]<fix>: Support gcc4.4. (#8740)

* [TD-11063]<fix>: Support gcc4.4.

* [TS-615]<CI>add Ningsi OS

* make jenkins happy
Co-authored-by: Nliuyq-617 <yqliu@taosdata.com>
上级 b1d7c094
......@@ -181,7 +181,76 @@ def pre_test_noinstall(){
'''
return 1
}
def pre_test_ningsi(){
sh'hostname'
sh'''
cd ${WKC}
git reset --hard HEAD~10 >/dev/null
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WKC}
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WKC}
git checkout 2.0
'''
}
else{
sh '''
cd ${WKC}
git checkout develop
'''
}
}
sh'''
cd ${WKC}
git pull >/dev/null
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
git clean -dfx
git submodule update --init --recursive
cd ${WK}
git reset --hard HEAD~10
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WK}
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WK}
git checkout 2.0
'''
}
else{
sh '''
cd ${WK}
git checkout develop
'''
}
}
sh '''
cd ${WK}
git pull >/dev/null
export TZ=Asia/Harbin
date
git clean -dfx
mkdir debug
cd debug
cmake .. -DOSTYPE=Ningsi60 > /dev/null
make
'''
return 1
}
def pre_test_win(){
bat '''
taskkill /f /t /im python.exe
......@@ -578,6 +647,13 @@ pipeline {
pre_test_noinstall()
}
}
stage('ningsi') {
agent{label "ningsi"}
steps {
pre_test_ningsi()
}
}
stage('build'){
agent{label " wintest "}
......
......@@ -29,7 +29,7 @@
A Unix time_t is the number of 1-second intervals since January 1, 1970.
time_ts are expressed in the GMT time zone. DOS times in the current local time.
*/
time_t Filetime2Timet(uint16_t date, uint16_t time) {
time_t Filetime2Timet(uint16_t date, uint16_t deps_time) {
unsigned int year, month, day, hour, minute, second;
struct tm stm;
......@@ -37,9 +37,9 @@ time_t Filetime2Timet(uint16_t date, uint16_t time) {
year = 1980 + ((date & 0xFE00) >> 9);
month = (date & 0x1E0) >> 5;
day = date & 0x1F;
hour = (time & 0xF800) >> 11;
minute = (time & 0x7E0) >> 5;
second = 2 * (time & 0x1F);
hour = (deps_time & 0xF800) >> 11;
minute = (deps_time & 0x7E0) >> 5;
second = 2 * (deps_time & 0x1F);
stm.tm_year = (int)year - 1900;
stm.tm_mon = (int)month - 1;
......@@ -55,7 +55,7 @@ time_t Filetime2Timet(uint16_t date, uint16_t time) {
#if 0
/* Older version of the same, trying to generate the time_t manually.
Did not handle DST well */
time_t Filetime2Timet(uint16_t date, uint16_t time) {
time_t Filetime2Timet(uint16_t date, uint16_t deps_time) {
unsigned int year, month, day, hour, minute, second;
unsigned int olympiads; /* 4-year periods */
unsigned long t = 0;
......@@ -64,9 +64,9 @@ time_t Filetime2Timet(uint16_t date, uint16_t time) {
year = 1980 + ((date & 0xFE00) >> 9);
month = (date & 0x1E0) >> 5;
day = date & 0x1F;
hour = (time & 0xF800) >> 11;
minute = (time & 0x7E0) >> 5;
second = 2 * (time & 0x1F);
hour = (deps_time & 0xF800) >> 11;
minute = (deps_time & 0x7E0) >> 5;
second = 2 * (deps_time & 0x1F);
/* Count days */
year -= 1970; /* Start of Unix time_t epoch */
......@@ -111,16 +111,16 @@ time_t Filetime2Timet(uint16_t date, uint16_t time) {
#endif
/* Generate a string with the local file time, in the ISO 8601 date/time format */
char *Filetime2String(uint16_t date, uint16_t time, char *pBuf, size_t nBufSize) {
char *Filetime2String(uint16_t date, uint16_t deps_time, char *pBuf, size_t nBufSize) {
unsigned int year, month, day, hour, minute, second;
/* Decode fields */
year = 1980 + ((date & 0xFE00) >> 9);
month = (date & 0x1E0) >> 5;
day = date & 0x1F;
hour = (time & 0xF800) >> 11;
minute = (time & 0x7E0) >> 5;
second = 2 * (time & 0x1F);
hour = (deps_time & 0xF800) >> 11;
minute = (deps_time & 0x7E0) >> 5;
second = 2 * (deps_time & 0x1F);
if (nBufSize >= 20) {
sprintf(pBuf, "%04d-%02d-%02d %02d:%02d:%02d", year, month, day, hour, minute, second);
......
......@@ -49,8 +49,8 @@
typedef struct {
const unsigned char *json;
size_t position;
} error;
static error global_error = { NULL, 0 };
} deps_error;
static deps_error global_error = { NULL, 0 };
CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void)
{
......@@ -210,8 +210,8 @@ typedef struct
#define can_read(buffer, size) ((buffer != NULL) && (((buffer)->offset + size) <= (buffer)->length))
#define cannot_read(buffer, size) (!can_read(buffer, size))
/* check if the buffer can be accessed at the given index (starting with 0) */
#define can_access_at_index(buffer, index) ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length))
#define cannot_access_at_index(buffer, index) (!can_access_at_index(buffer, index))
#define can_access_at_index(buffer, deps_index) ((buffer != NULL) && (((buffer)->offset + deps_index) < (buffer)->length))
#define cannot_access_at_index(buffer, deps_index) (!can_access_at_index(buffer, deps_index))
/* get a pointer to the buffer at the position */
#define buffer_at_offset(buffer) ((buffer)->content + (buffer)->offset)
......@@ -992,7 +992,7 @@ fail:
if (value != NULL)
{
error local_error;
deps_error local_error;
local_error.json = (const unsigned char*)value;
local_error.position = 0;
......@@ -1683,7 +1683,7 @@ CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array)
return (int)size;
}
static cJSON* get_array_item(const cJSON *array, size_t index)
static cJSON* get_array_item(const cJSON *array, size_t deps_index)
{
cJSON *current_child = NULL;
......@@ -1693,23 +1693,23 @@ static cJSON* get_array_item(const cJSON *array, size_t index)
}
current_child = array->child;
while ((current_child != NULL) && (index > 0))
while ((current_child != NULL) && (deps_index > 0))
{
index--;
deps_index--;
current_child = current_child->next;
}
return current_child;
}
CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index)
CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int deps_index)
{
if (index < 0)
if (deps_index < 0)
{
return NULL;
}
return get_array_item(array, (size_t)index);
return get_array_item(array, (size_t)deps_index);
}
static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bool case_sensitive)
......
......@@ -30,7 +30,7 @@ int main (int argc, char *argv[])
{
unsigned int data[0x100000];
int uni2index[0x110000];
int index;
int deps_index;
if (argc != 1)
exit(1);
......@@ -64,7 +64,7 @@ int main (int argc, char *argv[])
int j;
for (j = 0; j < 0x110000; j++)
uni2index[j] = -1;
index = 0;
deps_index = 0;
for (;;) {
c = getc(stdin);
if (c == EOF)
......@@ -86,8 +86,8 @@ int main (int argc, char *argv[])
if (c == '\t')
break;
if (uni2index[j] < 0) {
uni2index[j] = index;
data[index++] = 0;
uni2index[j] = deps_index;
data[deps_index++] = 0;
}
if (c >= 0x80) {
/* Finish reading an UTF-8 character. */
......@@ -104,17 +104,17 @@ int main (int argc, char *argv[])
}
}
}
data[index++] = (unsigned int) c;
data[deps_index++] = (unsigned int) c;
}
if (uni2index[j] >= 0)
data[uni2index[j]] = index - uni2index[j] - 1;
data[uni2index[j]] = deps_index - uni2index[j] - 1;
do { c = getc(stdin); } while (!(c == EOF || c == '\n'));
}
}
printf("static const unsigned int translit_data[%d] = {",index);
printf("static const unsigned int translit_data[%d] = {",deps_index);
{
int i;
for (i = 0; i < index; i++) {
for (i = 0; i < deps_index; i++) {
if (data[i] < 32)
printf("\n %3d,",data[i]);
else if (data[i] == '\'')
......
......@@ -491,7 +491,7 @@ const char * iconv_canonicalize (const char * name)
char* bp;
const struct alias * ap;
unsigned int count;
unsigned int index;
unsigned int deps_index;
const char* pool;
/* Before calling aliases_lookup, convert the input string to upper case,
......@@ -555,23 +555,23 @@ const char * iconv_canonicalize (const char * name)
This is also the case on native Woe32 systems. */
#if __STDC_ISO_10646__ || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
if (sizeof(wchar_t) == 4) {
index = ei_ucs4internal;
deps_index = ei_ucs4internal;
break;
}
if (sizeof(wchar_t) == 2) {
index = ei_ucs2internal;
deps_index = ei_ucs2internal;
break;
}
if (sizeof(wchar_t) == 1) {
index = ei_iso8859_1;
deps_index = ei_iso8859_1;
break;
}
#endif
}
index = ap->encoding_index;
deps_index = ap->encoding_index;
break;
}
return all_canonical[index] + pool;
return all_canonical[deps_index] + pool;
invalid:
return name;
}
......
......@@ -569,9 +569,9 @@ extern "C" {
return FALSE;
}
AccessibleContext GetAccessibleChildFromContext(long vmID, AccessibleContext ac, jint index) {
AccessibleContext GetAccessibleChildFromContext(long vmID, AccessibleContext ac, jint deps_index) {
if (theAccessBridgeInitializedFlag == TRUE) {
return theAccessBridge.GetAccessibleChildFromContext(vmID, ac, index);
return theAccessBridge.GetAccessibleChildFromContext(vmID, ac, deps_index);
}
return (AccessibleContext) 0;
}
......@@ -711,9 +711,9 @@ extern "C" {
* return the row number for a cell at a given index
*/
jint
getAccessibleTableRow(long vmID, AccessibleTable table, jint index) {
getAccessibleTableRow(long vmID, AccessibleTable table, jint deps_index) {
if (theAccessBridgeInitializedFlag == TRUE) {
return theAccessBridge.getAccessibleTableRow(vmID, table, index);
return theAccessBridge.getAccessibleTableRow(vmID, table, deps_index);
}
return -1;
}
......@@ -722,9 +722,9 @@ extern "C" {
* return the column number for a cell at a given index
*/
jint
getAccessibleTableColumn(long vmID, AccessibleTable table, jint index) {
getAccessibleTableColumn(long vmID, AccessibleTable table, jint deps_index) {
if (theAccessBridgeInitializedFlag == TRUE) {
return theAccessBridge.getAccessibleTableColumn(vmID, table, index);
return theAccessBridge.getAccessibleTableColumn(vmID, table, deps_index);
}
return -1;
}
......@@ -753,9 +753,9 @@ extern "C" {
return FALSE;
}
BOOL GetAccessibleTextItems(long vmID, AccessibleText at, AccessibleTextItemsInfo *textItems, jint index) {
BOOL GetAccessibleTextItems(long vmID, AccessibleText at, AccessibleTextItemsInfo *textItems, jint deps_index) {
if (theAccessBridgeInitializedFlag == TRUE) {
return theAccessBridge.GetAccessibleTextItems(vmID, at, textItems, index);
return theAccessBridge.GetAccessibleTextItems(vmID, at, textItems, deps_index);
}
return FALSE;
}
......@@ -767,23 +767,23 @@ extern "C" {
return FALSE;
}
BOOL GetAccessibleTextAttributes(long vmID, AccessibleText at, jint index, AccessibleTextAttributesInfo *attributes) {
BOOL GetAccessibleTextAttributes(long vmID, AccessibleText at, jint deps_index, AccessibleTextAttributesInfo *attributes) {
if (theAccessBridgeInitializedFlag == TRUE) {
return theAccessBridge.GetAccessibleTextAttributes(vmID, at, index, attributes);
return theAccessBridge.GetAccessibleTextAttributes(vmID, at, deps_index, attributes);
}
return FALSE;
}
BOOL GetAccessibleTextRect(long vmID, AccessibleText at, AccessibleTextRectInfo *rectInfo, jint index) {
BOOL GetAccessibleTextRect(long vmID, AccessibleText at, AccessibleTextRectInfo *rectInfo, jint deps_index) {
if (theAccessBridgeInitializedFlag == TRUE) {
return theAccessBridge.GetAccessibleTextRect(vmID, at, rectInfo, index);
return theAccessBridge.GetAccessibleTextRect(vmID, at, rectInfo, deps_index);
}
return FALSE;
}
BOOL GetAccessibleTextLineBounds(long vmID, AccessibleText at, jint index, jint *startIndex, jint *endIndex) {
BOOL GetAccessibleTextLineBounds(long vmID, AccessibleText at, jint deps_index, jint *startIndex, jint *endIndex) {
if (theAccessBridgeInitializedFlag == TRUE) {
return theAccessBridge.GetAccessibleTextLineBounds(vmID, at, index, startIndex, endIndex);
return theAccessBridge.GetAccessibleTextLineBounds(vmID, at, deps_index, startIndex, endIndex);
}
return FALSE;
}
......@@ -844,7 +844,7 @@ extern "C" {
/*
* This method is used to iterate through the hyperlinks in a component. It
* returns hypertext information for a component starting at hyperlink index
* returns hypertext information for a component starting at hyperlink deps_index
* nStartIndex. No more than MAX_HYPERLINKS AccessibleHypertextInfo objects will
* be returned for each call to this method.
* returns FALSE on error.
......@@ -1109,9 +1109,9 @@ extern "C" {
/**
* Gets the text caret location
*/
BOOL getCaretLocation(long vmID, AccessibleContext ac, AccessibleTextRectInfo *rectInfo, jint index) {
BOOL getCaretLocation(long vmID, AccessibleContext ac, AccessibleTextRectInfo *rectInfo, jint deps_index) {
if (theAccessBridgeInitializedFlag == TRUE) {
return theAccessBridge.getCaretLocation(vmID, ac, rectInfo, index);
return theAccessBridge.getCaretLocation(vmID, ac, rectInfo, deps_index);
}
return FALSE;
}
......
......@@ -114,13 +114,13 @@ static void setprogdir (lua_State *L) {
static void pusherror (lua_State *L) {
int error = GetLastError();
int lua_error = GetLastError();
char buffer[128];
if (FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, error, 0, buffer, sizeof(buffer), NULL))
NULL, lua_error, 0, buffer, sizeof(buffer), NULL))
lua_pushstring(L, buffer);
else
lua_pushfstring(L, "system error %d\n", error);
lua_pushfstring(L, "system error %d\n", lua_error);
}
static void ll_unloadlib (void *lib) {
......
......@@ -120,7 +120,7 @@ static reg_errcode_t build_charclass (re_bitset_ptr_t sbcset,
static bin_tree_t *build_word_op (re_dfa_t *dfa, int not, reg_errcode_t *err);
static void free_bin_tree (bin_tree_t *tree);
static bin_tree_t *create_tree (bin_tree_t *left, bin_tree_t *right,
re_token_type_t type, int index);
re_token_type_t type, int deps_index);
static bin_tree_t *duplicate_tree (const bin_tree_t *src, re_dfa_t *dfa);
/* This table gives an error message for each of the error codes listed
......@@ -3447,11 +3447,11 @@ free_charset (re_charset_t *cset)
Note: This function automatically free left and right if malloc fails. */
static bin_tree_t *
create_tree (left, right, type, index)
create_tree (left, right, type, deps_index)
bin_tree_t *left;
bin_tree_t *right;
re_token_type_t type;
int index;
int deps_index;
{
bin_tree_t *tree;
tree = re_malloc (bin_tree_t, 1);
......@@ -3465,7 +3465,7 @@ create_tree (left, right, type, index)
tree->left = left;
tree->right = right;
tree->type = type;
tree->node_idx = index;
tree->node_idx = deps_index;
tree->first = -1;
tree->next = -1;
re_node_set_init_empty (&tree->eclosure);
......
......@@ -32,7 +32,9 @@ IF (TD_LINUX)
#MESSAGE(STATUS "build version ${TD_VER_NUMBER}")
SET_TARGET_PROPERTIES(taos PROPERTIES VERSION ${TD_VER_NUMBER} SOVERSION 1)
ADD_SUBDIRECTORY(tests)
IF (NOT TD_NINGSI_60)
ADD_SUBDIRECTORY(tests)
ENDIF ()
ELSEIF (TD_DARWIN)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/jni/linux)
......@@ -53,8 +55,9 @@ ELSEIF (TD_DARWIN)
#SOVERSION dylib version
#MESSAGE(STATUS "build version ${TD_VER_NUMBER}")
SET_TARGET_PROPERTIES(taos PROPERTIES VERSION ${TD_VER_NUMBER} SOVERSION 1)
ADD_SUBDIRECTORY(tests)
IF (NOT TD_NINGSI_60)
ADD_SUBDIRECTORY(tests)
ENDIF ()
ELSEIF (TD_WINDOWS)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/jni/windows)
......
......@@ -33,12 +33,12 @@ typedef struct SCompareParam {
int32_t groupOrderType;
} SCompareParam;
static bool needToMerge(SSDataBlock* pBlock, SArray* columnIndexList, int32_t index, char **buf) {
static bool needToMerge(SSDataBlock* pBlock, SArray* columnIndexList, int32_t tsc_index, char **buf) {
int32_t ret = 0;
size_t size = taosArrayGetSize(columnIndexList);
if (size > 0) {
ret = compare_aRv(pBlock, columnIndexList, (int32_t) size, index, buf, TSDB_ORDER_ASC);
ret = compare_aRv(pBlock, columnIndexList, (int32_t) size, tsc_index, buf, TSDB_ORDER_ASC);
}
// if ret == 0, means the result belongs to the same group
......@@ -555,9 +555,9 @@ static void savePrevOrderColumns(char** prevRow, SArray* pColumnList, SSDataBloc
int32_t size = (int32_t) taosArrayGetSize(pColumnList);
for(int32_t i = 0; i < size; ++i) {
SColIndex* index = taosArrayGet(pColumnList, i);
SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, index->colIndex);
assert(index->colId == pColInfo->info.colId);
SColIndex* tsc_index = taosArrayGet(pColumnList, i);
SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, tsc_index->colIndex);
assert(tsc_index->colId == pColInfo->info.colId);
memcpy(prevRow[i], pColInfo->pData + pColInfo->info.bytes * rowIndex, pColInfo->info.bytes);
}
......
......@@ -152,7 +152,7 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) {
static int32_t tscBuildTableSchemaResultFields(SSqlObj *pSql, int32_t numOfCols, int32_t typeColLength,
int32_t noteColLength) {
int32_t rowLen = 0;
SColumnIndex index = {0};
SColumnIndex tsc_index = {0};
pSql->cmd.numOfCols = numOfCols;
......@@ -163,7 +163,7 @@ static int32_t tscBuildTableSchemaResultFields(SSqlObj *pSql, int32_t numOfCols,
tstrncpy(f.name, "Field", sizeof(f.name));
SInternalField* pInfo = tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &index, TSDB_DATA_TYPE_BINARY,
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &tsc_index, TSDB_DATA_TYPE_BINARY,
(TSDB_COL_NAME_LEN - 1) + VARSTR_HEADER_SIZE, -1000, (TSDB_COL_NAME_LEN - 1), false);
rowLen += ((TSDB_COL_NAME_LEN - 1) + VARSTR_HEADER_SIZE);
......@@ -173,7 +173,7 @@ static int32_t tscBuildTableSchemaResultFields(SSqlObj *pSql, int32_t numOfCols,
tstrncpy(f.name, "Type", sizeof(f.name));
pInfo = tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &index, TSDB_DATA_TYPE_BINARY, (int16_t)(typeColLength + VARSTR_HEADER_SIZE),
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &tsc_index, TSDB_DATA_TYPE_BINARY, (int16_t)(typeColLength + VARSTR_HEADER_SIZE),
-1000, typeColLength, false);
rowLen += typeColLength + VARSTR_HEADER_SIZE;
......@@ -183,7 +183,7 @@ static int32_t tscBuildTableSchemaResultFields(SSqlObj *pSql, int32_t numOfCols,
tstrncpy(f.name, "Length", sizeof(f.name));
pInfo = tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &index, TSDB_DATA_TYPE_INT, sizeof(int32_t),
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &tsc_index, TSDB_DATA_TYPE_INT, sizeof(int32_t),
-1000, sizeof(int32_t), false);
rowLen += sizeof(int32_t);
......@@ -193,7 +193,7 @@ static int32_t tscBuildTableSchemaResultFields(SSqlObj *pSql, int32_t numOfCols,
tstrncpy(f.name, "Note", sizeof(f.name));
pInfo = tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &index, TSDB_DATA_TYPE_BINARY, (int16_t)(noteColLength + VARSTR_HEADER_SIZE),
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &tsc_index, TSDB_DATA_TYPE_BINARY, (int16_t)(noteColLength + VARSTR_HEADER_SIZE),
-1000, noteColLength, false);
rowLen += noteColLength + VARSTR_HEADER_SIZE;
......@@ -396,7 +396,7 @@ static int32_t tscGetTableTagValue(SCreateBuilder *builder, char *result) {
static int32_t tscSCreateBuildResultFields(SSqlObj *pSql, BuildType type, const char *ddl) {
int32_t rowLen = 0;
int16_t ddlLen = (int16_t)strlen(ddl);
SColumnIndex index = {0};
SColumnIndex tsc_index = {0};
pSql->cmd.numOfCols = 2;
SQueryInfo* pQueryInfo = tscGetQueryInfo(&pSql->cmd);
......@@ -414,7 +414,7 @@ static int32_t tscSCreateBuildResultFields(SSqlObj *pSql, BuildType type, const
}
SInternalField* pInfo = tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &index, TSDB_DATA_TYPE_BINARY, f.bytes, -1000, f.bytes - VARSTR_HEADER_SIZE, false);
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &tsc_index, TSDB_DATA_TYPE_BINARY, f.bytes, -1000, f.bytes - VARSTR_HEADER_SIZE, false);
rowLen += f.bytes;
......@@ -427,7 +427,7 @@ static int32_t tscSCreateBuildResultFields(SSqlObj *pSql, BuildType type, const
}
pInfo = tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &index, TSDB_DATA_TYPE_BINARY,
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &tsc_index, TSDB_DATA_TYPE_BINARY,
(int16_t)(ddlLen + VARSTR_HEADER_SIZE), -1000, ddlLen, false);
rowLen += ddlLen + VARSTR_HEADER_SIZE;
......
......@@ -91,8 +91,8 @@ int initMemRowBuilder(SMemRowBuilder *pBuilder, uint32_t nRows, uint3
return TSDB_CODE_SUCCESS;
}
int tsParseTime(SStrToken *pToken, int64_t *time, char **next, char *error, int16_t timePrec) {
int32_t index = 0;
int tsParseTime(SStrToken *pToken, int64_t *tsc_time, char **next, char *tsc_error, int16_t timePrec) {
int32_t tsc_index = 0;
SStrToken sToken;
int64_t interval;
int64_t useconds = 0;
......@@ -106,8 +106,8 @@ int tsParseTime(SStrToken *pToken, int64_t *time, char **next, char *error, int1
useconds = taosStr2int64(pToken->z);
} else {
// strptime("2001-11-12 18:31:01", "%Y-%m-%d %H:%M:%S", &tm);
if (taosParseTime(pToken->z, time, pToken->n, timePrec, tsDaylight) != TSDB_CODE_SUCCESS) {
return tscInvalidOperationMsg(error, "invalid timestamp format", pToken->z);
if (taosParseTime(pToken->z, tsc_time, pToken->n, timePrec, tsDaylight) != TSDB_CODE_SUCCESS) {
return tscInvalidOperationMsg(tsc_error, "invalid timestamp format", pToken->z);
}
return TSDB_CODE_SUCCESS;
......@@ -117,7 +117,7 @@ int tsParseTime(SStrToken *pToken, int64_t *time, char **next, char *error, int1
if (isspace(pToken->z[k])) continue;
if (pToken->z[k] == ',') {
*next = pTokenEnd;
*time = useconds;
*tsc_time = useconds;
return 0;
}
......@@ -125,21 +125,21 @@ int tsParseTime(SStrToken *pToken, int64_t *time, char **next, char *error, int1
}
/*
* time expression:
* tsc_time expression:
* e.g., now+12a, now-5h
*/
SStrToken valueToken;
index = 0;
sToken = tStrGetToken(pTokenEnd, &index, false);
pTokenEnd += index;
tsc_index = 0;
sToken = tStrGetToken(pTokenEnd, &tsc_index, false);
pTokenEnd += tsc_index;
if (sToken.type == TK_MINUS || sToken.type == TK_PLUS) {
index = 0;
valueToken = tStrGetToken(pTokenEnd, &index, false);
pTokenEnd += index;
tsc_index = 0;
valueToken = tStrGetToken(pTokenEnd, &tsc_index, false);
pTokenEnd += tsc_index;
if (valueToken.n < 2) {
return tscInvalidOperationMsg(error, "value expected in timestamp", sToken.z);
return tscInvalidOperationMsg(tsc_error, "value expected in timestamp", sToken.z);
}
char unit = 0;
......@@ -156,7 +156,7 @@ int tsParseTime(SStrToken *pToken, int64_t *time, char **next, char *error, int1
*next = pTokenEnd;
}
*time = useconds;
*tsc_time = useconds;
return TSDB_CODE_SUCCESS;
}
......@@ -448,7 +448,7 @@ int32_t tsCheckTimestamp(STableDataBlocks *pDataBlocks, const char *start) {
int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, int32_t *len, char *tmpTokenBuf,
SInsertStatementParam *pInsertParam) {
int32_t index = 0;
int32_t tsc_index = 0;
SStrToken sToken = {0};
char *row = pDataBlocks->pData + pDataBlocks->size; // skip the SSubmitBlk header
......@@ -472,9 +472,9 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i
SSchema *pSchema = &schema[colIndex]; // get colId here
index = 0;
sToken = tStrGetToken(*str, &index, true);
*str += index;
tsc_index = 0;
sToken = tStrGetToken(*str, &tsc_index, true);
*str += tsc_index;
if (sToken.type == TK_QUESTION) {
if (!isParseBindParam) {
......@@ -606,7 +606,7 @@ int32_t boundIdxCompar(const void *lhs, const void *rhs) {
int32_t tsParseValues(char **str, STableDataBlocks *pDataBlock, int maxRows, SInsertStatementParam *pInsertParam,
int32_t* numOfRows, char *tmpTokenBuf) {
int32_t index = 0;
int32_t tsc_index = 0;
int32_t code = 0;
(*numOfRows) = 0;
......@@ -626,11 +626,11 @@ int32_t tsParseValues(char **str, STableDataBlocks *pDataBlock, int maxRows, SIn
return code;
}
while (1) {
index = 0;
sToken = tStrGetToken(*str, &index, false);
tsc_index = 0;
sToken = tStrGetToken(*str, &tsc_index, false);
if (sToken.n == 0 || sToken.type != TK_LP) break;
*str += index;
*str += tsc_index;
if ((*numOfRows) >= maxRows || pDataBlock->size + extendedRowSize >= pDataBlock->nAllocSize) {
int32_t tSize;
code = tscAllocateMemIfNeed(pDataBlock, extendedRowSize, &tSize);
......@@ -651,13 +651,13 @@ int32_t tsParseValues(char **str, STableDataBlocks *pDataBlock, int maxRows, SIn
pDataBlock->size += len;
index = 0;
sToken = tStrGetToken(*str, &index, false);
tsc_index = 0;
sToken = tStrGetToken(*str, &tsc_index, false);
if (sToken.n == 0 || sToken.type != TK_RP) {
return tscSQLSyntaxErrMsg(pInsertParam->msg, ") expected", *str);
}
*str += index;
*str += tsc_index;
(*numOfRows)++;
}
......@@ -905,7 +905,7 @@ static int32_t doParseInsertStatement(SInsertStatementParam *pInsertParam, char
}
static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundColumn) {
int32_t index = 0;
int32_t tsc_index = 0;
SStrToken sToken = {0};
SStrToken tableToken = {0};
int32_t code = TSDB_CODE_SUCCESS;
......@@ -920,14 +920,14 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
char *sql = *sqlstr;
// get the token of specified table
index = 0;
tableToken = tStrGetToken(sql, &index, false);
sql += index;
tsc_index = 0;
tableToken = tStrGetToken(sql, &tsc_index, false);
sql += tsc_index;
// skip possibly exists column list
index = 0;
sToken = tStrGetToken(sql, &index, false);
sql += index;
tsc_index = 0;
sToken = tStrGetToken(sql, &tsc_index, false);
sql += tsc_index;
int32_t numOfColList = 0;
......@@ -936,8 +936,8 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
*boundColumn = &sToken.z[0];
while (1) {
index = 0;
sToken = tStrGetToken(sql, &index, false);
tsc_index = 0;
sToken = tStrGetToken(sql, &tsc_index, false);
if (sToken.type == TK_ILLEGAL) {
return tscSQLSyntaxErrMsg(pCmd->payload, "unrecognized token", sToken.z);
......@@ -947,12 +947,12 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
break;
}
sql += index;
sql += tsc_index;
++numOfColList;
}
sToken = tStrGetToken(sql, &index, false);
sql += index;
sToken = tStrGetToken(sql, &tsc_index, false);
sql += tsc_index;
}
if (numOfColList == 0 && (*boundColumn) != NULL) {
......@@ -962,9 +962,9 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, TABLE_INDEX);
if (sToken.type == TK_USING) { // create table if not exists according to the super table
index = 0;
sToken = tStrGetToken(sql, &index, false);
sql += index;
tsc_index = 0;
sToken = tStrGetToken(sql, &tsc_index, false);
sql += tsc_index;
//the source super table is moved to the secondary position of the pTableMetaInfo list
if (pQueryInfo->numOfTables < 2) {
......@@ -995,8 +995,8 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
SParsedDataColInfo spd = {0};
tscSetBoundColumnInfo(&spd, pTagSchema, tscGetNumOfTags(pSTableMetaInfo->pTableMeta));
index = 0;
sToken = tStrGetToken(sql, &index, false);
tsc_index = 0;
sToken = tStrGetToken(sql, &tsc_index, false);
if (sToken.type != TK_TAGS && sToken.type != TK_LP) {
tscDestroyBoundColumnInfo(&spd);
return tscSQLSyntaxErrMsg(pInsertParam->msg, "keyword TAGS expected", sToken.z);
......@@ -1017,16 +1017,16 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
sql = end;
index = 0; // keywords of "TAGS"
sToken = tStrGetToken(sql, &index, false);
sql += index;
tsc_index = 0; // keywords of "TAGS"
sToken = tStrGetToken(sql, &tsc_index, false);
sql += tsc_index;
} else {
sql += index;
sql += tsc_index;
}
index = 0;
sToken = tStrGetToken(sql, &index, false);
sql += index;
tsc_index = 0;
sToken = tStrGetToken(sql, &tsc_index, false);
sql += tsc_index;
if (sToken.type != TK_LP) {
tscDestroyBoundColumnInfo(&spd);
......@@ -1042,9 +1042,9 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
for (int i = 0; i < spd.numOfBound; ++i) {
SSchema* pSchema = &pTagSchema[spd.boundedColumns[i]];
index = 0;
sToken = tStrGetToken(sql, &index, true);
sql += index;
tsc_index = 0;
sToken = tStrGetToken(sql, &tsc_index, true);
sql += tsc_index;
if (TK_ILLEGAL == sToken.type) {
tdDestroyKVRowBuilder(&kvRowBuilder);
......@@ -1096,9 +1096,9 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
free(row);
pInsertParam->tagData.data = pTag;
index = 0;
sToken = tStrGetToken(sql, &index, false);
sql += index;
tsc_index = 0;
sToken = tStrGetToken(sql, &tsc_index, false);
sql += tsc_index;
if (sToken.n == 0 || sToken.type != TK_RP) {
return tscSQLSyntaxErrMsg(pInsertParam->msg, ") expected", sToken.z);
}
......@@ -1107,9 +1107,9 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
* 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;
tsc_index = 0;
sToken = tStrGetToken(sql, &tsc_index, false);
sql += tsc_index;
int numOfColsAfterTags = 0;
if (sToken.type == TK_LP) {
if (*boundColumn != NULL) {
......@@ -1119,18 +1119,18 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
}
while (1) {
index = 0;
sToken = tStrGetToken(sql, &index, false);
tsc_index = 0;
sToken = tStrGetToken(sql, &tsc_index, false);
if (sToken.type == TK_RP) {
break;
}
if (sToken.n == 0 || sToken.type == TK_SEMI || index == 0) {
if (sToken.n == 0 || sToken.type == TK_SEMI || tsc_index == 0) {
return tscSQLSyntaxErrMsg(pCmd->payload, "unexpected token", sql);
}
sql += index;
sql += tsc_index;
++numOfColsAfterTags;
}
......@@ -1138,7 +1138,7 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
return TSDB_CODE_TSC_SQL_SYNTAX_ERROR;
}
sToken = tStrGetToken(sql, &index, false);
sToken = tStrGetToken(sql, &tsc_index, false);
}
sql = sToken.z;
......@@ -1213,9 +1213,9 @@ static int32_t parseBoundColumns(SInsertStatementParam *pInsertParam, SParsedDat
int32_t code = TSDB_CODE_SUCCESS;
int32_t index = 0;
SStrToken sToken = tStrGetToken(str, &index, false);
str += index;
int32_t tsc_index = 0;
SStrToken sToken = tStrGetToken(str, &tsc_index, false);
str += tsc_index;
if (sToken.type != TK_LP) {
code = tscSQLSyntaxErrMsg(pInsertParam->msg, "( is expected", sToken.z);
......@@ -1225,9 +1225,9 @@ static int32_t parseBoundColumns(SInsertStatementParam *pInsertParam, SParsedDat
bool isOrdered = true;
int32_t lastColIdx = -1; // last column found
while (1) {
index = 0;
sToken = tStrGetToken(str, &index, false);
str += index;
tsc_index = 0;
sToken = tStrGetToken(str, &tsc_index, false);
str += tsc_index;
if (TK_STRING == sToken.type) {
tscDequoteAndTrimToken(&sToken);
......@@ -1378,8 +1378,8 @@ int tsParseInsertSql(SSqlObj *pSql) {
tscDebug("0x%"PRIx64" create data block list hashList:%p", pSql->self, pInsertParam->pTableBlockHashList);
while (1) {
int32_t index = 0;
SStrToken sToken = tStrGetToken(str, &index, false);
int32_t tsc_index = 0;
SStrToken sToken = tStrGetToken(str, &tsc_index, false);
// no data in the sql string anymore.
if (sToken.n == 0) {
......@@ -1437,9 +1437,9 @@ int tsParseInsertSql(SSqlObj *pSql) {
goto _clean;
}
index = 0;
sToken = tStrGetToken(str, &index, false);
str += index;
tsc_index = 0;
sToken = tStrGetToken(str, &tsc_index, false);
str += tsc_index;
if (sToken.n == 0 || (sToken.type != TK_FILE && sToken.type != TK_VALUES)) {
code = tscSQLSyntaxErrMsg(pInsertParam->msg, "keyword VALUES or FILE required", sToken.z);
......@@ -1452,13 +1452,13 @@ int tsParseInsertSql(SSqlObj *pSql) {
goto _clean;
}
index = 0;
sToken = tStrGetToken(str, &index, false);
tsc_index = 0;
sToken = tStrGetToken(str, &tsc_index, false);
if (sToken.type != TK_STRING && sToken.type != TK_ID) {
code = tscSQLSyntaxErrMsg(pInsertParam->msg, "file path is required following keyword FILE", sToken.z);
goto _clean;
}
str += index;
str += tsc_index;
if (sToken.n == 0) {
code = tscSQLSyntaxErrMsg(pInsertParam->msg, "file path is required following keyword FILE", sToken.z);
goto _clean;
......@@ -1553,10 +1553,10 @@ int tsInsertInitialCheck(SSqlObj *pSql) {
return TSDB_CODE_TSC_NO_WRITE_AUTH;
}
int32_t index = 0;
int32_t tsc_index = 0;
SSqlCmd *pCmd = &pSql->cmd;
SStrToken sToken = tStrGetToken(pSql->sqlstr, &index, false);
SStrToken sToken = tStrGetToken(pSql->sqlstr, &tsc_index, false);
assert(sToken.type == TK_INSERT || sToken.type == TK_IMPORT);
pCmd->count = 0;
......@@ -1566,7 +1566,7 @@ int tsInsertInitialCheck(SSqlObj *pSql) {
SQueryInfo *pQueryInfo = tscGetQueryInfoS(pCmd);
TSDB_QUERY_SET_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_INSERT);
sToken = tStrGetToken(pSql->sqlstr, &index, false);
sToken = tStrGetToken(pSql->sqlstr, &tsc_index, false);
if (sToken.type != TK_INTO) {
return tscSQLSyntaxErrMsg(pInsertParam->msg, "keyword INTO is expected", sToken.z);
}
......
......@@ -970,25 +970,25 @@ static int32_t applyChildTableTags(TAOS* taos, char* cTableName, char* sTableNam
taosArraySetSize(tagBinds, numTags);
int isNullColBind = TSDB_TRUE;
for (int j = 0; j < numTags; ++j) {
TAOS_BIND* bind = taosArrayGet(tagBinds, j);
bind->is_null = &isNullColBind;
TAOS_BIND* tsc_bind = taosArrayGet(tagBinds, j);
tsc_bind->is_null = &isNullColBind;
}
for (int j = 0; j < numTags; ++j) {
if (tagKVs[j] == NULL) continue;
TAOS_SML_KV* kv = tagKVs[j];
TAOS_BIND* bind = taosArrayGet(tagBinds, kv->fieldSchemaIdx);
bind->buffer_type = kv->type;
bind->length = malloc(sizeof(uintptr_t*));
*bind->length = kv->length;
bind->buffer = kv->value;
bind->is_null = NULL;
TAOS_BIND* tsc_bind = taosArrayGet(tagBinds, kv->fieldSchemaIdx);
tsc_bind->buffer_type = kv->type;
tsc_bind->length = malloc(sizeof(uintptr_t*));
*tsc_bind->length = kv->length;
tsc_bind->buffer = kv->value;
tsc_bind->is_null = NULL;
}
int32_t code = creatChildTableIfNotExists(taos, cTableName, sTableName, sTableSchema->tags, tagBinds, info);
for (int i = 0; i < taosArrayGetSize(tagBinds); ++i) {
TAOS_BIND* bind = taosArrayGet(tagBinds, i);
free(bind->length);
TAOS_BIND* tsc_bind = taosArrayGet(tagBinds, i);
free(tsc_bind->length);
}
taosArrayDestroy(tagBinds);
return code;
......@@ -1014,17 +1014,17 @@ static int32_t applyChildTableFields(TAOS* taos, SSmlSTableSchema* sTableSchema,
}
for (int j = 0; j < numCols; ++j) {
TAOS_BIND* bind = colBinds + j;
bind->is_null = &isNullColBind;
TAOS_BIND* tsc_bind = colBinds + j;
tsc_bind->is_null = &isNullColBind;
}
for (int j = 0; j < point->fieldNum; ++j) {
TAOS_SML_KV* kv = point->fields + j;
TAOS_BIND* bind = colBinds + kv->fieldSchemaIdx;
bind->buffer_type = kv->type;
bind->length = malloc(sizeof(uintptr_t*));
*bind->length = kv->length;
bind->buffer = kv->value;
bind->is_null = NULL;
TAOS_BIND* tsc_bind = colBinds + kv->fieldSchemaIdx;
tsc_bind->buffer_type = kv->type;
tsc_bind->length = malloc(sizeof(uintptr_t*));
*tsc_bind->length = kv->length;
tsc_bind->buffer = kv->value;
tsc_bind->is_null = NULL;
}
taosArrayPush(rowsBind, &colBinds);
}
......@@ -1037,8 +1037,8 @@ static int32_t applyChildTableFields(TAOS* taos, SSmlSTableSchema* sTableSchema,
for (int i = 0; i < rows; ++i) {
TAOS_BIND* colBinds = taosArrayGetP(rowsBind, i);
for (int j = 0; j < numCols; ++j) {
TAOS_BIND* bind = colBinds + j;
free(bind->length);
TAOS_BIND* tsc_bind = colBinds + j;
free(tsc_bind->length);
}
free(colBinds);
}
......@@ -1794,14 +1794,14 @@ static int32_t convertSmlTimeStamp(TAOS_SML_KV *pVal, char *value,
return TSDB_CODE_SUCCESS;
}
static int32_t parseSmlTimeStamp(TAOS_SML_KV **pTS, const char **index, SSmlLinesInfo* info) {
static int32_t parseSmlTimeStamp(TAOS_SML_KV **pTS, const char **tsc_index, SSmlLinesInfo* info) {
const char *start, *cur;
int32_t ret = TSDB_CODE_SUCCESS;
int len = 0;
char key[] = "_ts";
char *value = NULL;
start = cur = *index;
start = cur = *tsc_index;
*pTS = calloc(1, sizeof(TAOS_SML_KV));
while(*cur != '\0') {
......@@ -1851,8 +1851,8 @@ static bool checkDuplicateKey(char *key, SHashObj *pHash, SSmlLinesInfo* info) {
return false;
}
static int32_t parseSmlKey(TAOS_SML_KV *pKV, const char **index, SHashObj *pHash, SSmlLinesInfo* info) {
const char *cur = *index;
static int32_t parseSmlKey(TAOS_SML_KV *pKV, const char **tsc_index, SHashObj *pHash, SSmlLinesInfo* info) {
const char *cur = *tsc_index;
char key[TSDB_COL_NAME_LEN + 1]; // +1 to avoid key[len] over write
uint16_t len = 0;
......@@ -1887,17 +1887,17 @@ static int32_t parseSmlKey(TAOS_SML_KV *pKV, const char **index, SHashObj *pHash
pKV->key = calloc(len + 1, 1);
memcpy(pKV->key, key, len + 1);
//tscDebug("SML:0x%"PRIx64" Key:%s|len:%d", info->id, pKV->key, len);
*index = cur + 1;
*tsc_index = cur + 1;
return TSDB_CODE_SUCCESS;
}
static bool parseSmlValue(TAOS_SML_KV *pKV, const char **index,
static bool parseSmlValue(TAOS_SML_KV *pKV, const char **tsc_index,
bool *is_last_kv, SSmlLinesInfo* info) {
const char *start, *cur;
char *value = NULL;
uint16_t len = 0;
start = cur = *index;
start = cur = *tsc_index;
while (1) {
// unescaped ',' or ' ' or '\0' identifies a value
......@@ -1928,13 +1928,13 @@ static bool parseSmlValue(TAOS_SML_KV *pKV, const char **index,
}
free(value);
*index = (*cur == '\0') ? cur : cur + 1;
*tsc_index = (*cur == '\0') ? cur : cur + 1;
return TSDB_CODE_SUCCESS;
}
static int32_t parseSmlMeasurement(TAOS_SML_DATA_POINT *pSml, const char **index,
static int32_t parseSmlMeasurement(TAOS_SML_DATA_POINT *pSml, const char **tsc_index,
uint8_t *has_tags, SSmlLinesInfo* info) {
const char *cur = *index;
const char *cur = *tsc_index;
uint16_t len = 0;
pSml->stableName = calloc(TSDB_TABLE_NAME_LEN + 1, 1); // +1 to avoid 1772 line over write
......@@ -1973,7 +1973,7 @@ static int32_t parseSmlMeasurement(TAOS_SML_DATA_POINT *pSml, const char **index
len++;
}
pSml->stableName[len] = '\0';
*index = cur + 1;
*tsc_index = cur + 1;
tscDebug("SML:0x%"PRIx64" Stable name in measurement:%s|len:%d", info->id, pSml->stableName, len);
return TSDB_CODE_SUCCESS;
......@@ -1992,10 +1992,10 @@ static int32_t isValidChildTableName(const char *pTbName, int16_t len) {
static int32_t parseSmlKvPairs(TAOS_SML_KV **pKVs, int *num_kvs,
const char **index, bool isField,
const char **tsc_index, bool isField,
TAOS_SML_DATA_POINT* smlData, SHashObj *pHash,
SSmlLinesInfo* info) {
const char *cur = *index;
const char *cur = *tsc_index;
int32_t ret = TSDB_CODE_SUCCESS;
TAOS_SML_KV *pkv;
bool is_last_kv = false;
......@@ -2077,7 +2077,7 @@ static int32_t parseSmlKvPairs(TAOS_SML_KV **pKVs, int *num_kvs,
error:
return ret;
done:
*index = cur;
*tsc_index = cur;
return ret;
}
......@@ -2097,13 +2097,13 @@ static void moveTimeStampToFirstKv(TAOS_SML_DATA_POINT** smlData, TAOS_SML_KV *t
}
int32_t tscParseLine(const char* sql, TAOS_SML_DATA_POINT* smlData, SSmlLinesInfo* info) {
const char* index = sql;
const char* tsc_index = sql;
int32_t ret = TSDB_CODE_SUCCESS;
uint8_t has_tags = 0;
TAOS_SML_KV *timestamp = NULL;
SHashObj *keyHashTable = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, false);
ret = parseSmlMeasurement(smlData, &index, &has_tags, info);
ret = parseSmlMeasurement(smlData, &tsc_index, &has_tags, info);
if (ret) {
tscError("SML:0x%"PRIx64" Unable to parse measurement", info->id);
taosHashCleanup(keyHashTable);
......@@ -2113,7 +2113,7 @@ int32_t tscParseLine(const char* sql, TAOS_SML_DATA_POINT* smlData, SSmlLinesInf
//Parse Tags
if (has_tags) {
ret = parseSmlKvPairs(&smlData->tags, &smlData->tagNum, &index, false, smlData, keyHashTable, info);
ret = parseSmlKvPairs(&smlData->tags, &smlData->tagNum, &tsc_index, false, smlData, keyHashTable, info);
if (ret) {
tscError("SML:0x%"PRIx64" Unable to parse tag", info->id);
taosHashCleanup(keyHashTable);
......@@ -2123,7 +2123,7 @@ int32_t tscParseLine(const char* sql, TAOS_SML_DATA_POINT* smlData, SSmlLinesInf
tscDebug("SML:0x%"PRIx64" Parse tags finished, num of tags:%d", info->id, smlData->tagNum);
//Parse fields
ret = parseSmlKvPairs(&smlData->fields, &smlData->fieldNum, &index, true, smlData, keyHashTable, info);
ret = parseSmlKvPairs(&smlData->fields, &smlData->fieldNum, &tsc_index, true, smlData, keyHashTable, info);
if (ret) {
tscError("SML:0x%"PRIx64" Unable to parse field", info->id);
taosHashCleanup(keyHashTable);
......@@ -2133,7 +2133,7 @@ int32_t tscParseLine(const char* sql, TAOS_SML_DATA_POINT* smlData, SSmlLinesInf
taosHashCleanup(keyHashTable);
//Parse timestamp
ret = parseSmlTimeStamp(&timestamp, &index, info);
ret = parseSmlTimeStamp(&timestamp, &tsc_index, info);
if (ret) {
tscError("SML:0x%"PRIx64" Unable to parse timestamp", info->id);
return ret;
......
此差异已折叠。
此差异已折叠。
......@@ -860,13 +860,13 @@ static char *doSerializeTableInfo(SQueryTableMsg *pQueryMsg, SSqlObj *pSql, STab
int32_t vgId = -1;
if (UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo)) {
int32_t index = pTableMetaInfo->vgroupIndex;
assert(index >= 0);
int32_t tsc_index = pTableMetaInfo->vgroupIndex;
assert(tsc_index >= 0);
SVgroupInfo* pVgroupInfo = NULL;
if (pTableMetaInfo->vgroupList && pTableMetaInfo->vgroupList->numOfVgroups > 0) {
assert(index < pTableMetaInfo->vgroupList->numOfVgroups);
pVgroupInfo = &pTableMetaInfo->vgroupList->vgroups[index];
assert(tsc_index < pTableMetaInfo->vgroupList->numOfVgroups);
pVgroupInfo = &pTableMetaInfo->vgroupList->vgroups[tsc_index];
} else {
tscError("0x%"PRIx64" No vgroup info found", pSql->self);
......@@ -876,7 +876,7 @@ static char *doSerializeTableInfo(SQueryTableMsg *pQueryMsg, SSqlObj *pSql, STab
vgId = pVgroupInfo->vgId;
tscSetDnodeEpSet(&pSql->epSet, pVgroupInfo);
tscDebug("0x%"PRIx64" query on stable, vgIndex:%d, numOfVgroups:%d", pSql->self, index, pTableMetaInfo->vgroupList->numOfVgroups);
tscDebug("0x%"PRIx64" query on stable, vgIndex:%d, numOfVgroups:%d", pSql->self, tsc_index, pTableMetaInfo->vgroupList->numOfVgroups);
} else {
vgId = pTableMeta->vgId;
......@@ -898,11 +898,11 @@ static char *doSerializeTableInfo(SQueryTableMsg *pQueryMsg, SSqlObj *pSql, STab
pQueryMsg->numOfTables = htonl(1); // set the number of tables
pMsg += sizeof(STableIdInfo);
} else { // it is a subquery of the super table query, this EP info is acquired from vgroupInfo
int32_t index = pTableMetaInfo->vgroupIndex;
int32_t tsc_index = pTableMetaInfo->vgroupIndex;
int32_t numOfVgroups = (int32_t)taosArrayGetSize(pTableMetaInfo->pVgroupTables);
assert(index >= 0 && index < numOfVgroups);
assert(tsc_index >= 0 && tsc_index < numOfVgroups);
SVgroupTableInfo* pTableIdList = taosArrayGet(pTableMetaInfo->pVgroupTables, index);
SVgroupTableInfo* pTableIdList = taosArrayGet(pTableMetaInfo->pVgroupTables, tsc_index);
// set the vgroup info
tscSetDnodeEpSet(&pSql->epSet, &pTableIdList->vgInfo);
......@@ -912,7 +912,7 @@ static char *doSerializeTableInfo(SQueryTableMsg *pQueryMsg, SSqlObj *pSql, STab
pQueryMsg->numOfTables = htonl(numOfTables); // set the number of tables
tscDebug("0x%"PRIx64" query on stable, vgId:%d, numOfTables:%d, vgIndex:%d, numOfVgroups:%d", pSql->self,
pTableIdList->vgInfo.vgId, numOfTables, index, numOfVgroups);
pTableIdList->vgInfo.vgId, numOfTables, tsc_index, numOfVgroups);
// serialize each table id info
for(int32_t i = 0; i < numOfTables; ++i) {
......@@ -2621,18 +2621,18 @@ int tscProcessShowRsp(SSqlObj *pSql) {
SFieldInfo* pFieldInfo = &pQueryInfo->fieldsInfo;
SColumnIndex index = {0};
SColumnIndex tsc_index = {0};
pSchema = pMetaMsg->schema;
uint64_t uid = pTableMetaInfo->pTableMeta->id.uid;
for (int16_t i = 0; i < pMetaMsg->numOfColumns; ++i, ++pSchema) {
index.columnIndex = i;
tsc_index.columnIndex = i;
tscColumnListInsert(pQueryInfo->colList, i, uid, pSchema);
TAOS_FIELD f = tscCreateField(pSchema->type, pSchema->name, pSchema->bytes);
SInternalField* pInfo = tscFieldInfoAppend(pFieldInfo, &f);
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &index,
pInfo->pExpr = tscExprAppend(pQueryInfo, TSDB_FUNC_TS_DUMMY, &tsc_index,
pTableSchema[i].type, pTableSchema[i].bytes, getNewResColId(pCmd), pTableSchema[i].bytes, false);
}
......
......@@ -417,8 +417,8 @@ static void tscSetNextLaunchTimer(SSqlStream *pStream, SSqlObj *pSql) {
return;
}
} else {
int64_t stime = taosTimeTruncate(pStream->stime - 1, &pStream->interval, pStream->precision);
if (stime >= pStream->etime) {
int64_t tsc_stime = taosTimeTruncate(pStream->stime - 1, &pStream->interval, pStream->precision);
if (tsc_stime >= pStream->etime) {
tscDebug("0x%"PRIx64" stream:%p, stime:%" PRId64 " is larger than end time: %" PRId64 ", stop the stream", pStream->pSql->self, pStream,
pStream->stime, pStream->etime);
// TODO : How to terminate stream here
......@@ -498,7 +498,7 @@ static int32_t tscSetSlidingWindowInfo(SSqlObj *pSql, SSqlStream *pStream) {
return TSDB_CODE_SUCCESS;
}
static int64_t tscGetStreamStartTimestamp(SSqlObj *pSql, SSqlStream *pStream, int64_t stime) {
static int64_t tscGetStreamStartTimestamp(SSqlObj *pSql, SSqlStream *pStream, int64_t tsc_stime) {
SQueryInfo* pQueryInfo = tscGetQueryInfo(&pSql->cmd);
if (pStream->isProject) {
......@@ -506,31 +506,31 @@ static int64_t tscGetStreamStartTimestamp(SSqlObj *pSql, SSqlStream *pStream, in
pStream->interval.interval = tsProjectExecInterval;
pStream->interval.sliding = tsProjectExecInterval;
if (stime != INT64_MIN) { // first projection start from the latest event timestamp
assert(stime >= pQueryInfo->window.skey);
stime += 1; // exclude the last records from table
if (tsc_stime != INT64_MIN) { // first projection start from the latest event timestamp
assert(tsc_stime >= pQueryInfo->window.skey);
tsc_stime += 1; // exclude the last records from table
} else {
stime = pQueryInfo->window.skey;
tsc_stime = pQueryInfo->window.skey;
}
} else { // timewindow based aggregation stream
if (stime == INT64_MIN) { // no data in meter till now
if (tsc_stime == INT64_MIN) { // no data in meter till now
if (pQueryInfo->window.skey != INT64_MIN) {
stime = pQueryInfo->window.skey;
tsc_stime = pQueryInfo->window.skey;
} else {
return stime;
return tsc_stime;
}
stime = taosTimeTruncate(stime, &pStream->interval, pStream->precision);
tsc_stime = taosTimeTruncate(tsc_stime, &pStream->interval, pStream->precision);
} else {
int64_t newStime = taosTimeTruncate(stime, &pStream->interval, pStream->precision);
if (newStime != stime) {
tscWarn("0x%"PRIx64" stream:%p, last timestamp:%" PRId64 ", reset to:%" PRId64, pSql->self, pStream, stime, newStime);
stime = newStime;
int64_t newStime = taosTimeTruncate(tsc_stime, &pStream->interval, pStream->precision);
if (newStime != tsc_stime) {
tscWarn("0x%"PRIx64" stream:%p, last timestamp:%" PRId64 ", reset to:%" PRId64, pSql->self, pStream, tsc_stime, newStime);
tsc_stime = newStime;
}
}
}
return stime;
return tsc_stime;
}
static int64_t tscGetLaunchTimestamp(const SSqlStream *pStream) {
......@@ -663,7 +663,7 @@ void cbParseSql(void* param, TAOS_RES* res, int code) {
}
TAOS_STREAM *taos_open_stream_withname(TAOS *taos, const char* dstTable, const char *sqlstr, void (*fp)(void *param, TAOS_RES *, TAOS_ROW row),
int64_t stime, void *param, void (*callback)(void *), void* cqhandle) {
int64_t tsc_stime, void *param, void (*callback)(void *), void* cqhandle) {
STscObj *pObj = (STscObj *)taos;
if (pObj == NULL || pObj->signature != pObj) return NULL;
......@@ -692,7 +692,7 @@ TAOS_STREAM *taos_open_stream_withname(TAOS *taos, const char* dstTable, const c
}
pStream->ltime = INT64_MIN;
pStream->stime = stime;
pStream->stime = tsc_stime;
pStream->fp = fp;
pStream->callback = callback;
pStream->param = param;
......@@ -745,8 +745,8 @@ TAOS_STREAM *taos_open_stream_withname(TAOS *taos, const char* dstTable, const c
}
TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sqlstr, void (*fp)(void *param, TAOS_RES *, TAOS_ROW row),
int64_t stime, void *param, void (*callback)(void *)) {
return taos_open_stream_withname(taos, "", sqlstr, fp, stime, param, callback, NULL);
int64_t tsc_stime, void *param, void (*callback)(void *)) {
return taos_open_stream_withname(taos, "", sqlstr, fp, tsc_stime, param, callback, NULL);
}
void taos_close_stream(TAOS_STREAM *handle) {
......
......@@ -380,7 +380,7 @@ static int64_t doTSBlockIntersect(SSqlObj* pSql, STimeWindow * win) {
// todo handle failed to create sub query
SJoinSupporter* tscCreateJoinSupporter(SSqlObj* pSql, int32_t index) {
SJoinSupporter* tscCreateJoinSupporter(SSqlObj* pSql, int32_t tsc_index) {
SJoinSupporter* pSupporter = calloc(1, sizeof(SJoinSupporter));
if (pSupporter == NULL) {
return NULL;
......@@ -388,13 +388,13 @@ SJoinSupporter* tscCreateJoinSupporter(SSqlObj* pSql, int32_t index) {
pSupporter->pObj = pSql->self;
pSupporter->subqueryIndex = index;
pSupporter->subqueryIndex = tsc_index;
SQueryInfo* pQueryInfo = tscGetQueryInfo(&pSql->cmd);
memcpy(&pSupporter->interval, &pQueryInfo->interval, sizeof(pSupporter->interval));
pSupporter->limit = pQueryInfo->limit;
STableMetaInfo* pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, index);
STableMetaInfo* pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, tsc_index);
pSupporter->uid = pTableMetaInfo->pTableMeta->id.uid;
assert (pSupporter->uid != 0);
......@@ -598,7 +598,7 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
* during the timestamp intersection.
*/
pSupporter->limit = pQueryInfo->limit;
SColumnIndex index = {.tableIndex = 0, .columnIndex = PRIMARYKEY_TIMESTAMP_COL_INDEX};
SColumnIndex tsc_index = {.tableIndex = 0, .columnIndex = PRIMARYKEY_TIMESTAMP_COL_INDEX};
SSchema* s = tscGetTableColumnSchema(pTableMetaInfo->pTableMeta, 0);
SExprInfo* pExpr = tscExprGet(pQueryInfo, 0);
......@@ -610,7 +610,7 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
int16_t functionId = tscIsProjectionQuery(pQueryInfo)? TSDB_FUNC_PRJ : TSDB_FUNC_TS;
tscAddFuncInSelectClause(pQueryInfo, 0, functionId, &index, s, TSDB_COL_NORMAL, getNewResColId(&pNew->cmd));
tscAddFuncInSelectClause(pQueryInfo, 0, functionId, &tsc_index, s, TSDB_COL_NORMAL, getNewResColId(&pNew->cmd));
tscPrintSelNodeList(pNew, 0);
tscFieldInfoUpdateOffset(pQueryInfo);
......@@ -806,8 +806,8 @@ static void issueTsCompQuery(SSqlObj* pSql, SJoinSupporter* pSupporter, SSqlObj*
SSchema colSchema = {.type = TSDB_DATA_TYPE_BINARY, .bytes = 1};
SColumnIndex index = {0, PRIMARYKEY_TIMESTAMP_COL_INDEX};
tscAddFuncInSelectClause(pQueryInfo, 0, TSDB_FUNC_TS_COMP, &index, &colSchema, TSDB_COL_NORMAL, getNewResColId(pCmd));
SColumnIndex tsc_index = {0, PRIMARYKEY_TIMESTAMP_COL_INDEX};
tscAddFuncInSelectClause(pQueryInfo, 0, TSDB_FUNC_TS_COMP, &tsc_index, &colSchema, TSDB_COL_NORMAL, getNewResColId(pCmd));
// set the tags value for ts_comp function
if (UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo)) {
......@@ -2424,7 +2424,7 @@ int32_t tscHandleFirstRoundStableQuery(SSqlObj *pSql) {
int32_t numOfExprs = (int32_t) tscNumOfExprs(pQueryInfo);
int32_t index = 0;
int32_t tsc_index = 0;
for(int32_t i = 0; i < numOfExprs; ++i) {
SExprInfo* pExpr = tscExprGet(pQueryInfo, i);
if (pExpr->base.functionId == TSDB_FUNC_TS && pQueryInfo->interval.interval > 0) {
......@@ -2433,7 +2433,7 @@ int32_t tscHandleFirstRoundStableQuery(SSqlObj *pSql) {
SColumnIndex colIndex = {.tableIndex = 0, .columnIndex = PRIMARYKEY_TIMESTAMP_COL_INDEX};
SSchema* schema = tscGetColumnSchemaById(pTableMetaInfo1->pTableMeta, pExpr->base.colInfo.colId);
SExprInfo* p = tscAddFuncInSelectClause(pNewQueryInfo, index++, TSDB_FUNC_TS, &colIndex, schema, TSDB_COL_NORMAL, getNewResColId(pCmd));
SExprInfo* p = tscAddFuncInSelectClause(pNewQueryInfo, tsc_index++, TSDB_FUNC_TS, &colIndex, schema, TSDB_COL_NORMAL, getNewResColId(pCmd));
p->base.resColId = pExpr->base.resColId; // update the result column id
} else if (pExpr->base.functionId == TSDB_FUNC_STDDEV_DST) {
taosArrayPush(pSup->pColsInfo, &pExpr->base.resColId);
......@@ -2442,7 +2442,7 @@ int32_t tscHandleFirstRoundStableQuery(SSqlObj *pSql) {
SSchema schema = {.type = TSDB_DATA_TYPE_DOUBLE, .bytes = sizeof(double)};
tstrncpy(schema.name, pExpr->base.aliasName, tListLen(schema.name));
SExprInfo* p = tscAddFuncInSelectClause(pNewQueryInfo, index++, TSDB_FUNC_AVG, &colIndex, &schema, TSDB_COL_NORMAL, getNewResColId(pCmd));
SExprInfo* p = tscAddFuncInSelectClause(pNewQueryInfo, tsc_index++, TSDB_FUNC_AVG, &colIndex, &schema, TSDB_COL_NORMAL, getNewResColId(pCmd));
p->base.resColId = pExpr->base.resColId; // update the result column id
} else if (pExpr->base.functionId == TSDB_FUNC_TAG) {
pSup->tagLen += pExpr->base.resBytes;
......@@ -2455,7 +2455,7 @@ int32_t tscHandleFirstRoundStableQuery(SSqlObj *pSql) {
schema = tGetTbnameColumnSchema();
}
SExprInfo* p = tscAddFuncInSelectClause(pNewQueryInfo, index++, TSDB_FUNC_TAG, &colIndex, schema, TSDB_COL_TAG, getNewResColId(pCmd));
SExprInfo* p = tscAddFuncInSelectClause(pNewQueryInfo, tsc_index++, TSDB_FUNC_TAG, &colIndex, schema, TSDB_COL_TAG, getNewResColId(pCmd));
p->base.resColId = pExpr->base.resColId;
} else if (pExpr->base.functionId == TSDB_FUNC_PRJ) {
int32_t num = (int32_t) taosArrayGetSize(pNewQueryInfo->groupbyExpr.columnInfo);
......@@ -2469,7 +2469,7 @@ int32_t tscHandleFirstRoundStableQuery(SSqlObj *pSql) {
SSchema* schema = tscGetColumnSchemaById(pTableMetaInfo1->pTableMeta, pExpr->base.colInfo.colId);
//doLimitOutputNormalColOfGroupby
SExprInfo* p = tscAddFuncInSelectClause(pNewQueryInfo, index++, TSDB_FUNC_PRJ, &colIndex, schema, TSDB_COL_NORMAL, getNewResColId(pCmd));
SExprInfo* p = tscAddFuncInSelectClause(pNewQueryInfo, tsc_index++, TSDB_FUNC_PRJ, &colIndex, schema, TSDB_COL_NORMAL, getNewResColId(pCmd));
p->base.numOfParams = 1;
p->base.param[0].i64 = 1;
p->base.param[0].nType = TSDB_DATA_TYPE_INT;
......@@ -2511,7 +2511,7 @@ int32_t tscHandleFirstRoundStableQuery(SSqlObj *pSql) {
"0x%"PRIx64" first round subquery:0x%"PRIx64" tableIndex:%d, vgroupIndex:%d, numOfVgroups:%d, type:%d, query to retrieve timestamps, "
"numOfExpr:%" PRIzu ", colList:%d, numOfOutputFields:%d, name:%s",
pSql->self, pNew->self, 0, pTableMetaInfo->vgroupIndex, pTableMetaInfo->vgroupList->numOfVgroups, pNewQueryInfo->type,
tscNumOfExprs(pNewQueryInfo), index+1, pNewQueryInfo->fieldsInfo.numOfOutput, tNameGetTableName(&pTableMetaInfo->name));
tscNumOfExprs(pNewQueryInfo), tsc_index+1, pNewQueryInfo->fieldsInfo.numOfOutput, tNameGetTableName(&pTableMetaInfo->name));
pSql->pSubs = calloc(1, POINTER_BYTES);
if (pSql->pSubs == NULL) {
......@@ -3145,7 +3145,7 @@ static SSqlObj *tscCreateSTableSubquery(SSqlObj *pSql, SRetrieveSupport *trsuppo
assert(trsupport->subqueryIndex < pSql->subState.numOfSub);
// launch subquery for each vnode, so the subquery index equals to the vgroupIndex.
// launch subquery for each vnode, so the subquery tsc_index equals to the vgroupIndex.
STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, table_index);
pTableMetaInfo->vgroupIndex = trsupport->subqueryIndex;
......@@ -3628,19 +3628,19 @@ void tscBuildResFromSubqueries(SSqlObj *pSql) {
char *getArithmeticInputSrc(void *param, const char *name, int32_t colId) {
SArithmeticSupport *pSupport = (SArithmeticSupport *) param;
int32_t index = -1;
int32_t tsc_index = -1;
SExprInfo* pExpr = NULL;
for (int32_t i = 0; i < pSupport->numOfCols; ++i) {
pExpr = taosArrayGetP(pSupport->exprList, i);
if (strncmp(name, pExpr->base.aliasName, sizeof(pExpr->base.aliasName) - 1) == 0) {
index = i;
tsc_index = i;
break;
}
}
assert(index >= 0 && index < pSupport->numOfCols);
return pSupport->data[index] + pSupport->offset * pExpr->base.resBytes;
assert(tsc_index >= 0 && tsc_index < pSupport->numOfCols);
return pSupport->data[tsc_index] + pSupport->offset * pExpr->base.resBytes;
}
TAOS_ROW doSetResultRowData(SSqlObj *pSql) {
......@@ -3819,7 +3819,7 @@ void* createQInfoFromQueryNode(SQueryInfo* pQueryInfo, STableGroupInfo* pTableGr
pthread_mutex_init(&pQInfo->lock, NULL);
tsem_init(&pQInfo->ready, 0, 0);
int32_t index = 0;
int32_t tsc_index = 0;
for(int32_t i = 0; i < numOfGroups; ++i) {
SArray* pa = taosArrayGetP(pQueryAttr->tableGroupInfo.pGroupList, i);
......@@ -3836,7 +3836,7 @@ void* createQInfoFromQueryNode(SQueryInfo* pQueryInfo, STableGroupInfo* pTableGr
STableKeyInfo* info = taosArrayGet(pa, j);
window.skey = info->lastKey;
void* buf = (char*) pQInfo->pBuf + index * sizeof(STableQueryInfo);
void* buf = (char*) pQInfo->pBuf + tsc_index * sizeof(STableQueryInfo);
STableQueryInfo* item = createTableQueryInfo(pQueryAttr, info->pTable, pQueryAttr->groupbyColumn, window, buf);
if (item == NULL) {
goto _cleanup;
......@@ -3847,7 +3847,7 @@ void* createQInfoFromQueryNode(SQueryInfo* pQueryInfo, STableGroupInfo* pTableGr
STableId id = {.tid = 0, .uid = 0};
taosHashPut(pRuntimeEnv->tableqinfoGroupInfo.map, &id.tid, sizeof(id.tid), &item, POINTER_BYTES);
index += 1;
tsc_index += 1;
}
}
......
......@@ -84,24 +84,24 @@ int32_t tscAcquireRpc(const char *key, const char *user, const char *secretEncry
return 0;
}
SRpcInit rpcInit;
memset(&rpcInit, 0, sizeof(rpcInit));
rpcInit.localPort = 0;
rpcInit.label = "TSC";
rpcInit.numOfThreads = tscNumOfThreads;
rpcInit.cfp = tscProcessMsgFromServer;
rpcInit.sessions = tsMaxConnections;
rpcInit.connType = TAOS_CONN_CLIENT;
rpcInit.user = (char *)user;
rpcInit.idleTime = tsShellActivityTimer * 1000;
rpcInit.ckey = "key";
rpcInit.spi = 1;
rpcInit.secret = (char *)secretEncrypt;
SRpcInit tsc_rpcInit;
memset(&tsc_rpcInit, 0, sizeof(tsc_rpcInit));
tsc_rpcInit.localPort = 0;
tsc_rpcInit.label = "TSC";
tsc_rpcInit.numOfThreads = tscNumOfThreads;
tsc_rpcInit.cfp = tscProcessMsgFromServer;
tsc_rpcInit.sessions = tsMaxConnections;
tsc_rpcInit.connType = TAOS_CONN_CLIENT;
tsc_rpcInit.user = (char *)user;
tsc_rpcInit.idleTime = tsShellActivityTimer * 1000;
tsc_rpcInit.ckey = "key";
tsc_rpcInit.spi = 1;
tsc_rpcInit.secret = (char *)secretEncrypt;
SRpcObj rpcObj;
memset(&rpcObj, 0, sizeof(rpcObj));
strncpy(rpcObj.key, key, strlen(key));
rpcObj.pDnodeConn = rpcOpen(&rpcInit);
rpcObj.pDnodeConn = rpcOpen(&tsc_rpcInit);
if (rpcObj.pDnodeConn == NULL) {
pthread_mutex_unlock(&rpcObjMutex);
tscError("failed to init connection to TDengine");
......
......@@ -2132,10 +2132,10 @@ void tscCloseTscObj(void *param) {
}
bool tscIsInsertData(char* sqlstr) {
int32_t index = 0;
int32_t tsc_index = 0;
do {
SStrToken t0 = tStrGetToken(sqlstr, &index, false);
SStrToken t0 = tStrGetToken(sqlstr, &tsc_index, false);
if (t0.type != TK_LP) {
return t0.type == TK_INSERT || t0.type == TK_IMPORT;
}
......@@ -2202,12 +2202,12 @@ SInternalField* tscFieldInfoAppend(SFieldInfo* pFieldInfo, TAOS_FIELD* pField) {
return taosArrayPush(pFieldInfo->internalField, &info);
}
SInternalField* tscFieldInfoInsert(SFieldInfo* pFieldInfo, int32_t index, TAOS_FIELD* field) {
SInternalField* tscFieldInfoInsert(SFieldInfo* pFieldInfo, int32_t tsc_index, TAOS_FIELD* field) {
pFieldInfo->numOfOutput++;
struct SInternalField info = { .pExpr = NULL, .visible = true };
info.field = *field;
return taosArrayInsert(pFieldInfo->internalField, index, &info);
return taosArrayInsert(pFieldInfo->internalField, tsc_index, &info);
}
void tscFieldInfoUpdateOffset(SQueryInfo* pQueryInfo) {
......@@ -2222,18 +2222,18 @@ void tscFieldInfoUpdateOffset(SQueryInfo* pQueryInfo) {
}
}
SInternalField* tscFieldInfoGetInternalField(SFieldInfo* pFieldInfo, int32_t index) {
assert(index < pFieldInfo->numOfOutput);
return TARRAY_GET_ELEM(pFieldInfo->internalField, index);
SInternalField* tscFieldInfoGetInternalField(SFieldInfo* pFieldInfo, int32_t tsc_index) {
assert(tsc_index < pFieldInfo->numOfOutput);
return TARRAY_GET_ELEM(pFieldInfo->internalField, tsc_index);
}
TAOS_FIELD* tscFieldInfoGetField(SFieldInfo* pFieldInfo, int32_t index) {
assert(index < pFieldInfo->numOfOutput);
return &((SInternalField*)TARRAY_GET_ELEM(pFieldInfo->internalField, index))->field;
TAOS_FIELD* tscFieldInfoGetField(SFieldInfo* pFieldInfo, int32_t tsc_index) {
assert(tsc_index < pFieldInfo->numOfOutput);
return &((SInternalField*)TARRAY_GET_ELEM(pFieldInfo->internalField, tsc_index))->field;
}
int16_t tscFieldInfoGetOffset(SQueryInfo* pQueryInfo, int32_t index) {
SInternalField* pInfo = tscFieldInfoGetInternalField(&pQueryInfo->fieldsInfo, index);
int16_t tscFieldInfoGetOffset(SQueryInfo* pQueryInfo, int32_t tsc_index) {
SInternalField* pInfo = tscFieldInfoGetInternalField(&pQueryInfo->fieldsInfo, tsc_index);
assert(pInfo != NULL && pInfo->pExpr->pExpr == NULL);
return pInfo->pExpr->base.offset;
......@@ -2402,7 +2402,7 @@ SExprInfo* tscExprCreate(STableMetaInfo* pTableMetaInfo, int16_t functionId, SCo
SSqlExpr* p = &pExpr->base;
p->functionId = functionId;
// set the correct columnIndex index
// set the correct columnIndex tsc_index
if (pColIndex->columnIndex == TSDB_TBNAME_COLUMN_INDEX) {
SSchema* s = tGetTbnameColumnSchema();
p->colInfo.colId = TSDB_TBNAME_COLUMN_INDEX;
......@@ -2449,16 +2449,16 @@ SExprInfo* tscExprCreate(STableMetaInfo* pTableMetaInfo, int16_t functionId, SCo
return pExpr;
}
SExprInfo* tscExprInsert(SQueryInfo* pQueryInfo, int32_t index, int16_t functionId, SColumnIndex* pColIndex, int16_t type,
SExprInfo* tscExprInsert(SQueryInfo* pQueryInfo, int32_t tsc_index, int16_t functionId, SColumnIndex* pColIndex, int16_t type,
int16_t size, int16_t resColId, int16_t interSize, bool isTagCol) {
int32_t num = (int32_t)taosArrayGetSize(pQueryInfo->exprList);
if (index == num) {
if (tsc_index == num) {
return tscExprAppend(pQueryInfo, functionId, pColIndex, type, size, resColId, interSize, isTagCol);
}
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, pColIndex->tableIndex);
SExprInfo* pExpr = tscExprCreate(pTableMetaInfo, functionId, pColIndex, type, size, resColId, interSize, isTagCol);
taosArrayInsert(pQueryInfo->exprList, index, &pExpr);
taosArrayInsert(pQueryInfo->exprList, tsc_index, &pExpr);
return pExpr;
}
......@@ -2470,10 +2470,10 @@ SExprInfo* tscExprAppend(SQueryInfo* pQueryInfo, int16_t functionId, SColumnInde
return pExpr;
}
SExprInfo* tscExprUpdate(SQueryInfo* pQueryInfo, int32_t index, int16_t functionId, int16_t srcColumnIndex,
SExprInfo* tscExprUpdate(SQueryInfo* pQueryInfo, int32_t tsc_index, int16_t functionId, int16_t srcColumnIndex,
int16_t type, int16_t size) {
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
SExprInfo* pExpr = tscExprGet(pQueryInfo, index);
SExprInfo* pExpr = tscExprGet(pQueryInfo, tsc_index);
if (pExpr == NULL) {
return NULL;
}
......@@ -2490,8 +2490,8 @@ SExprInfo* tscExprUpdate(SQueryInfo* pQueryInfo, int32_t index, int16_t function
return pExpr;
}
bool tscMultiRoundQuery(SQueryInfo* pQueryInfo, int32_t index) {
if (!UTIL_TABLE_IS_SUPER_TABLE(pQueryInfo->pTableMetaInfo[index])) {
bool tscMultiRoundQuery(SQueryInfo* pQueryInfo, int32_t tsc_index) {
if (!UTIL_TABLE_IS_SUPER_TABLE(pQueryInfo->pTableMetaInfo[tsc_index])) {
return false;
}
......@@ -2522,8 +2522,8 @@ void tscExprAddParams(SSqlExpr* pExpr, char* argument, int32_t type, int32_t byt
assert(pExpr->numOfParams <= 3);
}
SExprInfo* tscExprGet(SQueryInfo* pQueryInfo, int32_t index) {
return taosArrayGetP(pQueryInfo->exprList, index);
SExprInfo* tscExprGet(SQueryInfo* pQueryInfo, int32_t tsc_index) {
return taosArrayGetP(pQueryInfo->exprList, tsc_index);
}
/*
......@@ -3045,8 +3045,8 @@ void tscGetSrcColumnInfo(SSrcColumnInfo* pColInfo, SQueryInfo* pQueryInfo) {
if (TSDB_COL_IS_TAG(pExpr->base.colInfo.flag)) {
SSchema* pTagSchema = tscGetTableTagSchema(pTableMetaInfo->pTableMeta);
int16_t index = pExpr->base.colInfo.colIndex;
pColInfo[i].type = (index != -1) ? pTagSchema[index].type : TSDB_DATA_TYPE_BINARY;
int16_t tsc_index = pExpr->base.colInfo.colIndex;
pColInfo[i].type = (tsc_index != -1) ? pTagSchema[tsc_index].type : TSDB_DATA_TYPE_BINARY;
} else {
pColInfo[i].type = pSchema[pExpr->base.colInfo.colIndex].type;
}
......@@ -3126,7 +3126,7 @@ SQueryInfo* tscGetQueryInfoS(SSqlCmd* pCmd) {
return pQueryInfo;
}
STableMetaInfo* tscGetTableMetaInfoByUid(SQueryInfo* pQueryInfo, uint64_t uid, int32_t* index) {
STableMetaInfo* tscGetTableMetaInfoByUid(SQueryInfo* pQueryInfo, uint64_t uid, int32_t* tsc_index) {
int32_t k = -1;
for (int32_t i = 0; i < pQueryInfo->numOfTables; ++i) {
......@@ -3136,8 +3136,8 @@ STableMetaInfo* tscGetTableMetaInfoByUid(SQueryInfo* pQueryInfo, uint64_t uid, i
}
}
if (index != NULL) {
*index = k;
if (tsc_index != NULL) {
*tsc_index = k;
}
assert(k != -1);
......@@ -3347,15 +3347,15 @@ void tscFreeVgroupTableInfo(SArray* pVgroupTables) {
taosArrayDestroy(pVgroupTables);
}
void tscRemoveVgroupTableGroup(SArray* pVgroupTable, int32_t index) {
assert(pVgroupTable != NULL && index >= 0);
void tscRemoveVgroupTableGroup(SArray* pVgroupTable, int32_t tsc_index) {
assert(pVgroupTable != NULL && tsc_index >= 0);
size_t size = taosArrayGetSize(pVgroupTable);
assert(size > index);
assert(size > tsc_index);
SVgroupTableInfo* pInfo = taosArrayGet(pVgroupTable, index);
SVgroupTableInfo* pInfo = taosArrayGet(pVgroupTable, tsc_index);
taosArrayDestroy(pInfo->itemList);
taosArrayRemove(pVgroupTable, index);
taosArrayRemove(pVgroupTable, tsc_index);
}
void tscVgroupTableCopy(SVgroupTableInfo* info, SVgroupTableInfo* pInfo) {
......@@ -3825,15 +3825,15 @@ static void tscSubqueryRetrieveCallback(void* param, TAOS_RES* tres, int code) {
SSqlObj* pParentSql = ps->pParentSql;
SSqlObj* pSql = tres;
int32_t index = ps->subqueryIndex;
bool ret = subAndCheckDone(pSql, pParentSql, index);
int32_t tsc_index = ps->subqueryIndex;
bool ret = subAndCheckDone(pSql, pParentSql, tsc_index);
// TODO refactor
tfree(ps);
pSql->param = NULL;
if (!ret) {
tscDebug("0x%"PRIx64" sub:0x%"PRIx64" orderOfSub:%d completed, not all subquery finished", pParentSql->self, pSql->self, index);
tscDebug("0x%"PRIx64" sub:0x%"PRIx64" orderOfSub:%d completed, not all subquery finished", pParentSql->self, pSql->self, tsc_index);
return;
}
......@@ -3854,13 +3854,13 @@ static void tscSubqueryCompleteCallback(void* param, TAOS_RES* tres, int code) {
if (pSql->res.code != TSDB_CODE_SUCCESS) {
SSqlObj* pParentSql = ps->pParentSql;
int32_t index = ps->subqueryIndex;
bool ret = subAndCheckDone(pSql, pParentSql, index);
int32_t tsc_index = ps->subqueryIndex;
bool ret = subAndCheckDone(pSql, pParentSql, tsc_index);
tscFreeRetrieveSup(&pSql->param);
if (!ret) {
tscDebug("0x%"PRIx64" sub:0x%"PRIx64" orderOfSub:%d completed, not all subquery finished", pParentSql->self, pSql->self, index);
tscDebug("0x%"PRIx64" sub:0x%"PRIx64" orderOfSub:%d completed, not all subquery finished", pParentSql->self, pSql->self, tsc_index);
return;
}
......
......@@ -304,14 +304,14 @@ bool isNEleNull(SDataCol *pCol, int nEle) {
return true;
}
static FORCE_INLINE void dataColSetNullAt(SDataCol *pCol, int index) {
static FORCE_INLINE void dataColSetNullAt(SDataCol *pCol, int utl_index) {
if (IS_VAR_DATA_TYPE(pCol->type)) {
pCol->dataOff[index] = pCol->len;
pCol->dataOff[utl_index] = pCol->len;
char *ptr = POINTER_SHIFT(pCol->pData, pCol->len);
setVardataNull(ptr, pCol->type);
pCol->len += varDataTLen(ptr);
} else {
setNull(POINTER_SHIFT(pCol->pData, TYPE_BYTES[pCol->type] * index), pCol->type, pCol->bytes);
setNull(POINTER_SHIFT(pCol->pData, TYPE_BYTES[pCol->type] * utl_index), pCol->type, pCol->bytes);
pCol->len += TYPE_BYTES[pCol->type];
}
}
......
......@@ -376,10 +376,10 @@ bool taosCfgDynamicOptions(char *msg) {
return false;
}
void taosAddDataDir(int index, char *v1, int level, int primary) {
tstrncpy(tsDiskCfg[index].dir, v1, TSDB_FILENAME_LEN);
tsDiskCfg[index].level = level;
tsDiskCfg[index].primary = primary;
void taosAddDataDir(int utl_index, char *v1, int level, int primary) {
tstrncpy(tsDiskCfg[utl_index].dir, v1, TSDB_FILENAME_LEN);
tsDiskCfg[utl_index].level = level;
tsDiskCfg[utl_index].primary = primary;
uTrace("dataDir:%s, level:%d primary:%d is configured", v1, level, primary);
}
......
......@@ -338,29 +338,29 @@ void tNameAssign(SName* dst, const SName* src) {
memcpy(dst, src, sizeof(SName));
}
int32_t tNameSetDbName(SName* dst, const char* acct, SStrToken* dbToken) {
assert(dst != NULL && dbToken != NULL && acct != NULL);
int32_t tNameSetDbName(SName* dst, const char* utl_acct, SStrToken* dbToken) {
assert(dst != NULL && dbToken != NULL && utl_acct != NULL);
// too long account id or too long db name
if (strlen(acct) >= tListLen(dst->acctId) || dbToken->n >= tListLen(dst->dbname)) {
if (strlen(utl_acct) >= tListLen(dst->acctId) || dbToken->n >= tListLen(dst->dbname)) {
return -1;
}
dst->type = TSDB_DB_NAME_T;
tstrncpy(dst->acctId, acct, tListLen(dst->acctId));
tstrncpy(dst->acctId, utl_acct, tListLen(dst->acctId));
tstrncpy(dst->dbname, dbToken->z, dbToken->n + 1);
return 0;
}
int32_t tNameSetAcctId(SName* dst, const char* acct) {
assert(dst != NULL && acct != NULL);
int32_t tNameSetAcctId(SName* dst, const char* utl_acct) {
assert(dst != NULL && utl_acct != NULL);
// too long account id or too long db name
if (strlen(acct) >= tListLen(dst->acctId)) {
if (strlen(utl_acct) >= tListLen(dst->acctId)) {
return -1;
}
tstrncpy(dst->acctId, acct, tListLen(dst->acctId));
tstrncpy(dst->acctId, utl_acct, tListLen(dst->acctId));
assert(strlen(dst->acctId) > 0);
......
......@@ -258,8 +258,8 @@ static void getStatics_u64(const void *pData, int32_t numOfRow, int64_t *min, in
static void getStatics_f(const void *pData, int32_t numOfRow, int64_t *min, int64_t *max,
int64_t *sum, int16_t *minIndex, int16_t *maxIndex, int16_t *numOfNull) {
float *data = (float *)pData;
float fmin = FLT_MAX;
float fmax = -FLT_MAX;
float utl_fmin = FLT_MAX;
float utl_fmax = -FLT_MAX;
double dsum = 0;
*minIndex = 0;
*maxIndex = 0;
......@@ -275,20 +275,20 @@ static void getStatics_f(const void *pData, int32_t numOfRow, int64_t *min, int6
float fv = GET_FLOAT_VAL((const char*)&(data[i]));
dsum += fv;
if (fmin > fv) {
fmin = fv;
if (utl_fmin > fv) {
utl_fmin = fv;
*minIndex = i;
}
if (fmax < fv) {
fmax = fv;
if (utl_fmax < fv) {
utl_fmax = fv;
*maxIndex = i;
}
}
SET_DOUBLE_VAL(sum, dsum);
SET_DOUBLE_VAL(max, fmax);
SET_DOUBLE_VAL(min, fmin);
SET_DOUBLE_VAL(max, utl_fmax);
SET_DOUBLE_VAL(min, utl_fmin);
}
static void getStatics_d(const void *pData, int32_t numOfRow, int64_t *min, int64_t *max,
......
......@@ -424,7 +424,7 @@ static void cqProcessCreateTimer(void *param, void *tmrId) {
// inner implement in tscStream.c
TAOS_STREAM *taos_open_stream_withname(TAOS *taos, const char* desName, const char *sqlstr, void (*fp)(void *param, TAOS_RES *, TAOS_ROW row),
int64_t stime, void *param, void (*callback)(void *), void* cqhandle);
int64_t tsc_stime, void *param, void (*callback)(void *), void* cqhandle);
static void cqCreateStream(SCqContext *pContext, SCqObj *pObj) {
pObj->pContext = pContext;
......
......@@ -229,12 +229,12 @@ static void dnodeAllocCheckItem() {
}
void dnodeCleanupCheck() {
for (ECheckItemType index = 0; index < TSDB_CHECK_ITEM_MAX; ++index) {
if (tsCheckItem[index].enable && tsCheckItem[index].stopFp) {
(*tsCheckItem[index].stopFp)();
for (ECheckItemType dnd_index = 0; dnd_index < TSDB_CHECK_ITEM_MAX; ++dnd_index) {
if (tsCheckItem[dnd_index].enable && tsCheckItem[dnd_index].stopFp) {
(*tsCheckItem[dnd_index].stopFp)();
}
if (tsCheckItem[index].cleanUpFp) {
(*tsCheckItem[index].cleanUpFp)();
if (tsCheckItem[dnd_index].cleanUpFp) {
(*tsCheckItem[dnd_index].cleanUpFp)();
}
}
}
......@@ -242,19 +242,19 @@ void dnodeCleanupCheck() {
int32_t dnodeInitCheck() {
dnodeAllocCheckItem();
for (ECheckItemType index = 0; index < TSDB_CHECK_ITEM_MAX; ++index) {
if (tsCheckItem[index].initFp) {
if ((*tsCheckItem[index].initFp)() != 0) {
dError("failed to init check item:%s", tsCheckItem[index].name);
for (ECheckItemType dnd_index = 0; dnd_index < TSDB_CHECK_ITEM_MAX; ++dnd_index) {
if (tsCheckItem[dnd_index].initFp) {
if ((*tsCheckItem[dnd_index].initFp)() != 0) {
dError("failed to init check item:%s", tsCheckItem[dnd_index].name);
return -1;
}
}
}
for (ECheckItemType index = 0; index < TSDB_CHECK_ITEM_MAX; ++index) {
if (tsCheckItem[index].enable && tsCheckItem[index].startFp) {
if ((*tsCheckItem[index].startFp)() != 0) {
dError("failed to check item:%s", tsCheckItem[index].name);
for (ECheckItemType dnd_index = 0; dnd_index < TSDB_CHECK_ITEM_MAX; ++dnd_index) {
if (tsCheckItem[dnd_index].enable && tsCheckItem[dnd_index].startFp) {
if ((*tsCheckItem[dnd_index].startFp)() != 0) {
dError("failed to check item:%s", tsCheckItem[dnd_index].name);
exit(-1);
}
}
......
......@@ -56,17 +56,17 @@ int32_t dnodeInitServer() {
dnodeProcessReqMsgFp[TSDB_MSG_TYPE_DM_GRANT] = dnodeDispatchToMPeerQueue;
dnodeProcessReqMsgFp[TSDB_MSG_TYPE_DM_STATUS] = dnodeDispatchToMPeerQueue;
SRpcInit rpcInit;
memset(&rpcInit, 0, sizeof(rpcInit));
rpcInit.localPort = tsDnodeDnodePort;
rpcInit.label = "DND-S";
rpcInit.numOfThreads = 1;
rpcInit.cfp = dnodeProcessReqMsgFromDnode;
rpcInit.sessions = TSDB_MAX_VNODES << 4;
rpcInit.connType = TAOS_CONN_SERVER;
rpcInit.idleTime = tsShellActivityTimer * 1000;
tsServerRpc = rpcOpen(&rpcInit);
SRpcInit dnd_rpcInit;
memset(&dnd_rpcInit, 0, sizeof(dnd_rpcInit));
dnd_rpcInit.localPort = tsDnodeDnodePort;
dnd_rpcInit.label = "DND-S";
dnd_rpcInit.numOfThreads = 1;
dnd_rpcInit.cfp = dnodeProcessReqMsgFromDnode;
dnd_rpcInit.sessions = TSDB_MAX_VNODES << 4;
dnd_rpcInit.connType = TAOS_CONN_SERVER;
dnd_rpcInit.idleTime = tsShellActivityTimer * 1000;
tsServerRpc = rpcOpen(&dnd_rpcInit);
if (tsServerRpc == NULL) {
dError("failed to init inter-dnodes RPC server");
return -1;
......@@ -123,19 +123,19 @@ static void dnodeProcessReqMsgFromDnode(SRpcMsg *pMsg, SRpcEpSet *pEpSet) {
int32_t dnodeInitClient() {
char secret[TSDB_KEY_LEN] = "secret";
SRpcInit rpcInit;
memset(&rpcInit, 0, sizeof(rpcInit));
rpcInit.label = "DND-C";
rpcInit.numOfThreads = 1;
rpcInit.cfp = dnodeProcessRspFromDnode;
rpcInit.sessions = TSDB_MAX_VNODES << 4;
rpcInit.connType = TAOS_CONN_CLIENT;
rpcInit.idleTime = tsShellActivityTimer * 1000;
rpcInit.user = "t";
rpcInit.ckey = "key";
rpcInit.secret = secret;
tsClientRpc = rpcOpen(&rpcInit);
SRpcInit dnd_rpcInit;
memset(&dnd_rpcInit, 0, sizeof(dnd_rpcInit));
dnd_rpcInit.label = "DND-C";
dnd_rpcInit.numOfThreads = 1;
dnd_rpcInit.cfp = dnodeProcessRspFromDnode;
dnd_rpcInit.sessions = TSDB_MAX_VNODES << 4;
dnd_rpcInit.connType = TAOS_CONN_CLIENT;
dnd_rpcInit.idleTime = tsShellActivityTimer * 1000;
dnd_rpcInit.user = "t";
dnd_rpcInit.ckey = "key";
dnd_rpcInit.secret = secret;
tsClientRpc = rpcOpen(&dnd_rpcInit);
if (tsClientRpc == NULL) {
dError("failed to init mnode rpc client");
return -1;
......
......@@ -83,18 +83,18 @@ int32_t dnodeInitShell() {
numOfThreads = 1;
}
SRpcInit rpcInit;
memset(&rpcInit, 0, sizeof(rpcInit));
rpcInit.localPort = tsDnodeShellPort;
rpcInit.label = "SHELL";
rpcInit.numOfThreads = numOfThreads;
rpcInit.cfp = dnodeProcessMsgFromShell;
rpcInit.sessions = tsMaxShellConns;
rpcInit.connType = TAOS_CONN_SERVER;
rpcInit.idleTime = tsShellActivityTimer * 1000;
rpcInit.afp = dnodeRetrieveUserAuthInfo;
tsShellRpc = rpcOpen(&rpcInit);
SRpcInit dnd_rpcInit;
memset(&dnd_rpcInit, 0, sizeof(dnd_rpcInit));
dnd_rpcInit.localPort = tsDnodeShellPort;
dnd_rpcInit.label = "SHELL";
dnd_rpcInit.numOfThreads = numOfThreads;
dnd_rpcInit.cfp = dnodeProcessMsgFromShell;
dnd_rpcInit.sessions = tsMaxShellConns;
dnd_rpcInit.connType = TAOS_CONN_SERVER;
dnd_rpcInit.idleTime = tsShellActivityTimer * 1000;
dnd_rpcInit.afp = dnodeRetrieveUserAuthInfo;
tsShellRpc = rpcOpen(&dnd_rpcInit);
if (tsShellRpc == NULL) {
dError("failed to init shell rpc server");
return -1;
......
......@@ -93,8 +93,8 @@ static void shellCheckTablesSQLFile(const char *directoryName)
{
sprintf(shellTablesSQLFile, "%s/tables.sql", directoryName);
struct stat fstat;
if (stat(shellTablesSQLFile, &fstat) < 0) {
struct stat kit_fstat;
if (stat(shellTablesSQLFile, &kit_fstat) < 0) {
shellTablesSQLFile[0] = 0;
}
}
......
此差异已折叠。
......@@ -145,8 +145,8 @@ static int32_t mnodeCreateCluster() {
SClusterObj *pCluster = malloc(sizeof(SClusterObj));
memset(pCluster, 0, sizeof(SClusterObj));
pCluster->createdTime = taosGetTimestampMs();
bool getuid = taosGetSystemUid(pCluster->uid);
if (!getuid) {
bool mnd_getuid = taosGetSystemUid(pCluster->uid);
if (!mnd_getuid) {
strcpy(pCluster->uid, "tdengine2.0");
mError("failed to get uid from system, set to default val %s", pCluster->uid);
} else {
......
此差异已折叠。
此差异已折叠。
......@@ -10,5 +10,6 @@ ELSEIF (TD_WINDOWS)
ENDIF ()
ADD_SUBDIRECTORY(src/detail)
ADD_SUBDIRECTORY(tests)
IF (NOT TD_NINGSI_60)
ADD_SUBDIRECTORY(tests)
ENDIF ()
......@@ -45,8 +45,8 @@ void taosRemoveDir(char *rootDir) {
uInfo("dir:%s is removed", rootDir);
}
bool taosDirExist(const char* dirname) {
return access(dirname, F_OK) == 0;
bool taosDirExist(const char* os_dirname) {
return access(os_dirname, F_OK) == 0;
}
int taosMkDir(const char *path, mode_t mode) {
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册