提交 33b1bb13 编写于 作者: A Alex Duan

fixed build error

上级 9285e8ea
...@@ -1353,8 +1353,8 @@ bool appendAfterSelect(TAOS * con, Command * cmd, char* sql, int32_t len) { ...@@ -1353,8 +1353,8 @@ bool appendAfterSelect(TAOS * con, Command * cmd, char* sql, int32_t len) {
bool fieldEnd = fieldsInputEnd(p); bool fieldEnd = fieldsInputEnd(p);
// cheeck fields input end then insert from keyword // cheeck fields input end then insert from keyword
if (fieldEnd && p[len-1] == ' ') { if (fieldEnd && p[len-1] == ' ') {
shellInsertChar(cmd, "from", 4); insertChar(cmd, "from", 4);
taosMemoryFree(p); free(p);
return true; return true;
} }
...@@ -1366,7 +1366,7 @@ bool appendAfterSelect(TAOS * con, Command * cmd, char* sql, int32_t len) { ...@@ -1366,7 +1366,7 @@ bool appendAfterSelect(TAOS * con, Command * cmd, char* sql, int32_t len) {
ret = fillWithType(con, cmd, last, WT_VAR_FUNC); ret = fillWithType(con, cmd, last, WT_VAR_FUNC);
} }
taosMemoryFree(p); free(p);
return ret; return ret;
} }
...@@ -1379,7 +1379,7 @@ bool appendAfterSelect(TAOS * con, Command * cmd, char* sql, int32_t len) { ...@@ -1379,7 +1379,7 @@ bool appendAfterSelect(TAOS * con, Command * cmd, char* sql, int32_t len) {
ret = fillWithType(con, cmd, last, WT_VAR_KEYWORD); ret = fillWithType(con, cmd, last, WT_VAR_KEYWORD);
} }
taosMemoryFree(p); free(p);
return ret; return ret;
} }
...@@ -1446,7 +1446,7 @@ bool matchSelectQuery(TAOS * con, Command * cmd) { ...@@ -1446,7 +1446,7 @@ bool matchSelectQuery(TAOS * con, Command * cmd) {
// search // search
char* sql_cp = strndup(p, len); char* sql_cp = strndup(p, len);
int32_t n = searchAfterSelect(sql_cp, len); int32_t n = searchAfterSelect(sql_cp, len);
taosMemoryFree(sql_cp); free(sql_cp);
if(n == -1 || n > len) if(n == -1 || n > len)
return false; return false;
p += n; p += n;
...@@ -1540,7 +1540,7 @@ bool matchOther(TAOS * con, Command * cmd) { ...@@ -1540,7 +1540,7 @@ bool matchOther(TAOS * con, Command * cmd) {
if (p[len - 1] == '\\') { if (p[len - 1] == '\\') {
// append '\G' // append '\G'
char a[] = "G;"; char a[] = "G;";
shellInsertChar(cmd, a, 2); insertChar(cmd, a, 2);
return true; return true;
} }
...@@ -1554,7 +1554,7 @@ bool matchOther(TAOS * con, Command * cmd) { ...@@ -1554,7 +1554,7 @@ bool matchOther(TAOS * con, Command * cmd) {
if (strcmp(last, "from(") == 0) { if (strcmp(last, "from(") == 0) {
fillWithType(con, cmd, "", WT_VAR_KEYSELECT); fillWithType(con, cmd, "", WT_VAR_KEYSELECT);
taosMemoryFree(sql); free(sql);
return true; return true;
} }
if (strncmp(last, "(", 1) == 0) { if (strncmp(last, "(", 1) == 0) {
...@@ -1597,12 +1597,12 @@ bool matchOther(TAOS * con, Command * cmd) { ...@@ -1597,12 +1597,12 @@ bool matchOther(TAOS * con, Command * cmd) {
if (found) { if (found) {
fillWithType(con, cmd, last, WT_VAR_KEYSELECT); fillWithType(con, cmd, last, WT_VAR_KEYSELECT);
taosMemoryFree(sql); free(sql);
return true; return true;
} }
} }
taosMemoryFree(sql); free(sql);
return false; return false;
} }
...@@ -1712,7 +1712,7 @@ bool dealUseDB(char * sql) { ...@@ -1712,7 +1712,7 @@ bool dealUseDB(char * sql) {
} }
// switch new db // switch new db
taosThreadMutexLock(&tiresMutex); pthread_mutex_lock(&tiresMutex);
// STABLE set null // STABLE set null
STire* tire = tires[WT_VAR_STABLE]; STire* tire = tires[WT_VAR_STABLE];
tires[WT_VAR_STABLE] = NULL; tires[WT_VAR_STABLE] = NULL;
...@@ -1727,7 +1727,7 @@ bool dealUseDB(char * sql) { ...@@ -1727,7 +1727,7 @@ bool dealUseDB(char * sql) {
} }
// save // save
strcpy(dbName, db); strcpy(dbName, db);
taosThreadMutexUnlock(&tiresMutex); pthread_mutex_unlock(&tiresMutex);
return true; return true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册