提交 c50de3f8 编写于 作者: G Ganlin Zhao

Merge branch 'develop' into fix/TD-11248

......@@ -156,13 +156,15 @@ static int32_t getSmlMd5ChildTableName(TAOS_SML_DATA_POINT* point, char* tableNa
SStringBuilder sb; memset(&sb, 0, sizeof(sb));
char sTableName[TSDB_TABLE_NAME_LEN + TS_ESCAPE_CHAR_SIZE] = {0};
strtolower(sTableName, point->stableName);
strncpy(sTableName, point->stableName, strlen(point->stableName));
//strtolower(sTableName, point->stableName);
taosStringBuilderAppendString(&sb, sTableName);
for (int j = 0; j < point->tagNum; ++j) {
taosStringBuilderAppendChar(&sb, ',');
TAOS_SML_KV* tagKv = point->tags + j;
char tagName[TSDB_COL_NAME_LEN + TS_ESCAPE_CHAR_SIZE] = {0};
strtolower(tagName, tagKv->key);
strncpy(tagName, tagKv->key, strlen(tagKv->key));
//strtolower(tagName, tagKv->key);
taosStringBuilderAppendString(&sb, tagName);
taosStringBuilderAppendChar(&sb, '=');
taosStringBuilderAppend(&sb, tagKv->value, tagKv->length);
......@@ -261,10 +263,10 @@ static int32_t buildDataPointSchemas(TAOS_SML_DATA_POINT* points, int numPoint,
static int32_t generateSchemaAction(SSchema* pointColField, SHashObj* dbAttrHash, SArray* dbAttrArray, bool isTag, char sTableName[],
SSchemaAction* action, bool* actionNeeded, SSmlLinesInfo* info) {
char fieldNameLowerCase[TSDB_COL_NAME_LEN + TS_ESCAPE_CHAR_SIZE] = {0};
strtolower(fieldNameLowerCase, pointColField->name);
char fieldName[TSDB_COL_NAME_LEN + TS_ESCAPE_CHAR_SIZE] = {0};
strcpy(fieldName, pointColField->name);
size_t* pDbIndex = taosHashGet(dbAttrHash, fieldNameLowerCase, strlen(fieldNameLowerCase));
size_t* pDbIndex = taosHashGet(dbAttrHash, fieldName, strlen(fieldName));
if (pDbIndex) {
SSchema* dbAttr = taosArrayGet(dbAttrArray, *pDbIndex);
assert(strcasecmp(dbAttr->name, pointColField->name) == 0);
......@@ -297,7 +299,7 @@ static int32_t generateSchemaAction(SSchema* pointColField, SHashObj* dbAttrHash
*actionNeeded = true;
}
if (*actionNeeded) {
tscDebug("SML:0x%" PRIx64 " generate schema action. column name: %s, action: %d", info->id, fieldNameLowerCase,
tscDebug("SML:0x%" PRIx64 " generate schema action. column name: %s, action: %d", info->id, fieldName,
action->action);
}
return 0;
......@@ -536,11 +538,8 @@ static int32_t retrieveTableMeta(TAOS* taos, char* tableName, STableMeta** pTabl
tscDebug("SML:0x%" PRIx64 " retrieve table meta. super table name: %s", info->id, tableName);
char tableNameLowerCase[TSDB_TABLE_NAME_LEN + TS_ESCAPE_CHAR_SIZE];
strtolower(tableNameLowerCase, tableName);
char sql[256];
snprintf(sql, 256, "describe %s", tableNameLowerCase);
snprintf(sql, 256, "describe %s", tableName);
TAOS_RES* res = taos_query(taos, sql);
code = taos_errno(res);
if (code != 0) {
......@@ -561,8 +560,10 @@ static int32_t retrieveTableMeta(TAOS* taos, char* tableName, STableMeta** pTabl
pSql->fp = NULL;
registerSqlObj(pSql);
SStrToken tableToken = {.z = tableNameLowerCase, .n = (uint32_t)strlen(tableNameLowerCase), .type = TK_ID};
tGetToken(tableNameLowerCase, &tableToken.type);
char tableNameBuf[TSDB_TABLE_NAME_LEN + TS_ESCAPE_CHAR_SIZE] = {0};
memcpy(tableNameBuf, tableName, strlen(tableName));
SStrToken tableToken = {.z = tableNameBuf, .n = (uint32_t)strlen(tableName), .type = TK_ID};
tGetToken(tableNameBuf, &tableToken.type);
bool dbIncluded = false;
// Check if the table name available or not
if (tscValidateName(&tableToken, true, &dbIncluded) != TSDB_CODE_SUCCESS) {
......@@ -1870,24 +1871,14 @@ static int32_t parseSmlTimeStamp(TAOS_SML_KV **pTS, const char **index, SSmlLine
bool checkDuplicateKey(char *key, SHashObj *pHash, SSmlLinesInfo* info) {
char *val = NULL;
char *cur = key;
char keyLower[TSDB_COL_NAME_LEN];
size_t keyLen = 0;
while(*cur != '\0') {
keyLower[keyLen] = tolower(*cur);
keyLen++;
cur++;
}
keyLower[keyLen] = '\0';
val = taosHashGet(pHash, keyLower, keyLen);
val = taosHashGet(pHash, key, strlen(key));
if (val) {
tscError("SML:0x%"PRIx64" Duplicate key detected:%s", info->id, keyLower);
tscError("SML:0x%"PRIx64" Duplicate key detected:%s", info->id, key);
return true;
}
uint8_t dummy_val = 0;
taosHashPut(pHash, keyLower, strlen(key), &dummy_val, sizeof(uint8_t));
taosHashPut(pHash, key, strlen(key), &dummy_val, sizeof(uint8_t));
return false;
}
......@@ -1925,7 +1916,6 @@ static int32_t parseSmlKey(TAOS_SML_KV *pKV, const char **index, SHashObj *pHash
pKV->key = calloc(len + TS_ESCAPE_CHAR_SIZE + 1, 1);
memcpy(pKV->key, key, len + 1);
strntolower_s(pKV->key, pKV->key, (int32_t)len);
addEscapeCharToString(pKV->key, len);
tscDebug("SML:0x%"PRIx64" Key:%s|len:%d", info->id, pKV->key, len);
*index = cur + 1;
......@@ -2053,7 +2043,7 @@ static int32_t parseSmlMeasurement(TAOS_SML_DATA_POINT *pSml, const char **index
if (*cur == '\\') {
escapeSpecialCharacter(1, &cur);
}
pSml->stableName[len] = tolower(*cur);
pSml->stableName[len] = *cur;
cur++;
len++;
}
......@@ -2129,7 +2119,6 @@ static int32_t parseSmlKvPairs(TAOS_SML_KV **pKVs, int *num_kvs,
if (!isField && childTableNameLen != 0 && strcasecmp(pkv->key, childTableName) == 0) {
smlData->childTableName = malloc(pkv->length + TS_ESCAPE_CHAR_SIZE + 1);
memcpy(smlData->childTableName, pkv->value, pkv->length);
strntolower_s(smlData->childTableName, smlData->childTableName, (int32_t)pkv->length);
addEscapeCharToString(smlData->childTableName, (int32_t)pkv->length);
free(pkv->key);
free(pkv->value);
......
......@@ -65,7 +65,7 @@ static int32_t parseTelnetMetric(TAOS_SML_DATA_POINT *pSml, const char **index,
}
}
pSml->stableName[len] = tolower(*cur);
pSml->stableName[len] = *cur;
cur++;
len++;
......@@ -241,7 +241,6 @@ static int32_t parseTelnetTagKey(TAOS_SML_KV *pKV, const char **index, SHashObj
pKV->key = tcalloc(len + TS_ESCAPE_CHAR_SIZE + 1, 1);
memcpy(pKV->key, key, len + 1);
strntolower_s(pKV->key, pKV->key, (int32_t)len);
addEscapeCharToString(pKV->key, len);
//tscDebug("OTD:0x%"PRIx64" Key:%s|len:%d", info->id, pKV->key, len);
*index = cur + 1;
......@@ -327,7 +326,6 @@ static int32_t parseTelnetTagKvs(TAOS_SML_KV **pKVs, int *num_kvs,
*childTableName = tcalloc(pkv->length + TS_ESCAPE_CHAR_SIZE + 1, 1);
memcpy(*childTableName, pkv->value, pkv->length);
(*childTableName)[pkv->length] = '\0';
strntolower_s(*childTableName, *childTableName, (int32_t)pkv->length);
addEscapeCharToString(*childTableName, pkv->length);
tfree(pkv->key);
tfree(pkv->value);
......@@ -515,7 +513,6 @@ static int32_t parseMetricFromJSON(cJSON *root, TAOS_SML_DATA_POINT* pSml, SSmlL
*/
tstrncpy(pSml->stableName, metric->valuestring, stableLen + 1);
strntolower_s(pSml->stableName, pSml->stableName, (int32_t)stableLen);
addEscapeCharToString(pSml->stableName, (int32_t)stableLen);
return TSDB_CODE_SUCCESS;
......@@ -546,7 +543,6 @@ static int32_t parseTimestampFromJSONObj(cJSON *root, int64_t *tsVal, SSmlLinesI
}
size_t typeLen = strlen(type->valuestring);
strntolower_s(type->valuestring, type->valuestring, (int32_t)typeLen);
if (typeLen == 1 && type->valuestring[0] == 's') {
//seconds
*tsVal = (int64_t)(*tsVal * 1e9);
......@@ -915,7 +911,6 @@ static int32_t parseTagsFromJSON(cJSON *root, TAOS_SML_KV **pKVs, int *num_kvs,
size_t idLen = strlen(id->valuestring);
*childTableName = tcalloc(idLen + TS_ESCAPE_CHAR_SIZE + 1, sizeof(char));
memcpy(*childTableName, id->valuestring, idLen);
strntolower_s(*childTableName, *childTableName, (int32_t)idLen);
addEscapeCharToString(*childTableName, (int32_t)idLen);
//check duplicate IDs
......@@ -954,7 +949,6 @@ static int32_t parseTagsFromJSON(cJSON *root, TAOS_SML_KV **pKVs, int *num_kvs,
}
pkv->key = tcalloc(keyLen + TS_ESCAPE_CHAR_SIZE + 1, sizeof(char));
strncpy(pkv->key, tag->string, keyLen);
strntolower_s(pkv->key, pkv->key, (int32_t)keyLen);
addEscapeCharToString(pkv->key, (int32_t)keyLen);
//value
ret = parseValueFromJSON(tag, pkv, info);
......
......@@ -1623,7 +1623,7 @@ int taos_stmt_prepare(TAOS_STMT* stmt, const char* sql, unsigned long length) {
pRes->qId = 0;
pRes->numOfRows = 0;
strtolower(pSql->sqlstr, sql);
strcpy(pSql->sqlstr, sql);
tscDebugL("0x%"PRIx64" SQL: %s", pSql->self, pSql->sqlstr);
if (tscIsInsertData(pSql->sqlstr)) {
......
......@@ -6361,6 +6361,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
// the schema is located after the pMsg body, then followed by true tag value
char* d = pUpdateMsg->data;
SSchema* pTagCols = tscGetTableTagSchema(pTableMeta);
for (int i = 0; i < numOfTags; ++i) {
STColumn* pCol = (STColumn*) d;
pCol->colId = htons(pTagCols[i].colId);
......@@ -6415,6 +6416,14 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER;
SStrToken name = {.type = TK_STRING, .z = pItem->pVar.pz, .n = pItem->pVar.nLen};
//handle Escape character backstick
bool inEscape = false;
if (name.z[0] == TS_ESCAPE_CHAR && name.z[name.n - 1] == TS_ESCAPE_CHAR) {
inEscape = true;
name.type = TK_ID;
}
if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) {
return invalidOperationMsg(pMsg, msg17);
}
......@@ -6425,6 +6434,13 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
char name1[TSDB_COL_NAME_LEN] = {0};
tstrncpy(name1, pItem->pVar.pz, sizeof(name1));
int32_t nameLen = pItem->pVar.nLen;
if (inEscape) {
memmove(name1, name1 + 1, nameLen);
name1[nameLen - TS_ESCAPE_CHAR_SIZE] = '\0';
}
TAOS_FIELD f = tscCreateField(TSDB_DATA_TYPE_INT, name1, tDataTypes[TSDB_DATA_TYPE_INT].bytes);
tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
} else if (pAlterSQL->type == TSDB_ALTER_TABLE_CHANGE_COLUMN) {
......@@ -6440,11 +6456,12 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER;
SStrToken name = {.type = TK_STRING, .z = pItem->name, .n = (uint32_t)strlen(pItem->name)};
//handle Escape character backstick
bool inEscape = false;
if (name.z[0] == TS_ESCAPE_CHAR && name.z[name.n - 1] == TS_ESCAPE_CHAR) {
memmove(name.z, name.z + 1, name.n);
name.z[name.n - TS_ESCAPE_CHAR_SIZE] = '\0';
name.n -= TS_ESCAPE_CHAR_SIZE;
inEscape = true;
name.type = TK_ID;
}
if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) {
......@@ -6480,6 +6497,13 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
if (nLen >= TSDB_MAX_BYTES_PER_ROW) {
return invalidOperationMsg(pMsg, msg24);
}
if (inEscape) {
memmove(name.z, name.z + 1, name.n);
name.z[name.n - TS_ESCAPE_CHAR_SIZE] = '\0';
name.n -= TS_ESCAPE_CHAR_SIZE;
}
TAOS_FIELD f = tscCreateField(pColSchema->type, name.z, pItem->bytes);
tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
}else if (pAlterSQL->type == TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN) {
......
......@@ -148,6 +148,7 @@ extern char tsMqttTopic[];
// monitor
extern int8_t tsEnableMonitorModule;
extern int8_t tsMonitorReplica;
extern char tsMonitorDbName[];
extern char tsInternalPass[];
extern int32_t tsMonitorInterval;
......
......@@ -39,7 +39,7 @@ typedef struct tVariant {
bool tVariantIsValid(tVariant *pVar);
void tVariantCreate(tVariant *pVar, SStrToken *token);
void tVariantCreate(tVariant *pVar, SStrToken *token, bool needRmquoteEscape);
void tVariantCreateFromBinary(tVariant *pVar, const char *pz, size_t len, uint32_t type);
......
......@@ -193,6 +193,7 @@ char tsMqttTopic[TSDB_MQTT_TOPIC_LEN] = "/test"; // #
// monitor
int8_t tsEnableMonitorModule = 1;
int8_t tsMonitorReplica = 1;
char tsMonitorDbName[TSDB_DB_NAME_LEN] = "log";
char tsInternalPass[] = "secretkey";
int32_t tsMonitorInterval = 30; // seconds
......@@ -669,6 +670,16 @@ static void doInitGlobalConfig(void) {
cfg.unitType = TAOS_CFG_UTYPE_SECOND;
taosInitConfigOption(cfg);
cfg.option = "monitorReplica";
cfg.ptr = &tsMonitorReplica;
cfg.valType = TAOS_CFG_VTYPE_INT8;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
cfg.minValue = 1;
cfg.maxValue = 3;
cfg.ptrLength = 1;
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosInitConfigOption(cfg);
cfg.option = "offlineThreshold";
cfg.ptr = &tsOfflineThreshold;
cfg.valType = TAOS_CFG_VTYPE_INT32;
......
......@@ -30,7 +30,7 @@
assert(0); \
} while (0)
void tVariantCreate(tVariant *pVar, SStrToken *token) {
void tVariantCreate(tVariant *pVar, SStrToken *token, bool needRmquoteEscape) {
int32_t ret = 0;
int32_t type = token->type;
......@@ -81,7 +81,7 @@ void tVariantCreate(tVariant *pVar, SStrToken *token) {
case TSDB_DATA_TYPE_BINARY: {
pVar->pz = strndup(token->z, token->n);
pVar->nLen = strRmquoteEscape(pVar->pz, token->n);
pVar->nLen = needRmquoteEscape ? strRmquoteEscape(pVar->pz, token->n) : token->n;
break;
}
case TSDB_DATA_TYPE_TIMESTAMP: {
......
......@@ -29,8 +29,8 @@ extern "C" {
extern int32_t dDebugFlag;
#define dFatal(...) { if (dDebugFlag & DEBUG_FATAL) { taosPrintLog("DND FATAL ", 255, __VA_ARGS__); }}
#define dError(...) { if (dDebugFlag & DEBUG_ERROR) { taosPrintLog("DND ERROR ", 255, __VA_ARGS__); }}
#define dFatal(...) { if (dDebugFlag & DEBUG_FATAL) { taosPrintLog("DND FATAL ", 255, __VA_ARGS__); dnodeIncDnodeError(); }}
#define dError(...) { if (dDebugFlag & DEBUG_ERROR) { taosPrintLog("DND ERROR ", 255, __VA_ARGS__); dnodeIncDnodeError(); }}
#define dWarn(...) { if (dDebugFlag & DEBUG_WARN) { taosPrintLog("DND WARN ", 255, __VA_ARGS__); }}
#define dInfo(...) { if (dDebugFlag & DEBUG_INFO) { taosPrintLog("DND ", 255, __VA_ARGS__); }}
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", dDebugFlag, __VA_ARGS__); }}
......
......@@ -54,6 +54,7 @@ void moduleStop() {}
void *tsDnodeTmr = NULL;
static SRunStatus tsRunStatus = TSDB_RUN_STATUS_STOPPED;
static int64_t tsDnodeErrors = 0;
static int32_t dnodeInitStorage();
static void dnodeCleanupStorage();
......@@ -225,6 +226,14 @@ static void dnodeSetRunStatus(SRunStatus status) {
tsRunStatus = status;
}
int64_t dnodeGetDnodeError() {
return tsDnodeErrors;
}
void dnodeIncDnodeError() {
atomic_add_fetch_64(&tsDnodeErrors, 1);
}
static void dnodeCheckDataDirOpenned(char *dir) {
char filepath[256] = {0};
sprintf(filepath, "%s/.running", dir);
......
......@@ -28,8 +28,8 @@ static void (*dnodeProcessShellMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *);
static void dnodeProcessMsgFromShell(SRpcMsg *pMsg, SRpcEpSet *);
static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char *secret, char *ckey);
static void * tsShellRpc = NULL;
static int32_t tsQueryReqNum = 0;
static int32_t tsSubmitReqNum = 0;
static int64_t tsQueryReqNum = 0;
static int64_t tsSubmitReqNum = 0;
int32_t dnodeInitShell() {
dnodeProcessShellMsgFp[TSDB_MSG_TYPE_SUBMIT] = dnodeDispatchToVWriteQueue;
......@@ -136,9 +136,9 @@ static void dnodeProcessMsgFromShell(SRpcMsg *pMsg, SRpcEpSet *pEpSet) {
}
if (pMsg->msgType == TSDB_MSG_TYPE_QUERY) {
atomic_fetch_add_32(&tsQueryReqNum, 1);
atomic_fetch_add_64(&tsQueryReqNum, 1);
} else if (pMsg->msgType == TSDB_MSG_TYPE_SUBMIT) {
atomic_fetch_add_32(&tsSubmitReqNum, 1);
atomic_fetch_add_64(&tsSubmitReqNum, 1);
} else {}
if ( dnodeProcessShellMsgFp[pMsg->msgType] ) {
......@@ -237,15 +237,31 @@ void *dnodeSendCfgTableToRecv(int32_t vgId, int32_t tid) {
}
}
SStatisInfo dnodeGetStatisInfo() {
SStatisInfo info = {0};
SDnodeStatisInfo dnodeGetStatisInfo() {
SDnodeStatisInfo info = {0};
if (dnodeGetRunStatus() == TSDB_RUN_STATUS_RUNING) {
#ifdef HTTP_EMBEDDED
info.httpReqNum = httpGetReqCount();
#endif
info.queryReqNum = atomic_exchange_32(&tsQueryReqNum, 0);
info.submitReqNum = atomic_exchange_32(&tsSubmitReqNum, 0);
info.queryReqNum = atomic_exchange_64(&tsQueryReqNum, 0);
info.submitReqNum = atomic_exchange_64(&tsSubmitReqNum, 0);
}
return info;
}
int32_t dnodeGetHttpStatusInfo(int32_t index) {
int32_t httpStatus = 0;
#ifdef HTTP_EMBEDDED
httpStatus = httpGetStatusCodeCount(index);
#endif
return httpStatus;
}
void dnodeClearHttpStatusInfo() {
#ifdef HTTP_EMBEDDED
for (int i = 0; i < MAX_HTTP_STATUS_CODE_NUM; ++i) {
httpClearStatusCodeCount(i);
}
#endif
}
......@@ -23,13 +23,16 @@ extern "C" {
#include "trpc.h"
#include "taosmsg.h"
#define MAX_HTTP_STATUS_CODE_NUM 63
typedef struct {
int32_t queryReqNum;
int32_t submitReqNum;
int32_t httpReqNum;
} SStatisInfo;
int64_t queryReqNum;
int64_t submitReqNum;
int64_t httpReqNum;
} SDnodeStatisInfo;
SStatisInfo dnodeGetStatisInfo();
SDnodeStatisInfo dnodeGetStatisInfo();
int32_t dnodeGetHttpStatusInfo(int32_t index);
void dnodeClearHttpStatusInfo();
bool dnodeIsFirstDeploy();
bool dnodeIsMasterEp(char *ep);
......@@ -37,6 +40,8 @@ void dnodeGetEpSetForPeer(SRpcEpSet *epSet);
void dnodeGetEpSetForShell(SRpcEpSet *epSet);
int32_t dnodeGetDnodeId();
void dnodeGetClusterId(char *clusterId);
int64_t dnodeGetDnodeError();
void dnodeIncDnodeError();
void dnodeUpdateEp(int32_t dnodeId, char *ep, char *fqdn, uint16_t *port);
bool dnodeCheckEpChanged(int32_t dnodeId, char *epstr);
......
......@@ -22,7 +22,9 @@ extern "C" {
#include <stdint.h>
int32_t httpGetReqCount();
int64_t httpGetReqCount();
int32_t httpGetStatusCodeCount(int index);
int32_t httpClearStatusCodeCount(int index);
int32_t httpInitSystem();
int32_t httpStartSystem();
void httpStopSystem();
......
......@@ -22,6 +22,17 @@ extern "C" {
#include <stdint.h>
#define monSaveLogs(level, ...) { \
monSaveLog(level, __VA_ARGS__); \
monSaveDnodeLog(level, __VA_ARGS__); \
}
typedef struct {
const char * name;
int32_t code;
int32_t index;
} SMonHttpStatus;
typedef struct {
char * acctId;
int64_t currentPointsPerSecond;
......@@ -53,9 +64,16 @@ void monStopSystem();
void monCleanupSystem();
void monSaveAcctLog(SAcctMonitorObj *pMonObj);
void monSaveLog(int32_t level, const char *const format, ...);
void monSaveDnodeLog(int32_t level, const char *const format, ...);
void monExecuteSQL(char *sql);
typedef void (*MonExecuteSQLCbFP)(void *param, TAOS_RES *, int code);
void monExecuteSQLWithResultCallback(char *sql, MonExecuteSQLCbFP callback, void* param);
void monIncQueryReqCnt();
void monIncSubmitReqCnt();
int32_t monFetchQueryReqCnt();
int32_t monFetchSubmitReqCnt();
SMonHttpStatus *monGetHttpStatusHashTableEntry(int32_t code);
#ifdef __cplusplus
}
#endif
......
......@@ -22,6 +22,12 @@ extern "C" {
#include "trpc.h"
#include "twal.h"
typedef struct {
int64_t submitReqSucNum;
int64_t submitRowNum;
int64_t submitRowSucNum;
} SVnodeStatisInfo;
typedef struct {
int32_t len;
void * rsp;
......@@ -62,7 +68,7 @@ int32_t vnodeOpen(int32_t vgId);
int32_t vnodeAlter(void *pVnode, SCreateVnodeMsg *pVnodeCfg);
int32_t vnodeSync(int32_t vgId);
int32_t vnodeClose(int32_t vgId);
int32_t vnodeCompact(int32_t vgId);
int32_t vnodeCompact(int32_t vgId);
// vnodeMgmt
int32_t vnodeInitMgmt();
......@@ -80,6 +86,8 @@ int32_t vnodeWriteToWQueue(void *pVnode, void *pHead, int32_t qtype, void *pRpcM
void vnodeFreeFromWQueue(void *pVnode, SVWriteMsg *pWrite);
int32_t vnodeProcessWrite(void *pVnode, void *pHead, int32_t qtype, void *pRspRet);
SVnodeStatisInfo vnodeGetStatisInfo();
// vnodeSync
void vnodeConfirmForward(void *pVnode, uint64_t version, int32_t code, bool force);
......
......@@ -41,9 +41,9 @@ extern int32_t sdbDebugFlag;
#define sdbDebug(...) { if (sdbDebugFlag & DEBUG_DEBUG) { taosPrintLog("SDB ", sdbDebugFlag, __VA_ARGS__); }}
#define sdbTrace(...) { if (sdbDebugFlag & DEBUG_TRACE) { taosPrintLog("SDB ", sdbDebugFlag, __VA_ARGS__); }}
#define mLError(...) { monSaveLog(2, __VA_ARGS__); mError(__VA_ARGS__) }
#define mLWarn(...) { monSaveLog(1, __VA_ARGS__); mWarn(__VA_ARGS__) }
#define mLInfo(...) { monSaveLog(0, __VA_ARGS__); mInfo(__VA_ARGS__) }
#define mLError(...) { monSaveLogs(2, __VA_ARGS__); mError(__VA_ARGS__) }
#define mLWarn(...) { monSaveLogs(1, __VA_ARGS__); mWarn(__VA_ARGS__) }
#define mLInfo(...) { monSaveLogs(0, __VA_ARGS__); mInfo(__VA_ARGS__) }
#ifdef __cplusplus
}
......
......@@ -1177,8 +1177,8 @@ static int32_t mnodeGetVnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
int32_t cols = 0;
SUserObj *pUser = mnodeGetUserFromConn(pConn);
if (pUser == NULL) return 0;
if (strcmp(pUser->user, TSDB_DEFAULT_USER) != 0) {
if (strcmp(pUser->pAcct->user, TSDB_DEFAULT_USER) != 0 ) {
mnodeDecUserRef(pUser);
return TSDB_CODE_MND_NO_RIGHTS;
}
......@@ -1256,10 +1256,10 @@ static int32_t mnodeRetrieveVnodes(SShowObj *pShow, char *data, int32_t rows, vo
STR_TO_VARSTR(pWrite, syncRole[pVgid->role]);
cols++;
numOfRows++;
}
}
if (numOfRows >= rows) {
mnodeDecVgroupRef(pVgroup);
break;
}
......
......@@ -166,7 +166,7 @@ static void mnodeCancelGetNextConn(void *pIter) {
static int32_t mnodeGetConnsMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn) {
SUserObj *pUser = mnodeGetUserFromConn(pConn);
if (pUser == NULL) return 0;
if (strcmp(pUser->user, TSDB_DEFAULT_USER) != 0) return TSDB_CODE_MND_NO_RIGHTS;
if (strcmp(pUser->pAcct->user, TSDB_DEFAULT_USER) != 0) return TSDB_CODE_MND_NO_RIGHTS;
int32_t cols = 0;
SSchema *pSchema = pMeta->schema;
......@@ -322,7 +322,7 @@ int32_t mnodeSaveQueryStreamList(SConnObj *pConn, SHeartBeatMsg *pHBMsg) {
static int32_t mnodeGetQueryMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn) {
SUserObj *pUser = mnodeGetUserFromConn(pConn);
if (pUser == NULL) return 0;
if (strcmp(pUser->user, TSDB_DEFAULT_USER) != 0) return TSDB_CODE_MND_NO_RIGHTS;
if (strcmp(pUser->pAcct->user, TSDB_DEFAULT_USER) != 0) return TSDB_CODE_MND_NO_RIGHTS;
int32_t cols = 0;
SSchema *pSchema = pMeta->schema;
......
......@@ -30,10 +30,11 @@ int32_t taosGetDiskSize(char *dataDir, SysDiskSize *diskSize);
int32_t taosGetCpuCores();
void taosGetSystemInfo();
bool taosReadProcIO(int64_t* rchars, int64_t* wchars);
bool taosGetProcIO(float *readKB, float *writeKB);
bool taosReadProcIO(int64_t* rchars, int64_t* wchars, int64_t* rbytes, int64_t* wbytes);
bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float* wbyteKB);
bool taosGetCardInfo(int64_t *bytes, int64_t *rbytes, int64_t *tbytes);
bool taosGetBandSpeed(float *bandSpeedKb);
bool taosGetNetworkIO(float *netInKb, float *netOutKb);
void taosGetDisk();
bool taosGetCpuUsage(float *sysCpuUsage, float *procCpuUsage) ;
bool taosGetProcMemory(float *memoryUsedMB) ;
......
......@@ -191,15 +191,19 @@ void taosGetSystemInfo() {
taosGetSystemLocale();
}
bool taosReadProcIO(int64_t *rchars, int64_t *wchars) {
bool taosReadProcIO(int64_t *rchars, int64_t *wchars, int64_t *rbytes, int64_t *wbytes) {
if (rchars) *rchars = 0;
if (wchars) *wchars = 0;
if (rbytes) *rbytes = 0;
if (wbytes) *wbytes = 0;
return true;
}
bool taosGetProcIO(float *readKB, float *writeKB) {
*readKB = 0;
*writeKB = 0;
bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteKB) {
*rcharKB = 0;
*wcharKB = 0;
*rbyteKB = 0;
*wbyteKB = 0;
return true;
}
......@@ -215,6 +219,12 @@ bool taosGetBandSpeed(float *bandSpeedKb) {
return true;
}
bool taosGetNetworkIO(float *netInKb, float *netOutKb) {
*netInKb = 0;
*netOutKb = 0;
return true;
}
bool taosGetCpuUsage(float *sysCpuUsage, float *procCpuUsage) {
*sysCpuUsage = 0;
*procCpuUsage = 0;
......
......@@ -335,7 +335,9 @@ int32_t taosGetDiskSize(char *dataDir, SysDiskSize *diskSize) {
}
bool taosGetCardInfo(int64_t *bytes, int64_t *rbytes, int64_t *tbytes) {
*bytes = 0;
if (bytes) *bytes = 0;
if (rbytes) *rbytes = 0;
if (tbytes) *tbytes = 0;
FILE *fp = fopen(tsSysNetFile, "r");
if (fp == NULL) {
uError("open file:%s failed", tsSysNetFile);
......@@ -350,7 +352,7 @@ bool taosGetCardInfo(int64_t *bytes, int64_t *rbytes, int64_t *tbytes) {
memset(line, 0, len);
int64_t o_rbytes = 0;
int64_t rpackts = 0;
int64_t rpackets = 0;
int64_t o_tbytes = 0;
int64_t tpackets = 0;
int64_t nouse1 = 0;
......@@ -376,10 +378,10 @@ bool taosGetCardInfo(int64_t *bytes, int64_t *rbytes, int64_t *tbytes) {
sscanf(line,
"%s %" PRId64 " %" PRId64 " %" PRId64 " %" PRId64 " %" PRId64 " %" PRId64 " %" PRId64 " %" PRId64 " %" PRId64
" %" PRId64,
nouse0, &o_rbytes, &rpackts, &nouse1, &nouse2, &nouse3, &nouse4, &nouse5, &nouse6, &o_tbytes, &tpackets);
nouse0, &o_rbytes, &rpackets, &nouse1, &nouse2, &nouse3, &nouse4, &nouse5, &nouse6, &o_tbytes, &tpackets);
if (rbytes) *rbytes = o_rbytes;
if (tbytes) *tbytes = o_tbytes;
*bytes += (o_rbytes + o_tbytes);
if (bytes) *bytes += (o_rbytes + o_tbytes);
}
tfree(line);
......@@ -424,7 +426,46 @@ bool taosGetBandSpeed(float *bandSpeedKb) {
return true;
}
bool taosReadProcIO(int64_t *rchars, int64_t *wchars) {
bool taosGetNetworkIO(float *netInKb, float *netOutKb) {
static int64_t lastBytesIn = 0, lastBytesOut = 0;
static time_t lastTimeIO = 0;
int64_t curBytesIn = 0, curBytesOut = 0;
time_t curTime = time(NULL);
if (!taosGetCardInfo(NULL, &curBytesIn, &curBytesOut)) {
return false;
}
if (lastTimeIO == 0 || lastBytesIn == 0 || lastBytesOut == 0) {
lastTimeIO = curTime;
lastBytesIn = curBytesIn; lastBytesOut = curBytesOut;
*netInKb = 0;
*netOutKb = 0;
return true;
}
if (lastTimeIO >= curTime || lastBytesIn > curBytesIn || lastBytesOut > curBytesOut) {
lastTimeIO = curTime;
lastBytesIn = curBytesIn; lastBytesOut = curBytesOut;
*netInKb = 0;
*netOutKb = 0;
return true;
}
double totalBytesIn = (double)(curBytesIn - lastBytesIn) / 1024 * 8; // Kb
*netInKb = (float)(totalBytesIn / (double)(curTime - lastTimeIO));
double totalBytesOut = (double)(curBytesOut - lastBytesOut) / 1024 * 8; // Kb
*netOutKb = (float)(totalBytesOut / (double)(curTime - lastTimeIO));
lastTimeIO = curTime;
lastBytesIn = curBytesIn;
lastBytesOut = curBytesOut;
return true;
}
bool taosReadProcIO(int64_t *rchars, int64_t *wchars, int64_t *rbytes, int64_t *wbytes) {
FILE *fp = fopen(tsProcIOFile, "r");
if (fp == NULL) {
uError("open file:%s failed", tsProcIOFile);
......@@ -434,7 +475,7 @@ bool taosReadProcIO(int64_t *rchars, int64_t *wchars) {
ssize_t _bytes = 0;
size_t len;
char * line = NULL;
char tmp[10];
char tmp[15];
int readIndex = 0;
while (!feof(fp)) {
......@@ -450,16 +491,21 @@ bool taosReadProcIO(int64_t *rchars, int64_t *wchars) {
} else if (strstr(line, "wchar:") != NULL) {
sscanf(line, "%s %" PRId64, tmp, wchars);
readIndex++;
} else {
} else if (strstr(line, "read_bytes:") != NULL){
sscanf(line, "%s %" PRId64, tmp, rbytes);
readIndex++;
} else if (strstr(line, "write_bytes:") != NULL){
sscanf(line, "%s %" PRId64, tmp, wbytes);
readIndex++;
}
if (readIndex >= 2) break;
if (readIndex >= 4) break;
}
tfree(line);
fclose(fp);
if (readIndex < 2) {
if (readIndex < 4) {
uError("read file:%s failed", tsProcIOFile);
return false;
}
......@@ -467,30 +513,43 @@ bool taosReadProcIO(int64_t *rchars, int64_t *wchars) {
return true;
}
bool taosGetProcIO(float *readKB, float *writeKB) {
static int64_t lastReadbyte = -1;
static int64_t lastWritebyte = -1;
bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteKB) {
static int64_t lastRchar = -1, lastRbyte = -1;
static int64_t lastWchar = -1, lastWbyte = -1;
static time_t lastTime = 0;
time_t curTime = time(NULL);
int64_t curReadbyte = 0;
int64_t curWritebyte = 0;
int64_t curRchar = 0, curRbyte = 0;
int64_t curWchar = 0, curWbyte = 0;
if (!taosReadProcIO(&curReadbyte, &curWritebyte)) {
if (!taosReadProcIO(&curRchar, &curWchar, &curRbyte, &curWbyte)) {
return false;
}
if (lastReadbyte == -1 || lastWritebyte == -1) {
lastReadbyte = curReadbyte;
lastWritebyte = curWritebyte;
if (lastTime == 0 || lastRchar == -1 || lastWchar == -1 || lastRbyte == -1 || lastWbyte == -1) {
lastTime = curTime;
lastRchar = curRchar;
lastWchar = curWchar;
lastRbyte = curRbyte;
lastWbyte = curWbyte;
return false;
}
*readKB = (float)((double)(curReadbyte - lastReadbyte) / 1024);
*writeKB = (float)((double)(curWritebyte - lastWritebyte) / 1024);
if (*readKB < 0) *readKB = 0;
if (*writeKB < 0) *writeKB = 0;
*rcharKB = (float)((double)(curRchar - lastRchar) / 1024 / (double)(curTime - lastTime));
*wcharKB = (float)((double)(curWchar - lastWchar) / 1024 / (double)(curTime - lastTime));
if (*rcharKB < 0) *rcharKB = 0;
if (*wcharKB < 0) *wcharKB = 0;
*rbyteKB = (float)((double)(curRbyte - lastRbyte) / 1024 / (double)(curTime - lastTime));
*wbyteKB = (float)((double)(curWbyte - lastWbyte) / 1024 / (double)(curTime - lastTime));
if (*rbyteKB < 0) *rbyteKB = 0;
if (*wbyteKB < 0) *wbyteKB = 0;
lastReadbyte = curReadbyte;
lastWritebyte = curWritebyte;
lastRchar = curRchar;
lastWchar = curWchar;
lastRbyte = curRbyte;
lastWbyte = curWbyte;
lastTime = curTime;
return true;
}
......@@ -501,13 +560,13 @@ void taosGetSystemInfo() {
tsNumOfCores = taosGetCpuCores();
tsTotalMemoryMB = taosGetTotalMemory();
float tmp1, tmp2;
float tmp1, tmp2, tmp3, tmp4;
taosGetSysMemory(&tmp1);
taosGetProcMemory(&tmp2);
// taosGetDisk();
taosGetBandSpeed(&tmp1);
taosGetCpuUsage(&tmp1, &tmp2);
taosGetProcIO(&tmp1, &tmp2);
taosGetProcIO(&tmp1, &tmp2, &tmp3, &tmp4);
taosGetSystemTimezone();
taosGetSystemLocale();
......
......@@ -169,40 +169,59 @@ bool taosGetBandSpeed(float *bandSpeedKb) {
return true;
}
bool taosReadProcIO(int64_t *readbyte, int64_t *writebyte) {
bool taosGetNetworkIO(float *netInKb, float *netOutKb) {
*netInKb = 0;
*netOutKb = 0;
return true;
}
bool taosReadProcIO(int64_t *rchars, int64_t *wchars, int64_t *rbytes, int64_t *wbytes) {
IO_COUNTERS io_counter;
if (GetProcessIoCounters(GetCurrentProcess(), &io_counter)) {
if (readbyte) *readbyte = io_counter.ReadTransferCount;
if (writebyte) *writebyte = io_counter.WriteTransferCount;
if (rchars) *rchars = io_counter.ReadTransferCount;
if (wchars) *wchars = io_counter.WriteTransferCount;
return true;
}
return false;
}
bool taosGetProcIO(float *readKB, float *writeKB) {
static int64_t lastReadbyte = -1;
static int64_t lastWritebyte = -1;
bool taosGetProcIO(float *rcharKB, float *wcharKB, float *rbyteKB, float *wbyteKB) {
static int64_t lastRchar = -1, lastRbyte = -1;
static int64_t lastWchar = -1, lastWbyte = -1;
static time_t lastTime = 0;
time_t curTime = time(NULL);
int64_t curReadbyte = 0;
int64_t curWritebyte = 0;
int64_t curRchar = 0, curRbyte = 0;
int64_t curWchar = 0, curWbyte = 0;
if (!taosReadProcIO(&curReadbyte, &curWritebyte)) {
if (!taosReadProcIO(&curRchar, &curWchar, &curRbyte, &curWbyte)) {
return false;
}
if (lastReadbyte == -1 || lastWritebyte == -1) {
lastReadbyte = curReadbyte;
lastWritebyte = curWritebyte;
if (lastTime == 0 || lastRchar == -1 || lastWchar == -1 || lastRbyte == -1 || lastWbyte == -1) {
lastTime = curTime;
lastRchar = curRchar;
lastWchar = curWchar;
lastRbyte = curRbyte;
lastWbyte = curWbyte;
return false;
}
*readKB = (float)((double)(curReadbyte - lastReadbyte) / 1024);
*writeKB = (float)((double)(curWritebyte - lastWritebyte) / 1024);
if (*readKB < 0) *readKB = 0;
if (*writeKB < 0) *writeKB = 0;
*rcharKB = (float)((double)(curRchar - lastRchar) / 1024 / (double)(curTime - lastTime));
*wcharKB = (float)((double)(curWchar - lastWchar) / 1024 / (double)(curTime - lastTime));
if (*rcharKB < 0) *rcharKB = 0;
if (*wcharKB < 0) *wcharKB = 0;
*rbyteKB = (float)((double)(curRbyte - lastRbyte) / 1024 / (double)(curTime - lastTime));
*wbyteKB = (float)((double)(curWbyte - lastWbyte) / 1024 / (double)(curTime - lastTime));
if (*rbyteKB < 0) *rbyteKB = 0;
if (*wbyteKB < 0) *wbyteKB = 0;
lastReadbyte = curReadbyte;
lastWritebyte = curWritebyte;
lastRchar = curRchar;
lastWchar = curWchar;
lastRbyte = curRbyte;
lastWbyte = curWbyte;
lastTime = curTime;
return true;
}
......@@ -211,11 +230,11 @@ void taosGetSystemInfo() {
tsNumOfCores = taosGetCpuCores();
tsTotalMemoryMB = taosGetTotalMemory();
float tmp1, tmp2;
float tmp1, tmp2, tmp3, tmp4;
// taosGetDisk();
taosGetBandSpeed(&tmp1);
taosGetCpuUsage(&tmp1, &tmp2);
taosGetProcIO(&tmp1, &tmp2);
taosGetProcIO(&tmp1, &tmp2, &tmp3, &tmp4);
taosGetSystemTimezone();
taosGetSystemLocale();
......
......@@ -42,6 +42,7 @@
#define HTTP_WRITE_WAIT_TIME_MS 5
#define HTTP_PASSWORD_LEN TSDB_UNI_LEN
#define HTTP_SESSION_ID_LEN (TSDB_USER_LEN + HTTP_PASSWORD_LEN)
#define HTTP_STATUS_CODE_NUM 63
typedef enum HttpReqType {
HTTP_REQTYPE_OTHERS = 0,
......@@ -187,8 +188,9 @@ typedef struct HttpServer {
SOCKET fd;
int32_t numOfThreads;
int32_t methodScannerLen;
int32_t requestNum;
int64_t requestNum;
int32_t status;
int32_t statusCodeErrs[HTTP_STATUS_CODE_NUM];
pthread_t thread;
HttpThread * pThreads;
void * contextCache;
......
......@@ -123,9 +123,9 @@ bool metricsProcessRequest(HttpContext* pContext) {
}
{
int64_t rchars = 0;
int64_t wchars = 0;
bool succeeded = taosReadProcIO(&rchars, &wchars);
int64_t rchars = 0, rbytes = 0;
int64_t wchars = 0, wbytes = 0;
bool succeeded = taosReadProcIO(&rchars, &wchars, &rbytes, &wbytes);
if (!succeeded) {
httpError("failed to get io info");
} else {
......@@ -164,7 +164,7 @@ bool metricsProcessRequest(HttpContext* pContext) {
}
{
SStatisInfo info = dnodeGetStatisInfo();
SDnodeStatisInfo info = dnodeGetStatisInfo();
{
char* keyReqHttp = "req_http";
char* keyReqSelect = "req_select";
......@@ -181,4 +181,4 @@ bool metricsProcessRequest(HttpContext* pContext) {
pContext->reqType = HTTP_REQTYPE_OTHERS;
httpFreeJsonBuf(pContext);
return false;
}
\ No newline at end of file
}
......@@ -21,6 +21,7 @@
#include "httpResp.h"
#include "httpJson.h"
#include "httpContext.h"
#include "monitor.h"
const char *httpKeepAliveStr[] = {"", "Connection: Keep-Alive\r\n", "Connection: Close\r\n"};
......@@ -153,6 +154,10 @@ void httpSendErrorResp(HttpContext *pContext, int32_t errNo) {
httpCode = pContext->parser->httpCode;
}
HttpServer *pServer = &tsHttpServer;
SMonHttpStatus *httpStatus = monGetHttpStatusHashTableEntry(httpCode);
pServer->statusCodeErrs[httpStatus->index] += 1;
pContext->error = true;
char *httpCodeStr = httpGetStatusDesc(httpCode);
......
......@@ -190,7 +190,7 @@ static void httpProcessHttpData(void *param) {
} else {
if (httpReadData(pContext)) {
(*(pThread->processData))(pContext);
atomic_fetch_add_32(&pServer->requestNum, 1);
atomic_fetch_add_64(&pServer->requestNum, 1);
}
}
}
......
......@@ -120,4 +120,10 @@ void httpCleanUpSystem() {
tsHttpServer.status = HTTP_SERVER_CLOSED;
}
int32_t httpGetReqCount() { return atomic_exchange_32(&tsHttpServer.requestNum, 0); }
int64_t httpGetReqCount() { return atomic_exchange_64(&tsHttpServer.requestNum, 0); }
int32_t httpGetStatusCodeCount(int index) {
return atomic_load_32(&tsHttpServer.statusCodeErrs[index]);
}
int32_t httpClearStatusCodeCount(int index) {
return atomic_exchange_32(&tsHttpServer.statusCodeErrs[index], 0);
}
......@@ -17,12 +17,14 @@
#include "os.h"
#include "taosdef.h"
#include "taoserror.h"
#include "tfs.h"
#include "tlog.h"
#include "ttimer.h"
#include "tutil.h"
#include "tscUtil.h"
#include "tsclient.h"
#include "dnode.h"
#include "vnode.h"
#include "monitor.h"
#include "taoserror.h"
......@@ -33,10 +35,79 @@
#define monDebug(...) { if (monDebugFlag & DEBUG_DEBUG) { taosPrintLog("MON ", monDebugFlag, __VA_ARGS__); }}
#define monTrace(...) { if (monDebugFlag & DEBUG_TRACE) { taosPrintLog("MON ", monDebugFlag, __VA_ARGS__); }}
#define SQL_LENGTH 1030
#define LOG_LEN_STR 512
#define IP_LEN_STR TSDB_EP_LEN
#define CHECK_INTERVAL 1000
#define SQL_LENGTH 4096
#define LOG_LEN_STR 512
#define IP_LEN_STR TSDB_EP_LEN
#define VGROUP_STATUS_LEN 512
#define DNODE_INFO_LEN 128
#define QUERY_ID_LEN 24
#define CHECK_INTERVAL 1000
static SMonHttpStatus monHttpStatusTable[] = {
{"HTTP_CODE_CONTINUE", 100},
{"HTTP_CODE_SWITCHING_PROTOCOL", 101},
{"HTTP_CODE_PROCESSING", 102},
{"HTTP_CODE_EARLY_HINTS", 103},
{"HTTP_CODE_OK", 200},
{"HTTP_CODE_CREATED", 201},
{"HTTP_CODE_ACCEPTED", 202},
{"HTTP_CODE_NON_AUTHORITATIVE_INFO", 203},
{"HTTP_CODE_NO_CONTENT", 204},
{"HTTP_CODE_RESET_CONTENT", 205},
{"HTTP_CODE_PARTIAL_CONTENT", 206},
{"HTTP_CODE_MULTI_STATUS", 207},
{"HTTP_CODE_ALREADY_REPORTED", 208},
{"HTTP_CODE_IM_USED", 226},
{"HTTP_CODE_MULTIPLE_CHOICE", 300},
{"HTTP_CODE_MOVED_PERMANENTLY", 301},
{"HTTP_CODE_FOUND", 302},
{"HTTP_CODE_SEE_OTHER", 303},
{"HTTP_CODE_NOT_MODIFIED", 304},
{"HTTP_CODE_USE_PROXY", 305},
{"HTTP_CODE_UNUSED", 306},
{"HTTP_CODE_TEMPORARY_REDIRECT", 307},
{"HTTP_CODE_PERMANENT_REDIRECT", 308},
{"HTTP_CODE_BAD_REQUEST", 400},
{"HTTP_CODE_UNAUTHORIZED", 401},
{"HTTP_CODE_PAYMENT_REQUIRED", 402},
{"HTTP_CODE_FORBIDDEN", 403},
{"HTTP_CODE_NOT_FOUND", 404},
{"HTTP_CODE_METHOD_NOT_ALLOWED", 405},
{"HTTP_CODE_NOT_ACCEPTABLE", 406},
{"HTTP_CODE_PROXY_AUTH_REQUIRED", 407},
{"HTTP_CODE_REQUEST_TIMEOUT", 408},
{"HTTP_CODE_CONFLICT", 409},
{"HTTP_CODE_GONE", 410},
{"HTTP_CODE_LENGTH_REQUIRED", 411},
{"HTTP_CODE_PRECONDITION_FAILED", 412},
{"HTTP_CODE_PAYLOAD_TOO_LARGE", 413},
{"HTTP_CODE_URI_TOO_LARGE", 414},
{"HTTP_CODE_UNSUPPORTED_MEDIA_TYPE", 415},
{"HTTP_CODE_RANGE_NOT_SATISFIABLE", 416},
{"HTTP_CODE_EXPECTATION_FAILED", 417},
{"HTTP_CODE_IM_A_TEAPOT", 418},
{"HTTP_CODE_MISDIRECTED_REQUEST", 421},
{"HTTP_CODE_UNPROCESSABLE_ENTITY", 422},
{"HTTP_CODE_LOCKED", 423},
{"HTTP_CODE_FAILED_DEPENDENCY", 424},
{"HTTP_CODE_TOO_EARLY", 425},
{"HTTP_CODE_UPGRADE_REQUIRED", 426},
{"HTTP_CODE_PRECONDITION_REQUIRED", 428},
{"HTTP_CODE_TOO_MANY_REQUESTS", 429},
{"HTTP_CODE_REQ_HDR_FIELDS_TOO_LARGE",431},
{"HTTP_CODE_UNAVAIL_4_LEGAL_REASONS", 451},
{"HTTP_CODE_INTERNAL_SERVER_ERROR", 500},
{"HTTP_CODE_NOT_IMPLEMENTED", 501},
{"HTTP_CODE_BAD_GATEWAY", 502},
{"HTTP_CODE_SERVICE_UNAVAILABLE", 503},
{"HTTP_CODE_GATEWAY_TIMEOUT", 504},
{"HTTP_CODE_HTTP_VER_NOT_SUPPORTED", 505},
{"HTTP_CODE_VARIANT_ALSO_NEGOTIATES", 506},
{"HTTP_CODE_INSUFFICIENT_STORAGE", 507},
{"HTTP_CODE_LOOP_DETECTED", 508},
{"HTTP_CODE_NOT_EXTENDED", 510},
{"HTTP_CODE_NETWORK_AUTH_REQUIRED", 511}
};
typedef enum {
MON_CMD_CREATE_DB,
......@@ -46,6 +117,18 @@ typedef enum {
MON_CMD_CREATE_TB_DN,
MON_CMD_CREATE_TB_ACCT_ROOT,
MON_CMD_CREATE_TB_SLOWQUERY,
//followings are extension for taoskeeper
MON_CMD_CREATE_TB_CLUSTER,
MON_CMD_CREATE_MT_DNODES,
MON_CMD_CREATE_TB_DNODE,
MON_CMD_CREATE_MT_DISKS,
MON_CMD_CREATE_TB_DISKS,
MON_CMD_CREATE_MT_VGROUPS,
MON_CMD_CREATE_MT_LOGS,
MON_CMD_CREATE_TB_DNODE_LOG,
MON_CMD_CREATE_TB_GRANTS,
MON_CMD_CREATE_MT_RESTFUL,
MON_CMD_CREATE_TB_RESTFUL,
MON_CMD_MAX
} EMonCmd;
......@@ -61,17 +144,46 @@ typedef struct {
int8_t cmdIndex;
int8_t state;
int8_t start; // enable/disable by mnode
int8_t quiting; // taosd is quiting
int8_t quiting; // taosd is quiting
char sql[SQL_LENGTH + 1];
} SMonConn;
typedef struct {
SDnodeStatisInfo dInfo;
SVnodeStatisInfo vInfo;
float io_read;
float io_write;
float io_read_disk;
float io_write_disk;
int32_t monQueryReqCnt;
int32_t monSubmitReqCnt;
} SMonStat;
static void *monHttpStatusHashTable;
static SMonConn tsMonitor = {0};
static SMonStat tsMonStat = {{0}};
static int32_t monQueryReqNum = 0, monSubmitReqNum = 0;
static bool monHasMnodeMaster = false;
static void monSaveSystemInfo();
static void monSaveClusterInfo();
static void monSaveDnodesInfo();
static void monSaveVgroupsInfo();
static void monSaveSlowQueryInfo();
static void monSaveDisksInfo();
static void monSaveGrantsInfo();
static void monSaveHttpReqInfo();
static void monGetSysStats();
static void *monThreadFunc(void *param);
static void monBuildMonitorSql(char *sql, int32_t cmd);
static void monInitHttpStatusHashTable();
static void monCleanupHttpStatusHashTable();
extern int32_t (*monStartSystemFp)();
extern void (*monStopSystemFp)();
extern void (*monExecuteSQLFp)(char *sql);
extern char * strptime(const char *buf, const char *fmt, struct tm *tm); //make the compilation pass
int32_t monInitSystem() {
if (tsMonitor.ep[0] == 0) {
......@@ -84,6 +196,7 @@ int32_t monInitSystem() {
tsMonitor.ep[i] = '_';
}
}
monInitHttpStatusHashTable();
pthread_attr_t thAttr;
pthread_attr_init(&thAttr);
......@@ -112,6 +225,31 @@ int32_t monStartSystem() {
return 0;
}
static void monInitHttpStatusHashTable() {
int32_t numOfEntries = tListLen(monHttpStatusTable);
monHttpStatusHashTable = taosHashInit(numOfEntries, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, false);
for (int32_t i = 0; i < numOfEntries; ++i) {
monHttpStatusTable[i].index = i;
SMonHttpStatus* pEntry = &monHttpStatusTable[i];
taosHashPut(monHttpStatusHashTable, &monHttpStatusTable[i].code, sizeof(int32_t),
&pEntry, POINTER_BYTES);
}
}
static void monCleanupHttpStatusHashTable() {
void* m = monHttpStatusHashTable;
if (m != NULL && atomic_val_compare_exchange_ptr(&monHttpStatusHashTable, m, 0) == m) {
taosHashCleanup(m);
}
}
SMonHttpStatus *monGetHttpStatusHashTableEntry(int32_t code) {
if (monHttpStatusHashTable == NULL) {
return NULL;
}
return (SMonHttpStatus*)taosHashGet(monHttpStatusHashTable, &code, sizeof(int32_t));
}
static void *monThreadFunc(void *param) {
monDebug("starting to initialize monitor module ...");
setThreadName("monitor");
......@@ -132,7 +270,7 @@ static void *monThreadFunc(void *param) {
if (tsMonitor.start == 0) {
continue;
}
if (dnodeGetDnodeId() <= 0) {
monDebug("dnode not initialized, waiting for 3000 ms to start monitor module");
continue;
......@@ -173,6 +311,19 @@ static void *monThreadFunc(void *param) {
if (tsMonitor.state == MON_STATE_INITED) {
if (accessTimes % tsMonitorInterval == 0) {
monGetSysStats();
//monSaveDnodesInfo has to be the first, as it calculates
//stats using monSubmitReqNum before any insertion from monitor
monSaveDnodesInfo();
if (monHasMnodeMaster) {
//only mnode master will write cluster info
monSaveClusterInfo();
}
monSaveVgroupsInfo();
monSaveSlowQueryInfo();
monSaveDisksInfo();
monSaveGrantsInfo();
monSaveHttpReqInfo();
monSaveSystemInfo();
}
}
......@@ -193,9 +344,9 @@ static void monBuildMonitorSql(char *sql, int32_t cmd) {
if (cmd == MON_CMD_CREATE_DB) {
snprintf(sql, SQL_LENGTH,
"create database if not exists %s replica 1 days 10 keep %s cache %d "
"create database if not exists %s replica %d days 10 keep %s cache %d "
"blocks %d precision 'us'",
tsMonitorDbName, keepValue, TSDB_MIN_CACHE_BLOCK_SIZE, TSDB_MIN_TOTAL_BLOCKS);
tsMonitorDbName, tsMonitorReplica, keepValue, TSDB_MIN_CACHE_BLOCK_SIZE, TSDB_MIN_TOTAL_BLOCKS);
} else if (cmd == MON_CMD_CREATE_MT_DN) {
snprintf(sql, SQL_LENGTH,
"create table if not exists %s.dn(ts timestamp"
......@@ -204,7 +355,7 @@ static void monBuildMonitorSql(char *sql, int32_t cmd) {
", disk_used float, disk_total int"
", band_speed float"
", io_read float, io_write float"
", req_http int, req_select int, req_insert int"
", req_http bigint, req_select bigint, req_insert bigint"
") tags (dnodeid int, fqdn binary(%d))",
tsMonitorDbName, TSDB_FQDN_LEN);
} else if (cmd == MON_CMD_CREATE_TB_DN) {
......@@ -231,14 +382,96 @@ static void monBuildMonitorSql(char *sql, int32_t cmd) {
tsMonitorDbName, TSDB_DEFAULT_USER);
} else if (cmd == MON_CMD_CREATE_TB_SLOWQUERY) {
snprintf(sql, SQL_LENGTH,
"create table if not exists %s.slowquery(ts timestamp, username "
"binary(%d), created_time timestamp, time bigint, sql binary(%d))",
tsMonitorDbName, TSDB_TABLE_FNAME_LEN - 1, TSDB_SLOW_QUERY_SQL_LEN);
"create table if not exists %s.slowquery(ts timestamp, query_id "
"binary(%d), username binary(%d), qid binary(%d), created_time timestamp, time bigint, end_point binary(%d), sql binary(%d))",
tsMonitorDbName, QUERY_ID_LEN, TSDB_TABLE_FNAME_LEN - 1, QUERY_ID_LEN, TSDB_EP_LEN, TSDB_SLOW_QUERY_SQL_LEN);
} else if (cmd == MON_CMD_CREATE_TB_LOG) {
snprintf(sql, SQL_LENGTH,
"create table if not exists %s.log(ts timestamp, level tinyint, "
"content binary(%d), ipaddr binary(%d))",
tsMonitorDbName, LOG_LEN_STR, IP_LEN_STR);
} else if (cmd == MON_CMD_CREATE_TB_CLUSTER) {
snprintf(sql, SQL_LENGTH,
"create table if not exists %s.cluster_info(ts timestamp"
", first_ep binary(%d), version binary(%d)"
", master_uptime float, monitor_interval int"
", dnodes_total int, dnodes_alive int"
", mnodes_total int, mnodes_alive int"
", vgroups_total int, vgroups_alive int"
", vnodes_total int, vnodes_alive int"
", connections_total int)",
tsMonitorDbName, TSDB_EP_LEN, TSDB_VERSION_LEN);
} else if (cmd == MON_CMD_CREATE_MT_DNODES) {
snprintf(sql, SQL_LENGTH,
"create table if not exists %s.dnodes_info(ts timestamp"
", uptime float"
", cpu_engine float, cpu_system float, cpu_cores int"
", mem_engine float, mem_system float, mem_total float"
", disk_engine float, disk_used float, disk_total float"
", net_in float, net_out float"
", io_read float, io_write float"
", io_read_disk float, io_write_disk float"
", req_http bigint, req_http_rate float"
", req_select bigint, req_select_rate float"
", req_insert bigint, req_insert_success bigint, req_insert_rate float"
", req_insert_batch bigint, req_insert_batch_success bigint, req_insert_batch_rate float"
", errors bigint"
", vnodes_num int"
", masters int"
", has_mnode bool"
") tags (dnode_id int, dnode_ep binary(%d))",
tsMonitorDbName, TSDB_EP_LEN);
} else if (cmd == MON_CMD_CREATE_TB_DNODE) {
snprintf(sql, SQL_LENGTH, "create table if not exists %s.dnode_%d using %s.dnodes_info tags(%d, '%s')", tsMonitorDbName,
dnodeGetDnodeId(), tsMonitorDbName, dnodeGetDnodeId(), tsLocalEp);
} else if (cmd == MON_CMD_CREATE_MT_DISKS) {
snprintf(sql, SQL_LENGTH,
"create table if not exists %s.disks_info(ts timestamp"
", datadir_l0_used float, datadir_l0_total float"
", datadir_l1_used float, datadir_l1_total float"
", datadir_l2_used float, datadir_l2_total float"
") tags (dnode_id int, dnode_ep binary(%d))",
tsMonitorDbName, TSDB_EP_LEN);
} else if (cmd == MON_CMD_CREATE_TB_DISKS) {
snprintf(sql, SQL_LENGTH, "create table if not exists %s.disks_%d using %s.disks_info tags(%d, '%s')", tsMonitorDbName,
dnodeGetDnodeId(), tsMonitorDbName, dnodeGetDnodeId(), tsLocalEp);
} else if (cmd == MON_CMD_CREATE_MT_VGROUPS) {
snprintf(sql, SQL_LENGTH,
"create table if not exists %s.vgroups_info(ts timestamp"
", database_name binary(%d)"
", tables_num int, status binary(%d)"
", online_vnodes tinyint"
", dnode_ids binary(%d), dnode_roles binary(%d)"
") tags (vgroup_id int)",
tsMonitorDbName, TSDB_DB_NAME_LEN, VGROUP_STATUS_LEN,
DNODE_INFO_LEN, DNODE_INFO_LEN);
} else if (cmd == MON_CMD_CREATE_MT_LOGS) {
snprintf(sql, SQL_LENGTH,
"create table if not exists %s.logs(ts timestamp, level tinyint, "
"content binary(%d)) tags (dnode_id int, dnode_ep binary(%d))",
tsMonitorDbName, LOG_LEN_STR, TSDB_EP_LEN);
} else if (cmd == MON_CMD_CREATE_TB_DNODE_LOG) {
snprintf(sql, SQL_LENGTH, "create table if not exists %s.dnode_%d_log using %s.logs tags(%d, '%s')", tsMonitorDbName,
dnodeGetDnodeId(), tsMonitorDbName, dnodeGetDnodeId(), tsLocalEp);
} else if (cmd == MON_CMD_CREATE_TB_GRANTS) {
snprintf(sql, SQL_LENGTH,
"create table if not exists %s.grants_info(ts timestamp"
", expire_time int, timeseries_used int, timeseries_total int)",
tsMonitorDbName);
} else if (cmd == MON_CMD_CREATE_MT_RESTFUL) {
int pos = snprintf(sql, SQL_LENGTH,
"create table if not exists %s.restful_info(ts timestamp", tsMonitorDbName);
for (int i = 0; i < tListLen(monHttpStatusTable); ++i) {
pos += snprintf(sql + pos, SQL_LENGTH, ", `%s(%d)` int",
monHttpStatusTable[i].name,
monHttpStatusTable[i].code);
}
snprintf(sql + pos, SQL_LENGTH,
") tags (dnode_id int, dnode_ep binary(%d))",
TSDB_EP_LEN);
} else if (cmd == MON_CMD_CREATE_TB_RESTFUL) {
snprintf(sql, SQL_LENGTH, "create table if not exists %s.restful_%d using %s.restful_info tags(%d, '%s')", tsMonitorDbName,
dnodeGetDnodeId(), tsMonitorDbName, dnodeGetDnodeId(), tsLocalEp);
}
sql[SQL_LENGTH] = 0;
......@@ -262,9 +495,25 @@ void monCleanupSystem() {
taos_close(tsMonitor.conn);
tsMonitor.conn = NULL;
}
monCleanupHttpStatusHashTable();
monInfo("monitor module is cleaned up");
}
static void monGetSysStats() {
memset(&tsMonStat, 0, sizeof(SMonStat));
bool suc = taosGetProcIO(&tsMonStat.io_read, &tsMonStat.io_write,
&tsMonStat.io_read_disk, &tsMonStat.io_write_disk);
if (!suc) {
monDebug("failed to get io info");
}
tsMonStat.dInfo = dnodeGetStatisInfo();
tsMonStat.vInfo = vnodeGetStatisInfo();
tsMonStat.monQueryReqCnt = monFetchQueryReqCnt();
tsMonStat.monSubmitReqCnt = monFetchSubmitReqCnt();
}
// unit is MB
static int32_t monBuildMemorySql(char *sql) {
float sysMemoryUsedMB = 0;
......@@ -279,7 +528,7 @@ static int32_t monBuildMemorySql(char *sql) {
monDebug("failed to get proc memory info");
}
return sprintf(sql, ", %f, %f, %d", procMemoryUsedMB, sysMemoryUsedMB, tsTotalMemoryMB);
return snprintf(sql, SQL_LENGTH, ", %f, %f, %d", procMemoryUsedMB, sysMemoryUsedMB, tsTotalMemoryMB);
}
// unit is %
......@@ -294,12 +543,12 @@ static int32_t monBuildCpuSql(char *sql) {
sysCpuUsage = procCpuUsage + 0.1f;
}
return sprintf(sql, ", %f, %f, %d", procCpuUsage, sysCpuUsage, tsNumOfCores);
return snprintf(sql, SQL_LENGTH, ", %f, %f, %d", procCpuUsage, sysCpuUsage, tsNumOfCores);
}
// unit is GB
static int32_t monBuildDiskSql(char *sql) {
return sprintf(sql, ", %f, %d", tsUsedDataDirGB, (int32_t)tsTotalDataDirGB);
return snprintf(sql, SQL_LENGTH, ", %f, %d", tsUsedDataDirGB, (int32_t)tsTotalDataDirGB);
}
// unit is Kb
......@@ -310,22 +559,20 @@ static int32_t monBuildBandSql(char *sql) {
monDebug("failed to get bandwidth speed");
}
return sprintf(sql, ", %f", bandSpeedKb);
return snprintf(sql, SQL_LENGTH, ", %f", bandSpeedKb);
}
static int32_t monBuildReqSql(char *sql) {
SStatisInfo info = dnodeGetStatisInfo();
return sprintf(sql, ", %d, %d, %d)", info.httpReqNum, info.queryReqNum, info.submitReqNum);
SDnodeStatisInfo info = tsMonStat.dInfo;
return snprintf(sql, SQL_LENGTH, ", %"PRId64", %"PRId64", %"PRId64")", info.httpReqNum, info.queryReqNum, info.submitReqNum);
}
static int32_t monBuildIoSql(char *sql) {
float readKB = 0, writeKB = 0;
bool suc = taosGetProcIO(&readKB, &writeKB);
if (!suc) {
monDebug("failed to get io info");
}
readKB = tsMonStat.io_read;
writeKB = tsMonStat.io_write;
return sprintf(sql, ", %f, %f", readKB, writeKB);
return snprintf(sql, SQL_LENGTH, ", %f, %f", readKB, writeKB);
}
static void monSaveSystemInfo() {
......@@ -347,15 +594,773 @@ static void monSaveSystemInfo() {
if (code != 0) {
monError("failed to save system info, reason:%s, sql:%s", tstrerror(code), tsMonitor.sql);
} else {
monIncSubmitReqCnt();
monDebug("successfully to save system info, sql:%s", tsMonitor.sql);
}
}
static int32_t monGetRowElemCharLen(TAOS_FIELD field, char *rowElem) {
int32_t charLen = varDataLen(rowElem - VARSTR_HEADER_SIZE);
if (field.type == TSDB_DATA_TYPE_BINARY) {
assert(charLen <= field.bytes && charLen >= 0);
} else {
assert(charLen <= field.bytes * TSDB_NCHAR_SIZE && charLen >= 0);
}
return charLen;
}
static int32_t monBuildFirstEpSql(char *sql) {
return snprintf(sql, SQL_LENGTH, ", \"%s\"", tsFirst);
}
static int32_t monBuildVersionSql(char *sql) {
return snprintf(sql, SQL_LENGTH, ", \"%s\"", version);
}
static int32_t monBuildMasterUptimeSql(char *sql) {
int64_t masterUptime = 0;
TAOS_RES *result = taos_query(tsMonitor.conn, "show mnodes");
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
while ((row = taos_fetch_row(result))) {
for (int i = 0; i < num_fields; ++i) {
if (strcmp(fields[i].name, "role") == 0 && strcmp((char *)row[i], "master") == 0) {
if (strcmp(fields[i + 1].name, "role_time") == 0) {
int64_t now = taosGetTimestamp(TSDB_TIME_PRECISION_MILLI);
//master uptime in seconds
masterUptime = (now - *(int64_t *)row[i + 1]) / 1000;
}
}
}
}
taos_free_result(result);
return snprintf(sql, SQL_LENGTH, ", %" PRId64, masterUptime);
}
static int32_t monBuildMonIntervalSql(char *sql) {
return snprintf(sql, SQL_LENGTH, ", %d", tsMonitorInterval);
}
static int32_t monBuildDnodesTotalSql(char *sql) {
int32_t totalDnodes = 0, totalDnodesAlive = 0;
TAOS_RES *result = taos_query(tsMonitor.conn, "show dnodes");
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show dnodes, reason:%s", tstrerror(code));
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
while ((row = taos_fetch_row(result))) {
totalDnodes++;
for (int i = 0; i < num_fields; ++i) {
if (strcmp(fields[i].name, "status") == 0) {
int32_t charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (strncmp((char *)row[i], "ready", charLen) == 0) {
totalDnodesAlive++;
}
}
}
}
taos_free_result(result);
return snprintf(sql, SQL_LENGTH, ", %d, %d", totalDnodes, totalDnodesAlive);
}
static int32_t monBuildMnodesTotalSql(char *sql) {
int32_t totalMnodes = 0, totalMnodesAlive= 0;
TAOS_RES *result = taos_query(tsMonitor.conn, "show mnodes");
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show mnodes, reason:%s", tstrerror(code));
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
while ((row = taos_fetch_row(result))) {
totalMnodes++;
for (int i = 0; i < num_fields; ++i) {
if (strcmp(fields[i].name, "role") == 0) {
int32_t charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (strncmp((char *)row[i], "master", charLen) == 0 ||
strncmp((char *)row[i], "slave", charLen) == 0) {
totalMnodesAlive += 1;
}
}
}
}
taos_free_result(result);
return snprintf(sql, SQL_LENGTH, ", %d, %d", totalMnodes, totalMnodesAlive);
}
static int32_t monGetVgroupsTotalStats(char *dbName, int32_t *totalVgroups,
int32_t *totalVgroupsAlive) {
char subsql[TSDB_DB_NAME_LEN + 14];
memset(subsql, 0, sizeof(subsql));
snprintf(subsql, TSDB_DB_NAME_LEN + 13, "show %s.vgroups", dbName);
TAOS_RES *result = taos_query(tsMonitor.conn, subsql);
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show %s.vgroups, reason:%s", dbName, tstrerror(code));
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
while ((row = taos_fetch_row(result))) {
*totalVgroups += 1;
for (int i = 0; i < num_fields; ++i) {
if (strcmp(fields[i].name, "status") == 0) {
int32_t charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (strncmp((char *)row[i], "ready", charLen) == 0) {
*totalVgroupsAlive += 1;
}
}
}
}
taos_free_result(result);
return 0;
}
static int32_t monBuildVgroupsTotalSql(char *sql) {
int32_t totalVgroups = 0, totalVgroupsAlive = 0;
TAOS_RES *result = taos_query(tsMonitor.conn, "show databases");
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show databases, reason:%s", tstrerror(code));
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
while ((row = taos_fetch_row(result))) {
for (int i = 0; i < num_fields; ++i) {
//database name
if (strcmp(fields[i].name, "name") == 0) {
monGetVgroupsTotalStats((char *)row[i], &totalVgroups, &totalVgroupsAlive);
}
}
}
taos_free_result(result);
return snprintf(sql, SQL_LENGTH, ", %d, %d", totalVgroups, totalVgroupsAlive);
}
static int32_t monGetVnodesTotalStats(char *ep, int32_t *totalVnodes,
int32_t *totalVnodesAlive) {
char subsql[TSDB_EP_LEN + 15];
memset(subsql, 0, sizeof(subsql));
snprintf(subsql, TSDB_EP_LEN, "show vnodes \"%s\"", ep);
TAOS_RES *result = taos_query(tsMonitor.conn, subsql);
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show vnodes \"%s\", reason:%s", ep, tstrerror(code));
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
while ((row = taos_fetch_row(result))) {
*totalVnodes += 1;
for (int i = 0; i < num_fields; ++i) {
if (strcmp(fields[i].name, "status") == 0) {
int32_t charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (strncmp((char *)row[i], "master", charLen) == 0 ||
strncmp((char *)row[i], "slave", charLen) == 0) {
*totalVnodesAlive += 1;
}
}
}
}
taos_free_result(result);
return 0;
}
static int32_t monBuildVnodesTotalSql(char *sql) {
int32_t totalVnodes = 0, totalVnodesAlive = 0;
TAOS_RES *result = taos_query(tsMonitor.conn, "show dnodes");
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show dnodes, reason:%s", tstrerror(code));
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
while ((row = taos_fetch_row(result))) {
for (int i = 0; i < num_fields; ++i) {
//database name
if (strcmp(fields[i].name, "end_point") == 0) {
monGetVnodesTotalStats((char *)row[i], &totalVnodes, &totalVnodesAlive);
}
}
}
taos_free_result(result);
return snprintf(sql, SQL_LENGTH, ", %d, %d", totalVnodes, totalVnodesAlive);
}
static int32_t monBuildConnsTotalSql(char *sql) {
int32_t totalConns = 0;
TAOS_RES *result = taos_query(tsMonitor.conn, "show connections");
TAOS_ROW row;
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show connections, reason:%s", tstrerror(code));
}
while ((row = taos_fetch_row(result))) {
totalConns++;
}
taos_free_result(result);
return snprintf(sql, SQL_LENGTH, ", %d)", totalConns);
}
static int32_t monBuildDnodeUptimeSql(char *sql) {
int64_t dnodeUptime = 0;
TAOS_RES *result = taos_query(tsMonitor.conn, "show dnodes");
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show dnodes, reason:%s", tstrerror(code));
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
bool is_self_ep = false;
while ((row = taos_fetch_row(result))) {
if (is_self_ep) {
break;
}
for (int i = 0; i < num_fields; ++i) {
if (strcmp(fields[i].name, "end_point") == 0) {
int32_t charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (strncmp((char *)row[i], tsLocalEp, charLen) == 0) {
is_self_ep = true;
}
}
if (strcmp(fields[i].name, "create_time") == 0) {
if (is_self_ep) {
int64_t now = taosGetTimestamp(TSDB_TIME_PRECISION_MILLI);
//dnodes uptime in seconds
dnodeUptime = (now - *(int64_t *)row[i]) / 1000;
}
}
}
}
taos_free_result(result);
return snprintf(sql, SQL_LENGTH, ", %" PRId64, dnodeUptime);
}
static int32_t monBuildDnodeIoSql(char *sql) {
float rcharKB = 0, wcharKB = 0;
float rbyteKB = 0, wbyteKB = 0;
rcharKB = tsMonStat.io_read;
wcharKB = tsMonStat.io_write;
rbyteKB = tsMonStat.io_read_disk;
wbyteKB = tsMonStat.io_write_disk;
return snprintf(sql, SQL_LENGTH, ", %f, %f, %f, %f", rcharKB / 1024, wcharKB / 1024,
rbyteKB / 1024, wbyteKB / 1024);
}
static int32_t monBuildNetworkIOSql(char *sql) {
float netInKb = 0, netOutKb = 0;
bool suc = taosGetNetworkIO(&netInKb, &netOutKb);
if (!suc) {
monDebug("failed to get network I/O info");
}
return snprintf(sql, SQL_LENGTH, ", %f, %f", netInKb / 1024,
netOutKb / 1024);
}
static int32_t monBuildDnodeReqSql(char *sql) {
int64_t queryReqNum = tsMonStat.dInfo.queryReqNum - tsMonStat.monQueryReqCnt;
int64_t submitReqNum = tsMonStat.dInfo.submitReqNum;
int64_t submitRowNum = tsMonStat.vInfo.submitRowNum;
int64_t submitReqSucNum = tsMonStat.vInfo.submitReqSucNum;
int64_t submitRowSucNum = tsMonStat.vInfo.submitRowSucNum;
float interval = (float)(tsMonitorInterval * 1.0);
float httpReqRate = tsMonStat.dInfo.httpReqNum / interval;
float queryReqRate = queryReqNum / interval;
float submitReqRate = submitReqNum / interval;
float submitRowRate = submitRowNum / interval;
return snprintf(sql, SQL_LENGTH, ", %"PRId64", %f, %"PRId64", %f, %"PRId64", %"PRId64", %f, %"PRId64", %"PRId64", %f",
tsMonStat.dInfo.httpReqNum, httpReqRate,
queryReqNum, queryReqRate,
submitRowNum, submitRowSucNum, submitRowRate,
submitReqNum, submitReqSucNum, submitReqRate);
}
static int32_t monBuildDnodeErrorsSql(char *sql) {
int64_t dnode_err = dnodeGetDnodeError();
return snprintf(sql, SQL_LENGTH, ", %"PRId64, dnode_err);
}
static int32_t monBuildDnodeVnodesSql(char *sql) {
int32_t vnodeNum = 0, masterNum = 0;
char sqlStr[TSDB_EP_LEN + 15];
memset(sqlStr, 0, sizeof(sqlStr));
snprintf(sqlStr, TSDB_EP_LEN + 14, "show vnodes \"%s\"", tsLocalEp);
TAOS_RES *result = taos_query(tsMonitor.conn, sqlStr);
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show vnodes \"%s\", reason:%s", tsLocalEp, tstrerror(code));
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
while ((row = taos_fetch_row(result))) {
vnodeNum += 1;
for (int i = 0; i < num_fields; ++i) {
if (strcmp(fields[i].name, "status") == 0) {
int32_t charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (strncmp((char *)row[i], "master", charLen) == 0) {
masterNum += 1;
}
}
}
}
taos_free_result(result);
return snprintf(sql, SQL_LENGTH, ", %d, %d", vnodeNum, masterNum);
}
static int32_t monBuildDnodeMnodeSql(char *sql) {
bool has_mnode = false, has_mnode_row;
TAOS_RES *result = taos_query(tsMonitor.conn, "show mnodes");
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show mnodes, reason:%s", tstrerror(code));
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
while ((row = taos_fetch_row(result))) {
has_mnode_row = false;
for (int i = 0; i < num_fields; ++i) {
if (strcmp(fields[i].name, "end_point") == 0) {
int32_t charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (strncmp((char *)row[i], tsLocalEp, charLen) == 0) {
has_mnode = true;
has_mnode_row = true;
}
} else if (strcmp(fields[i].name, "role") == 0) {
int32_t charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (strncmp((char *)row[i], "master", charLen) == 0) {
if (has_mnode_row) {
monHasMnodeMaster = true;
}
}
}
}
}
taos_free_result(result);
return snprintf(sql, SQL_LENGTH, ", %s)", has_mnode ? "true" : "false");
}
static int32_t monBuildDnodeDiskSql(char *sql) {
float taosdDataDirGB = 0;
return snprintf(sql, SQL_LENGTH, ", %f, %f, %f", taosdDataDirGB, tsUsedDataDirGB, tsTotalDataDirGB);
}
static int32_t monBuildDiskTierSql(char *sql) {
const int8_t numTiers = 3;
const double unit = 1024 * 1024 * 1024;
SFSMeta fsMeta;
STierMeta* tierMetas = calloc(numTiers, sizeof(STierMeta));
tfsUpdateInfo(&fsMeta, tierMetas, numTiers);
int32_t pos = 0;
for (int i = 0; i < numTiers; ++i) {
pos += snprintf(sql + pos, SQL_LENGTH, ", %f, %f", (float)(tierMetas[i].used / unit), (float)(tierMetas[i].size / unit));
}
pos += snprintf(sql + pos, SQL_LENGTH, ")");
free(tierMetas);
return pos;
}
static void monSaveClusterInfo() {
int64_t ts = taosGetTimestampUs();
char * sql = tsMonitor.sql;
int32_t pos = snprintf(sql, SQL_LENGTH, "insert into %s.cluster_info values(%" PRId64, tsMonitorDbName, ts);
pos += monBuildFirstEpSql(sql + pos);
pos += monBuildVersionSql(sql + pos);
pos += monBuildMasterUptimeSql(sql + pos);
pos += monBuildMonIntervalSql(sql + pos);
pos += monBuildDnodesTotalSql(sql + pos);
pos += monBuildMnodesTotalSql(sql + pos);
pos += monBuildVgroupsTotalSql(sql + pos);
pos += monBuildVnodesTotalSql(sql + pos);
pos += monBuildConnsTotalSql(sql + pos);
monDebug("save cluster, sql:%s", sql);
void *res = taos_query(tsMonitor.conn, tsMonitor.sql);
int32_t code = taos_errno(res);
taos_free_result(res);
if (code != 0) {
monError("failed to save cluster info, reason:%s, sql:%s", tstrerror(code), tsMonitor.sql);
} else {
monIncSubmitReqCnt();
monDebug("successfully to save cluster info, sql:%s", tsMonitor.sql);
}
}
static void monSaveDnodesInfo() {
int64_t ts = taosGetTimestampUs();
char * sql = tsMonitor.sql;
int64_t intervalUs = tsMonitorInterval * 1000000;
ts = ts / intervalUs * intervalUs; //To align timestamp to integer multiples of monitor interval
int32_t pos = snprintf(sql, SQL_LENGTH, "insert into %s.dnode_%d values(%" PRId64, tsMonitorDbName, dnodeGetDnodeId(), ts);
pos += monBuildDnodeUptimeSql(sql + pos);
pos += monBuildCpuSql(sql + pos);
pos += monBuildMemorySql(sql + pos);
pos += monBuildDnodeDiskSql(sql + pos);
pos += monBuildNetworkIOSql(sql + pos);
pos += monBuildDnodeIoSql(sql + pos);
pos += monBuildDnodeReqSql(sql + pos);
pos += monBuildDnodeErrorsSql(sql + pos);
pos += monBuildDnodeVnodesSql(sql + pos);
pos += monBuildDnodeMnodeSql(sql + pos);
monDebug("save dnodes, sql:%s", sql);
void *res = taos_query(tsMonitor.conn, tsMonitor.sql);
int32_t code = taos_errno(res);
taos_free_result(res);
if (code != 0) {
monError("failed to save dnode_%d info, reason:%s, sql:%s", dnodeGetDnodeId(), tstrerror(code), tsMonitor.sql);
} else {
monIncSubmitReqCnt();
monDebug("successfully to save dnode_%d info, sql:%s", dnodeGetDnodeId(), tsMonitor.sql);
}
}
static int32_t checkCreateVgroupTable(int32_t vgId) {
char subsql[256];
bool create_table = false;
int32_t code = TSDB_CODE_SUCCESS;
memset(subsql, 0, sizeof(subsql));
snprintf(subsql, 255, "describe %s.vgroup_%d", tsMonitorDbName, vgId);
TAOS_RES *result = taos_query(tsMonitor.conn, subsql);
code = taos_errno(result);
if (code != 0) {
create_table = true;
snprintf(subsql, sizeof(subsql), "create table if not exists %s.vgroup_%d using %s.vgroups_info tags(%d)",
tsMonitorDbName, vgId, tsMonitorDbName, vgId);
monError("table vgroup_%d not exist, create table vgroup_%d", vgId, vgId);
}
taos_free_result(result);
if (create_table == true) {
result = taos_query(tsMonitor.conn, subsql);
code = taos_errno(result);
taos_free_result(result);
}
return code;
}
static uint32_t monBuildVgroupsInfoSql(char *sql, char *dbName) {
char v_dnode_ids[256], v_dnode_status[1024];
int64_t ts = taosGetTimestampUs();
memset(sql, 0, SQL_LENGTH + 1);
snprintf(sql, SQL_LENGTH, "show %s.vgroups", dbName);
TAOS_RES *result = taos_query(tsMonitor.conn, sql);
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show %s.vgroups, reason:%s", dbName, tstrerror(code));
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
while ((row = taos_fetch_row(result))) {
int32_t vgId;
int32_t pos = 0;
for (int i = 0; i < num_fields; ++i) {
const char *v_dnode_str = strchr(fields[i].name, '_');
if (strcmp(fields[i].name, "vgId") == 0) {
vgId = *(int32_t *)row[i];
if (checkCreateVgroupTable(vgId) == TSDB_CODE_SUCCESS) {
memset(sql, 0, SQL_LENGTH + 1);
pos += snprintf(sql, SQL_LENGTH, "insert into %s.vgroup_%d values(%" PRId64 ", \"%s\"",
tsMonitorDbName, vgId, ts, dbName);
} else {
return TSDB_CODE_SUCCESS;
}
} else if (strcmp(fields[i].name, "tables") == 0) {
pos += snprintf(sql + pos, SQL_LENGTH, ", %d", *(int32_t *)row[i]);
} else if (strcmp(fields[i].name, "status") == 0) {
pos += snprintf(sql + pos, SQL_LENGTH, ", \"%s\"", (char *)row[i]);
} else if (strcmp(fields[i].name, "onlines") == 0) {
pos += snprintf(sql + pos, SQL_LENGTH, ", %d", *(int32_t *)row[i]);
} else if (v_dnode_str && strcmp(v_dnode_str, "_dnode") == 0) {
snprintf(v_dnode_ids, sizeof(v_dnode_ids), "%d;", *(int16_t *)row[i]);
} else if (v_dnode_str && strcmp(v_dnode_str, "_status") == 0) {
snprintf(v_dnode_status, sizeof(v_dnode_status), "%s;", (char *)row[i]);
} else if (strcmp(fields[i].name, "compacting") == 0) {
//flush dnode_ids and dnode_role in to sql
pos += snprintf(sql + pos, SQL_LENGTH, ", \"%s\", \"%s\")", v_dnode_ids, v_dnode_status);
}
}
monDebug("save vgroups, sql:%s", sql);
TAOS_RES *res = taos_query(tsMonitor.conn, sql);
code = taos_errno(res);
taos_free_result(res);
if (code != 0) {
monError("failed to save vgroup_%d info, reason:%s, sql:%s", vgId, tstrerror(code), tsMonitor.sql);
} else {
monIncSubmitReqCnt();
monDebug("successfully to save vgroup_%d info, sql:%s", vgId, tsMonitor.sql);
}
}
taos_free_result(result);
return TSDB_CODE_SUCCESS;
}
static void monSaveVgroupsInfo() {
char * sql = tsMonitor.sql;
TAOS_RES *result = taos_query(tsMonitor.conn, "show databases");
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show databases, reason:%s", tstrerror(code));
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
while ((row = taos_fetch_row(result))) {
for (int i = 0; i < num_fields; ++i) {
//database name
if (strcmp(fields[i].name, "name") == 0) {
monBuildVgroupsInfoSql(sql, (char *)row[i]);
}
}
}
taos_free_result(result);
}
static void monSaveSlowQueryInfo() {
int64_t ts = taosGetTimestampUs();
char * sql = tsMonitor.sql;
int32_t pos = snprintf(sql, SQL_LENGTH, "insert into %s.slowquery values(%" PRId64, tsMonitorDbName, ts);
bool has_slowquery = false;
TAOS_RES *result = taos_query(tsMonitor.conn, "show queries");
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show queries, reason:%s", tstrerror(code));
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
while ((row = taos_fetch_row(result))) {
for (int i = 0; i < num_fields; ++i) {
if (strcmp(fields[i].name, "query_id") == 0) {
has_slowquery = true;
pos += snprintf(sql + pos, SQL_LENGTH, ", \"%s\"", (char *)row[i]);
} else if (strcmp(fields[i].name, "user") == 0) {
pos += snprintf(sql + pos, SQL_LENGTH, ", \"%s\"", (char *)row[i]);
} else if (strcmp(fields[i].name, "qid") == 0) {
pos += snprintf(sql + pos, SQL_LENGTH, ", \"%s\"", (char *)row[i]);
} else if (strcmp(fields[i].name, "created_time") == 0) {
int64_t create_time = *(int64_t *)row[i];
create_time = convertTimePrecision(create_time, TSDB_TIME_PRECISION_MILLI, TSDB_TIME_PRECISION_MICRO);
pos += snprintf(sql + pos, SQL_LENGTH, ", %" PRId64 "", create_time);
} else if (strcmp(fields[i].name, "time") == 0) {
pos += snprintf(sql + pos, SQL_LENGTH, ", %" PRId64 "", *(int64_t *)row[i]);
} else if (strcmp(fields[i].name, "ep") == 0) {
pos += snprintf(sql + pos, SQL_LENGTH, ", \"%s\"", (char *)row[i]);
} else if (strcmp(fields[i].name, "sql") == 0) {
pos += snprintf(sql + pos, SQL_LENGTH, ", \"%s\")", (char *)row[i]);
}
}
}
monDebug("save slow query, sql:%s", sql);
taos_free_result(result);
if (!has_slowquery) {
return;
}
void *res = taos_query(tsMonitor.conn, tsMonitor.sql);
code = taos_errno(res);
taos_free_result(res);
if (code != 0) {
monError("failed to save slowquery info, reason:%s, sql:%s", tstrerror(code), tsMonitor.sql);
} else {
monIncSubmitReqCnt();
monDebug("successfully to save slowquery info, sql:%s", tsMonitor.sql);
}
}
static void monSaveDisksInfo() {
int64_t ts = taosGetTimestampUs();
char * sql = tsMonitor.sql;
int32_t pos = snprintf(sql, SQL_LENGTH, "insert into %s.disks_%d values(%" PRId64, tsMonitorDbName, dnodeGetDnodeId(), ts);
monBuildDiskTierSql(sql + pos);
monDebug("save disk, sql:%s", sql);
void *res = taos_query(tsMonitor.conn, tsMonitor.sql);
int32_t code = taos_errno(res);
taos_free_result(res);
if (code != 0) {
monError("failed to save disks_%d info, reason:%s, sql:%s", dnodeGetDnodeId(), tstrerror(code), tsMonitor.sql);
} else {
monIncSubmitReqCnt();
monDebug("successfully to save disks_%d info, sql:%s", dnodeGetDnodeId(), tsMonitor.sql);
}
}
static void monSaveGrantsInfo() {
int64_t ts = taosGetTimestampUs();
char * sql = tsMonitor.sql;
int32_t pos = snprintf(sql, SQL_LENGTH, "insert into %s.grants_info values(%" PRId64, tsMonitorDbName, ts);
TAOS_RES *result = taos_query(tsMonitor.conn, "show grants");
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
taos_free_result(result);
return;
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
while ((row = taos_fetch_row(result))) {
for (int i = 0; i < num_fields; ++i) {
if (strcmp(fields[i].name, "expire time") == 0) {
char *expStr = (char *)row[i];
if (expStr[0] == 'u') {
pos += snprintf(sql + pos, SQL_LENGTH, ", NULL");
} else {
struct tm expTime = {0};
strptime((char *)row[i], "%Y-%m-%d %H:%M:%S", &expTime);
int32_t expTimeSec = (int32_t)mktime(&expTime);
pos += snprintf(sql + pos, SQL_LENGTH, ", %d", expTimeSec - taosGetTimestampSec());
}
} else if (strcmp(fields[i].name, "timeseries") == 0) {
char *timeseries = (char *)row[i];
if (timeseries[0] == 'u') {
pos += snprintf(sql + pos, SQL_LENGTH, ", NULL, NULL)");
} else {
int32_t timeseries_used = strtol(timeseries, NULL, 10);
timeseries = strchr(timeseries, '/');
int32_t timeseries_total = strtol(timeseries + 1, NULL, 10);
pos += snprintf(sql + pos, SQL_LENGTH, ", %d, %d)", timeseries_used, timeseries_total);
}
}
}
}
monDebug("save grants, sql:%s", sql);
taos_free_result(result);
void *res = taos_query(tsMonitor.conn, tsMonitor.sql);
code = taos_errno(res);
taos_free_result(res);
if (code != 0) {
monError("failed to save grants info, reason:%s, sql:%s", tstrerror(code), tsMonitor.sql);
} else {
monIncSubmitReqCnt();
monDebug("successfully to save grants info, sql:%s", tsMonitor.sql);
}
}
static void monSaveHttpReqInfo() {
int64_t ts = taosGetTimestampUs();
char * sql = tsMonitor.sql;
int32_t pos = snprintf(sql, SQL_LENGTH, "insert into %s.restful_%d values(%" PRId64, tsMonitorDbName, dnodeGetDnodeId(), ts);
for (int32_t i = 0; i < tListLen(monHttpStatusTable); ++i) {
int32_t status = dnodeGetHttpStatusInfo(i);
pos += snprintf(sql + pos, SQL_LENGTH, ", %d", status);
}
pos += snprintf(sql + pos, SQL_LENGTH, ")");
dnodeClearHttpStatusInfo();
monDebug("save http req, sql:%s", sql);
void *res = taos_query(tsMonitor.conn, tsMonitor.sql);
int32_t code = taos_errno(res);
taos_free_result(res);
if (code != 0) {
monError("failed to save restful_%d info, reason:%s, sql:%s", dnodeGetDnodeId(), tstrerror(code), tsMonitor.sql);
} else {
monIncSubmitReqCnt();
monDebug("successfully to save restful_%d info, sql:%s", dnodeGetDnodeId(), tsMonitor.sql);
}
}
static void monExecSqlCb(void *param, TAOS_RES *result, int32_t code) {
int32_t c = taos_errno(result);
if (c != TSDB_CODE_SUCCESS) {
monError("save %s failed, reason:%s", (char *)param, tstrerror(c));
} else {
monIncSubmitReqCnt();
int32_t rows = taos_affected_rows(result);
monDebug("save %s succ, rows:%d", (char *)param, rows);
}
......@@ -367,7 +1372,7 @@ void monSaveAcctLog(SAcctMonitorObj *pMon) {
if (tsMonitor.state != MON_STATE_INITED) return;
char sql[1024] = {0};
sprintf(sql,
snprintf(sql, 1023,
"insert into %s.acct_%s using %s.acct tags('%s') values(now"
", %" PRId64 ", %" PRId64
", %" PRId64 ", %" PRId64
......@@ -411,13 +1416,34 @@ void monSaveLog(int32_t level, const char *const format, ...) {
va_end(argpointer);
if (len > max_length) len = max_length;
len += sprintf(sql + len, "', '%s')", tsLocalEp);
len += snprintf(sql + len, SQL_LENGTH, "', '%s')", tsLocalEp);
sql[len++] = 0;
monDebug("save log, sql: %s", sql);
taos_query_a(tsMonitor.conn, sql, monExecSqlCb, "log");
}
void monSaveDnodeLog(int32_t level, const char *const format, ...) {
if (tsMonitor.state != MON_STATE_INITED) return;
va_list argpointer;
char sql[SQL_LENGTH] = {0};
int32_t max_length = SQL_LENGTH - 30;
int32_t len = snprintf(sql, (size_t)max_length, "insert into %s.dnode_%d_log values(%" PRId64 ", %d,'", tsMonitorDbName,
dnodeGetDnodeId(), taosGetTimestampUs(), level);
va_start(argpointer, format);
len += vsnprintf(sql + len, (size_t)(max_length - len), format, argpointer);
va_end(argpointer);
if (len > max_length) len = max_length;
len += snprintf(sql + len, SQL_LENGTH, "')");
sql[len++] = 0;
monDebug("save dnode log, sql: %s", sql);
taos_query_a(tsMonitor.conn, sql, monExecSqlCb, "log");
}
void monExecuteSQL(char *sql) {
if (tsMonitor.state != MON_STATE_INITED) return;
......@@ -434,3 +1460,19 @@ void monExecuteSQLWithResultCallback(char *sql, MonExecuteSQLCbFP callback, void
monDebug("execute sql:%s", sql);
taos_query_a(tsMonitor.conn, sql, callback, param);
}
void monIncQueryReqCnt() {
atomic_fetch_add_32(&monQueryReqNum, 1);
}
void monIncSubmitReqCnt() {
atomic_fetch_add_32(&monSubmitReqNum, 1);
}
int32_t monFetchQueryReqCnt() {
return atomic_exchange_32(&monQueryReqNum, 0);
}
int32_t monFetchSubmitReqCnt() {
return atomic_exchange_32(&monSubmitReqNum, 0);
}
......@@ -281,7 +281,7 @@ typedef struct tSqlExprItem {
SArray *tVariantListAppend(SArray *pList, tVariant *pVar, uint8_t sortOrder);
SArray *tVariantListInsert(SArray *pList, tVariant *pVar, uint8_t sortOrder, int32_t index);
SArray *tVariantListAppendToken(SArray *pList, SStrToken *pAliasToken, uint8_t sortOrder);
SArray *tVariantListAppendToken(SArray *pList, SStrToken *pAliasToken, uint8_t sortOrder, bool needRmquoteEscape);
SRelationInfo *setTableNameList(SRelationInfo* pFromInfo, SStrToken *pName, SStrToken* pAlias);
void *destroyRelationInfo(SRelationInfo* pFromInfo);
......
......@@ -253,7 +253,7 @@ acct_optr(Y) ::= pps(C) tseries(D) storage(P) streams(F) qtime(Q) dbs(E) users(K
intitemlist(A) ::= intitemlist(X) COMMA intitem(Y). { A = tVariantListAppend(X, &Y, -1); }
intitemlist(A) ::= intitem(X). { A = tVariantListAppend(NULL, &X, -1); }
intitem(A) ::= INTEGER(X). { toTSDBType(X.type); tVariantCreate(&A, &X); }
intitem(A) ::= INTEGER(X). { toTSDBType(X.type); tVariantCreate(&A, &X, true); }
%type keep {SArray*}
%destructor keep {taosArrayDestroy($$);}
......@@ -438,39 +438,39 @@ column(A) ::= ids(X) typename(Y). {
tagitemlist(A) ::= tagitemlist(X) COMMA tagitem(Y). { A = tVariantListAppend(X, &Y, -1); }
tagitemlist(A) ::= tagitem(X). { A = tVariantListAppend(NULL, &X, -1); }
tagitem(A) ::= INTEGER(X). { toTSDBType(X.type); tVariantCreate(&A, &X); }
tagitem(A) ::= FLOAT(X). { toTSDBType(X.type); tVariantCreate(&A, &X); }
tagitem(A) ::= STRING(X). { toTSDBType(X.type); tVariantCreate(&A, &X); }
tagitem(A) ::= BOOL(X). { toTSDBType(X.type); tVariantCreate(&A, &X); }
tagitem(A) ::= NULL(X). { X.type = 0; tVariantCreate(&A, &X); }
tagitem(A) ::= NOW(X). { X.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&A, &X);}
tagitem(A) ::= INTEGER(X). { toTSDBType(X.type); tVariantCreate(&A, &X, true); }
tagitem(A) ::= FLOAT(X). { toTSDBType(X.type); tVariantCreate(&A, &X, true); }
tagitem(A) ::= STRING(X). { toTSDBType(X.type); tVariantCreate(&A, &X, true); }
tagitem(A) ::= BOOL(X). { toTSDBType(X.type); tVariantCreate(&A, &X, true); }
tagitem(A) ::= NULL(X). { X.type = 0; tVariantCreate(&A, &X, true); }
tagitem(A) ::= NOW(X). { X.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&A, &X, true);}
tagitem(A) ::= MINUS(X) INTEGER(Y).{
X.n += Y.n;
X.type = Y.type;
toTSDBType(X.type);
tVariantCreate(&A, &X);
tVariantCreate(&A, &X, true);
}
tagitem(A) ::= MINUS(X) FLOAT(Y). {
X.n += Y.n;
X.type = Y.type;
toTSDBType(X.type);
tVariantCreate(&A, &X);
tVariantCreate(&A, &X, true);
}
tagitem(A) ::= PLUS(X) INTEGER(Y). {
X.n += Y.n;
X.type = Y.type;
toTSDBType(X.type);
tVariantCreate(&A, &X);
tVariantCreate(&A, &X, true);
}
tagitem(A) ::= PLUS(X) FLOAT(Y). {
X.n += Y.n;
X.type = Y.type;
toTSDBType(X.type);
tVariantCreate(&A, &X);
tVariantCreate(&A, &X, true);
}
//////////////////////// The SELECT statement /////////////////////////////////
......@@ -609,7 +609,7 @@ fill_opt(N) ::= . { N = 0; }
fill_opt(N) ::= FILL LP ID(Y) COMMA tagitemlist(X) RP. {
tVariant A = {0};
toTSDBType(Y.type);
tVariantCreate(&A, &Y);
tVariantCreate(&A, &Y, true);
tVariantListInsert(X, &A, -1, 0);
N = X;
......@@ -617,7 +617,7 @@ fill_opt(N) ::= FILL LP ID(Y) COMMA tagitemlist(X) RP. {
fill_opt(N) ::= FILL LP ID(Y) RP. {
toTSDBType(Y.type);
N = tVariantListAppendToken(NULL, &Y, -1);
N = tVariantListAppendToken(NULL, &Y, -1, true);
}
%type sliding_opt {SStrToken}
......@@ -649,7 +649,7 @@ item(A) ::= ids(X) cpxName(Y). {
toTSDBType(X.type);
X.n += Y.n;
tVariantCreate(&A, &X);
tVariantCreate(&A, &X, true);
}
%type sortorder {int}
......@@ -796,7 +796,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) DROP COLUMN ids(A). {
X.n += F.n;
toTSDBType(A.type);
SArray* K = tVariantListAppendToken(NULL, &A, -1);
SArray* K = tVariantListAppendToken(NULL, &A, -1, false);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
......@@ -818,7 +818,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(Z) DROP TAG ids(Y). {
X.n += Z.n;
toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1);
SArray* A = tVariantListAppendToken(NULL, &Y, -1, true);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
......@@ -828,10 +828,10 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) CHANGE TAG ids(Y) ids(Z). {
X.n += F.n;
toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1);
SArray* A = tVariantListAppendToken(NULL, &Y, -1, true);
toTSDBType(Z.type);
A = tVariantListAppendToken(A, &Z, -1);
A = tVariantListAppendToken(A, &Z, -1, true);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
......@@ -841,7 +841,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) SET TAG ids(Y) EQ tagitem(Z). {
X.n += F.n;
toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1);
SArray* A = tVariantListAppendToken(NULL, &Y, -1, true);
A = tVariantListAppend(A, &Z, -1);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1);
......@@ -865,7 +865,7 @@ cmd ::= ALTER STABLE ids(X) cpxName(F) DROP COLUMN ids(A). {
X.n += F.n;
toTSDBType(A.type);
SArray* K = tVariantListAppendToken(NULL, &A, -1);
SArray* K = tVariantListAppendToken(NULL, &A, -1, true);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
......@@ -887,7 +887,7 @@ cmd ::= ALTER STABLE ids(X) cpxName(Z) DROP TAG ids(Y). {
X.n += Z.n;
toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1);
SArray* A = tVariantListAppendToken(NULL, &Y, -1, true);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
......@@ -897,10 +897,10 @@ cmd ::= ALTER STABLE ids(X) cpxName(F) CHANGE TAG ids(Y) ids(Z). {
X.n += F.n;
toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1);
SArray* A = tVariantListAppendToken(NULL, &Y, -1, true);
toTSDBType(Z.type);
A = tVariantListAppendToken(A, &Z, -1);
A = tVariantListAppendToken(A, &Z, -1, true);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
......@@ -910,7 +910,7 @@ cmd ::= ALTER STABLE ids(X) cpxName(F) SET TAG ids(Y) EQ tagitem(Z). {
X.n += F.n;
toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1);
SArray* A = tVariantListAppendToken(NULL, &Y, -1, true);
A = tVariantListAppend(A, &Z, -1);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE);
......
......@@ -143,14 +143,14 @@ tSqlExpr *tSqlExprCreateIdValue(SSqlInfo* pInfo, SStrToken *pToken, int32_t optr
if (optrType == TK_NULL) {
if (pToken){
pToken->type = TSDB_DATA_TYPE_NULL;
tVariantCreate(&pSqlExpr->value, pToken);
tVariantCreate(&pSqlExpr->value, pToken, true);
}
pSqlExpr->tokenId = optrType;
pSqlExpr->type = SQL_NODE_VALUE;
} else if (optrType == TK_INTEGER || optrType == TK_STRING || optrType == TK_FLOAT || optrType == TK_BOOL) {
if (pToken) {
toTSDBType(pToken->type);
tVariantCreate(&pSqlExpr->value, pToken);
tVariantCreate(&pSqlExpr->value, pToken, true);
}
pSqlExpr->tokenId = optrType;
pSqlExpr->type = SQL_NODE_VALUE;
......@@ -203,7 +203,7 @@ tSqlExpr *tSqlExprCreateTimestamp(SStrToken *pToken, int32_t optrType) {
if (optrType == TK_INTEGER || optrType == TK_STRING) {
if (pToken) {
toTSDBType(pToken->type);
tVariantCreate(&pSqlExpr->value, pToken);
tVariantCreate(&pSqlExpr->value, pToken, true);
}
pSqlExpr->tokenId = optrType;
pSqlExpr->type = SQL_NODE_VALUE;
......@@ -559,14 +559,14 @@ void tSqlExprDestroy(tSqlExpr *pExpr) {
doDestroySqlExprNode(pExpr);
}
SArray *tVariantListAppendToken(SArray *pList, SStrToken *pToken, uint8_t order) {
SArray *tVariantListAppendToken(SArray *pList, SStrToken *pToken, uint8_t order, bool needRmquoteEscape) {
if (pList == NULL) {
pList = taosArrayInit(4, sizeof(tVariantListItem));
}
if (pToken) {
tVariantListItem item;
tVariantCreate(&item.pVar, pToken);
tVariantCreate(&item.pVar, pToken, needRmquoteEscape);
item.sortOrder = order;
taosArrayPush(pList, &item);
......
......@@ -139,18 +139,18 @@ typedef union {
#define ParseCTX_FETCH
#define ParseCTX_STORE
#define YYFALLBACK 1
#define YYNSTATE 379
#define YYNRULE 303
#define YYNRULE_WITH_ACTION 303
#define YYNSTATE 378
#define YYNRULE 302
#define YYNRULE_WITH_ACTION 302
#define YYNTOKEN 199
#define YY_MAX_SHIFT 378
#define YY_MIN_SHIFTREDUCE 594
#define YY_MAX_SHIFTREDUCE 896
#define YY_ERROR_ACTION 897
#define YY_ACCEPT_ACTION 898
#define YY_NO_ACTION 899
#define YY_MIN_REDUCE 900
#define YY_MAX_REDUCE 1202
#define YY_MAX_SHIFT 377
#define YY_MIN_SHIFTREDUCE 593
#define YY_MAX_SHIFTREDUCE 894
#define YY_ERROR_ACTION 895
#define YY_ACCEPT_ACTION 896
#define YY_NO_ACTION 897
#define YY_MIN_REDUCE 898
#define YY_MAX_REDUCE 1199
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
......@@ -217,88 +217,87 @@ typedef union {
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (791)
#define YY_ACTTAB_COUNT (790)
static const YYACTIONTYPE yy_action[] = {
/* 0 */ 245, 646, 377, 238, 1056, 23, 214, 730, 1078, 647,
/* 10 */ 682, 898, 378, 59, 60, 251, 63, 64, 1178, 1056,
/* 20 */ 259, 53, 52, 51, 646, 62, 335, 67, 65, 68,
/* 30 */ 66, 159, 647, 337, 175, 58, 57, 355, 354, 56,
/* 40 */ 55, 54, 59, 60, 253, 63, 64, 1055, 1056, 259,
/* 50 */ 53, 52, 51, 297, 62, 335, 67, 65, 68, 66,
/* 60 */ 1026, 1069, 1024, 1025, 58, 57, 1198, 1027, 56, 55,
/* 70 */ 54, 1028, 256, 1029, 1030, 58, 57, 1075, 281, 56,
/* 80 */ 55, 54, 59, 60, 166, 63, 64, 38, 84, 259,
/* 90 */ 53, 52, 51, 90, 62, 335, 67, 65, 68, 66,
/* 100 */ 1069, 288, 287, 646, 58, 57, 333, 29, 56, 55,
/* 110 */ 54, 647, 59, 61, 833, 63, 64, 241, 1042, 259,
/* 120 */ 53, 52, 51, 646, 62, 335, 67, 65, 68, 66,
/* 130 */ 45, 647, 240, 214, 58, 57, 1053, 852, 56, 55,
/* 140 */ 54, 60, 1050, 63, 64, 1179, 282, 259, 53, 52,
/* 150 */ 51, 166, 62, 335, 67, 65, 68, 66, 38, 309,
/* 160 */ 39, 95, 58, 57, 798, 799, 56, 55, 54, 595,
/* 170 */ 596, 597, 598, 599, 600, 601, 602, 603, 604, 605,
/* 180 */ 606, 607, 608, 157, 1069, 239, 63, 64, 770, 252,
/* 190 */ 259, 53, 52, 51, 255, 62, 335, 67, 65, 68,
/* 200 */ 66, 242, 365, 249, 333, 58, 57, 1053, 211, 56,
/* 210 */ 55, 54, 257, 44, 331, 372, 371, 330, 329, 328,
/* 220 */ 370, 327, 326, 325, 369, 324, 368, 367, 1126, 16,
/* 230 */ 307, 15, 166, 24, 6, 1018, 1006, 1007, 1008, 1009,
/* 240 */ 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1019, 1020,
/* 250 */ 217, 166, 258, 848, 212, 214, 837, 225, 840, 839,
/* 260 */ 843, 842, 99, 141, 140, 139, 224, 1179, 258, 848,
/* 270 */ 340, 90, 837, 774, 840, 273, 843, 56, 55, 54,
/* 280 */ 67, 65, 68, 66, 277, 276, 236, 237, 58, 57,
/* 290 */ 336, 767, 56, 55, 54, 1039, 1040, 35, 1043, 260,
/* 300 */ 373, 987, 236, 237, 5, 41, 185, 268, 45, 1125,
/* 310 */ 38, 184, 108, 113, 104, 112, 754, 9, 181, 751,
/* 320 */ 262, 752, 786, 753, 38, 102, 789, 267, 96, 38,
/* 330 */ 320, 280, 838, 82, 841, 69, 125, 119, 130, 218,
/* 340 */ 232, 949, 118, 129, 117, 135, 138, 128, 195, 264,
/* 350 */ 265, 69, 293, 294, 132, 205, 203, 201, 38, 1052,
/* 360 */ 214, 1044, 200, 145, 144, 143, 142, 127, 38, 250,
/* 370 */ 849, 844, 1179, 1053, 344, 38, 38, 845, 1053, 365,
/* 380 */ 846, 44, 38, 372, 371, 83, 849, 844, 370, 376,
/* 390 */ 375, 150, 369, 845, 368, 367, 38, 263, 38, 261,
/* 400 */ 268, 343, 342, 345, 269, 219, 266, 1053, 350, 349,
/* 410 */ 815, 182, 14, 346, 220, 268, 98, 1053, 87, 1041,
/* 420 */ 347, 351, 88, 97, 1053, 1053, 1054, 352, 156, 154,
/* 430 */ 153, 1053, 959, 755, 756, 950, 34, 243, 85, 195,
/* 440 */ 795, 353, 195, 357, 805, 1053, 101, 1053, 806, 1,
/* 450 */ 183, 3, 196, 847, 161, 284, 292, 291, 70, 284,
/* 460 */ 75, 78, 26, 740, 312, 742, 314, 741, 814, 315,
/* 470 */ 871, 850, 835, 645, 18, 81, 17, 39, 39, 70,
/* 480 */ 100, 70, 137, 136, 25, 25, 759, 25, 760, 20,
/* 490 */ 757, 19, 758, 124, 22, 123, 21, 289, 1173, 1172,
/* 500 */ 1171, 234, 79, 76, 235, 215, 216, 729, 290, 1190,
/* 510 */ 836, 221, 213, 222, 223, 1136, 227, 228, 229, 1135,
/* 520 */ 247, 226, 278, 1132, 210, 1131, 248, 356, 48, 1070,
/* 530 */ 158, 1077, 1088, 1067, 155, 1085, 1086, 285, 1118, 1090,
/* 540 */ 160, 165, 1117, 303, 1051, 177, 283, 86, 178, 1049,
/* 550 */ 179, 180, 964, 785, 317, 318, 296, 319, 322, 323,
/* 560 */ 167, 46, 244, 298, 310, 168, 208, 42, 334, 958,
/* 570 */ 341, 1197, 115, 1196, 1193, 186, 348, 1189, 121, 300,
/* 580 */ 80, 77, 50, 308, 1188, 1185, 169, 306, 187, 304,
/* 590 */ 984, 43, 302, 40, 47, 209, 946, 131, 944, 133,
/* 600 */ 134, 942, 941, 299, 270, 198, 199, 938, 937, 936,
/* 610 */ 935, 934, 933, 932, 202, 204, 929, 927, 925, 923,
/* 620 */ 206, 920, 295, 207, 916, 49, 321, 91, 301, 1119,
/* 630 */ 366, 126, 359, 358, 360, 361, 363, 233, 362, 254,
/* 640 */ 316, 364, 374, 896, 271, 272, 895, 275, 274, 894,
/* 650 */ 876, 230, 963, 231, 109, 962, 110, 877, 279, 284,
/* 660 */ 311, 10, 286, 762, 30, 89, 940, 939, 190, 194,
/* 670 */ 146, 985, 188, 189, 192, 191, 931, 193, 147, 148,
/* 680 */ 930, 4, 149, 1022, 92, 986, 922, 176, 172, 170,
/* 690 */ 173, 171, 174, 33, 921, 794, 2, 73, 792, 791,
/* 700 */ 1032, 788, 787, 74, 164, 796, 162, 246, 807, 163,
/* 710 */ 31, 801, 93, 32, 803, 94, 305, 11, 12, 13,
/* 720 */ 27, 313, 36, 28, 101, 103, 106, 660, 695, 693,
/* 730 */ 692, 105, 691, 689, 688, 37, 107, 687, 684, 650,
/* 740 */ 111, 332, 7, 853, 851, 8, 338, 339, 39, 114,
/* 750 */ 71, 116, 72, 120, 732, 731, 728, 122, 676, 674,
/* 760 */ 666, 672, 668, 670, 664, 662, 698, 697, 696, 694,
/* 770 */ 690, 686, 685, 197, 648, 612, 900, 899, 899, 899,
/* 780 */ 899, 899, 899, 899, 899, 899, 899, 899, 899, 151,
/* 790 */ 152,
/* 0 */ 244, 644, 376, 237, 1053, 23, 213, 728, 1075, 645,
/* 10 */ 680, 896, 377, 59, 60, 250, 63, 64, 1175, 1053,
/* 20 */ 258, 53, 52, 51, 644, 62, 334, 67, 65, 68,
/* 30 */ 66, 158, 645, 336, 174, 58, 57, 354, 353, 56,
/* 40 */ 55, 54, 59, 60, 252, 63, 64, 1052, 1053, 258,
/* 50 */ 53, 52, 51, 296, 62, 334, 67, 65, 68, 66,
/* 60 */ 1023, 1066, 1021, 1022, 58, 57, 1195, 1024, 56, 55,
/* 70 */ 54, 1025, 255, 1026, 1027, 58, 57, 1072, 280, 56,
/* 80 */ 55, 54, 59, 60, 165, 63, 64, 38, 84, 258,
/* 90 */ 53, 52, 51, 90, 62, 334, 67, 65, 68, 66,
/* 100 */ 1066, 287, 286, 644, 58, 57, 332, 29, 56, 55,
/* 110 */ 54, 645, 59, 61, 831, 63, 64, 240, 1039, 258,
/* 120 */ 53, 52, 51, 644, 62, 334, 67, 65, 68, 66,
/* 130 */ 45, 645, 239, 213, 58, 57, 1050, 850, 56, 55,
/* 140 */ 54, 60, 1047, 63, 64, 1176, 281, 258, 53, 52,
/* 150 */ 51, 165, 62, 334, 67, 65, 68, 66, 38, 308,
/* 160 */ 39, 95, 58, 57, 796, 797, 56, 55, 54, 594,
/* 170 */ 595, 596, 597, 598, 599, 600, 601, 602, 603, 604,
/* 180 */ 605, 606, 607, 156, 1066, 238, 63, 64, 768, 251,
/* 190 */ 258, 53, 52, 51, 254, 62, 334, 67, 65, 68,
/* 200 */ 66, 241, 364, 248, 332, 58, 57, 1050, 210, 56,
/* 210 */ 55, 54, 256, 44, 330, 371, 370, 329, 328, 327,
/* 220 */ 369, 326, 325, 324, 368, 323, 367, 366, 1123, 16,
/* 230 */ 306, 15, 165, 24, 6, 1015, 1003, 1004, 1005, 1006,
/* 240 */ 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1016, 1017,
/* 250 */ 216, 165, 257, 846, 211, 213, 835, 224, 838, 837,
/* 260 */ 841, 840, 99, 141, 140, 139, 223, 1176, 257, 846,
/* 270 */ 339, 90, 835, 772, 838, 272, 841, 56, 55, 54,
/* 280 */ 67, 65, 68, 66, 276, 275, 235, 236, 58, 57,
/* 290 */ 335, 765, 56, 55, 54, 1036, 1037, 35, 1040, 259,
/* 300 */ 372, 984, 235, 236, 5, 41, 184, 267, 45, 1122,
/* 310 */ 38, 183, 108, 113, 104, 112, 752, 9, 180, 749,
/* 320 */ 261, 750, 784, 751, 38, 102, 787, 266, 96, 38,
/* 330 */ 319, 279, 836, 82, 839, 69, 125, 119, 130, 217,
/* 340 */ 231, 946, 118, 129, 117, 135, 138, 128, 194, 263,
/* 350 */ 264, 69, 292, 293, 132, 204, 202, 200, 38, 1049,
/* 360 */ 213, 1041, 199, 145, 144, 143, 142, 127, 38, 249,
/* 370 */ 847, 842, 1176, 1050, 343, 38, 38, 843, 1050, 364,
/* 380 */ 844, 44, 38, 371, 370, 83, 847, 842, 369, 375,
/* 390 */ 374, 621, 368, 843, 367, 366, 38, 262, 38, 260,
/* 400 */ 267, 342, 341, 344, 268, 218, 265, 1050, 349, 348,
/* 410 */ 813, 181, 14, 345, 219, 267, 98, 1050, 87, 1038,
/* 420 */ 346, 350, 88, 97, 1050, 1050, 1051, 351, 155, 153,
/* 430 */ 152, 1050, 956, 753, 754, 947, 34, 242, 85, 194,
/* 440 */ 793, 352, 194, 356, 803, 1050, 101, 1050, 804, 1,
/* 450 */ 182, 3, 195, 845, 160, 283, 291, 290, 70, 283,
/* 460 */ 75, 78, 26, 738, 311, 740, 313, 739, 812, 314,
/* 470 */ 869, 848, 833, 643, 18, 81, 17, 39, 39, 70,
/* 480 */ 100, 70, 137, 136, 25, 25, 757, 25, 758, 20,
/* 490 */ 755, 19, 756, 124, 22, 123, 21, 288, 1170, 1169,
/* 500 */ 1168, 233, 79, 76, 234, 214, 215, 727, 289, 1187,
/* 510 */ 834, 220, 212, 221, 222, 1133, 226, 227, 228, 1132,
/* 520 */ 246, 225, 277, 1129, 209, 1128, 247, 355, 48, 1067,
/* 530 */ 157, 1074, 1085, 1064, 154, 1082, 1083, 284, 1115, 1087,
/* 540 */ 159, 164, 1114, 302, 1048, 176, 282, 86, 177, 1046,
/* 550 */ 178, 179, 961, 783, 316, 317, 295, 318, 321, 322,
/* 560 */ 166, 46, 243, 297, 309, 80, 207, 42, 333, 955,
/* 570 */ 340, 1194, 115, 1193, 1190, 185, 347, 1186, 121, 299,
/* 580 */ 77, 167, 50, 307, 1185, 1182, 168, 305, 186, 303,
/* 590 */ 981, 43, 301, 40, 47, 208, 943, 131, 941, 133,
/* 600 */ 134, 939, 938, 298, 269, 197, 198, 935, 934, 933,
/* 610 */ 932, 931, 930, 929, 201, 203, 925, 923, 921, 205,
/* 620 */ 918, 206, 294, 914, 320, 49, 91, 300, 1116, 365,
/* 630 */ 126, 357, 358, 359, 360, 361, 362, 232, 363, 253,
/* 640 */ 315, 373, 894, 270, 271, 893, 273, 274, 229, 892,
/* 650 */ 875, 230, 109, 960, 959, 874, 110, 146, 278, 283,
/* 660 */ 310, 10, 285, 89, 92, 760, 937, 936, 189, 147,
/* 670 */ 188, 982, 187, 190, 191, 193, 928, 192, 148, 927,
/* 680 */ 4, 149, 1019, 920, 30, 983, 919, 175, 171, 169,
/* 690 */ 172, 170, 173, 33, 2, 792, 1029, 73, 790, 789,
/* 700 */ 786, 785, 74, 163, 794, 161, 245, 805, 162, 11,
/* 710 */ 799, 93, 31, 801, 94, 304, 32, 12, 13, 27,
/* 720 */ 312, 103, 28, 101, 106, 36, 658, 693, 691, 690,
/* 730 */ 689, 105, 687, 686, 37, 107, 685, 682, 648, 111,
/* 740 */ 7, 331, 849, 337, 8, 851, 338, 114, 39, 71,
/* 750 */ 72, 116, 120, 730, 729, 726, 122, 674, 672, 664,
/* 760 */ 670, 666, 668, 662, 660, 696, 695, 694, 692, 688,
/* 770 */ 684, 683, 196, 646, 611, 898, 897, 897, 897, 897,
/* 780 */ 897, 897, 897, 897, 897, 897, 897, 897, 150, 151,
};
static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 247, 1, 201, 202, 251, 269, 269, 5, 201, 9,
......@@ -357,30 +356,30 @@ static const YYCODETYPE yy_lookahead[] = {
/* 530 */ 201, 201, 201, 265, 62, 201, 201, 249, 279, 201,
/* 540 */ 201, 201, 279, 201, 249, 253, 203, 203, 201, 201,
/* 550 */ 201, 201, 201, 126, 201, 201, 273, 201, 201, 201,
/* 560 */ 264, 201, 273, 273, 134, 263, 201, 201, 201, 201,
/* 560 */ 264, 201, 273, 273, 134, 139, 201, 201, 201, 201,
/* 570 */ 201, 201, 201, 201, 201, 201, 201, 201, 201, 273,
/* 580 */ 139, 141, 138, 137, 201, 201, 262, 132, 201, 131,
/* 580 */ 141, 263, 138, 137, 201, 201, 262, 132, 201, 131,
/* 590 */ 201, 201, 130, 201, 201, 201, 201, 201, 201, 201,
/* 600 */ 201, 201, 201, 133, 201, 201, 201, 201, 201, 201,
/* 610 */ 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
/* 620 */ 201, 201, 127, 201, 201, 143, 91, 203, 203, 203,
/* 630 */ 115, 98, 53, 97, 94, 96, 95, 203, 57, 203,
/* 640 */ 203, 93, 86, 5, 156, 5, 5, 5, 156, 5,
/* 650 */ 101, 203, 213, 203, 209, 213, 209, 102, 145, 122,
/* 660 */ 117, 84, 99, 85, 84, 123, 203, 203, 216, 215,
/* 670 */ 204, 222, 221, 220, 217, 219, 203, 218, 204, 204,
/* 680 */ 203, 205, 204, 240, 99, 224, 203, 254, 259, 261,
/* 690 */ 258, 260, 257, 255, 203, 85, 210, 99, 126, 126,
/* 700 */ 240, 5, 5, 84, 99, 85, 84, 1, 85, 84,
/* 710 */ 99, 85, 84, 99, 85, 84, 84, 135, 135, 84,
/* 720 */ 84, 117, 89, 84, 118, 80, 72, 5, 9, 5,
/* 730 */ 5, 88, 5, 5, 5, 89, 88, 5, 5, 87,
/* 740 */ 80, 15, 84, 119, 85, 84, 26, 61, 99, 150,
/* 750 */ 16, 150, 16, 150, 5, 5, 85, 150, 5, 5,
/* 620 */ 201, 201, 127, 201, 91, 143, 203, 203, 203, 115,
/* 630 */ 98, 97, 53, 94, 96, 57, 95, 203, 93, 203,
/* 640 */ 203, 86, 5, 156, 5, 5, 156, 5, 203, 5,
/* 650 */ 102, 203, 209, 213, 213, 101, 209, 204, 145, 122,
/* 660 */ 117, 84, 99, 123, 99, 85, 203, 203, 216, 204,
/* 670 */ 220, 222, 221, 219, 217, 215, 203, 218, 204, 203,
/* 680 */ 205, 204, 240, 203, 84, 224, 203, 254, 259, 261,
/* 690 */ 258, 260, 257, 255, 210, 85, 240, 99, 126, 126,
/* 700 */ 5, 5, 84, 99, 85, 84, 1, 85, 84, 135,
/* 710 */ 85, 84, 99, 85, 84, 84, 99, 135, 84, 84,
/* 720 */ 117, 80, 84, 118, 72, 89, 5, 9, 5, 5,
/* 730 */ 5, 88, 5, 5, 89, 88, 5, 5, 87, 80,
/* 740 */ 84, 15, 85, 26, 84, 119, 61, 150, 99, 16,
/* 750 */ 16, 150, 150, 5, 5, 85, 150, 5, 5, 5,
/* 760 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
/* 770 */ 5, 5, 5, 99, 87, 62, 0, 282, 282, 282,
/* 780 */ 282, 282, 282, 282, 282, 282, 282, 282, 282, 21,
/* 790 */ 21, 282, 282, 282, 282, 282, 282, 282, 282, 282,
/* 770 */ 5, 5, 99, 87, 62, 0, 282, 282, 282, 282,
/* 780 */ 282, 282, 282, 282, 282, 282, 282, 282, 21, 21,
/* 790 */ 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
/* 800 */ 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
/* 810 */ 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
/* 820 */ 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
......@@ -399,17 +398,17 @@ static const YYCODETYPE yy_lookahead[] = {
/* 950 */ 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
/* 960 */ 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
/* 970 */ 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
/* 980 */ 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
/* 980 */ 282, 282, 282, 282, 282, 282, 282, 282, 282,
};
#define YY_SHIFT_COUNT (378)
#define YY_SHIFT_COUNT (377)
#define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (776)
#define YY_SHIFT_MAX (775)
static const unsigned short int yy_shift_ofst[] = {
/* 0 */ 187, 113, 113, 281, 281, 20, 251, 267, 267, 23,
/* 10 */ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
/* 20 */ 102, 102, 102, 0, 122, 267, 314, 314, 314, 9,
/* 30 */ 9, 102, 102, 36, 102, 118, 102, 102, 102, 102,
/* 40 */ 287, 20, 110, 110, 5, 791, 791, 791, 267, 267,
/* 40 */ 287, 20, 110, 110, 5, 790, 790, 790, 267, 267,
/* 50 */ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
/* 60 */ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
/* 70 */ 314, 314, 314, 317, 317, 2, 2, 2, 2, 2,
......@@ -420,33 +419,33 @@ static const unsigned short int yy_shift_ofst[] = {
/* 120 */ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
/* 130 */ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
/* 140 */ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
/* 150 */ 102, 102, 102, 102, 102, 102, 102, 102, 472, 472,
/* 160 */ 472, 427, 427, 427, 427, 472, 472, 441, 440, 430,
/* 170 */ 444, 446, 455, 458, 462, 470, 495, 482, 472, 472,
/* 180 */ 472, 535, 535, 515, 20, 20, 472, 472, 533, 536,
/* 190 */ 579, 540, 539, 581, 541, 548, 515, 5, 472, 472,
/* 200 */ 556, 556, 472, 556, 472, 556, 472, 472, 791, 791,
/* 210 */ 29, 69, 69, 99, 69, 127, 170, 240, 253, 253,
/* 220 */ 253, 253, 253, 253, 272, 291, 40, 40, 40, 40,
/* 230 */ 250, 257, 130, 328, 238, 238, 254, 327, 322, 364,
/* 240 */ 61, 333, 337, 421, 355, 359, 363, 361, 362, 378,
/* 250 */ 379, 380, 381, 382, 352, 385, 386, 471, 150, 18,
/* 260 */ 388, 81, 194, 326, 481, 485, 341, 345, 391, 346,
/* 270 */ 402, 638, 488, 640, 641, 492, 642, 644, 555, 549,
/* 280 */ 513, 537, 543, 577, 542, 578, 580, 563, 585, 610,
/* 290 */ 598, 572, 573, 696, 697, 619, 620, 622, 623, 625,
/* 300 */ 626, 605, 628, 629, 631, 706, 632, 611, 582, 614,
/* 310 */ 583, 635, 543, 636, 604, 639, 606, 645, 633, 643,
/* 320 */ 654, 722, 646, 648, 719, 724, 725, 727, 728, 729,
/* 330 */ 732, 733, 652, 726, 660, 658, 659, 624, 661, 720,
/* 340 */ 686, 734, 599, 601, 649, 649, 649, 649, 736, 603,
/* 350 */ 607, 649, 649, 649, 749, 750, 671, 649, 753, 754,
/* 150 */ 102, 102, 102, 102, 102, 102, 102, 472, 472, 472,
/* 160 */ 427, 427, 427, 427, 472, 472, 426, 439, 430, 444,
/* 170 */ 446, 455, 458, 462, 470, 495, 482, 472, 472, 472,
/* 180 */ 533, 533, 514, 20, 20, 472, 472, 532, 534, 579,
/* 190 */ 539, 538, 578, 541, 545, 514, 5, 472, 472, 555,
/* 200 */ 555, 472, 555, 472, 555, 472, 472, 790, 790, 29,
/* 210 */ 69, 69, 99, 69, 127, 170, 240, 253, 253, 253,
/* 220 */ 253, 253, 253, 272, 291, 40, 40, 40, 40, 250,
/* 230 */ 257, 130, 328, 238, 238, 254, 327, 322, 364, 61,
/* 240 */ 333, 337, 421, 355, 359, 363, 361, 362, 378, 379,
/* 250 */ 380, 381, 382, 352, 385, 386, 471, 150, 18, 388,
/* 260 */ 81, 194, 326, 481, 485, 341, 345, 391, 346, 402,
/* 270 */ 637, 487, 639, 640, 490, 642, 644, 548, 554, 513,
/* 280 */ 537, 543, 577, 540, 580, 600, 563, 565, 610, 598,
/* 290 */ 572, 573, 695, 696, 618, 619, 621, 622, 624, 625,
/* 300 */ 604, 627, 628, 630, 705, 631, 613, 574, 617, 582,
/* 310 */ 634, 543, 635, 603, 638, 605, 641, 636, 643, 652,
/* 320 */ 721, 645, 647, 718, 723, 724, 725, 727, 728, 731,
/* 330 */ 732, 651, 726, 659, 656, 657, 626, 660, 717, 685,
/* 340 */ 733, 597, 601, 649, 649, 649, 649, 734, 602, 606,
/* 350 */ 649, 649, 649, 748, 749, 670, 649, 752, 753, 754,
/* 360 */ 755, 756, 757, 758, 759, 760, 761, 762, 763, 764,
/* 370 */ 765, 766, 767, 674, 687, 768, 769, 713, 776,
/* 370 */ 765, 766, 673, 686, 767, 768, 712, 775,
};
#define YY_REDUCE_COUNT (209)
#define YY_REDUCE_COUNT (208)
#define YY_REDUCE_MIN (-264)
#define YY_REDUCE_MAX (491)
#define YY_REDUCE_MAX (484)
static const short yy_reduce_ofst[] = {
/* 0 */ -188, 10, 10, -165, -165, 53, -136, -14, 91, -170,
/* 10 */ -114, -50, -117, -43, 123, 128, 157, 167, 174, 175,
......@@ -463,52 +462,52 @@ static const short yy_reduce_ofst[] = {
/* 120 */ 375, 376, 377, 383, 384, 387, 389, 390, 392, 393,
/* 130 */ 394, 395, 396, 397, 398, 399, 400, 401, 403, 404,
/* 140 */ 405, 406, 407, 408, 409, 410, 411, 412, 413, 414,
/* 150 */ 415, 416, 417, 418, 419, 420, 422, 423, 343, 344,
/* 160 */ 424, 283, 289, 290, 306, 425, 426, 268, 296, 302,
/* 170 */ 324, 428, 431, 429, 432, 435, 438, 433, 434, 436,
/* 180 */ 437, 439, 442, 443, 445, 447, 448, 450, 449, 451,
/* 190 */ 453, 452, 456, 457, 459, 454, 460, 461, 463, 464,
/* 200 */ 466, 474, 473, 475, 477, 478, 483, 491, 486, 476,
/* 150 */ 415, 416, 417, 418, 419, 420, 422, 343, 344, 423,
/* 160 */ 283, 289, 290, 306, 424, 425, 268, 296, 318, 324,
/* 170 */ 428, 431, 429, 432, 435, 438, 433, 434, 436, 437,
/* 180 */ 440, 441, 442, 443, 447, 445, 448, 449, 451, 450,
/* 190 */ 452, 454, 457, 459, 460, 456, 461, 463, 464, 453,
/* 200 */ 465, 473, 474, 476, 477, 480, 483, 484, 475,
};
static const YYACTIONTYPE yy_default[] = {
/* 0 */ 897, 1021, 960, 1031, 947, 957, 1181, 1181, 1181, 897,
/* 10 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
/* 20 */ 897, 897, 897, 1079, 917, 1181, 897, 897, 897, 897,
/* 30 */ 897, 897, 897, 1103, 897, 957, 897, 897, 897, 897,
/* 40 */ 967, 957, 967, 967, 897, 1074, 1005, 1023, 897, 897,
/* 50 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
/* 60 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
/* 70 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
/* 80 */ 897, 897, 897, 897, 897, 1081, 1087, 1084, 897, 897,
/* 90 */ 897, 1089, 897, 897, 897, 1122, 1122, 1072, 897, 897,
/* 100 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
/* 110 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
/* 120 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
/* 130 */ 897, 945, 897, 943, 897, 897, 897, 897, 897, 897,
/* 140 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
/* 150 */ 928, 897, 897, 897, 897, 897, 897, 915, 919, 919,
/* 160 */ 919, 897, 897, 897, 897, 919, 919, 1129, 1133, 1115,
/* 170 */ 1127, 1123, 1110, 1108, 1106, 1114, 1099, 1137, 919, 919,
/* 180 */ 919, 965, 965, 961, 957, 957, 919, 919, 983, 981,
/* 190 */ 979, 971, 977, 973, 975, 969, 948, 897, 919, 919,
/* 200 */ 955, 955, 919, 955, 919, 955, 919, 919, 1005, 1023,
/* 210 */ 897, 1138, 1128, 897, 1180, 1168, 1167, 897, 1176, 1175,
/* 220 */ 1174, 1166, 1165, 1164, 897, 897, 1160, 1163, 1162, 1161,
/* 230 */ 897, 897, 897, 897, 1170, 1169, 897, 897, 897, 897,
/* 240 */ 897, 897, 897, 1096, 897, 897, 897, 1134, 1130, 897,
/* 250 */ 897, 897, 897, 897, 897, 897, 897, 897, 1140, 897,
/* 260 */ 897, 897, 897, 897, 897, 897, 897, 897, 1033, 897,
/* 270 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
/* 280 */ 897, 1071, 897, 897, 897, 897, 897, 1083, 1082, 897,
/* 290 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
/* 300 */ 897, 897, 897, 897, 897, 897, 897, 1124, 897, 1116,
/* 310 */ 897, 897, 1045, 897, 897, 897, 897, 897, 897, 897,
/* 320 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
/* 330 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
/* 340 */ 897, 897, 897, 897, 1199, 1194, 1195, 1192, 897, 897,
/* 350 */ 897, 1191, 1186, 1187, 897, 897, 897, 1184, 897, 897,
/* 360 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
/* 370 */ 897, 897, 897, 989, 897, 926, 924, 897, 897,
/* 0 */ 895, 1018, 957, 1028, 944, 954, 1178, 1178, 1178, 895,
/* 10 */ 895, 895, 895, 895, 895, 895, 895, 895, 895, 895,
/* 20 */ 895, 895, 895, 1076, 915, 1178, 895, 895, 895, 895,
/* 30 */ 895, 895, 895, 1100, 895, 954, 895, 895, 895, 895,
/* 40 */ 964, 954, 964, 964, 895, 1071, 1002, 1020, 895, 895,
/* 50 */ 895, 895, 895, 895, 895, 895, 895, 895, 895, 895,
/* 60 */ 895, 895, 895, 895, 895, 895, 895, 895, 895, 895,
/* 70 */ 895, 895, 895, 895, 895, 895, 895, 895, 895, 895,
/* 80 */ 895, 895, 895, 895, 895, 1078, 1084, 1081, 895, 895,
/* 90 */ 895, 1086, 895, 895, 895, 1119, 1119, 1069, 895, 895,
/* 100 */ 895, 895, 895, 895, 895, 895, 895, 895, 895, 895,
/* 110 */ 895, 895, 895, 895, 895, 895, 895, 895, 895, 895,
/* 120 */ 895, 895, 895, 895, 895, 895, 895, 895, 895, 895,
/* 130 */ 895, 942, 895, 940, 895, 895, 895, 895, 895, 895,
/* 140 */ 895, 895, 895, 895, 895, 895, 895, 895, 895, 895,
/* 150 */ 895, 895, 895, 895, 895, 895, 913, 917, 917, 917,
/* 160 */ 895, 895, 895, 895, 917, 917, 1126, 1130, 1112, 1124,
/* 170 */ 1120, 1107, 1105, 1103, 1111, 1096, 1134, 917, 917, 917,
/* 180 */ 962, 962, 958, 954, 954, 917, 917, 980, 978, 976,
/* 190 */ 968, 974, 970, 972, 966, 945, 895, 917, 917, 952,
/* 200 */ 952, 917, 952, 917, 952, 917, 917, 1002, 1020, 895,
/* 210 */ 1135, 1125, 895, 1177, 1165, 1164, 895, 1173, 1172, 1171,
/* 220 */ 1163, 1162, 1161, 895, 895, 1157, 1160, 1159, 1158, 895,
/* 230 */ 895, 895, 895, 1167, 1166, 895, 895, 895, 895, 895,
/* 240 */ 895, 895, 1093, 895, 895, 895, 1131, 1127, 895, 895,
/* 250 */ 895, 895, 895, 895, 895, 895, 895, 1137, 895, 895,
/* 260 */ 895, 895, 895, 895, 895, 895, 895, 1030, 895, 895,
/* 270 */ 895, 895, 895, 895, 895, 895, 895, 895, 895, 895,
/* 280 */ 1068, 895, 895, 895, 895, 895, 1080, 1079, 895, 895,
/* 290 */ 895, 895, 895, 895, 895, 895, 895, 895, 895, 895,
/* 300 */ 895, 895, 895, 895, 895, 895, 1121, 895, 1113, 895,
/* 310 */ 895, 1042, 895, 895, 895, 895, 895, 895, 895, 895,
/* 320 */ 895, 895, 895, 895, 895, 895, 895, 895, 895, 895,
/* 330 */ 895, 895, 895, 895, 895, 895, 895, 895, 895, 895,
/* 340 */ 895, 895, 895, 1196, 1191, 1192, 1189, 895, 895, 895,
/* 350 */ 1188, 1183, 1184, 895, 895, 895, 1181, 895, 895, 895,
/* 360 */ 895, 895, 895, 895, 895, 895, 895, 895, 895, 895,
/* 370 */ 895, 895, 986, 895, 924, 922, 895, 895,
};
/********** End of lemon-generated parsing tables *****************************/
......@@ -1132,280 +1131,279 @@ static const char *const yyRuleName[] = {
/* 26 */ "cmd ::= SHOW dbPrefix STABLES",
/* 27 */ "cmd ::= SHOW dbPrefix STABLES LIKE ids",
/* 28 */ "cmd ::= SHOW dbPrefix VGROUPS",
/* 29 */ "cmd ::= SHOW dbPrefix VGROUPS ids",
/* 30 */ "cmd ::= DROP TABLE ifexists ids cpxName",
/* 31 */ "cmd ::= DROP STABLE ifexists ids cpxName",
/* 32 */ "cmd ::= DROP DATABASE ifexists ids",
/* 33 */ "cmd ::= DROP TOPIC ifexists ids",
/* 34 */ "cmd ::= DROP FUNCTION ids",
/* 35 */ "cmd ::= DROP DNODE ids",
/* 36 */ "cmd ::= DROP USER ids",
/* 37 */ "cmd ::= DROP ACCOUNT ids",
/* 38 */ "cmd ::= USE ids",
/* 39 */ "cmd ::= DESCRIBE ids cpxName",
/* 40 */ "cmd ::= DESC ids cpxName",
/* 41 */ "cmd ::= ALTER USER ids PASS ids",
/* 42 */ "cmd ::= ALTER USER ids PRIVILEGE ids",
/* 43 */ "cmd ::= ALTER DNODE ids ids",
/* 44 */ "cmd ::= ALTER DNODE ids ids ids",
/* 45 */ "cmd ::= ALTER LOCAL ids",
/* 46 */ "cmd ::= ALTER LOCAL ids ids",
/* 47 */ "cmd ::= ALTER DATABASE ids alter_db_optr",
/* 48 */ "cmd ::= ALTER TOPIC ids alter_topic_optr",
/* 49 */ "cmd ::= ALTER ACCOUNT ids acct_optr",
/* 50 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr",
/* 51 */ "cmd ::= COMPACT VNODES IN LP exprlist RP",
/* 52 */ "ids ::= ID",
/* 53 */ "ids ::= STRING",
/* 54 */ "ifexists ::= IF EXISTS",
/* 55 */ "ifexists ::=",
/* 56 */ "ifnotexists ::= IF NOT EXISTS",
/* 57 */ "ifnotexists ::=",
/* 58 */ "cmd ::= CREATE DNODE ids",
/* 59 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr",
/* 60 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr",
/* 61 */ "cmd ::= CREATE TOPIC ifnotexists ids topic_optr",
/* 62 */ "cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize",
/* 63 */ "cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize",
/* 64 */ "cmd ::= CREATE USER ids PASS ids",
/* 65 */ "bufsize ::=",
/* 66 */ "bufsize ::= BUFSIZE INTEGER",
/* 67 */ "pps ::=",
/* 68 */ "pps ::= PPS INTEGER",
/* 69 */ "tseries ::=",
/* 70 */ "tseries ::= TSERIES INTEGER",
/* 71 */ "dbs ::=",
/* 72 */ "dbs ::= DBS INTEGER",
/* 73 */ "streams ::=",
/* 74 */ "streams ::= STREAMS INTEGER",
/* 75 */ "storage ::=",
/* 76 */ "storage ::= STORAGE INTEGER",
/* 77 */ "qtime ::=",
/* 78 */ "qtime ::= QTIME INTEGER",
/* 79 */ "users ::=",
/* 80 */ "users ::= USERS INTEGER",
/* 81 */ "conns ::=",
/* 82 */ "conns ::= CONNS INTEGER",
/* 83 */ "state ::=",
/* 84 */ "state ::= STATE ids",
/* 85 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state",
/* 86 */ "intitemlist ::= intitemlist COMMA intitem",
/* 87 */ "intitemlist ::= intitem",
/* 88 */ "intitem ::= INTEGER",
/* 89 */ "keep ::= KEEP intitemlist",
/* 90 */ "cache ::= CACHE INTEGER",
/* 91 */ "replica ::= REPLICA INTEGER",
/* 92 */ "quorum ::= QUORUM INTEGER",
/* 93 */ "days ::= DAYS INTEGER",
/* 94 */ "minrows ::= MINROWS INTEGER",
/* 95 */ "maxrows ::= MAXROWS INTEGER",
/* 96 */ "blocks ::= BLOCKS INTEGER",
/* 97 */ "ctime ::= CTIME INTEGER",
/* 98 */ "wal ::= WAL INTEGER",
/* 99 */ "fsync ::= FSYNC INTEGER",
/* 100 */ "comp ::= COMP INTEGER",
/* 101 */ "prec ::= PRECISION STRING",
/* 102 */ "update ::= UPDATE INTEGER",
/* 103 */ "cachelast ::= CACHELAST INTEGER",
/* 104 */ "partitions ::= PARTITIONS INTEGER",
/* 105 */ "db_optr ::=",
/* 106 */ "db_optr ::= db_optr cache",
/* 107 */ "db_optr ::= db_optr replica",
/* 108 */ "db_optr ::= db_optr quorum",
/* 109 */ "db_optr ::= db_optr days",
/* 110 */ "db_optr ::= db_optr minrows",
/* 111 */ "db_optr ::= db_optr maxrows",
/* 112 */ "db_optr ::= db_optr blocks",
/* 113 */ "db_optr ::= db_optr ctime",
/* 114 */ "db_optr ::= db_optr wal",
/* 115 */ "db_optr ::= db_optr fsync",
/* 116 */ "db_optr ::= db_optr comp",
/* 117 */ "db_optr ::= db_optr prec",
/* 118 */ "db_optr ::= db_optr keep",
/* 119 */ "db_optr ::= db_optr update",
/* 120 */ "db_optr ::= db_optr cachelast",
/* 121 */ "topic_optr ::= db_optr",
/* 122 */ "topic_optr ::= topic_optr partitions",
/* 123 */ "alter_db_optr ::=",
/* 124 */ "alter_db_optr ::= alter_db_optr replica",
/* 125 */ "alter_db_optr ::= alter_db_optr quorum",
/* 126 */ "alter_db_optr ::= alter_db_optr keep",
/* 127 */ "alter_db_optr ::= alter_db_optr blocks",
/* 128 */ "alter_db_optr ::= alter_db_optr comp",
/* 129 */ "alter_db_optr ::= alter_db_optr update",
/* 130 */ "alter_db_optr ::= alter_db_optr cachelast",
/* 131 */ "alter_topic_optr ::= alter_db_optr",
/* 132 */ "alter_topic_optr ::= alter_topic_optr partitions",
/* 133 */ "typename ::= ids",
/* 134 */ "typename ::= ids LP signed RP",
/* 135 */ "typename ::= ids UNSIGNED",
/* 136 */ "signed ::= INTEGER",
/* 137 */ "signed ::= PLUS INTEGER",
/* 138 */ "signed ::= MINUS INTEGER",
/* 139 */ "cmd ::= CREATE TABLE create_table_args",
/* 140 */ "cmd ::= CREATE TABLE create_stable_args",
/* 141 */ "cmd ::= CREATE STABLE create_stable_args",
/* 142 */ "cmd ::= CREATE TABLE create_table_list",
/* 143 */ "create_table_list ::= create_from_stable",
/* 144 */ "create_table_list ::= create_table_list create_from_stable",
/* 145 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP",
/* 146 */ "create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP",
/* 147 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP",
/* 148 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP",
/* 149 */ "tagNamelist ::= tagNamelist COMMA ids",
/* 150 */ "tagNamelist ::= ids",
/* 151 */ "create_table_args ::= ifnotexists ids cpxName AS select",
/* 152 */ "columnlist ::= columnlist COMMA column",
/* 153 */ "columnlist ::= column",
/* 154 */ "column ::= ids typename",
/* 155 */ "tagitemlist ::= tagitemlist COMMA tagitem",
/* 156 */ "tagitemlist ::= tagitem",
/* 157 */ "tagitem ::= INTEGER",
/* 158 */ "tagitem ::= FLOAT",
/* 159 */ "tagitem ::= STRING",
/* 160 */ "tagitem ::= BOOL",
/* 161 */ "tagitem ::= NULL",
/* 162 */ "tagitem ::= NOW",
/* 163 */ "tagitem ::= MINUS INTEGER",
/* 164 */ "tagitem ::= MINUS FLOAT",
/* 165 */ "tagitem ::= PLUS INTEGER",
/* 166 */ "tagitem ::= PLUS FLOAT",
/* 167 */ "select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt",
/* 168 */ "select ::= LP select RP",
/* 169 */ "union ::= select",
/* 170 */ "union ::= union UNION ALL select",
/* 171 */ "cmd ::= union",
/* 172 */ "select ::= SELECT selcollist",
/* 173 */ "sclp ::= selcollist COMMA",
/* 174 */ "sclp ::=",
/* 175 */ "selcollist ::= sclp distinct expr as",
/* 176 */ "selcollist ::= sclp STAR",
/* 177 */ "as ::= AS ids",
/* 178 */ "as ::= ids",
/* 179 */ "as ::=",
/* 180 */ "distinct ::= DISTINCT",
/* 181 */ "distinct ::=",
/* 182 */ "from ::= FROM tablelist",
/* 183 */ "from ::= FROM sub",
/* 184 */ "sub ::= LP union RP",
/* 185 */ "sub ::= LP union RP ids",
/* 186 */ "sub ::= sub COMMA LP union RP ids",
/* 187 */ "tablelist ::= ids cpxName",
/* 188 */ "tablelist ::= ids cpxName ids",
/* 189 */ "tablelist ::= tablelist COMMA ids cpxName",
/* 190 */ "tablelist ::= tablelist COMMA ids cpxName ids",
/* 191 */ "tmvar ::= VARIABLE",
/* 192 */ "timestamp ::= INTEGER",
/* 193 */ "timestamp ::= MINUS INTEGER",
/* 194 */ "timestamp ::= PLUS INTEGER",
/* 195 */ "timestamp ::= STRING",
/* 196 */ "timestamp ::= NOW",
/* 197 */ "timestamp ::= NOW PLUS VARIABLE",
/* 198 */ "timestamp ::= NOW MINUS VARIABLE",
/* 199 */ "range_option ::=",
/* 200 */ "range_option ::= RANGE LP timestamp COMMA timestamp RP",
/* 201 */ "interval_option ::= intervalKey LP tmvar RP",
/* 202 */ "interval_option ::= intervalKey LP tmvar COMMA tmvar RP",
/* 203 */ "interval_option ::=",
/* 204 */ "intervalKey ::= INTERVAL",
/* 205 */ "intervalKey ::= EVERY",
/* 206 */ "session_option ::=",
/* 207 */ "session_option ::= SESSION LP ids cpxName COMMA tmvar RP",
/* 208 */ "windowstate_option ::=",
/* 209 */ "windowstate_option ::= STATE_WINDOW LP ids RP",
/* 210 */ "fill_opt ::=",
/* 211 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP",
/* 212 */ "fill_opt ::= FILL LP ID RP",
/* 213 */ "sliding_opt ::= SLIDING LP tmvar RP",
/* 214 */ "sliding_opt ::=",
/* 215 */ "orderby_opt ::=",
/* 216 */ "orderby_opt ::= ORDER BY sortlist",
/* 217 */ "sortlist ::= sortlist COMMA item sortorder",
/* 218 */ "sortlist ::= item sortorder",
/* 219 */ "item ::= ids cpxName",
/* 220 */ "sortorder ::= ASC",
/* 221 */ "sortorder ::= DESC",
/* 222 */ "sortorder ::=",
/* 223 */ "groupby_opt ::=",
/* 224 */ "groupby_opt ::= GROUP BY grouplist",
/* 225 */ "grouplist ::= grouplist COMMA item",
/* 226 */ "grouplist ::= item",
/* 227 */ "having_opt ::=",
/* 228 */ "having_opt ::= HAVING expr",
/* 229 */ "limit_opt ::=",
/* 230 */ "limit_opt ::= LIMIT signed",
/* 231 */ "limit_opt ::= LIMIT signed OFFSET signed",
/* 232 */ "limit_opt ::= LIMIT signed COMMA signed",
/* 233 */ "slimit_opt ::=",
/* 234 */ "slimit_opt ::= SLIMIT signed",
/* 235 */ "slimit_opt ::= SLIMIT signed SOFFSET signed",
/* 236 */ "slimit_opt ::= SLIMIT signed COMMA signed",
/* 237 */ "where_opt ::=",
/* 238 */ "where_opt ::= WHERE expr",
/* 239 */ "expr ::= LP expr RP",
/* 240 */ "expr ::= ID",
/* 241 */ "expr ::= ID DOT ID",
/* 242 */ "expr ::= ID DOT STAR",
/* 243 */ "expr ::= INTEGER",
/* 244 */ "expr ::= MINUS INTEGER",
/* 245 */ "expr ::= PLUS INTEGER",
/* 246 */ "expr ::= FLOAT",
/* 247 */ "expr ::= MINUS FLOAT",
/* 248 */ "expr ::= PLUS FLOAT",
/* 249 */ "expr ::= STRING",
/* 250 */ "expr ::= NOW",
/* 251 */ "expr ::= VARIABLE",
/* 252 */ "expr ::= PLUS VARIABLE",
/* 253 */ "expr ::= MINUS VARIABLE",
/* 254 */ "expr ::= BOOL",
/* 255 */ "expr ::= NULL",
/* 256 */ "expr ::= ID LP exprlist RP",
/* 257 */ "expr ::= ID LP STAR RP",
/* 258 */ "expr ::= expr IS NULL",
/* 259 */ "expr ::= expr IS NOT NULL",
/* 260 */ "expr ::= expr LT expr",
/* 261 */ "expr ::= expr GT expr",
/* 262 */ "expr ::= expr LE expr",
/* 263 */ "expr ::= expr GE expr",
/* 264 */ "expr ::= expr NE expr",
/* 265 */ "expr ::= expr EQ expr",
/* 266 */ "expr ::= expr BETWEEN expr AND expr",
/* 267 */ "expr ::= expr AND expr",
/* 268 */ "expr ::= expr OR expr",
/* 269 */ "expr ::= expr PLUS expr",
/* 270 */ "expr ::= expr MINUS expr",
/* 271 */ "expr ::= expr STAR expr",
/* 272 */ "expr ::= expr SLASH expr",
/* 273 */ "expr ::= expr REM expr",
/* 274 */ "expr ::= expr LIKE expr",
/* 275 */ "expr ::= expr MATCH expr",
/* 276 */ "expr ::= expr NMATCH expr",
/* 277 */ "expr ::= expr IN LP exprlist RP",
/* 278 */ "exprlist ::= exprlist COMMA expritem",
/* 279 */ "exprlist ::= expritem",
/* 280 */ "expritem ::= expr",
/* 281 */ "expritem ::=",
/* 282 */ "cmd ::= RESET QUERY CACHE",
/* 283 */ "cmd ::= SYNCDB ids REPLICA",
/* 284 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
/* 285 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
/* 286 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist",
/* 287 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
/* 288 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
/* 289 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
/* 290 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
/* 291 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist",
/* 292 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist",
/* 293 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids",
/* 294 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist",
/* 295 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist",
/* 296 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids",
/* 297 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids",
/* 298 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem",
/* 299 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist",
/* 300 */ "cmd ::= KILL CONNECTION INTEGER",
/* 301 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
/* 302 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER",
/* 29 */ "cmd ::= DROP TABLE ifexists ids cpxName",
/* 30 */ "cmd ::= DROP STABLE ifexists ids cpxName",
/* 31 */ "cmd ::= DROP DATABASE ifexists ids",
/* 32 */ "cmd ::= DROP TOPIC ifexists ids",
/* 33 */ "cmd ::= DROP FUNCTION ids",
/* 34 */ "cmd ::= DROP DNODE ids",
/* 35 */ "cmd ::= DROP USER ids",
/* 36 */ "cmd ::= DROP ACCOUNT ids",
/* 37 */ "cmd ::= USE ids",
/* 38 */ "cmd ::= DESCRIBE ids cpxName",
/* 39 */ "cmd ::= DESC ids cpxName",
/* 40 */ "cmd ::= ALTER USER ids PASS ids",
/* 41 */ "cmd ::= ALTER USER ids PRIVILEGE ids",
/* 42 */ "cmd ::= ALTER DNODE ids ids",
/* 43 */ "cmd ::= ALTER DNODE ids ids ids",
/* 44 */ "cmd ::= ALTER LOCAL ids",
/* 45 */ "cmd ::= ALTER LOCAL ids ids",
/* 46 */ "cmd ::= ALTER DATABASE ids alter_db_optr",
/* 47 */ "cmd ::= ALTER TOPIC ids alter_topic_optr",
/* 48 */ "cmd ::= ALTER ACCOUNT ids acct_optr",
/* 49 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr",
/* 50 */ "cmd ::= COMPACT VNODES IN LP exprlist RP",
/* 51 */ "ids ::= ID",
/* 52 */ "ids ::= STRING",
/* 53 */ "ifexists ::= IF EXISTS",
/* 54 */ "ifexists ::=",
/* 55 */ "ifnotexists ::= IF NOT EXISTS",
/* 56 */ "ifnotexists ::=",
/* 57 */ "cmd ::= CREATE DNODE ids",
/* 58 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr",
/* 59 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr",
/* 60 */ "cmd ::= CREATE TOPIC ifnotexists ids topic_optr",
/* 61 */ "cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize",
/* 62 */ "cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize",
/* 63 */ "cmd ::= CREATE USER ids PASS ids",
/* 64 */ "bufsize ::=",
/* 65 */ "bufsize ::= BUFSIZE INTEGER",
/* 66 */ "pps ::=",
/* 67 */ "pps ::= PPS INTEGER",
/* 68 */ "tseries ::=",
/* 69 */ "tseries ::= TSERIES INTEGER",
/* 70 */ "dbs ::=",
/* 71 */ "dbs ::= DBS INTEGER",
/* 72 */ "streams ::=",
/* 73 */ "streams ::= STREAMS INTEGER",
/* 74 */ "storage ::=",
/* 75 */ "storage ::= STORAGE INTEGER",
/* 76 */ "qtime ::=",
/* 77 */ "qtime ::= QTIME INTEGER",
/* 78 */ "users ::=",
/* 79 */ "users ::= USERS INTEGER",
/* 80 */ "conns ::=",
/* 81 */ "conns ::= CONNS INTEGER",
/* 82 */ "state ::=",
/* 83 */ "state ::= STATE ids",
/* 84 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state",
/* 85 */ "intitemlist ::= intitemlist COMMA intitem",
/* 86 */ "intitemlist ::= intitem",
/* 87 */ "intitem ::= INTEGER",
/* 88 */ "keep ::= KEEP intitemlist",
/* 89 */ "cache ::= CACHE INTEGER",
/* 90 */ "replica ::= REPLICA INTEGER",
/* 91 */ "quorum ::= QUORUM INTEGER",
/* 92 */ "days ::= DAYS INTEGER",
/* 93 */ "minrows ::= MINROWS INTEGER",
/* 94 */ "maxrows ::= MAXROWS INTEGER",
/* 95 */ "blocks ::= BLOCKS INTEGER",
/* 96 */ "ctime ::= CTIME INTEGER",
/* 97 */ "wal ::= WAL INTEGER",
/* 98 */ "fsync ::= FSYNC INTEGER",
/* 99 */ "comp ::= COMP INTEGER",
/* 100 */ "prec ::= PRECISION STRING",
/* 101 */ "update ::= UPDATE INTEGER",
/* 102 */ "cachelast ::= CACHELAST INTEGER",
/* 103 */ "partitions ::= PARTITIONS INTEGER",
/* 104 */ "db_optr ::=",
/* 105 */ "db_optr ::= db_optr cache",
/* 106 */ "db_optr ::= db_optr replica",
/* 107 */ "db_optr ::= db_optr quorum",
/* 108 */ "db_optr ::= db_optr days",
/* 109 */ "db_optr ::= db_optr minrows",
/* 110 */ "db_optr ::= db_optr maxrows",
/* 111 */ "db_optr ::= db_optr blocks",
/* 112 */ "db_optr ::= db_optr ctime",
/* 113 */ "db_optr ::= db_optr wal",
/* 114 */ "db_optr ::= db_optr fsync",
/* 115 */ "db_optr ::= db_optr comp",
/* 116 */ "db_optr ::= db_optr prec",
/* 117 */ "db_optr ::= db_optr keep",
/* 118 */ "db_optr ::= db_optr update",
/* 119 */ "db_optr ::= db_optr cachelast",
/* 120 */ "topic_optr ::= db_optr",
/* 121 */ "topic_optr ::= topic_optr partitions",
/* 122 */ "alter_db_optr ::=",
/* 123 */ "alter_db_optr ::= alter_db_optr replica",
/* 124 */ "alter_db_optr ::= alter_db_optr quorum",
/* 125 */ "alter_db_optr ::= alter_db_optr keep",
/* 126 */ "alter_db_optr ::= alter_db_optr blocks",
/* 127 */ "alter_db_optr ::= alter_db_optr comp",
/* 128 */ "alter_db_optr ::= alter_db_optr update",
/* 129 */ "alter_db_optr ::= alter_db_optr cachelast",
/* 130 */ "alter_topic_optr ::= alter_db_optr",
/* 131 */ "alter_topic_optr ::= alter_topic_optr partitions",
/* 132 */ "typename ::= ids",
/* 133 */ "typename ::= ids LP signed RP",
/* 134 */ "typename ::= ids UNSIGNED",
/* 135 */ "signed ::= INTEGER",
/* 136 */ "signed ::= PLUS INTEGER",
/* 137 */ "signed ::= MINUS INTEGER",
/* 138 */ "cmd ::= CREATE TABLE create_table_args",
/* 139 */ "cmd ::= CREATE TABLE create_stable_args",
/* 140 */ "cmd ::= CREATE STABLE create_stable_args",
/* 141 */ "cmd ::= CREATE TABLE create_table_list",
/* 142 */ "create_table_list ::= create_from_stable",
/* 143 */ "create_table_list ::= create_table_list create_from_stable",
/* 144 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP",
/* 145 */ "create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP",
/* 146 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP",
/* 147 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP",
/* 148 */ "tagNamelist ::= tagNamelist COMMA ids",
/* 149 */ "tagNamelist ::= ids",
/* 150 */ "create_table_args ::= ifnotexists ids cpxName AS select",
/* 151 */ "columnlist ::= columnlist COMMA column",
/* 152 */ "columnlist ::= column",
/* 153 */ "column ::= ids typename",
/* 154 */ "tagitemlist ::= tagitemlist COMMA tagitem",
/* 155 */ "tagitemlist ::= tagitem",
/* 156 */ "tagitem ::= INTEGER",
/* 157 */ "tagitem ::= FLOAT",
/* 158 */ "tagitem ::= STRING",
/* 159 */ "tagitem ::= BOOL",
/* 160 */ "tagitem ::= NULL",
/* 161 */ "tagitem ::= NOW",
/* 162 */ "tagitem ::= MINUS INTEGER",
/* 163 */ "tagitem ::= MINUS FLOAT",
/* 164 */ "tagitem ::= PLUS INTEGER",
/* 165 */ "tagitem ::= PLUS FLOAT",
/* 166 */ "select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt",
/* 167 */ "select ::= LP select RP",
/* 168 */ "union ::= select",
/* 169 */ "union ::= union UNION ALL select",
/* 170 */ "cmd ::= union",
/* 171 */ "select ::= SELECT selcollist",
/* 172 */ "sclp ::= selcollist COMMA",
/* 173 */ "sclp ::=",
/* 174 */ "selcollist ::= sclp distinct expr as",
/* 175 */ "selcollist ::= sclp STAR",
/* 176 */ "as ::= AS ids",
/* 177 */ "as ::= ids",
/* 178 */ "as ::=",
/* 179 */ "distinct ::= DISTINCT",
/* 180 */ "distinct ::=",
/* 181 */ "from ::= FROM tablelist",
/* 182 */ "from ::= FROM sub",
/* 183 */ "sub ::= LP union RP",
/* 184 */ "sub ::= LP union RP ids",
/* 185 */ "sub ::= sub COMMA LP union RP ids",
/* 186 */ "tablelist ::= ids cpxName",
/* 187 */ "tablelist ::= ids cpxName ids",
/* 188 */ "tablelist ::= tablelist COMMA ids cpxName",
/* 189 */ "tablelist ::= tablelist COMMA ids cpxName ids",
/* 190 */ "tmvar ::= VARIABLE",
/* 191 */ "timestamp ::= INTEGER",
/* 192 */ "timestamp ::= MINUS INTEGER",
/* 193 */ "timestamp ::= PLUS INTEGER",
/* 194 */ "timestamp ::= STRING",
/* 195 */ "timestamp ::= NOW",
/* 196 */ "timestamp ::= NOW PLUS VARIABLE",
/* 197 */ "timestamp ::= NOW MINUS VARIABLE",
/* 198 */ "range_option ::=",
/* 199 */ "range_option ::= RANGE LP timestamp COMMA timestamp RP",
/* 200 */ "interval_option ::= intervalKey LP tmvar RP",
/* 201 */ "interval_option ::= intervalKey LP tmvar COMMA tmvar RP",
/* 202 */ "interval_option ::=",
/* 203 */ "intervalKey ::= INTERVAL",
/* 204 */ "intervalKey ::= EVERY",
/* 205 */ "session_option ::=",
/* 206 */ "session_option ::= SESSION LP ids cpxName COMMA tmvar RP",
/* 207 */ "windowstate_option ::=",
/* 208 */ "windowstate_option ::= STATE_WINDOW LP ids RP",
/* 209 */ "fill_opt ::=",
/* 210 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP",
/* 211 */ "fill_opt ::= FILL LP ID RP",
/* 212 */ "sliding_opt ::= SLIDING LP tmvar RP",
/* 213 */ "sliding_opt ::=",
/* 214 */ "orderby_opt ::=",
/* 215 */ "orderby_opt ::= ORDER BY sortlist",
/* 216 */ "sortlist ::= sortlist COMMA item sortorder",
/* 217 */ "sortlist ::= item sortorder",
/* 218 */ "item ::= ids cpxName",
/* 219 */ "sortorder ::= ASC",
/* 220 */ "sortorder ::= DESC",
/* 221 */ "sortorder ::=",
/* 222 */ "groupby_opt ::=",
/* 223 */ "groupby_opt ::= GROUP BY grouplist",
/* 224 */ "grouplist ::= grouplist COMMA item",
/* 225 */ "grouplist ::= item",
/* 226 */ "having_opt ::=",
/* 227 */ "having_opt ::= HAVING expr",
/* 228 */ "limit_opt ::=",
/* 229 */ "limit_opt ::= LIMIT signed",
/* 230 */ "limit_opt ::= LIMIT signed OFFSET signed",
/* 231 */ "limit_opt ::= LIMIT signed COMMA signed",
/* 232 */ "slimit_opt ::=",
/* 233 */ "slimit_opt ::= SLIMIT signed",
/* 234 */ "slimit_opt ::= SLIMIT signed SOFFSET signed",
/* 235 */ "slimit_opt ::= SLIMIT signed COMMA signed",
/* 236 */ "where_opt ::=",
/* 237 */ "where_opt ::= WHERE expr",
/* 238 */ "expr ::= LP expr RP",
/* 239 */ "expr ::= ID",
/* 240 */ "expr ::= ID DOT ID",
/* 241 */ "expr ::= ID DOT STAR",
/* 242 */ "expr ::= INTEGER",
/* 243 */ "expr ::= MINUS INTEGER",
/* 244 */ "expr ::= PLUS INTEGER",
/* 245 */ "expr ::= FLOAT",
/* 246 */ "expr ::= MINUS FLOAT",
/* 247 */ "expr ::= PLUS FLOAT",
/* 248 */ "expr ::= STRING",
/* 249 */ "expr ::= NOW",
/* 250 */ "expr ::= VARIABLE",
/* 251 */ "expr ::= PLUS VARIABLE",
/* 252 */ "expr ::= MINUS VARIABLE",
/* 253 */ "expr ::= BOOL",
/* 254 */ "expr ::= NULL",
/* 255 */ "expr ::= ID LP exprlist RP",
/* 256 */ "expr ::= ID LP STAR RP",
/* 257 */ "expr ::= expr IS NULL",
/* 258 */ "expr ::= expr IS NOT NULL",
/* 259 */ "expr ::= expr LT expr",
/* 260 */ "expr ::= expr GT expr",
/* 261 */ "expr ::= expr LE expr",
/* 262 */ "expr ::= expr GE expr",
/* 263 */ "expr ::= expr NE expr",
/* 264 */ "expr ::= expr EQ expr",
/* 265 */ "expr ::= expr BETWEEN expr AND expr",
/* 266 */ "expr ::= expr AND expr",
/* 267 */ "expr ::= expr OR expr",
/* 268 */ "expr ::= expr PLUS expr",
/* 269 */ "expr ::= expr MINUS expr",
/* 270 */ "expr ::= expr STAR expr",
/* 271 */ "expr ::= expr SLASH expr",
/* 272 */ "expr ::= expr REM expr",
/* 273 */ "expr ::= expr LIKE expr",
/* 274 */ "expr ::= expr MATCH expr",
/* 275 */ "expr ::= expr NMATCH expr",
/* 276 */ "expr ::= expr IN LP exprlist RP",
/* 277 */ "exprlist ::= exprlist COMMA expritem",
/* 278 */ "exprlist ::= expritem",
/* 279 */ "expritem ::= expr",
/* 280 */ "expritem ::=",
/* 281 */ "cmd ::= RESET QUERY CACHE",
/* 282 */ "cmd ::= SYNCDB ids REPLICA",
/* 283 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
/* 284 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
/* 285 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist",
/* 286 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
/* 287 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
/* 288 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
/* 289 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
/* 290 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist",
/* 291 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist",
/* 292 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids",
/* 293 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist",
/* 294 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist",
/* 295 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids",
/* 296 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids",
/* 297 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem",
/* 298 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist",
/* 299 */ "cmd ::= KILL CONNECTION INTEGER",
/* 300 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
/* 301 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER",
};
#endif /* NDEBUG */
......@@ -1903,280 +1901,279 @@ static const YYCODETYPE yyRuleInfoLhs[] = {
200, /* (26) cmd ::= SHOW dbPrefix STABLES */
200, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */
200, /* (28) cmd ::= SHOW dbPrefix VGROUPS */
200, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */
200, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */
200, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */
200, /* (32) cmd ::= DROP DATABASE ifexists ids */
200, /* (33) cmd ::= DROP TOPIC ifexists ids */
200, /* (34) cmd ::= DROP FUNCTION ids */
200, /* (35) cmd ::= DROP DNODE ids */
200, /* (36) cmd ::= DROP USER ids */
200, /* (37) cmd ::= DROP ACCOUNT ids */
200, /* (38) cmd ::= USE ids */
200, /* (39) cmd ::= DESCRIBE ids cpxName */
200, /* (40) cmd ::= DESC ids cpxName */
200, /* (41) cmd ::= ALTER USER ids PASS ids */
200, /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */
200, /* (43) cmd ::= ALTER DNODE ids ids */
200, /* (44) cmd ::= ALTER DNODE ids ids ids */
200, /* (45) cmd ::= ALTER LOCAL ids */
200, /* (46) cmd ::= ALTER LOCAL ids ids */
200, /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */
200, /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */
200, /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */
200, /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
200, /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */
201, /* (52) ids ::= ID */
201, /* (53) ids ::= STRING */
204, /* (54) ifexists ::= IF EXISTS */
204, /* (55) ifexists ::= */
209, /* (56) ifnotexists ::= IF NOT EXISTS */
209, /* (57) ifnotexists ::= */
200, /* (58) cmd ::= CREATE DNODE ids */
200, /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
200, /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
200, /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
200, /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
200, /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
200, /* (64) cmd ::= CREATE USER ids PASS ids */
213, /* (65) bufsize ::= */
213, /* (66) bufsize ::= BUFSIZE INTEGER */
214, /* (67) pps ::= */
214, /* (68) pps ::= PPS INTEGER */
215, /* (69) tseries ::= */
215, /* (70) tseries ::= TSERIES INTEGER */
216, /* (71) dbs ::= */
216, /* (72) dbs ::= DBS INTEGER */
217, /* (73) streams ::= */
217, /* (74) streams ::= STREAMS INTEGER */
218, /* (75) storage ::= */
218, /* (76) storage ::= STORAGE INTEGER */
219, /* (77) qtime ::= */
219, /* (78) qtime ::= QTIME INTEGER */
220, /* (79) users ::= */
220, /* (80) users ::= USERS INTEGER */
221, /* (81) conns ::= */
221, /* (82) conns ::= CONNS INTEGER */
222, /* (83) state ::= */
222, /* (84) state ::= STATE ids */
207, /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
223, /* (86) intitemlist ::= intitemlist COMMA intitem */
223, /* (87) intitemlist ::= intitem */
224, /* (88) intitem ::= INTEGER */
225, /* (89) keep ::= KEEP intitemlist */
226, /* (90) cache ::= CACHE INTEGER */
227, /* (91) replica ::= REPLICA INTEGER */
228, /* (92) quorum ::= QUORUM INTEGER */
229, /* (93) days ::= DAYS INTEGER */
230, /* (94) minrows ::= MINROWS INTEGER */
231, /* (95) maxrows ::= MAXROWS INTEGER */
232, /* (96) blocks ::= BLOCKS INTEGER */
233, /* (97) ctime ::= CTIME INTEGER */
234, /* (98) wal ::= WAL INTEGER */
235, /* (99) fsync ::= FSYNC INTEGER */
236, /* (100) comp ::= COMP INTEGER */
237, /* (101) prec ::= PRECISION STRING */
238, /* (102) update ::= UPDATE INTEGER */
239, /* (103) cachelast ::= CACHELAST INTEGER */
240, /* (104) partitions ::= PARTITIONS INTEGER */
210, /* (105) db_optr ::= */
210, /* (106) db_optr ::= db_optr cache */
210, /* (107) db_optr ::= db_optr replica */
210, /* (108) db_optr ::= db_optr quorum */
210, /* (109) db_optr ::= db_optr days */
210, /* (110) db_optr ::= db_optr minrows */
210, /* (111) db_optr ::= db_optr maxrows */
210, /* (112) db_optr ::= db_optr blocks */
210, /* (113) db_optr ::= db_optr ctime */
210, /* (114) db_optr ::= db_optr wal */
210, /* (115) db_optr ::= db_optr fsync */
210, /* (116) db_optr ::= db_optr comp */
210, /* (117) db_optr ::= db_optr prec */
210, /* (118) db_optr ::= db_optr keep */
210, /* (119) db_optr ::= db_optr update */
210, /* (120) db_optr ::= db_optr cachelast */
211, /* (121) topic_optr ::= db_optr */
211, /* (122) topic_optr ::= topic_optr partitions */
205, /* (123) alter_db_optr ::= */
205, /* (124) alter_db_optr ::= alter_db_optr replica */
205, /* (125) alter_db_optr ::= alter_db_optr quorum */
205, /* (126) alter_db_optr ::= alter_db_optr keep */
205, /* (127) alter_db_optr ::= alter_db_optr blocks */
205, /* (128) alter_db_optr ::= alter_db_optr comp */
205, /* (129) alter_db_optr ::= alter_db_optr update */
205, /* (130) alter_db_optr ::= alter_db_optr cachelast */
206, /* (131) alter_topic_optr ::= alter_db_optr */
206, /* (132) alter_topic_optr ::= alter_topic_optr partitions */
212, /* (133) typename ::= ids */
212, /* (134) typename ::= ids LP signed RP */
212, /* (135) typename ::= ids UNSIGNED */
241, /* (136) signed ::= INTEGER */
241, /* (137) signed ::= PLUS INTEGER */
241, /* (138) signed ::= MINUS INTEGER */
200, /* (139) cmd ::= CREATE TABLE create_table_args */
200, /* (140) cmd ::= CREATE TABLE create_stable_args */
200, /* (141) cmd ::= CREATE STABLE create_stable_args */
200, /* (142) cmd ::= CREATE TABLE create_table_list */
244, /* (143) create_table_list ::= create_from_stable */
244, /* (144) create_table_list ::= create_table_list create_from_stable */
242, /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
243, /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
245, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
245, /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
248, /* (149) tagNamelist ::= tagNamelist COMMA ids */
248, /* (150) tagNamelist ::= ids */
242, /* (151) create_table_args ::= ifnotexists ids cpxName AS select */
246, /* (152) columnlist ::= columnlist COMMA column */
246, /* (153) columnlist ::= column */
250, /* (154) column ::= ids typename */
247, /* (155) tagitemlist ::= tagitemlist COMMA tagitem */
247, /* (156) tagitemlist ::= tagitem */
251, /* (157) tagitem ::= INTEGER */
251, /* (158) tagitem ::= FLOAT */
251, /* (159) tagitem ::= STRING */
251, /* (160) tagitem ::= BOOL */
251, /* (161) tagitem ::= NULL */
251, /* (162) tagitem ::= NOW */
251, /* (163) tagitem ::= MINUS INTEGER */
251, /* (164) tagitem ::= MINUS FLOAT */
251, /* (165) tagitem ::= PLUS INTEGER */
251, /* (166) tagitem ::= PLUS FLOAT */
249, /* (167) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
249, /* (168) select ::= LP select RP */
266, /* (169) union ::= select */
266, /* (170) union ::= union UNION ALL select */
200, /* (171) cmd ::= union */
249, /* (172) select ::= SELECT selcollist */
267, /* (173) sclp ::= selcollist COMMA */
267, /* (174) sclp ::= */
252, /* (175) selcollist ::= sclp distinct expr as */
252, /* (176) selcollist ::= sclp STAR */
270, /* (177) as ::= AS ids */
270, /* (178) as ::= ids */
270, /* (179) as ::= */
268, /* (180) distinct ::= DISTINCT */
268, /* (181) distinct ::= */
253, /* (182) from ::= FROM tablelist */
253, /* (183) from ::= FROM sub */
272, /* (184) sub ::= LP union RP */
272, /* (185) sub ::= LP union RP ids */
272, /* (186) sub ::= sub COMMA LP union RP ids */
271, /* (187) tablelist ::= ids cpxName */
271, /* (188) tablelist ::= ids cpxName ids */
271, /* (189) tablelist ::= tablelist COMMA ids cpxName */
271, /* (190) tablelist ::= tablelist COMMA ids cpxName ids */
273, /* (191) tmvar ::= VARIABLE */
274, /* (192) timestamp ::= INTEGER */
274, /* (193) timestamp ::= MINUS INTEGER */
274, /* (194) timestamp ::= PLUS INTEGER */
274, /* (195) timestamp ::= STRING */
274, /* (196) timestamp ::= NOW */
274, /* (197) timestamp ::= NOW PLUS VARIABLE */
274, /* (198) timestamp ::= NOW MINUS VARIABLE */
255, /* (199) range_option ::= */
255, /* (200) range_option ::= RANGE LP timestamp COMMA timestamp RP */
256, /* (201) interval_option ::= intervalKey LP tmvar RP */
256, /* (202) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
256, /* (203) interval_option ::= */
275, /* (204) intervalKey ::= INTERVAL */
275, /* (205) intervalKey ::= EVERY */
258, /* (206) session_option ::= */
258, /* (207) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
259, /* (208) windowstate_option ::= */
259, /* (209) windowstate_option ::= STATE_WINDOW LP ids RP */
260, /* (210) fill_opt ::= */
260, /* (211) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
260, /* (212) fill_opt ::= FILL LP ID RP */
257, /* (213) sliding_opt ::= SLIDING LP tmvar RP */
257, /* (214) sliding_opt ::= */
263, /* (215) orderby_opt ::= */
263, /* (216) orderby_opt ::= ORDER BY sortlist */
276, /* (217) sortlist ::= sortlist COMMA item sortorder */
276, /* (218) sortlist ::= item sortorder */
278, /* (219) item ::= ids cpxName */
279, /* (220) sortorder ::= ASC */
279, /* (221) sortorder ::= DESC */
279, /* (222) sortorder ::= */
261, /* (223) groupby_opt ::= */
261, /* (224) groupby_opt ::= GROUP BY grouplist */
280, /* (225) grouplist ::= grouplist COMMA item */
280, /* (226) grouplist ::= item */
262, /* (227) having_opt ::= */
262, /* (228) having_opt ::= HAVING expr */
265, /* (229) limit_opt ::= */
265, /* (230) limit_opt ::= LIMIT signed */
265, /* (231) limit_opt ::= LIMIT signed OFFSET signed */
265, /* (232) limit_opt ::= LIMIT signed COMMA signed */
264, /* (233) slimit_opt ::= */
264, /* (234) slimit_opt ::= SLIMIT signed */
264, /* (235) slimit_opt ::= SLIMIT signed SOFFSET signed */
264, /* (236) slimit_opt ::= SLIMIT signed COMMA signed */
254, /* (237) where_opt ::= */
254, /* (238) where_opt ::= WHERE expr */
269, /* (239) expr ::= LP expr RP */
269, /* (240) expr ::= ID */
269, /* (241) expr ::= ID DOT ID */
269, /* (242) expr ::= ID DOT STAR */
269, /* (243) expr ::= INTEGER */
269, /* (244) expr ::= MINUS INTEGER */
269, /* (245) expr ::= PLUS INTEGER */
269, /* (246) expr ::= FLOAT */
269, /* (247) expr ::= MINUS FLOAT */
269, /* (248) expr ::= PLUS FLOAT */
269, /* (249) expr ::= STRING */
269, /* (250) expr ::= NOW */
269, /* (251) expr ::= VARIABLE */
269, /* (252) expr ::= PLUS VARIABLE */
269, /* (253) expr ::= MINUS VARIABLE */
269, /* (254) expr ::= BOOL */
269, /* (255) expr ::= NULL */
269, /* (256) expr ::= ID LP exprlist RP */
269, /* (257) expr ::= ID LP STAR RP */
269, /* (258) expr ::= expr IS NULL */
269, /* (259) expr ::= expr IS NOT NULL */
269, /* (260) expr ::= expr LT expr */
269, /* (261) expr ::= expr GT expr */
269, /* (262) expr ::= expr LE expr */
269, /* (263) expr ::= expr GE expr */
269, /* (264) expr ::= expr NE expr */
269, /* (265) expr ::= expr EQ expr */
269, /* (266) expr ::= expr BETWEEN expr AND expr */
269, /* (267) expr ::= expr AND expr */
269, /* (268) expr ::= expr OR expr */
269, /* (269) expr ::= expr PLUS expr */
269, /* (270) expr ::= expr MINUS expr */
269, /* (271) expr ::= expr STAR expr */
269, /* (272) expr ::= expr SLASH expr */
269, /* (273) expr ::= expr REM expr */
269, /* (274) expr ::= expr LIKE expr */
269, /* (275) expr ::= expr MATCH expr */
269, /* (276) expr ::= expr NMATCH expr */
269, /* (277) expr ::= expr IN LP exprlist RP */
208, /* (278) exprlist ::= exprlist COMMA expritem */
208, /* (279) exprlist ::= expritem */
281, /* (280) expritem ::= expr */
281, /* (281) expritem ::= */
200, /* (282) cmd ::= RESET QUERY CACHE */
200, /* (283) cmd ::= SYNCDB ids REPLICA */
200, /* (284) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
200, /* (285) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
200, /* (286) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
200, /* (287) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
200, /* (288) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
200, /* (289) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
200, /* (290) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
200, /* (291) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
200, /* (292) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
200, /* (293) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
200, /* (294) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
200, /* (295) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
200, /* (296) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
200, /* (297) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
200, /* (298) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
200, /* (299) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
200, /* (300) cmd ::= KILL CONNECTION INTEGER */
200, /* (301) cmd ::= KILL STREAM INTEGER COLON INTEGER */
200, /* (302) cmd ::= KILL QUERY INTEGER COLON INTEGER */
200, /* (29) cmd ::= DROP TABLE ifexists ids cpxName */
200, /* (30) cmd ::= DROP STABLE ifexists ids cpxName */
200, /* (31) cmd ::= DROP DATABASE ifexists ids */
200, /* (32) cmd ::= DROP TOPIC ifexists ids */
200, /* (33) cmd ::= DROP FUNCTION ids */
200, /* (34) cmd ::= DROP DNODE ids */
200, /* (35) cmd ::= DROP USER ids */
200, /* (36) cmd ::= DROP ACCOUNT ids */
200, /* (37) cmd ::= USE ids */
200, /* (38) cmd ::= DESCRIBE ids cpxName */
200, /* (39) cmd ::= DESC ids cpxName */
200, /* (40) cmd ::= ALTER USER ids PASS ids */
200, /* (41) cmd ::= ALTER USER ids PRIVILEGE ids */
200, /* (42) cmd ::= ALTER DNODE ids ids */
200, /* (43) cmd ::= ALTER DNODE ids ids ids */
200, /* (44) cmd ::= ALTER LOCAL ids */
200, /* (45) cmd ::= ALTER LOCAL ids ids */
200, /* (46) cmd ::= ALTER DATABASE ids alter_db_optr */
200, /* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */
200, /* (48) cmd ::= ALTER ACCOUNT ids acct_optr */
200, /* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
200, /* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */
201, /* (51) ids ::= ID */
201, /* (52) ids ::= STRING */
204, /* (53) ifexists ::= IF EXISTS */
204, /* (54) ifexists ::= */
209, /* (55) ifnotexists ::= IF NOT EXISTS */
209, /* (56) ifnotexists ::= */
200, /* (57) cmd ::= CREATE DNODE ids */
200, /* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
200, /* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
200, /* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
200, /* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
200, /* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
200, /* (63) cmd ::= CREATE USER ids PASS ids */
213, /* (64) bufsize ::= */
213, /* (65) bufsize ::= BUFSIZE INTEGER */
214, /* (66) pps ::= */
214, /* (67) pps ::= PPS INTEGER */
215, /* (68) tseries ::= */
215, /* (69) tseries ::= TSERIES INTEGER */
216, /* (70) dbs ::= */
216, /* (71) dbs ::= DBS INTEGER */
217, /* (72) streams ::= */
217, /* (73) streams ::= STREAMS INTEGER */
218, /* (74) storage ::= */
218, /* (75) storage ::= STORAGE INTEGER */
219, /* (76) qtime ::= */
219, /* (77) qtime ::= QTIME INTEGER */
220, /* (78) users ::= */
220, /* (79) users ::= USERS INTEGER */
221, /* (80) conns ::= */
221, /* (81) conns ::= CONNS INTEGER */
222, /* (82) state ::= */
222, /* (83) state ::= STATE ids */
207, /* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
223, /* (85) intitemlist ::= intitemlist COMMA intitem */
223, /* (86) intitemlist ::= intitem */
224, /* (87) intitem ::= INTEGER */
225, /* (88) keep ::= KEEP intitemlist */
226, /* (89) cache ::= CACHE INTEGER */
227, /* (90) replica ::= REPLICA INTEGER */
228, /* (91) quorum ::= QUORUM INTEGER */
229, /* (92) days ::= DAYS INTEGER */
230, /* (93) minrows ::= MINROWS INTEGER */
231, /* (94) maxrows ::= MAXROWS INTEGER */
232, /* (95) blocks ::= BLOCKS INTEGER */
233, /* (96) ctime ::= CTIME INTEGER */
234, /* (97) wal ::= WAL INTEGER */
235, /* (98) fsync ::= FSYNC INTEGER */
236, /* (99) comp ::= COMP INTEGER */
237, /* (100) prec ::= PRECISION STRING */
238, /* (101) update ::= UPDATE INTEGER */
239, /* (102) cachelast ::= CACHELAST INTEGER */
240, /* (103) partitions ::= PARTITIONS INTEGER */
210, /* (104) db_optr ::= */
210, /* (105) db_optr ::= db_optr cache */
210, /* (106) db_optr ::= db_optr replica */
210, /* (107) db_optr ::= db_optr quorum */
210, /* (108) db_optr ::= db_optr days */
210, /* (109) db_optr ::= db_optr minrows */
210, /* (110) db_optr ::= db_optr maxrows */
210, /* (111) db_optr ::= db_optr blocks */
210, /* (112) db_optr ::= db_optr ctime */
210, /* (113) db_optr ::= db_optr wal */
210, /* (114) db_optr ::= db_optr fsync */
210, /* (115) db_optr ::= db_optr comp */
210, /* (116) db_optr ::= db_optr prec */
210, /* (117) db_optr ::= db_optr keep */
210, /* (118) db_optr ::= db_optr update */
210, /* (119) db_optr ::= db_optr cachelast */
211, /* (120) topic_optr ::= db_optr */
211, /* (121) topic_optr ::= topic_optr partitions */
205, /* (122) alter_db_optr ::= */
205, /* (123) alter_db_optr ::= alter_db_optr replica */
205, /* (124) alter_db_optr ::= alter_db_optr quorum */
205, /* (125) alter_db_optr ::= alter_db_optr keep */
205, /* (126) alter_db_optr ::= alter_db_optr blocks */
205, /* (127) alter_db_optr ::= alter_db_optr comp */
205, /* (128) alter_db_optr ::= alter_db_optr update */
205, /* (129) alter_db_optr ::= alter_db_optr cachelast */
206, /* (130) alter_topic_optr ::= alter_db_optr */
206, /* (131) alter_topic_optr ::= alter_topic_optr partitions */
212, /* (132) typename ::= ids */
212, /* (133) typename ::= ids LP signed RP */
212, /* (134) typename ::= ids UNSIGNED */
241, /* (135) signed ::= INTEGER */
241, /* (136) signed ::= PLUS INTEGER */
241, /* (137) signed ::= MINUS INTEGER */
200, /* (138) cmd ::= CREATE TABLE create_table_args */
200, /* (139) cmd ::= CREATE TABLE create_stable_args */
200, /* (140) cmd ::= CREATE STABLE create_stable_args */
200, /* (141) cmd ::= CREATE TABLE create_table_list */
244, /* (142) create_table_list ::= create_from_stable */
244, /* (143) create_table_list ::= create_table_list create_from_stable */
242, /* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
243, /* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
245, /* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
245, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
248, /* (148) tagNamelist ::= tagNamelist COMMA ids */
248, /* (149) tagNamelist ::= ids */
242, /* (150) create_table_args ::= ifnotexists ids cpxName AS select */
246, /* (151) columnlist ::= columnlist COMMA column */
246, /* (152) columnlist ::= column */
250, /* (153) column ::= ids typename */
247, /* (154) tagitemlist ::= tagitemlist COMMA tagitem */
247, /* (155) tagitemlist ::= tagitem */
251, /* (156) tagitem ::= INTEGER */
251, /* (157) tagitem ::= FLOAT */
251, /* (158) tagitem ::= STRING */
251, /* (159) tagitem ::= BOOL */
251, /* (160) tagitem ::= NULL */
251, /* (161) tagitem ::= NOW */
251, /* (162) tagitem ::= MINUS INTEGER */
251, /* (163) tagitem ::= MINUS FLOAT */
251, /* (164) tagitem ::= PLUS INTEGER */
251, /* (165) tagitem ::= PLUS FLOAT */
249, /* (166) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
249, /* (167) select ::= LP select RP */
266, /* (168) union ::= select */
266, /* (169) union ::= union UNION ALL select */
200, /* (170) cmd ::= union */
249, /* (171) select ::= SELECT selcollist */
267, /* (172) sclp ::= selcollist COMMA */
267, /* (173) sclp ::= */
252, /* (174) selcollist ::= sclp distinct expr as */
252, /* (175) selcollist ::= sclp STAR */
270, /* (176) as ::= AS ids */
270, /* (177) as ::= ids */
270, /* (178) as ::= */
268, /* (179) distinct ::= DISTINCT */
268, /* (180) distinct ::= */
253, /* (181) from ::= FROM tablelist */
253, /* (182) from ::= FROM sub */
272, /* (183) sub ::= LP union RP */
272, /* (184) sub ::= LP union RP ids */
272, /* (185) sub ::= sub COMMA LP union RP ids */
271, /* (186) tablelist ::= ids cpxName */
271, /* (187) tablelist ::= ids cpxName ids */
271, /* (188) tablelist ::= tablelist COMMA ids cpxName */
271, /* (189) tablelist ::= tablelist COMMA ids cpxName ids */
273, /* (190) tmvar ::= VARIABLE */
274, /* (191) timestamp ::= INTEGER */
274, /* (192) timestamp ::= MINUS INTEGER */
274, /* (193) timestamp ::= PLUS INTEGER */
274, /* (194) timestamp ::= STRING */
274, /* (195) timestamp ::= NOW */
274, /* (196) timestamp ::= NOW PLUS VARIABLE */
274, /* (197) timestamp ::= NOW MINUS VARIABLE */
255, /* (198) range_option ::= */
255, /* (199) range_option ::= RANGE LP timestamp COMMA timestamp RP */
256, /* (200) interval_option ::= intervalKey LP tmvar RP */
256, /* (201) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
256, /* (202) interval_option ::= */
275, /* (203) intervalKey ::= INTERVAL */
275, /* (204) intervalKey ::= EVERY */
258, /* (205) session_option ::= */
258, /* (206) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
259, /* (207) windowstate_option ::= */
259, /* (208) windowstate_option ::= STATE_WINDOW LP ids RP */
260, /* (209) fill_opt ::= */
260, /* (210) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
260, /* (211) fill_opt ::= FILL LP ID RP */
257, /* (212) sliding_opt ::= SLIDING LP tmvar RP */
257, /* (213) sliding_opt ::= */
263, /* (214) orderby_opt ::= */
263, /* (215) orderby_opt ::= ORDER BY sortlist */
276, /* (216) sortlist ::= sortlist COMMA item sortorder */
276, /* (217) sortlist ::= item sortorder */
278, /* (218) item ::= ids cpxName */
279, /* (219) sortorder ::= ASC */
279, /* (220) sortorder ::= DESC */
279, /* (221) sortorder ::= */
261, /* (222) groupby_opt ::= */
261, /* (223) groupby_opt ::= GROUP BY grouplist */
280, /* (224) grouplist ::= grouplist COMMA item */
280, /* (225) grouplist ::= item */
262, /* (226) having_opt ::= */
262, /* (227) having_opt ::= HAVING expr */
265, /* (228) limit_opt ::= */
265, /* (229) limit_opt ::= LIMIT signed */
265, /* (230) limit_opt ::= LIMIT signed OFFSET signed */
265, /* (231) limit_opt ::= LIMIT signed COMMA signed */
264, /* (232) slimit_opt ::= */
264, /* (233) slimit_opt ::= SLIMIT signed */
264, /* (234) slimit_opt ::= SLIMIT signed SOFFSET signed */
264, /* (235) slimit_opt ::= SLIMIT signed COMMA signed */
254, /* (236) where_opt ::= */
254, /* (237) where_opt ::= WHERE expr */
269, /* (238) expr ::= LP expr RP */
269, /* (239) expr ::= ID */
269, /* (240) expr ::= ID DOT ID */
269, /* (241) expr ::= ID DOT STAR */
269, /* (242) expr ::= INTEGER */
269, /* (243) expr ::= MINUS INTEGER */
269, /* (244) expr ::= PLUS INTEGER */
269, /* (245) expr ::= FLOAT */
269, /* (246) expr ::= MINUS FLOAT */
269, /* (247) expr ::= PLUS FLOAT */
269, /* (248) expr ::= STRING */
269, /* (249) expr ::= NOW */
269, /* (250) expr ::= VARIABLE */
269, /* (251) expr ::= PLUS VARIABLE */
269, /* (252) expr ::= MINUS VARIABLE */
269, /* (253) expr ::= BOOL */
269, /* (254) expr ::= NULL */
269, /* (255) expr ::= ID LP exprlist RP */
269, /* (256) expr ::= ID LP STAR RP */
269, /* (257) expr ::= expr IS NULL */
269, /* (258) expr ::= expr IS NOT NULL */
269, /* (259) expr ::= expr LT expr */
269, /* (260) expr ::= expr GT expr */
269, /* (261) expr ::= expr LE expr */
269, /* (262) expr ::= expr GE expr */
269, /* (263) expr ::= expr NE expr */
269, /* (264) expr ::= expr EQ expr */
269, /* (265) expr ::= expr BETWEEN expr AND expr */
269, /* (266) expr ::= expr AND expr */
269, /* (267) expr ::= expr OR expr */
269, /* (268) expr ::= expr PLUS expr */
269, /* (269) expr ::= expr MINUS expr */
269, /* (270) expr ::= expr STAR expr */
269, /* (271) expr ::= expr SLASH expr */
269, /* (272) expr ::= expr REM expr */
269, /* (273) expr ::= expr LIKE expr */
269, /* (274) expr ::= expr MATCH expr */
269, /* (275) expr ::= expr NMATCH expr */
269, /* (276) expr ::= expr IN LP exprlist RP */
208, /* (277) exprlist ::= exprlist COMMA expritem */
208, /* (278) exprlist ::= expritem */
281, /* (279) expritem ::= expr */
281, /* (280) expritem ::= */
200, /* (281) cmd ::= RESET QUERY CACHE */
200, /* (282) cmd ::= SYNCDB ids REPLICA */
200, /* (283) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
200, /* (284) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
200, /* (285) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
200, /* (286) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
200, /* (287) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
200, /* (288) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
200, /* (289) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
200, /* (290) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
200, /* (291) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
200, /* (292) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
200, /* (293) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
200, /* (294) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
200, /* (295) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
200, /* (296) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
200, /* (297) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
200, /* (298) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
200, /* (299) cmd ::= KILL CONNECTION INTEGER */
200, /* (300) cmd ::= KILL STREAM INTEGER COLON INTEGER */
200, /* (301) cmd ::= KILL QUERY INTEGER COLON INTEGER */
};
/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
......@@ -2211,280 +2208,279 @@ static const signed char yyRuleInfoNRhs[] = {
-3, /* (26) cmd ::= SHOW dbPrefix STABLES */
-5, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */
-3, /* (28) cmd ::= SHOW dbPrefix VGROUPS */
-4, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */
-5, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */
-5, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */
-4, /* (32) cmd ::= DROP DATABASE ifexists ids */
-4, /* (33) cmd ::= DROP TOPIC ifexists ids */
-3, /* (34) cmd ::= DROP FUNCTION ids */
-3, /* (35) cmd ::= DROP DNODE ids */
-3, /* (36) cmd ::= DROP USER ids */
-3, /* (37) cmd ::= DROP ACCOUNT ids */
-2, /* (38) cmd ::= USE ids */
-3, /* (39) cmd ::= DESCRIBE ids cpxName */
-3, /* (40) cmd ::= DESC ids cpxName */
-5, /* (41) cmd ::= ALTER USER ids PASS ids */
-5, /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */
-4, /* (43) cmd ::= ALTER DNODE ids ids */
-5, /* (44) cmd ::= ALTER DNODE ids ids ids */
-3, /* (45) cmd ::= ALTER LOCAL ids */
-4, /* (46) cmd ::= ALTER LOCAL ids ids */
-4, /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */
-4, /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */
-4, /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */
-6, /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
-6, /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */
-1, /* (52) ids ::= ID */
-1, /* (53) ids ::= STRING */
-2, /* (54) ifexists ::= IF EXISTS */
0, /* (55) ifexists ::= */
-3, /* (56) ifnotexists ::= IF NOT EXISTS */
0, /* (57) ifnotexists ::= */
-3, /* (58) cmd ::= CREATE DNODE ids */
-6, /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
-5, /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
-5, /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
-8, /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
-9, /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
-5, /* (64) cmd ::= CREATE USER ids PASS ids */
0, /* (65) bufsize ::= */
-2, /* (66) bufsize ::= BUFSIZE INTEGER */
0, /* (67) pps ::= */
-2, /* (68) pps ::= PPS INTEGER */
0, /* (69) tseries ::= */
-2, /* (70) tseries ::= TSERIES INTEGER */
0, /* (71) dbs ::= */
-2, /* (72) dbs ::= DBS INTEGER */
0, /* (73) streams ::= */
-2, /* (74) streams ::= STREAMS INTEGER */
0, /* (75) storage ::= */
-2, /* (76) storage ::= STORAGE INTEGER */
0, /* (77) qtime ::= */
-2, /* (78) qtime ::= QTIME INTEGER */
0, /* (79) users ::= */
-2, /* (80) users ::= USERS INTEGER */
0, /* (81) conns ::= */
-2, /* (82) conns ::= CONNS INTEGER */
0, /* (83) state ::= */
-2, /* (84) state ::= STATE ids */
-9, /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
-3, /* (86) intitemlist ::= intitemlist COMMA intitem */
-1, /* (87) intitemlist ::= intitem */
-1, /* (88) intitem ::= INTEGER */
-2, /* (89) keep ::= KEEP intitemlist */
-2, /* (90) cache ::= CACHE INTEGER */
-2, /* (91) replica ::= REPLICA INTEGER */
-2, /* (92) quorum ::= QUORUM INTEGER */
-2, /* (93) days ::= DAYS INTEGER */
-2, /* (94) minrows ::= MINROWS INTEGER */
-2, /* (95) maxrows ::= MAXROWS INTEGER */
-2, /* (96) blocks ::= BLOCKS INTEGER */
-2, /* (97) ctime ::= CTIME INTEGER */
-2, /* (98) wal ::= WAL INTEGER */
-2, /* (99) fsync ::= FSYNC INTEGER */
-2, /* (100) comp ::= COMP INTEGER */
-2, /* (101) prec ::= PRECISION STRING */
-2, /* (102) update ::= UPDATE INTEGER */
-2, /* (103) cachelast ::= CACHELAST INTEGER */
-2, /* (104) partitions ::= PARTITIONS INTEGER */
0, /* (105) db_optr ::= */
-2, /* (106) db_optr ::= db_optr cache */
-2, /* (107) db_optr ::= db_optr replica */
-2, /* (108) db_optr ::= db_optr quorum */
-2, /* (109) db_optr ::= db_optr days */
-2, /* (110) db_optr ::= db_optr minrows */
-2, /* (111) db_optr ::= db_optr maxrows */
-2, /* (112) db_optr ::= db_optr blocks */
-2, /* (113) db_optr ::= db_optr ctime */
-2, /* (114) db_optr ::= db_optr wal */
-2, /* (115) db_optr ::= db_optr fsync */
-2, /* (116) db_optr ::= db_optr comp */
-2, /* (117) db_optr ::= db_optr prec */
-2, /* (118) db_optr ::= db_optr keep */
-2, /* (119) db_optr ::= db_optr update */
-2, /* (120) db_optr ::= db_optr cachelast */
-1, /* (121) topic_optr ::= db_optr */
-2, /* (122) topic_optr ::= topic_optr partitions */
0, /* (123) alter_db_optr ::= */
-2, /* (124) alter_db_optr ::= alter_db_optr replica */
-2, /* (125) alter_db_optr ::= alter_db_optr quorum */
-2, /* (126) alter_db_optr ::= alter_db_optr keep */
-2, /* (127) alter_db_optr ::= alter_db_optr blocks */
-2, /* (128) alter_db_optr ::= alter_db_optr comp */
-2, /* (129) alter_db_optr ::= alter_db_optr update */
-2, /* (130) alter_db_optr ::= alter_db_optr cachelast */
-1, /* (131) alter_topic_optr ::= alter_db_optr */
-2, /* (132) alter_topic_optr ::= alter_topic_optr partitions */
-1, /* (133) typename ::= ids */
-4, /* (134) typename ::= ids LP signed RP */
-2, /* (135) typename ::= ids UNSIGNED */
-1, /* (136) signed ::= INTEGER */
-2, /* (137) signed ::= PLUS INTEGER */
-2, /* (138) signed ::= MINUS INTEGER */
-3, /* (139) cmd ::= CREATE TABLE create_table_args */
-3, /* (140) cmd ::= CREATE TABLE create_stable_args */
-3, /* (141) cmd ::= CREATE STABLE create_stable_args */
-3, /* (142) cmd ::= CREATE TABLE create_table_list */
-1, /* (143) create_table_list ::= create_from_stable */
-2, /* (144) create_table_list ::= create_table_list create_from_stable */
-6, /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
-10, /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
-10, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
-13, /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
-3, /* (149) tagNamelist ::= tagNamelist COMMA ids */
-1, /* (150) tagNamelist ::= ids */
-5, /* (151) create_table_args ::= ifnotexists ids cpxName AS select */
-3, /* (152) columnlist ::= columnlist COMMA column */
-1, /* (153) columnlist ::= column */
-2, /* (154) column ::= ids typename */
-3, /* (155) tagitemlist ::= tagitemlist COMMA tagitem */
-1, /* (156) tagitemlist ::= tagitem */
-1, /* (157) tagitem ::= INTEGER */
-1, /* (158) tagitem ::= FLOAT */
-1, /* (159) tagitem ::= STRING */
-1, /* (160) tagitem ::= BOOL */
-1, /* (161) tagitem ::= NULL */
-1, /* (162) tagitem ::= NOW */
-2, /* (163) tagitem ::= MINUS INTEGER */
-2, /* (164) tagitem ::= MINUS FLOAT */
-2, /* (165) tagitem ::= PLUS INTEGER */
-2, /* (166) tagitem ::= PLUS FLOAT */
-15, /* (167) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
-3, /* (168) select ::= LP select RP */
-1, /* (169) union ::= select */
-4, /* (170) union ::= union UNION ALL select */
-1, /* (171) cmd ::= union */
-2, /* (172) select ::= SELECT selcollist */
-2, /* (173) sclp ::= selcollist COMMA */
0, /* (174) sclp ::= */
-4, /* (175) selcollist ::= sclp distinct expr as */
-2, /* (176) selcollist ::= sclp STAR */
-2, /* (177) as ::= AS ids */
-1, /* (178) as ::= ids */
0, /* (179) as ::= */
-1, /* (180) distinct ::= DISTINCT */
0, /* (181) distinct ::= */
-2, /* (182) from ::= FROM tablelist */
-2, /* (183) from ::= FROM sub */
-3, /* (184) sub ::= LP union RP */
-4, /* (185) sub ::= LP union RP ids */
-6, /* (186) sub ::= sub COMMA LP union RP ids */
-2, /* (187) tablelist ::= ids cpxName */
-3, /* (188) tablelist ::= ids cpxName ids */
-4, /* (189) tablelist ::= tablelist COMMA ids cpxName */
-5, /* (190) tablelist ::= tablelist COMMA ids cpxName ids */
-1, /* (191) tmvar ::= VARIABLE */
-1, /* (192) timestamp ::= INTEGER */
-2, /* (193) timestamp ::= MINUS INTEGER */
-2, /* (194) timestamp ::= PLUS INTEGER */
-1, /* (195) timestamp ::= STRING */
-1, /* (196) timestamp ::= NOW */
-3, /* (197) timestamp ::= NOW PLUS VARIABLE */
-3, /* (198) timestamp ::= NOW MINUS VARIABLE */
0, /* (199) range_option ::= */
-6, /* (200) range_option ::= RANGE LP timestamp COMMA timestamp RP */
-4, /* (201) interval_option ::= intervalKey LP tmvar RP */
-6, /* (202) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
0, /* (203) interval_option ::= */
-1, /* (204) intervalKey ::= INTERVAL */
-1, /* (205) intervalKey ::= EVERY */
0, /* (206) session_option ::= */
-7, /* (207) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
0, /* (208) windowstate_option ::= */
-4, /* (209) windowstate_option ::= STATE_WINDOW LP ids RP */
0, /* (210) fill_opt ::= */
-6, /* (211) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
-4, /* (212) fill_opt ::= FILL LP ID RP */
-4, /* (213) sliding_opt ::= SLIDING LP tmvar RP */
0, /* (214) sliding_opt ::= */
0, /* (215) orderby_opt ::= */
-3, /* (216) orderby_opt ::= ORDER BY sortlist */
-4, /* (217) sortlist ::= sortlist COMMA item sortorder */
-2, /* (218) sortlist ::= item sortorder */
-2, /* (219) item ::= ids cpxName */
-1, /* (220) sortorder ::= ASC */
-1, /* (221) sortorder ::= DESC */
0, /* (222) sortorder ::= */
0, /* (223) groupby_opt ::= */
-3, /* (224) groupby_opt ::= GROUP BY grouplist */
-3, /* (225) grouplist ::= grouplist COMMA item */
-1, /* (226) grouplist ::= item */
0, /* (227) having_opt ::= */
-2, /* (228) having_opt ::= HAVING expr */
0, /* (229) limit_opt ::= */
-2, /* (230) limit_opt ::= LIMIT signed */
-4, /* (231) limit_opt ::= LIMIT signed OFFSET signed */
-4, /* (232) limit_opt ::= LIMIT signed COMMA signed */
0, /* (233) slimit_opt ::= */
-2, /* (234) slimit_opt ::= SLIMIT signed */
-4, /* (235) slimit_opt ::= SLIMIT signed SOFFSET signed */
-4, /* (236) slimit_opt ::= SLIMIT signed COMMA signed */
0, /* (237) where_opt ::= */
-2, /* (238) where_opt ::= WHERE expr */
-3, /* (239) expr ::= LP expr RP */
-1, /* (240) expr ::= ID */
-3, /* (241) expr ::= ID DOT ID */
-3, /* (242) expr ::= ID DOT STAR */
-1, /* (243) expr ::= INTEGER */
-2, /* (244) expr ::= MINUS INTEGER */
-2, /* (245) expr ::= PLUS INTEGER */
-1, /* (246) expr ::= FLOAT */
-2, /* (247) expr ::= MINUS FLOAT */
-2, /* (248) expr ::= PLUS FLOAT */
-1, /* (249) expr ::= STRING */
-1, /* (250) expr ::= NOW */
-1, /* (251) expr ::= VARIABLE */
-2, /* (252) expr ::= PLUS VARIABLE */
-2, /* (253) expr ::= MINUS VARIABLE */
-1, /* (254) expr ::= BOOL */
-1, /* (255) expr ::= NULL */
-4, /* (256) expr ::= ID LP exprlist RP */
-4, /* (257) expr ::= ID LP STAR RP */
-3, /* (258) expr ::= expr IS NULL */
-4, /* (259) expr ::= expr IS NOT NULL */
-3, /* (260) expr ::= expr LT expr */
-3, /* (261) expr ::= expr GT expr */
-3, /* (262) expr ::= expr LE expr */
-3, /* (263) expr ::= expr GE expr */
-3, /* (264) expr ::= expr NE expr */
-3, /* (265) expr ::= expr EQ expr */
-5, /* (266) expr ::= expr BETWEEN expr AND expr */
-3, /* (267) expr ::= expr AND expr */
-3, /* (268) expr ::= expr OR expr */
-3, /* (269) expr ::= expr PLUS expr */
-3, /* (270) expr ::= expr MINUS expr */
-3, /* (271) expr ::= expr STAR expr */
-3, /* (272) expr ::= expr SLASH expr */
-3, /* (273) expr ::= expr REM expr */
-3, /* (274) expr ::= expr LIKE expr */
-3, /* (275) expr ::= expr MATCH expr */
-3, /* (276) expr ::= expr NMATCH expr */
-5, /* (277) expr ::= expr IN LP exprlist RP */
-3, /* (278) exprlist ::= exprlist COMMA expritem */
-1, /* (279) exprlist ::= expritem */
-1, /* (280) expritem ::= expr */
0, /* (281) expritem ::= */
-3, /* (282) cmd ::= RESET QUERY CACHE */
-3, /* (283) cmd ::= SYNCDB ids REPLICA */
-7, /* (284) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
-7, /* (285) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
-7, /* (286) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
-7, /* (287) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
-7, /* (288) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
-8, /* (289) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
-9, /* (290) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
-7, /* (291) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
-7, /* (292) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
-7, /* (293) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
-7, /* (294) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
-7, /* (295) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
-7, /* (296) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
-8, /* (297) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
-9, /* (298) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
-7, /* (299) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
-3, /* (300) cmd ::= KILL CONNECTION INTEGER */
-5, /* (301) cmd ::= KILL STREAM INTEGER COLON INTEGER */
-5, /* (302) cmd ::= KILL QUERY INTEGER COLON INTEGER */
-5, /* (29) cmd ::= DROP TABLE ifexists ids cpxName */
-5, /* (30) cmd ::= DROP STABLE ifexists ids cpxName */
-4, /* (31) cmd ::= DROP DATABASE ifexists ids */
-4, /* (32) cmd ::= DROP TOPIC ifexists ids */
-3, /* (33) cmd ::= DROP FUNCTION ids */
-3, /* (34) cmd ::= DROP DNODE ids */
-3, /* (35) cmd ::= DROP USER ids */
-3, /* (36) cmd ::= DROP ACCOUNT ids */
-2, /* (37) cmd ::= USE ids */
-3, /* (38) cmd ::= DESCRIBE ids cpxName */
-3, /* (39) cmd ::= DESC ids cpxName */
-5, /* (40) cmd ::= ALTER USER ids PASS ids */
-5, /* (41) cmd ::= ALTER USER ids PRIVILEGE ids */
-4, /* (42) cmd ::= ALTER DNODE ids ids */
-5, /* (43) cmd ::= ALTER DNODE ids ids ids */
-3, /* (44) cmd ::= ALTER LOCAL ids */
-4, /* (45) cmd ::= ALTER LOCAL ids ids */
-4, /* (46) cmd ::= ALTER DATABASE ids alter_db_optr */
-4, /* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */
-4, /* (48) cmd ::= ALTER ACCOUNT ids acct_optr */
-6, /* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
-6, /* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */
-1, /* (51) ids ::= ID */
-1, /* (52) ids ::= STRING */
-2, /* (53) ifexists ::= IF EXISTS */
0, /* (54) ifexists ::= */
-3, /* (55) ifnotexists ::= IF NOT EXISTS */
0, /* (56) ifnotexists ::= */
-3, /* (57) cmd ::= CREATE DNODE ids */
-6, /* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
-5, /* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
-5, /* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
-8, /* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
-9, /* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
-5, /* (63) cmd ::= CREATE USER ids PASS ids */
0, /* (64) bufsize ::= */
-2, /* (65) bufsize ::= BUFSIZE INTEGER */
0, /* (66) pps ::= */
-2, /* (67) pps ::= PPS INTEGER */
0, /* (68) tseries ::= */
-2, /* (69) tseries ::= TSERIES INTEGER */
0, /* (70) dbs ::= */
-2, /* (71) dbs ::= DBS INTEGER */
0, /* (72) streams ::= */
-2, /* (73) streams ::= STREAMS INTEGER */
0, /* (74) storage ::= */
-2, /* (75) storage ::= STORAGE INTEGER */
0, /* (76) qtime ::= */
-2, /* (77) qtime ::= QTIME INTEGER */
0, /* (78) users ::= */
-2, /* (79) users ::= USERS INTEGER */
0, /* (80) conns ::= */
-2, /* (81) conns ::= CONNS INTEGER */
0, /* (82) state ::= */
-2, /* (83) state ::= STATE ids */
-9, /* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
-3, /* (85) intitemlist ::= intitemlist COMMA intitem */
-1, /* (86) intitemlist ::= intitem */
-1, /* (87) intitem ::= INTEGER */
-2, /* (88) keep ::= KEEP intitemlist */
-2, /* (89) cache ::= CACHE INTEGER */
-2, /* (90) replica ::= REPLICA INTEGER */
-2, /* (91) quorum ::= QUORUM INTEGER */
-2, /* (92) days ::= DAYS INTEGER */
-2, /* (93) minrows ::= MINROWS INTEGER */
-2, /* (94) maxrows ::= MAXROWS INTEGER */
-2, /* (95) blocks ::= BLOCKS INTEGER */
-2, /* (96) ctime ::= CTIME INTEGER */
-2, /* (97) wal ::= WAL INTEGER */
-2, /* (98) fsync ::= FSYNC INTEGER */
-2, /* (99) comp ::= COMP INTEGER */
-2, /* (100) prec ::= PRECISION STRING */
-2, /* (101) update ::= UPDATE INTEGER */
-2, /* (102) cachelast ::= CACHELAST INTEGER */
-2, /* (103) partitions ::= PARTITIONS INTEGER */
0, /* (104) db_optr ::= */
-2, /* (105) db_optr ::= db_optr cache */
-2, /* (106) db_optr ::= db_optr replica */
-2, /* (107) db_optr ::= db_optr quorum */
-2, /* (108) db_optr ::= db_optr days */
-2, /* (109) db_optr ::= db_optr minrows */
-2, /* (110) db_optr ::= db_optr maxrows */
-2, /* (111) db_optr ::= db_optr blocks */
-2, /* (112) db_optr ::= db_optr ctime */
-2, /* (113) db_optr ::= db_optr wal */
-2, /* (114) db_optr ::= db_optr fsync */
-2, /* (115) db_optr ::= db_optr comp */
-2, /* (116) db_optr ::= db_optr prec */
-2, /* (117) db_optr ::= db_optr keep */
-2, /* (118) db_optr ::= db_optr update */
-2, /* (119) db_optr ::= db_optr cachelast */
-1, /* (120) topic_optr ::= db_optr */
-2, /* (121) topic_optr ::= topic_optr partitions */
0, /* (122) alter_db_optr ::= */
-2, /* (123) alter_db_optr ::= alter_db_optr replica */
-2, /* (124) alter_db_optr ::= alter_db_optr quorum */
-2, /* (125) alter_db_optr ::= alter_db_optr keep */
-2, /* (126) alter_db_optr ::= alter_db_optr blocks */
-2, /* (127) alter_db_optr ::= alter_db_optr comp */
-2, /* (128) alter_db_optr ::= alter_db_optr update */
-2, /* (129) alter_db_optr ::= alter_db_optr cachelast */
-1, /* (130) alter_topic_optr ::= alter_db_optr */
-2, /* (131) alter_topic_optr ::= alter_topic_optr partitions */
-1, /* (132) typename ::= ids */
-4, /* (133) typename ::= ids LP signed RP */
-2, /* (134) typename ::= ids UNSIGNED */
-1, /* (135) signed ::= INTEGER */
-2, /* (136) signed ::= PLUS INTEGER */
-2, /* (137) signed ::= MINUS INTEGER */
-3, /* (138) cmd ::= CREATE TABLE create_table_args */
-3, /* (139) cmd ::= CREATE TABLE create_stable_args */
-3, /* (140) cmd ::= CREATE STABLE create_stable_args */
-3, /* (141) cmd ::= CREATE TABLE create_table_list */
-1, /* (142) create_table_list ::= create_from_stable */
-2, /* (143) create_table_list ::= create_table_list create_from_stable */
-6, /* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
-10, /* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
-10, /* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
-13, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
-3, /* (148) tagNamelist ::= tagNamelist COMMA ids */
-1, /* (149) tagNamelist ::= ids */
-5, /* (150) create_table_args ::= ifnotexists ids cpxName AS select */
-3, /* (151) columnlist ::= columnlist COMMA column */
-1, /* (152) columnlist ::= column */
-2, /* (153) column ::= ids typename */
-3, /* (154) tagitemlist ::= tagitemlist COMMA tagitem */
-1, /* (155) tagitemlist ::= tagitem */
-1, /* (156) tagitem ::= INTEGER */
-1, /* (157) tagitem ::= FLOAT */
-1, /* (158) tagitem ::= STRING */
-1, /* (159) tagitem ::= BOOL */
-1, /* (160) tagitem ::= NULL */
-1, /* (161) tagitem ::= NOW */
-2, /* (162) tagitem ::= MINUS INTEGER */
-2, /* (163) tagitem ::= MINUS FLOAT */
-2, /* (164) tagitem ::= PLUS INTEGER */
-2, /* (165) tagitem ::= PLUS FLOAT */
-15, /* (166) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
-3, /* (167) select ::= LP select RP */
-1, /* (168) union ::= select */
-4, /* (169) union ::= union UNION ALL select */
-1, /* (170) cmd ::= union */
-2, /* (171) select ::= SELECT selcollist */
-2, /* (172) sclp ::= selcollist COMMA */
0, /* (173) sclp ::= */
-4, /* (174) selcollist ::= sclp distinct expr as */
-2, /* (175) selcollist ::= sclp STAR */
-2, /* (176) as ::= AS ids */
-1, /* (177) as ::= ids */
0, /* (178) as ::= */
-1, /* (179) distinct ::= DISTINCT */
0, /* (180) distinct ::= */
-2, /* (181) from ::= FROM tablelist */
-2, /* (182) from ::= FROM sub */
-3, /* (183) sub ::= LP union RP */
-4, /* (184) sub ::= LP union RP ids */
-6, /* (185) sub ::= sub COMMA LP union RP ids */
-2, /* (186) tablelist ::= ids cpxName */
-3, /* (187) tablelist ::= ids cpxName ids */
-4, /* (188) tablelist ::= tablelist COMMA ids cpxName */
-5, /* (189) tablelist ::= tablelist COMMA ids cpxName ids */
-1, /* (190) tmvar ::= VARIABLE */
-1, /* (191) timestamp ::= INTEGER */
-2, /* (192) timestamp ::= MINUS INTEGER */
-2, /* (193) timestamp ::= PLUS INTEGER */
-1, /* (194) timestamp ::= STRING */
-1, /* (195) timestamp ::= NOW */
-3, /* (196) timestamp ::= NOW PLUS VARIABLE */
-3, /* (197) timestamp ::= NOW MINUS VARIABLE */
0, /* (198) range_option ::= */
-6, /* (199) range_option ::= RANGE LP timestamp COMMA timestamp RP */
-4, /* (200) interval_option ::= intervalKey LP tmvar RP */
-6, /* (201) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
0, /* (202) interval_option ::= */
-1, /* (203) intervalKey ::= INTERVAL */
-1, /* (204) intervalKey ::= EVERY */
0, /* (205) session_option ::= */
-7, /* (206) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
0, /* (207) windowstate_option ::= */
-4, /* (208) windowstate_option ::= STATE_WINDOW LP ids RP */
0, /* (209) fill_opt ::= */
-6, /* (210) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
-4, /* (211) fill_opt ::= FILL LP ID RP */
-4, /* (212) sliding_opt ::= SLIDING LP tmvar RP */
0, /* (213) sliding_opt ::= */
0, /* (214) orderby_opt ::= */
-3, /* (215) orderby_opt ::= ORDER BY sortlist */
-4, /* (216) sortlist ::= sortlist COMMA item sortorder */
-2, /* (217) sortlist ::= item sortorder */
-2, /* (218) item ::= ids cpxName */
-1, /* (219) sortorder ::= ASC */
-1, /* (220) sortorder ::= DESC */
0, /* (221) sortorder ::= */
0, /* (222) groupby_opt ::= */
-3, /* (223) groupby_opt ::= GROUP BY grouplist */
-3, /* (224) grouplist ::= grouplist COMMA item */
-1, /* (225) grouplist ::= item */
0, /* (226) having_opt ::= */
-2, /* (227) having_opt ::= HAVING expr */
0, /* (228) limit_opt ::= */
-2, /* (229) limit_opt ::= LIMIT signed */
-4, /* (230) limit_opt ::= LIMIT signed OFFSET signed */
-4, /* (231) limit_opt ::= LIMIT signed COMMA signed */
0, /* (232) slimit_opt ::= */
-2, /* (233) slimit_opt ::= SLIMIT signed */
-4, /* (234) slimit_opt ::= SLIMIT signed SOFFSET signed */
-4, /* (235) slimit_opt ::= SLIMIT signed COMMA signed */
0, /* (236) where_opt ::= */
-2, /* (237) where_opt ::= WHERE expr */
-3, /* (238) expr ::= LP expr RP */
-1, /* (239) expr ::= ID */
-3, /* (240) expr ::= ID DOT ID */
-3, /* (241) expr ::= ID DOT STAR */
-1, /* (242) expr ::= INTEGER */
-2, /* (243) expr ::= MINUS INTEGER */
-2, /* (244) expr ::= PLUS INTEGER */
-1, /* (245) expr ::= FLOAT */
-2, /* (246) expr ::= MINUS FLOAT */
-2, /* (247) expr ::= PLUS FLOAT */
-1, /* (248) expr ::= STRING */
-1, /* (249) expr ::= NOW */
-1, /* (250) expr ::= VARIABLE */
-2, /* (251) expr ::= PLUS VARIABLE */
-2, /* (252) expr ::= MINUS VARIABLE */
-1, /* (253) expr ::= BOOL */
-1, /* (254) expr ::= NULL */
-4, /* (255) expr ::= ID LP exprlist RP */
-4, /* (256) expr ::= ID LP STAR RP */
-3, /* (257) expr ::= expr IS NULL */
-4, /* (258) expr ::= expr IS NOT NULL */
-3, /* (259) expr ::= expr LT expr */
-3, /* (260) expr ::= expr GT expr */
-3, /* (261) expr ::= expr LE expr */
-3, /* (262) expr ::= expr GE expr */
-3, /* (263) expr ::= expr NE expr */
-3, /* (264) expr ::= expr EQ expr */
-5, /* (265) expr ::= expr BETWEEN expr AND expr */
-3, /* (266) expr ::= expr AND expr */
-3, /* (267) expr ::= expr OR expr */
-3, /* (268) expr ::= expr PLUS expr */
-3, /* (269) expr ::= expr MINUS expr */
-3, /* (270) expr ::= expr STAR expr */
-3, /* (271) expr ::= expr SLASH expr */
-3, /* (272) expr ::= expr REM expr */
-3, /* (273) expr ::= expr LIKE expr */
-3, /* (274) expr ::= expr MATCH expr */
-3, /* (275) expr ::= expr NMATCH expr */
-5, /* (276) expr ::= expr IN LP exprlist RP */
-3, /* (277) exprlist ::= exprlist COMMA expritem */
-1, /* (278) exprlist ::= expritem */
-1, /* (279) expritem ::= expr */
0, /* (280) expritem ::= */
-3, /* (281) cmd ::= RESET QUERY CACHE */
-3, /* (282) cmd ::= SYNCDB ids REPLICA */
-7, /* (283) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
-7, /* (284) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
-7, /* (285) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
-7, /* (286) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
-7, /* (287) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
-8, /* (288) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
-9, /* (289) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
-7, /* (290) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
-7, /* (291) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
-7, /* (292) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
-7, /* (293) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
-7, /* (294) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
-7, /* (295) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
-8, /* (296) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
-9, /* (297) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
-7, /* (298) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
-3, /* (299) cmd ::= KILL CONNECTION INTEGER */
-5, /* (300) cmd ::= KILL STREAM INTEGER COLON INTEGER */
-5, /* (301) cmd ::= KILL QUERY INTEGER COLON INTEGER */
};
static void yy_accept(yyParser*); /* Forward Declaration */
......@@ -2575,9 +2571,9 @@ static YYACTIONTYPE yy_reduce(
/********** Begin reduce actions **********************************************/
YYMINORTYPE yylhsminor;
case 0: /* program ::= cmd */
case 139: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==139);
case 140: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==140);
case 141: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==141);
case 138: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==138);
case 139: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==139);
case 140: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==140);
{}
break;
case 1: /* cmd ::= SHOW DATABASES */
......@@ -2687,144 +2683,137 @@ static YYACTIONTYPE yy_reduce(
setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0);
}
break;
case 29: /* cmd ::= SHOW dbPrefix VGROUPS ids */
{
SStrToken token;
tSetDbName(&token, &yymsp[-2].minor.yy0);
setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, &yymsp[0].minor.yy0);
}
break;
case 30: /* cmd ::= DROP TABLE ifexists ids cpxName */
case 29: /* cmd ::= DROP TABLE ifexists ids cpxName */
{
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, -1);
}
break;
case 31: /* cmd ::= DROP STABLE ifexists ids cpxName */
case 30: /* cmd ::= DROP STABLE ifexists ids cpxName */
{
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, TSDB_SUPER_TABLE);
}
break;
case 32: /* cmd ::= DROP DATABASE ifexists ids */
case 31: /* cmd ::= DROP DATABASE ifexists ids */
{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_DEFAULT, -1); }
break;
case 33: /* cmd ::= DROP TOPIC ifexists ids */
case 32: /* cmd ::= DROP TOPIC ifexists ids */
{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_TOPIC, -1); }
break;
case 34: /* cmd ::= DROP FUNCTION ids */
case 33: /* cmd ::= DROP FUNCTION ids */
{ setDropFuncInfo(pInfo, TSDB_SQL_DROP_FUNCTION, &yymsp[0].minor.yy0); }
break;
case 35: /* cmd ::= DROP DNODE ids */
case 34: /* cmd ::= DROP DNODE ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0); }
break;
case 36: /* cmd ::= DROP USER ids */
case 35: /* cmd ::= DROP USER ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0); }
break;
case 37: /* cmd ::= DROP ACCOUNT ids */
case 36: /* cmd ::= DROP ACCOUNT ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0); }
break;
case 38: /* cmd ::= USE ids */
case 37: /* cmd ::= USE ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);}
break;
case 39: /* cmd ::= DESCRIBE ids cpxName */
case 40: /* cmd ::= DESC ids cpxName */ yytestcase(yyruleno==40);
case 38: /* cmd ::= DESCRIBE ids cpxName */
case 39: /* cmd ::= DESC ids cpxName */ yytestcase(yyruleno==39);
{
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDCLSqlElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0);
}
break;
case 41: /* cmd ::= ALTER USER ids PASS ids */
case 40: /* cmd ::= ALTER USER ids PASS ids */
{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL); }
break;
case 42: /* cmd ::= ALTER USER ids PRIVILEGE ids */
case 41: /* cmd ::= ALTER USER ids PRIVILEGE ids */
{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);}
break;
case 43: /* cmd ::= ALTER DNODE ids ids */
case 42: /* cmd ::= ALTER DNODE ids ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break;
case 44: /* cmd ::= ALTER DNODE ids ids ids */
case 43: /* cmd ::= ALTER DNODE ids ids ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break;
case 45: /* cmd ::= ALTER LOCAL ids */
case 44: /* cmd ::= ALTER LOCAL ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0); }
break;
case 46: /* cmd ::= ALTER LOCAL ids ids */
case 45: /* cmd ::= ALTER LOCAL ids ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break;
case 47: /* cmd ::= ALTER DATABASE ids alter_db_optr */
case 48: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==48);
case 46: /* cmd ::= ALTER DATABASE ids alter_db_optr */
case 47: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==47);
{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy10, &t);}
break;
case 49: /* cmd ::= ALTER ACCOUNT ids acct_optr */
case 48: /* cmd ::= ALTER ACCOUNT ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy427);}
break;
case 50: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
case 49: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy427);}
break;
case 51: /* cmd ::= COMPACT VNODES IN LP exprlist RP */
case 50: /* cmd ::= COMPACT VNODES IN LP exprlist RP */
{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy345);}
break;
case 52: /* ids ::= ID */
case 53: /* ids ::= STRING */ yytestcase(yyruleno==53);
case 51: /* ids ::= ID */
case 52: /* ids ::= STRING */ yytestcase(yyruleno==52);
{yylhsminor.yy0 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy0 = yylhsminor.yy0;
break;
case 54: /* ifexists ::= IF EXISTS */
case 53: /* ifexists ::= IF EXISTS */
{ yymsp[-1].minor.yy0.n = 1;}
break;
case 55: /* ifexists ::= */
case 57: /* ifnotexists ::= */ yytestcase(yyruleno==57);
case 181: /* distinct ::= */ yytestcase(yyruleno==181);
case 54: /* ifexists ::= */
case 56: /* ifnotexists ::= */ yytestcase(yyruleno==56);
case 180: /* distinct ::= */ yytestcase(yyruleno==180);
{ yymsp[1].minor.yy0.n = 0;}
break;
case 56: /* ifnotexists ::= IF NOT EXISTS */
case 55: /* ifnotexists ::= IF NOT EXISTS */
{ yymsp[-2].minor.yy0.n = 1;}
break;
case 58: /* cmd ::= CREATE DNODE ids */
case 57: /* cmd ::= CREATE DNODE ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);}
break;
case 59: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
case 58: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy427);}
break;
case 60: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
case 61: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==61);
case 59: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
case 60: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==60);
{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy10, &yymsp[-2].minor.yy0);}
break;
case 62: /* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
case 61: /* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy487, &yymsp[0].minor.yy0, 1);}
break;
case 63: /* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
case 62: /* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy487, &yymsp[0].minor.yy0, 2);}
break;
case 64: /* cmd ::= CREATE USER ids PASS ids */
case 63: /* cmd ::= CREATE USER ids PASS ids */
{ setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);}
break;
case 65: /* bufsize ::= */
case 67: /* pps ::= */ yytestcase(yyruleno==67);
case 69: /* tseries ::= */ yytestcase(yyruleno==69);
case 71: /* dbs ::= */ yytestcase(yyruleno==71);
case 73: /* streams ::= */ yytestcase(yyruleno==73);
case 75: /* storage ::= */ yytestcase(yyruleno==75);
case 77: /* qtime ::= */ yytestcase(yyruleno==77);
case 79: /* users ::= */ yytestcase(yyruleno==79);
case 81: /* conns ::= */ yytestcase(yyruleno==81);
case 83: /* state ::= */ yytestcase(yyruleno==83);
case 64: /* bufsize ::= */
case 66: /* pps ::= */ yytestcase(yyruleno==66);
case 68: /* tseries ::= */ yytestcase(yyruleno==68);
case 70: /* dbs ::= */ yytestcase(yyruleno==70);
case 72: /* streams ::= */ yytestcase(yyruleno==72);
case 74: /* storage ::= */ yytestcase(yyruleno==74);
case 76: /* qtime ::= */ yytestcase(yyruleno==76);
case 78: /* users ::= */ yytestcase(yyruleno==78);
case 80: /* conns ::= */ yytestcase(yyruleno==80);
case 82: /* state ::= */ yytestcase(yyruleno==82);
{ yymsp[1].minor.yy0.n = 0; }
break;
case 66: /* bufsize ::= BUFSIZE INTEGER */
case 68: /* pps ::= PPS INTEGER */ yytestcase(yyruleno==68);
case 70: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==70);
case 72: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==72);
case 74: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==74);
case 76: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==76);
case 78: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==78);
case 80: /* users ::= USERS INTEGER */ yytestcase(yyruleno==80);
case 82: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==82);
case 84: /* state ::= STATE ids */ yytestcase(yyruleno==84);
case 65: /* bufsize ::= BUFSIZE INTEGER */
case 67: /* pps ::= PPS INTEGER */ yytestcase(yyruleno==67);
case 69: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==69);
case 71: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==71);
case 73: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==73);
case 75: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==75);
case 77: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==77);
case 79: /* users ::= USERS INTEGER */ yytestcase(yyruleno==79);
case 81: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==81);
case 83: /* state ::= STATE ids */ yytestcase(yyruleno==83);
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break;
case 85: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
case 84: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{
yylhsminor.yy427.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
yylhsminor.yy427.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
......@@ -2838,135 +2827,135 @@ static YYACTIONTYPE yy_reduce(
}
yymsp[-8].minor.yy427 = yylhsminor.yy427;
break;
case 86: /* intitemlist ::= intitemlist COMMA intitem */
case 155: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==155);
case 85: /* intitemlist ::= intitemlist COMMA intitem */
case 154: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==154);
{ yylhsminor.yy345 = tVariantListAppend(yymsp[-2].minor.yy345, &yymsp[0].minor.yy2, -1); }
yymsp[-2].minor.yy345 = yylhsminor.yy345;
break;
case 87: /* intitemlist ::= intitem */
case 156: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==156);
case 86: /* intitemlist ::= intitem */
case 155: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==155);
{ yylhsminor.yy345 = tVariantListAppend(NULL, &yymsp[0].minor.yy2, -1); }
yymsp[0].minor.yy345 = yylhsminor.yy345;
break;
case 88: /* intitem ::= INTEGER */
case 157: /* tagitem ::= INTEGER */ yytestcase(yyruleno==157);
case 158: /* tagitem ::= FLOAT */ yytestcase(yyruleno==158);
case 159: /* tagitem ::= STRING */ yytestcase(yyruleno==159);
case 160: /* tagitem ::= BOOL */ yytestcase(yyruleno==160);
{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy2, &yymsp[0].minor.yy0); }
case 87: /* intitem ::= INTEGER */
case 156: /* tagitem ::= INTEGER */ yytestcase(yyruleno==156);
case 157: /* tagitem ::= FLOAT */ yytestcase(yyruleno==157);
case 158: /* tagitem ::= STRING */ yytestcase(yyruleno==158);
case 159: /* tagitem ::= BOOL */ yytestcase(yyruleno==159);
{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy2, &yymsp[0].minor.yy0, true); }
yymsp[0].minor.yy2 = yylhsminor.yy2;
break;
case 89: /* keep ::= KEEP intitemlist */
case 88: /* keep ::= KEEP intitemlist */
{ yymsp[-1].minor.yy345 = yymsp[0].minor.yy345; }
break;
case 90: /* cache ::= CACHE INTEGER */
case 91: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==91);
case 92: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==92);
case 93: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==93);
case 94: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==94);
case 95: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==95);
case 96: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==96);
case 97: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==97);
case 98: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==98);
case 99: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==99);
case 100: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==100);
case 101: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==101);
case 102: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==102);
case 103: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==103);
case 104: /* partitions ::= PARTITIONS INTEGER */ yytestcase(yyruleno==104);
case 89: /* cache ::= CACHE INTEGER */
case 90: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==90);
case 91: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==91);
case 92: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==92);
case 93: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==93);
case 94: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==94);
case 95: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==95);
case 96: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==96);
case 97: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==97);
case 98: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==98);
case 99: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==99);
case 100: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==100);
case 101: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==101);
case 102: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==102);
case 103: /* partitions ::= PARTITIONS INTEGER */ yytestcase(yyruleno==103);
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break;
case 105: /* db_optr ::= */
case 104: /* db_optr ::= */
{setDefaultCreateDbOption(&yymsp[1].minor.yy10); yymsp[1].minor.yy10.dbType = TSDB_DB_TYPE_DEFAULT;}
break;
case 106: /* db_optr ::= db_optr cache */
case 105: /* db_optr ::= db_optr cache */
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 107: /* db_optr ::= db_optr replica */
case 124: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==124);
case 106: /* db_optr ::= db_optr replica */
case 123: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==123);
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 108: /* db_optr ::= db_optr quorum */
case 125: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==125);
case 107: /* db_optr ::= db_optr quorum */
case 124: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==124);
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 109: /* db_optr ::= db_optr days */
case 108: /* db_optr ::= db_optr days */
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 110: /* db_optr ::= db_optr minrows */
case 109: /* db_optr ::= db_optr minrows */
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 111: /* db_optr ::= db_optr maxrows */
case 110: /* db_optr ::= db_optr maxrows */
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 112: /* db_optr ::= db_optr blocks */
case 127: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==127);
case 111: /* db_optr ::= db_optr blocks */
case 126: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==126);
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 113: /* db_optr ::= db_optr ctime */
case 112: /* db_optr ::= db_optr ctime */
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 114: /* db_optr ::= db_optr wal */
case 113: /* db_optr ::= db_optr wal */
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 115: /* db_optr ::= db_optr fsync */
case 114: /* db_optr ::= db_optr fsync */
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 116: /* db_optr ::= db_optr comp */
case 128: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==128);
case 115: /* db_optr ::= db_optr comp */
case 127: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==127);
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 117: /* db_optr ::= db_optr prec */
case 116: /* db_optr ::= db_optr prec */
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.precision = yymsp[0].minor.yy0; }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 118: /* db_optr ::= db_optr keep */
case 126: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==126);
case 117: /* db_optr ::= db_optr keep */
case 125: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==125);
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.keep = yymsp[0].minor.yy345; }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 119: /* db_optr ::= db_optr update */
case 129: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==129);
case 118: /* db_optr ::= db_optr update */
case 128: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==128);
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 120: /* db_optr ::= db_optr cachelast */
case 130: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==130);
case 119: /* db_optr ::= db_optr cachelast */
case 129: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==129);
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 121: /* topic_optr ::= db_optr */
case 131: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==131);
case 120: /* topic_optr ::= db_optr */
case 130: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==130);
{ yylhsminor.yy10 = yymsp[0].minor.yy10; yylhsminor.yy10.dbType = TSDB_DB_TYPE_TOPIC; }
yymsp[0].minor.yy10 = yylhsminor.yy10;
break;
case 122: /* topic_optr ::= topic_optr partitions */
case 132: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==132);
case 121: /* topic_optr ::= topic_optr partitions */
case 131: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==131);
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy10 = yylhsminor.yy10;
break;
case 123: /* alter_db_optr ::= */
case 122: /* alter_db_optr ::= */
{ setDefaultCreateDbOption(&yymsp[1].minor.yy10); yymsp[1].minor.yy10.dbType = TSDB_DB_TYPE_DEFAULT;}
break;
case 133: /* typename ::= ids */
case 132: /* typename ::= ids */
{
yymsp[0].minor.yy0.type = 0;
tSetColumnType (&yylhsminor.yy487, &yymsp[0].minor.yy0);
}
yymsp[0].minor.yy487 = yylhsminor.yy487;
break;
case 134: /* typename ::= ids LP signed RP */
case 133: /* typename ::= ids LP signed RP */
{
if (yymsp[-1].minor.yy525 <= 0) {
yymsp[-3].minor.yy0.type = 0;
......@@ -2978,7 +2967,7 @@ static YYACTIONTYPE yy_reduce(
}
yymsp[-3].minor.yy487 = yylhsminor.yy487;
break;
case 135: /* typename ::= ids UNSIGNED */
case 134: /* typename ::= ids UNSIGNED */
{
yymsp[-1].minor.yy0.type = 0;
yymsp[-1].minor.yy0.n = ((yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z);
......@@ -2986,20 +2975,20 @@ static YYACTIONTYPE yy_reduce(
}
yymsp[-1].minor.yy487 = yylhsminor.yy487;
break;
case 136: /* signed ::= INTEGER */
case 135: /* signed ::= INTEGER */
{ yylhsminor.yy525 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[0].minor.yy525 = yylhsminor.yy525;
break;
case 137: /* signed ::= PLUS INTEGER */
case 136: /* signed ::= PLUS INTEGER */
{ yymsp[-1].minor.yy525 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 138: /* signed ::= MINUS INTEGER */
case 137: /* signed ::= MINUS INTEGER */
{ yymsp[-1].minor.yy525 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
break;
case 142: /* cmd ::= CREATE TABLE create_table_list */
case 141: /* cmd ::= CREATE TABLE create_table_list */
{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy170;}
break;
case 143: /* create_table_list ::= create_from_stable */
case 142: /* create_table_list ::= create_from_stable */
{
SCreateTableSql* pCreateTable = calloc(1, sizeof(SCreateTableSql));
pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo));
......@@ -3010,14 +2999,14 @@ static YYACTIONTYPE yy_reduce(
}
yymsp[0].minor.yy170 = yylhsminor.yy170;
break;
case 144: /* create_table_list ::= create_table_list create_from_stable */
case 143: /* create_table_list ::= create_table_list create_from_stable */
{
taosArrayPush(yymsp[-1].minor.yy170->childTableInfo, &yymsp[0].minor.yy72);
yylhsminor.yy170 = yymsp[-1].minor.yy170;
}
yymsp[-1].minor.yy170 = yylhsminor.yy170;
break;
case 145: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
case 144: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{
yylhsminor.yy170 = tSetCreateTableInfo(yymsp[-1].minor.yy345, NULL, NULL, TSQL_CREATE_TABLE);
setSqlInfo(pInfo, yylhsminor.yy170, NULL, TSDB_SQL_CREATE_TABLE);
......@@ -3027,7 +3016,7 @@ static YYACTIONTYPE yy_reduce(
}
yymsp[-5].minor.yy170 = yylhsminor.yy170;
break;
case 146: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
case 145: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{
yylhsminor.yy170 = tSetCreateTableInfo(yymsp[-5].minor.yy345, yymsp[-1].minor.yy345, NULL, TSQL_CREATE_STABLE);
setSqlInfo(pInfo, yylhsminor.yy170, NULL, TSDB_SQL_CREATE_TABLE);
......@@ -3037,7 +3026,7 @@ static YYACTIONTYPE yy_reduce(
}
yymsp[-9].minor.yy170 = yylhsminor.yy170;
break;
case 147: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
case 146: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
......@@ -3045,7 +3034,7 @@ static YYACTIONTYPE yy_reduce(
}
yymsp[-9].minor.yy72 = yylhsminor.yy72;
break;
case 148: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
case 147: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
{
yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
yymsp[-11].minor.yy0.n += yymsp[-10].minor.yy0.n;
......@@ -3053,15 +3042,15 @@ static YYACTIONTYPE yy_reduce(
}
yymsp[-12].minor.yy72 = yylhsminor.yy72;
break;
case 149: /* tagNamelist ::= tagNamelist COMMA ids */
case 148: /* tagNamelist ::= tagNamelist COMMA ids */
{taosArrayPush(yymsp[-2].minor.yy345, &yymsp[0].minor.yy0); yylhsminor.yy345 = yymsp[-2].minor.yy345; }
yymsp[-2].minor.yy345 = yylhsminor.yy345;
break;
case 150: /* tagNamelist ::= ids */
case 149: /* tagNamelist ::= ids */
{yylhsminor.yy345 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy345, &yymsp[0].minor.yy0);}
yymsp[0].minor.yy345 = yylhsminor.yy345;
break;
case 151: /* create_table_args ::= ifnotexists ids cpxName AS select */
case 150: /* create_table_args ::= ifnotexists ids cpxName AS select */
{
yylhsminor.yy170 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy68, TSQL_CREATE_STREAM);
setSqlInfo(pInfo, yylhsminor.yy170, NULL, TSDB_SQL_CREATE_TABLE);
......@@ -3071,638 +3060,638 @@ static YYACTIONTYPE yy_reduce(
}
yymsp[-4].minor.yy170 = yylhsminor.yy170;
break;
case 152: /* columnlist ::= columnlist COMMA column */
case 151: /* columnlist ::= columnlist COMMA column */
{taosArrayPush(yymsp[-2].minor.yy345, &yymsp[0].minor.yy487); yylhsminor.yy345 = yymsp[-2].minor.yy345; }
yymsp[-2].minor.yy345 = yylhsminor.yy345;
break;
case 153: /* columnlist ::= column */
case 152: /* columnlist ::= column */
{yylhsminor.yy345 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy345, &yymsp[0].minor.yy487);}
yymsp[0].minor.yy345 = yylhsminor.yy345;
break;
case 154: /* column ::= ids typename */
case 153: /* column ::= ids typename */
{
tSetColumnInfo(&yylhsminor.yy487, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy487);
}
yymsp[-1].minor.yy487 = yylhsminor.yy487;
break;
case 161: /* tagitem ::= NULL */
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy2, &yymsp[0].minor.yy0); }
case 160: /* tagitem ::= NULL */
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy2, &yymsp[0].minor.yy0, true); }
yymsp[0].minor.yy2 = yylhsminor.yy2;
break;
case 162: /* tagitem ::= NOW */
{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yylhsminor.yy2, &yymsp[0].minor.yy0);}
case 161: /* tagitem ::= NOW */
{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yylhsminor.yy2, &yymsp[0].minor.yy0, true);}
yymsp[0].minor.yy2 = yylhsminor.yy2;
break;
case 163: /* tagitem ::= MINUS INTEGER */
case 164: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==164);
case 165: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==165);
case 166: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==166);
case 162: /* tagitem ::= MINUS INTEGER */
case 163: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==163);
case 164: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==164);
case 165: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==165);
{
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type;
toTSDBType(yymsp[-1].minor.yy0.type);
tVariantCreate(&yylhsminor.yy2, &yymsp[-1].minor.yy0);
tVariantCreate(&yylhsminor.yy2, &yymsp[-1].minor.yy0, true);
}
yymsp[-1].minor.yy2 = yylhsminor.yy2;
break;
case 167: /* select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
case 166: /* select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
{
yylhsminor.yy68 = tSetQuerySqlNode(&yymsp[-14].minor.yy0, yymsp[-13].minor.yy345, yymsp[-12].minor.yy484, yymsp[-11].minor.yy418, yymsp[-4].minor.yy345, yymsp[-2].minor.yy345, &yymsp[-9].minor.yy280, &yymsp[-7].minor.yy295, &yymsp[-6].minor.yy432, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy345, &yymsp[0].minor.yy114, &yymsp[-1].minor.yy114, yymsp[-3].minor.yy418, &yymsp[-10].minor.yy144);
}
yymsp[-14].minor.yy68 = yylhsminor.yy68;
break;
case 168: /* select ::= LP select RP */
case 167: /* select ::= LP select RP */
{yymsp[-2].minor.yy68 = yymsp[-1].minor.yy68;}
break;
case 169: /* union ::= select */
case 168: /* union ::= select */
{ yylhsminor.yy345 = setSubclause(NULL, yymsp[0].minor.yy68); }
yymsp[0].minor.yy345 = yylhsminor.yy345;
break;
case 170: /* union ::= union UNION ALL select */
case 169: /* union ::= union UNION ALL select */
{ yylhsminor.yy345 = appendSelectClause(yymsp[-3].minor.yy345, yymsp[0].minor.yy68); }
yymsp[-3].minor.yy345 = yylhsminor.yy345;
break;
case 171: /* cmd ::= union */
case 170: /* cmd ::= union */
{ setSqlInfo(pInfo, yymsp[0].minor.yy345, NULL, TSDB_SQL_SELECT); }
break;
case 172: /* select ::= SELECT selcollist */
case 171: /* select ::= SELECT selcollist */
{
yylhsminor.yy68 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy345, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
}
yymsp[-1].minor.yy68 = yylhsminor.yy68;
break;
case 173: /* sclp ::= selcollist COMMA */
case 172: /* sclp ::= selcollist COMMA */
{yylhsminor.yy345 = yymsp[-1].minor.yy345;}
yymsp[-1].minor.yy345 = yylhsminor.yy345;
break;
case 174: /* sclp ::= */
case 215: /* orderby_opt ::= */ yytestcase(yyruleno==215);
case 173: /* sclp ::= */
case 214: /* orderby_opt ::= */ yytestcase(yyruleno==214);
{yymsp[1].minor.yy345 = 0;}
break;
case 175: /* selcollist ::= sclp distinct expr as */
case 174: /* selcollist ::= sclp distinct expr as */
{
yylhsminor.yy345 = tSqlExprListAppend(yymsp[-3].minor.yy345, yymsp[-1].minor.yy418, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
}
yymsp[-3].minor.yy345 = yylhsminor.yy345;
break;
case 176: /* selcollist ::= sclp STAR */
case 175: /* selcollist ::= sclp STAR */
{
tSqlExpr *pNode = tSqlExprCreateIdValue(pInfo, NULL, TK_ALL);
yylhsminor.yy345 = tSqlExprListAppend(yymsp[-1].minor.yy345, pNode, 0, 0);
}
yymsp[-1].minor.yy345 = yylhsminor.yy345;
break;
case 177: /* as ::= AS ids */
case 176: /* as ::= AS ids */
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break;
case 178: /* as ::= ids */
case 177: /* as ::= ids */
{ yylhsminor.yy0 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy0 = yylhsminor.yy0;
break;
case 179: /* as ::= */
case 178: /* as ::= */
{ yymsp[1].minor.yy0.n = 0; }
break;
case 180: /* distinct ::= DISTINCT */
case 179: /* distinct ::= DISTINCT */
{ yylhsminor.yy0 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy0 = yylhsminor.yy0;
break;
case 182: /* from ::= FROM tablelist */
case 183: /* from ::= FROM sub */ yytestcase(yyruleno==183);
case 181: /* from ::= FROM tablelist */
case 182: /* from ::= FROM sub */ yytestcase(yyruleno==182);
{yymsp[-1].minor.yy484 = yymsp[0].minor.yy484;}
break;
case 184: /* sub ::= LP union RP */
case 183: /* sub ::= LP union RP */
{yymsp[-2].minor.yy484 = addSubqueryElem(NULL, yymsp[-1].minor.yy345, NULL);}
break;
case 185: /* sub ::= LP union RP ids */
case 184: /* sub ::= LP union RP ids */
{yymsp[-3].minor.yy484 = addSubqueryElem(NULL, yymsp[-2].minor.yy345, &yymsp[0].minor.yy0);}
break;
case 186: /* sub ::= sub COMMA LP union RP ids */
case 185: /* sub ::= sub COMMA LP union RP ids */
{yylhsminor.yy484 = addSubqueryElem(yymsp[-5].minor.yy484, yymsp[-2].minor.yy345, &yymsp[0].minor.yy0);}
yymsp[-5].minor.yy484 = yylhsminor.yy484;
break;
case 187: /* tablelist ::= ids cpxName */
case 186: /* tablelist ::= ids cpxName */
{
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy484 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL);
}
yymsp[-1].minor.yy484 = yylhsminor.yy484;
break;
case 188: /* tablelist ::= ids cpxName ids */
case 187: /* tablelist ::= ids cpxName ids */
{
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy484 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
}
yymsp[-2].minor.yy484 = yylhsminor.yy484;
break;
case 189: /* tablelist ::= tablelist COMMA ids cpxName */
case 188: /* tablelist ::= tablelist COMMA ids cpxName */
{
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy484 = setTableNameList(yymsp[-3].minor.yy484, &yymsp[-1].minor.yy0, NULL);
}
yymsp[-3].minor.yy484 = yylhsminor.yy484;
break;
case 190: /* tablelist ::= tablelist COMMA ids cpxName ids */
case 189: /* tablelist ::= tablelist COMMA ids cpxName ids */
{
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy484 = setTableNameList(yymsp[-4].minor.yy484, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
}
yymsp[-4].minor.yy484 = yylhsminor.yy484;
break;
case 191: /* tmvar ::= VARIABLE */
case 190: /* tmvar ::= VARIABLE */
{yylhsminor.yy0 = yymsp[0].minor.yy0;}
yymsp[0].minor.yy0 = yylhsminor.yy0;
break;
case 192: /* timestamp ::= INTEGER */
case 191: /* timestamp ::= INTEGER */
{ yylhsminor.yy418 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_INTEGER);}
yymsp[0].minor.yy418 = yylhsminor.yy418;
break;
case 193: /* timestamp ::= MINUS INTEGER */
case 194: /* timestamp ::= PLUS INTEGER */ yytestcase(yyruleno==194);
case 192: /* timestamp ::= MINUS INTEGER */
case 193: /* timestamp ::= PLUS INTEGER */ yytestcase(yyruleno==193);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy418 = tSqlExprCreateTimestamp(&yymsp[-1].minor.yy0, TK_INTEGER);}
yymsp[-1].minor.yy418 = yylhsminor.yy418;
break;
case 195: /* timestamp ::= STRING */
case 194: /* timestamp ::= STRING */
{ yylhsminor.yy418 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_STRING);}
yymsp[0].minor.yy418 = yylhsminor.yy418;
break;
case 196: /* timestamp ::= NOW */
case 195: /* timestamp ::= NOW */
{ yylhsminor.yy418 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_NOW); }
yymsp[0].minor.yy418 = yylhsminor.yy418;
break;
case 197: /* timestamp ::= NOW PLUS VARIABLE */
case 196: /* timestamp ::= NOW PLUS VARIABLE */
{yymsp[-2].minor.yy418 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_PLUS); }
break;
case 198: /* timestamp ::= NOW MINUS VARIABLE */
case 197: /* timestamp ::= NOW MINUS VARIABLE */
{yymsp[-2].minor.yy418 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_MINUS); }
break;
case 199: /* range_option ::= */
case 198: /* range_option ::= */
{yymsp[1].minor.yy144.start = 0; yymsp[1].minor.yy144.end = 0;}
break;
case 200: /* range_option ::= RANGE LP timestamp COMMA timestamp RP */
case 199: /* range_option ::= RANGE LP timestamp COMMA timestamp RP */
{yymsp[-5].minor.yy144.start = yymsp[-3].minor.yy418; yymsp[-5].minor.yy144.end = yymsp[-1].minor.yy418;}
break;
case 201: /* interval_option ::= intervalKey LP tmvar RP */
case 200: /* interval_option ::= intervalKey LP tmvar RP */
{yylhsminor.yy280.interval = yymsp[-1].minor.yy0; yylhsminor.yy280.offset.n = 0; yylhsminor.yy280.token = yymsp[-3].minor.yy40;}
yymsp[-3].minor.yy280 = yylhsminor.yy280;
break;
case 202: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
case 201: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
{yylhsminor.yy280.interval = yymsp[-3].minor.yy0; yylhsminor.yy280.offset = yymsp[-1].minor.yy0; yylhsminor.yy280.token = yymsp[-5].minor.yy40;}
yymsp[-5].minor.yy280 = yylhsminor.yy280;
break;
case 203: /* interval_option ::= */
case 202: /* interval_option ::= */
{memset(&yymsp[1].minor.yy280, 0, sizeof(yymsp[1].minor.yy280));}
break;
case 204: /* intervalKey ::= INTERVAL */
case 203: /* intervalKey ::= INTERVAL */
{yymsp[0].minor.yy40 = TK_INTERVAL;}
break;
case 205: /* intervalKey ::= EVERY */
case 204: /* intervalKey ::= EVERY */
{yymsp[0].minor.yy40 = TK_EVERY; }
break;
case 206: /* session_option ::= */
case 205: /* session_option ::= */
{yymsp[1].minor.yy295.col.n = 0; yymsp[1].minor.yy295.gap.n = 0;}
break;
case 207: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
case 206: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
yymsp[-6].minor.yy295.col = yymsp[-4].minor.yy0;
yymsp[-6].minor.yy295.gap = yymsp[-1].minor.yy0;
}
break;
case 208: /* windowstate_option ::= */
case 207: /* windowstate_option ::= */
{ yymsp[1].minor.yy432.col.n = 0; yymsp[1].minor.yy432.col.z = NULL;}
break;
case 209: /* windowstate_option ::= STATE_WINDOW LP ids RP */
case 208: /* windowstate_option ::= STATE_WINDOW LP ids RP */
{ yymsp[-3].minor.yy432.col = yymsp[-1].minor.yy0; }
break;
case 210: /* fill_opt ::= */
case 209: /* fill_opt ::= */
{ yymsp[1].minor.yy345 = 0; }
break;
case 211: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
case 210: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{
tVariant A = {0};
toTSDBType(yymsp[-3].minor.yy0.type);
tVariantCreate(&A, &yymsp[-3].minor.yy0);
tVariantCreate(&A, &yymsp[-3].minor.yy0, true);
tVariantListInsert(yymsp[-1].minor.yy345, &A, -1, 0);
yymsp[-5].minor.yy345 = yymsp[-1].minor.yy345;
}
break;
case 212: /* fill_opt ::= FILL LP ID RP */
case 211: /* fill_opt ::= FILL LP ID RP */
{
toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-3].minor.yy345 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
yymsp[-3].minor.yy345 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, true);
}
break;
case 213: /* sliding_opt ::= SLIDING LP tmvar RP */
case 212: /* sliding_opt ::= SLIDING LP tmvar RP */
{yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; }
break;
case 214: /* sliding_opt ::= */
case 213: /* sliding_opt ::= */
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; }
break;
case 216: /* orderby_opt ::= ORDER BY sortlist */
case 215: /* orderby_opt ::= ORDER BY sortlist */
{yymsp[-2].minor.yy345 = yymsp[0].minor.yy345;}
break;
case 217: /* sortlist ::= sortlist COMMA item sortorder */
case 216: /* sortlist ::= sortlist COMMA item sortorder */
{
yylhsminor.yy345 = tVariantListAppend(yymsp[-3].minor.yy345, &yymsp[-1].minor.yy2, yymsp[0].minor.yy281);
}
yymsp[-3].minor.yy345 = yylhsminor.yy345;
break;
case 218: /* sortlist ::= item sortorder */
case 217: /* sortlist ::= item sortorder */
{
yylhsminor.yy345 = tVariantListAppend(NULL, &yymsp[-1].minor.yy2, yymsp[0].minor.yy281);
}
yymsp[-1].minor.yy345 = yylhsminor.yy345;
break;
case 219: /* item ::= ids cpxName */
case 218: /* item ::= ids cpxName */
{
toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
tVariantCreate(&yylhsminor.yy2, &yymsp[-1].minor.yy0);
tVariantCreate(&yylhsminor.yy2, &yymsp[-1].minor.yy0, true);
}
yymsp[-1].minor.yy2 = yylhsminor.yy2;
break;
case 220: /* sortorder ::= ASC */
case 219: /* sortorder ::= ASC */
{ yymsp[0].minor.yy281 = TSDB_ORDER_ASC; }
break;
case 221: /* sortorder ::= DESC */
case 220: /* sortorder ::= DESC */
{ yymsp[0].minor.yy281 = TSDB_ORDER_DESC;}
break;
case 222: /* sortorder ::= */
case 221: /* sortorder ::= */
{ yymsp[1].minor.yy281 = TSDB_ORDER_ASC; }
break;
case 223: /* groupby_opt ::= */
case 222: /* groupby_opt ::= */
{ yymsp[1].minor.yy345 = 0;}
break;
case 224: /* groupby_opt ::= GROUP BY grouplist */
case 223: /* groupby_opt ::= GROUP BY grouplist */
{ yymsp[-2].minor.yy345 = yymsp[0].minor.yy345;}
break;
case 225: /* grouplist ::= grouplist COMMA item */
case 224: /* grouplist ::= grouplist COMMA item */
{
yylhsminor.yy345 = tVariantListAppend(yymsp[-2].minor.yy345, &yymsp[0].minor.yy2, -1);
}
yymsp[-2].minor.yy345 = yylhsminor.yy345;
break;
case 226: /* grouplist ::= item */
case 225: /* grouplist ::= item */
{
yylhsminor.yy345 = tVariantListAppend(NULL, &yymsp[0].minor.yy2, -1);
}
yymsp[0].minor.yy345 = yylhsminor.yy345;
break;
case 227: /* having_opt ::= */
case 237: /* where_opt ::= */ yytestcase(yyruleno==237);
case 281: /* expritem ::= */ yytestcase(yyruleno==281);
case 226: /* having_opt ::= */
case 236: /* where_opt ::= */ yytestcase(yyruleno==236);
case 280: /* expritem ::= */ yytestcase(yyruleno==280);
{yymsp[1].minor.yy418 = 0;}
break;
case 228: /* having_opt ::= HAVING expr */
case 238: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==238);
case 227: /* having_opt ::= HAVING expr */
case 237: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==237);
{yymsp[-1].minor.yy418 = yymsp[0].minor.yy418;}
break;
case 229: /* limit_opt ::= */
case 233: /* slimit_opt ::= */ yytestcase(yyruleno==233);
case 228: /* limit_opt ::= */
case 232: /* slimit_opt ::= */ yytestcase(yyruleno==232);
{yymsp[1].minor.yy114.limit = -1; yymsp[1].minor.yy114.offset = 0;}
break;
case 230: /* limit_opt ::= LIMIT signed */
case 234: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==234);
case 229: /* limit_opt ::= LIMIT signed */
case 233: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==233);
{yymsp[-1].minor.yy114.limit = yymsp[0].minor.yy525; yymsp[-1].minor.yy114.offset = 0;}
break;
case 231: /* limit_opt ::= LIMIT signed OFFSET signed */
case 230: /* limit_opt ::= LIMIT signed OFFSET signed */
{ yymsp[-3].minor.yy114.limit = yymsp[-2].minor.yy525; yymsp[-3].minor.yy114.offset = yymsp[0].minor.yy525;}
break;
case 232: /* limit_opt ::= LIMIT signed COMMA signed */
case 231: /* limit_opt ::= LIMIT signed COMMA signed */
{ yymsp[-3].minor.yy114.limit = yymsp[0].minor.yy525; yymsp[-3].minor.yy114.offset = yymsp[-2].minor.yy525;}
break;
case 235: /* slimit_opt ::= SLIMIT signed SOFFSET signed */
case 234: /* slimit_opt ::= SLIMIT signed SOFFSET signed */
{yymsp[-3].minor.yy114.limit = yymsp[-2].minor.yy525; yymsp[-3].minor.yy114.offset = yymsp[0].minor.yy525;}
break;
case 236: /* slimit_opt ::= SLIMIT signed COMMA signed */
case 235: /* slimit_opt ::= SLIMIT signed COMMA signed */
{yymsp[-3].minor.yy114.limit = yymsp[0].minor.yy525; yymsp[-3].minor.yy114.offset = yymsp[-2].minor.yy525;}
break;
case 239: /* expr ::= LP expr RP */
case 238: /* expr ::= LP expr RP */
{yylhsminor.yy418 = yymsp[-1].minor.yy418; yylhsminor.yy418->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy418->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);}
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 240: /* expr ::= ID */
case 239: /* expr ::= ID */
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_ID);}
yymsp[0].minor.yy418 = yylhsminor.yy418;
break;
case 241: /* expr ::= ID DOT ID */
case 240: /* expr ::= ID DOT ID */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID);}
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 242: /* expr ::= ID DOT STAR */
case 241: /* expr ::= ID DOT STAR */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ALL);}
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 243: /* expr ::= INTEGER */
case 242: /* expr ::= INTEGER */
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_INTEGER);}
yymsp[0].minor.yy418 = yylhsminor.yy418;
break;
case 244: /* expr ::= MINUS INTEGER */
case 245: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==245);
case 243: /* expr ::= MINUS INTEGER */
case 244: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==244);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_INTEGER);}
yymsp[-1].minor.yy418 = yylhsminor.yy418;
break;
case 246: /* expr ::= FLOAT */
case 245: /* expr ::= FLOAT */
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_FLOAT);}
yymsp[0].minor.yy418 = yylhsminor.yy418;
break;
case 247: /* expr ::= MINUS FLOAT */
case 248: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==248);
case 246: /* expr ::= MINUS FLOAT */
case 247: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==247);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_FLOAT);}
yymsp[-1].minor.yy418 = yylhsminor.yy418;
break;
case 249: /* expr ::= STRING */
case 248: /* expr ::= STRING */
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING);}
yymsp[0].minor.yy418 = yylhsminor.yy418;
break;
case 250: /* expr ::= NOW */
case 249: /* expr ::= NOW */
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NOW); }
yymsp[0].minor.yy418 = yylhsminor.yy418;
break;
case 251: /* expr ::= VARIABLE */
case 250: /* expr ::= VARIABLE */
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_VARIABLE);}
yymsp[0].minor.yy418 = yylhsminor.yy418;
break;
case 252: /* expr ::= PLUS VARIABLE */
case 253: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==253);
case 251: /* expr ::= PLUS VARIABLE */
case 252: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==252);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_VARIABLE);}
yymsp[-1].minor.yy418 = yylhsminor.yy418;
break;
case 254: /* expr ::= BOOL */
case 253: /* expr ::= BOOL */
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_BOOL);}
yymsp[0].minor.yy418 = yylhsminor.yy418;
break;
case 255: /* expr ::= NULL */
case 254: /* expr ::= NULL */
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NULL);}
yymsp[0].minor.yy418 = yylhsminor.yy418;
break;
case 256: /* expr ::= ID LP exprlist RP */
case 255: /* expr ::= ID LP exprlist RP */
{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy418 = tSqlExprCreateFunction(yymsp[-1].minor.yy345, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy418 = yylhsminor.yy418;
break;
case 257: /* expr ::= ID LP STAR RP */
case 256: /* expr ::= ID LP STAR RP */
{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy418 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy418 = yylhsminor.yy418;
break;
case 258: /* expr ::= expr IS NULL */
case 257: /* expr ::= expr IS NULL */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, NULL, TK_ISNULL);}
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 259: /* expr ::= expr IS NOT NULL */
case 258: /* expr ::= expr IS NOT NULL */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-3].minor.yy418, NULL, TK_NOTNULL);}
yymsp[-3].minor.yy418 = yylhsminor.yy418;
break;
case 260: /* expr ::= expr LT expr */
case 259: /* expr ::= expr LT expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_LT);}
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 261: /* expr ::= expr GT expr */
case 260: /* expr ::= expr GT expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_GT);}
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 262: /* expr ::= expr LE expr */
case 261: /* expr ::= expr LE expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_LE);}
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 263: /* expr ::= expr GE expr */
case 262: /* expr ::= expr GE expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_GE);}
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 264: /* expr ::= expr NE expr */
case 263: /* expr ::= expr NE expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_NE);}
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 265: /* expr ::= expr EQ expr */
case 264: /* expr ::= expr EQ expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_EQ);}
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 266: /* expr ::= expr BETWEEN expr AND expr */
case 265: /* expr ::= expr BETWEEN expr AND expr */
{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy418); yylhsminor.yy418 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy418, yymsp[-2].minor.yy418, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy418, TK_LE), TK_AND);}
yymsp[-4].minor.yy418 = yylhsminor.yy418;
break;
case 267: /* expr ::= expr AND expr */
case 266: /* expr ::= expr AND expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_AND);}
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 268: /* expr ::= expr OR expr */
case 267: /* expr ::= expr OR expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_OR); }
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 269: /* expr ::= expr PLUS expr */
case 268: /* expr ::= expr PLUS expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_PLUS); }
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 270: /* expr ::= expr MINUS expr */
case 269: /* expr ::= expr MINUS expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_MINUS); }
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 271: /* expr ::= expr STAR expr */
case 270: /* expr ::= expr STAR expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_STAR); }
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 272: /* expr ::= expr SLASH expr */
case 271: /* expr ::= expr SLASH expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_DIVIDE);}
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 273: /* expr ::= expr REM expr */
case 272: /* expr ::= expr REM expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_REM); }
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 274: /* expr ::= expr LIKE expr */
case 273: /* expr ::= expr LIKE expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_LIKE); }
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 275: /* expr ::= expr MATCH expr */
case 274: /* expr ::= expr MATCH expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_MATCH); }
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 276: /* expr ::= expr NMATCH expr */
case 275: /* expr ::= expr NMATCH expr */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_NMATCH); }
yymsp[-2].minor.yy418 = yylhsminor.yy418;
break;
case 277: /* expr ::= expr IN LP exprlist RP */
case 276: /* expr ::= expr IN LP exprlist RP */
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-4].minor.yy418, (tSqlExpr*)yymsp[-1].minor.yy345, TK_IN); }
yymsp[-4].minor.yy418 = yylhsminor.yy418;
break;
case 278: /* exprlist ::= exprlist COMMA expritem */
case 277: /* exprlist ::= exprlist COMMA expritem */
{yylhsminor.yy345 = tSqlExprListAppend(yymsp[-2].minor.yy345,yymsp[0].minor.yy418,0, 0);}
yymsp[-2].minor.yy345 = yylhsminor.yy345;
break;
case 279: /* exprlist ::= expritem */
case 278: /* exprlist ::= expritem */
{yylhsminor.yy345 = tSqlExprListAppend(0,yymsp[0].minor.yy418,0, 0);}
yymsp[0].minor.yy345 = yylhsminor.yy345;
break;
case 280: /* expritem ::= expr */
case 279: /* expritem ::= expr */
{yylhsminor.yy418 = yymsp[0].minor.yy418;}
yymsp[0].minor.yy418 = yylhsminor.yy418;
break;
case 282: /* cmd ::= RESET QUERY CACHE */
case 281: /* cmd ::= RESET QUERY CACHE */
{ setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
break;
case 283: /* cmd ::= SYNCDB ids REPLICA */
case 282: /* cmd ::= SYNCDB ids REPLICA */
{ setDCLSqlElems(pInfo, TSDB_SQL_SYNC_DB_REPLICA, 1, &yymsp[-1].minor.yy0);}
break;
case 284: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
case 283: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 285: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
case 284: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
toTSDBType(yymsp[0].minor.yy0.type);
SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1);
SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, false);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 286: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
case 285: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 287: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
case 286: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 288: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
case 287: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
toTSDBType(yymsp[0].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1);
SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, true);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 289: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
case 288: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
toTSDBType(yymsp[-1].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, true);
toTSDBType(yymsp[0].minor.yy0.type);
A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1);
A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1, true);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 290: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
case 289: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{
yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n;
toTSDBType(yymsp[-2].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1, true);
A = tVariantListAppend(A, &yymsp[0].minor.yy2, -1);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 291: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
case 290: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 292: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
case 291: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 293: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
case 292: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
toTSDBType(yymsp[0].minor.yy0.type);
SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1);
SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, true);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 294: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
case 293: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 295: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
case 294: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 296: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
case 295: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
toTSDBType(yymsp[0].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1);
SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, true);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 297: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
case 296: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
toTSDBType(yymsp[-1].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, true);
toTSDBType(yymsp[0].minor.yy0.type);
A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1);
A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1, true);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 298: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
case 297: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
{
yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n;
toTSDBType(yymsp[-2].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1, true);
A = tVariantListAppend(A, &yymsp[0].minor.yy2, -1);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 299: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
case 298: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 300: /* cmd ::= KILL CONNECTION INTEGER */
case 299: /* cmd ::= KILL CONNECTION INTEGER */
{setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);}
break;
case 301: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
case 300: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);}
break;
case 302: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
case 301: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);}
break;
default:
......
......@@ -57,7 +57,7 @@ int32_t tsdbInsertData(STsdbRepo *repo, SSubmitMsg *pMsg, SShellSubmitRspMsg *pR
STsdbRepo * pRepo = repo;
SSubmitMsgIter msgIter = {0};
SSubmitBlk * pBlock = NULL;
int32_t affectedrows = 0;
int32_t affectedrows = 0, numOfRows = 0;
if (tsdbScanAndConvertSubmitMsg(pRepo, pMsg) < 0) {
if (terrno != TSDB_CODE_TDB_TABLE_RECONFIGURE) {
......@@ -73,9 +73,13 @@ int32_t tsdbInsertData(STsdbRepo *repo, SSubmitMsg *pMsg, SShellSubmitRspMsg *pR
if (tsdbInsertDataToTable(pRepo, pBlock, &affectedrows) < 0) {
return -1;
}
numOfRows += pBlock->numOfRows;
}
if (pRsp != NULL) pRsp->affectedRows = htonl(affectedrows);
if (pRsp != NULL) {
pRsp->affectedRows = htonl(affectedrows);
pRsp->numOfRows = htonl(numOfRows);
}
if (tsdbCheckCommit(pRepo) < 0) return -1;
return 0;
......
......@@ -27,6 +27,10 @@
#define MAX_QUEUED_MSG_NUM 100000
#define MAX_QUEUED_MSG_SIZE 1024*1024*1024 //1GB
static int64_t tsSubmitReqSucNum = 0;
static int64_t tsSubmitRowNum = 0;
static int64_t tsSubmitRowSucNum = 0;
extern void * tsDnodeTmr;
static int32_t (*vnodeProcessWriteMsgFp[TSDB_MSG_TYPE_MAX])(SVnodeObj *, void *pCont, SRspRet *);
static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *);
......@@ -163,7 +167,16 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR
pRsp = pRet->rsp;
}
if (tsdbInsertData(pVnode->tsdb, pCont, pRsp) < 0) code = terrno;
if (tsdbInsertData(pVnode->tsdb, pCont, pRsp) < 0) {
code = terrno;
} else {
if (pRsp != NULL) atomic_fetch_add_64(&tsSubmitReqSucNum, 1);
}
if (pRsp) {
atomic_fetch_add_64(&tsSubmitRowNum, ntohl(pRsp->numOfRows));
atomic_fetch_add_64(&tsSubmitRowSucNum, ntohl(pRsp->affectedRows));
}
return code;
}
......@@ -425,3 +438,12 @@ void vnodeWaitWriteCompleted(SVnodeObj *pVnode) {
if (extraSleep)
taosMsleep(900);
}
SVnodeStatisInfo vnodeGetStatisInfo() {
SVnodeStatisInfo info = {0};
info.submitReqSucNum = atomic_exchange_64(&tsSubmitReqSucNum, 0);
info.submitRowNum = atomic_exchange_64(&tsSubmitRowNum, 0);
info.submitRowSucNum = atomic_exchange_64(&tsSubmitRowSucNum, 0);
return info;
}
......@@ -41,7 +41,7 @@ sql create dnode $hostname2
sleep 10000
sql show log.tables;
if $rows > 6 then
if $rows > 20 then
return -1
endi
......@@ -50,7 +50,7 @@ print ===>rows $rows
print $data00 $data01 $data02
print $data10 $data11 $data12
print $data20 $data21 $data22
if $rows < 10 then
if $rows < 9 then
return -1
endi
......
......@@ -42,7 +42,7 @@ print dnode2 openVnodes $data2_2
if $data2_1 != 0 then
return -1
endi
if $data2_2 != 1 then
if $data2_2 != 2 then
return -1
endi
......@@ -56,7 +56,25 @@ print $data30
print $data40
print $data50
if $rows > 6 then
print *num of tables $rows
if $rows > 17 then
return -1
endi
sql show log.stables
print $data00
print $data10
print $data20
print $data30
print $data40
print $data50
print $data60
print *num of stables $rows
if $rows > 7 then
return -1
endi
......
......@@ -19,7 +19,7 @@ sleep 3000
sql show dnodes
print dnode1 openVnodes $data2_1
if $data2_1 > 2 then
if $data2_1 > 4 then
return -1
endi
......@@ -28,20 +28,20 @@ sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
$x = 0
show2:
show2:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
if $data2_1 != 0 then
goto show2
endi
if $data2_2 > 2 then
if $data2_2 > 4 then
goto show2
endi
......@@ -55,7 +55,7 @@ print $data30
print $data40
print $data50
if $rows > 5 then
if $rows > 14 then
return -1
endi
......@@ -74,4 +74,4 @@ if $rows2 <= $rows1 then
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode2 -s stop -x SIGINT
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册