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