diff --git a/cmake/cmake.options b/cmake/cmake.options
index 1a1a5b5d78..946eb5d258 100644
--- a/cmake/cmake.options
+++ b/cmake/cmake.options
@@ -18,6 +18,13 @@ IF(${TD_WINDOWS})
ON
)
+ MESSAGE("build iconv Win32")
+ option(
+ BUILD_WITH_ICONV
+ "If build iconv on Windows"
+ ON
+ )
+
ENDIF ()
IF(${TD_LINUX} MATCHES TRUE)
diff --git a/cmake/iconv_CMakeLists.txt.in b/cmake/iconv_CMakeLists.txt.in
new file mode 100644
index 0000000000..31dfd829fc
--- /dev/null
+++ b/cmake/iconv_CMakeLists.txt.in
@@ -0,0 +1,12 @@
+
+# iconv
+ExternalProject_Add(iconv
+ GIT_REPOSITORY https://github.com/win-iconv/win-iconv.git
+ GIT_TAG v0.0.8
+ SOURCE_DIR "${CMAKE_CONTRIB_DIR}/iconv"
+ BINARY_DIR ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ TEST_COMMAND ""
+ )
\ No newline at end of file
diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt
index f87f660ab3..9cf68b87f9 100644
--- a/contrib/CMakeLists.txt
+++ b/contrib/CMakeLists.txt
@@ -83,6 +83,11 @@ if(${BUILD_WITH_NURAFT})
cat("${CMAKE_SUPPORT_DIR}/nuraft_CMakeLists.txt.in" ${CONTRIB_TMP_FILE})
endif(${BUILD_WITH_NURAFT})
+# iconv
+if(${BUILD_WITH_ICONV})
+ cat("${CMAKE_SUPPORT_DIR}/iconv_CMakeLists.txt.in" ${CONTRIB_TMP_FILE})
+endif(${BUILD_WITH_ICONV})
+
# download dependencies
configure_file(${CONTRIB_TMP_FILE} "${CMAKE_CONTRIB_DIR}/deps-download/CMakeLists.txt")
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
@@ -208,14 +213,10 @@ endif(${BUILD_WITH_TRAFT})
# LIBUV
if(${BUILD_WITH_UV})
- if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
- MESSAGE("Windows need set no-sign-compare")
- add_compile_options(-Wno-sign-compare)
- endif ()
- if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
- file(READ "libuv/include/uv.h" CONTENTS)
- string(REGEX REPLACE "/([\r]*)\nstruct uv_tcp_s {" "/\\1\ntypedef BOOL (PASCAL *LPFN_CONNECTEX) (SOCKET s, const struct sockaddr* name, int namelen, PVOID lpSendBuffer, DWORD dwSendDataLength,LPDWORD lpdwBytesSent, LPOVERLAPPED lpOverlapped);\\1\nstruct uv_tcp_s {" CONTENTS_NEW "${CONTENTS}")
- file(WRITE "libuv/include/uv.h" "${CONTENTS_NEW}")
+ if (${TD_WINDOWS})
+ file(READ "libuv/include/uv.h" CONTENTS)
+ string(REGEX REPLACE "/([\r]*)\nstruct uv_tcp_s {" "/\\1\ntypedef BOOL (PASCAL *LPFN_CONNECTEX) (SOCKET s, const struct sockaddr* name, int namelen, PVOID lpSendBuffer, DWORD dwSendDataLength,LPDWORD lpdwBytesSent, LPOVERLAPPED lpOverlapped);\\1\nstruct uv_tcp_s {" CONTENTS_NEW "${CONTENTS}")
+ file(WRITE "libuv/include/uv.h" "${CONTENTS_NEW}")
endif ()
add_subdirectory(libuv)
endif(${BUILD_WITH_UV})
@@ -249,10 +250,14 @@ endif(${BUILD_WITH_SQLITE})
# pthread
if(${BUILD_PTHREAD})
- ADD_DEFINITIONS("-DPTW32_STATIC_LIB")
- add_subdirectory(pthread-win32)
+ add_definitions(-DPTW32_STATIC_LIB)
+ add_subdirectory(pthread)
endif(${BUILD_PTHREAD})
+# iconv
+if(${BUILD_WITH_ICONV})
+ add_subdirectory(iconv)
+endif(${BUILD_WITH_ICONV})
# ================================================================================================
# Build test
diff --git a/include/common/tmsg.h b/include/common/tmsg.h
index 1621b175dd..bd4cc52837 100644
--- a/include/common/tmsg.h
+++ b/include/common/tmsg.h
@@ -111,15 +111,16 @@ typedef enum _mgmt_table {
TSDB_MGMT_TABLE_MAX,
} EShowType;
-#define TSDB_ALTER_TABLE_ADD_TAG 1
-#define TSDB_ALTER_TABLE_DROP_TAG 2
-#define TSDB_ALTER_TABLE_UPDATE_TAG_NAME 3
-#define TSDB_ALTER_TABLE_UPDATE_TAG_VAL 4
-
+#define TSDB_ALTER_TABLE_ADD_TAG 1
+#define TSDB_ALTER_TABLE_DROP_TAG 2
+#define TSDB_ALTER_TABLE_UPDATE_TAG_NAME 3
+#define TSDB_ALTER_TABLE_UPDATE_TAG_VAL 4
#define TSDB_ALTER_TABLE_ADD_COLUMN 5
#define TSDB_ALTER_TABLE_DROP_COLUMN 6
#define TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES 7
#define TSDB_ALTER_TABLE_UPDATE_TAG_BYTES 8
+#define TSDB_ALTER_TABLE_UPDATE_OPTIONS 9
+#define TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME 10
#define TSDB_FILL_NONE 0
#define TSDB_FILL_NULL 1
@@ -2052,27 +2053,19 @@ static FORCE_INLINE void* tDecodeTSma(void* buf, STSma* pSma) {
buf = taosDecodeFixedI64(buf, &pSma->sliding);
if (pSma->exprLen > 0) {
- pSma->expr = (char*)calloc(pSma->exprLen, 1);
- if (pSma->expr != NULL) {
- buf = taosDecodeStringTo(buf, pSma->expr);
- } else {
+ if ((buf = taosDecodeString(buf, &pSma->expr)) == NULL) {
tdDestroyTSma(pSma);
return NULL;
}
-
} else {
pSma->expr = NULL;
}
if (pSma->tagsFilterLen > 0) {
- pSma->tagsFilter = (char*)calloc(pSma->tagsFilterLen, 1);
- if (pSma->tagsFilter != NULL) {
- buf = taosDecodeStringTo(buf, pSma->tagsFilter);
- } else {
+ if ((buf = taosDecodeString(buf, &pSma->tagsFilter)) == NULL) {
tdDestroyTSma(pSma);
return NULL;
}
-
} else {
pSma->tagsFilter = NULL;
}
diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h
index 167c72a778..27d509e931 100644
--- a/include/common/ttokendef.h
+++ b/include/common/ttokendef.h
@@ -34,128 +34,147 @@
#define TK_NK_REM 16
#define TK_NK_CONCAT 17
#define TK_CREATE 18
-#define TK_USER 19
-#define TK_PASS 20
-#define TK_NK_STRING 21
-#define TK_ALTER 22
-#define TK_PRIVILEGE 23
-#define TK_DROP 24
-#define TK_SHOW 25
-#define TK_USERS 26
-#define TK_DNODE 27
-#define TK_PORT 28
-#define TK_NK_INTEGER 29
-#define TK_DNODES 30
-#define TK_NK_ID 31
-#define TK_NK_IPTOKEN 32
-#define TK_QNODE 33
-#define TK_ON 34
-#define TK_QNODES 35
-#define TK_DATABASE 36
-#define TK_DATABASES 37
-#define TK_USE 38
-#define TK_IF 39
-#define TK_NOT 40
-#define TK_EXISTS 41
-#define TK_BLOCKS 42
-#define TK_CACHE 43
-#define TK_CACHELAST 44
-#define TK_COMP 45
-#define TK_DAYS 46
-#define TK_FSYNC 47
-#define TK_MAXROWS 48
-#define TK_MINROWS 49
-#define TK_KEEP 50
-#define TK_PRECISION 51
-#define TK_QUORUM 52
-#define TK_REPLICA 53
-#define TK_TTL 54
-#define TK_WAL 55
-#define TK_VGROUPS 56
-#define TK_SINGLE_STABLE 57
-#define TK_STREAM_MODE 58
-#define TK_TABLE 59
-#define TK_NK_LP 60
-#define TK_NK_RP 61
-#define TK_STABLE 62
-#define TK_TABLES 63
-#define TK_STABLES 64
-#define TK_USING 65
-#define TK_TAGS 66
-#define TK_NK_DOT 67
-#define TK_NK_COMMA 68
-#define TK_COMMENT 69
-#define TK_BOOL 70
-#define TK_TINYINT 71
-#define TK_SMALLINT 72
-#define TK_INT 73
-#define TK_INTEGER 74
-#define TK_BIGINT 75
-#define TK_FLOAT 76
-#define TK_DOUBLE 77
-#define TK_BINARY 78
-#define TK_TIMESTAMP 79
-#define TK_NCHAR 80
-#define TK_UNSIGNED 81
-#define TK_JSON 82
-#define TK_VARCHAR 83
-#define TK_MEDIUMBLOB 84
-#define TK_BLOB 85
-#define TK_VARBINARY 86
-#define TK_DECIMAL 87
-#define TK_SMA 88
-#define TK_INDEX 89
-#define TK_FULLTEXT 90
-#define TK_FUNCTION 91
-#define TK_INTERVAL 92
-#define TK_TOPIC 93
-#define TK_AS 94
-#define TK_MNODES 95
-#define TK_NK_FLOAT 96
-#define TK_NK_BOOL 97
-#define TK_NK_VARIABLE 98
-#define TK_BETWEEN 99
-#define TK_IS 100
-#define TK_NULL 101
-#define TK_NK_LT 102
-#define TK_NK_GT 103
-#define TK_NK_LE 104
-#define TK_NK_GE 105
-#define TK_NK_NE 106
-#define TK_NK_EQ 107
-#define TK_LIKE 108
-#define TK_MATCH 109
-#define TK_NMATCH 110
-#define TK_IN 111
-#define TK_FROM 112
-#define TK_JOIN 113
-#define TK_INNER 114
-#define TK_SELECT 115
-#define TK_DISTINCT 116
-#define TK_WHERE 117
-#define TK_PARTITION 118
-#define TK_BY 119
-#define TK_SESSION 120
-#define TK_STATE_WINDOW 121
-#define TK_SLIDING 122
-#define TK_FILL 123
-#define TK_VALUE 124
-#define TK_NONE 125
-#define TK_PREV 126
-#define TK_LINEAR 127
-#define TK_NEXT 128
-#define TK_GROUP 129
-#define TK_HAVING 130
-#define TK_ORDER 131
-#define TK_SLIMIT 132
-#define TK_SOFFSET 133
-#define TK_LIMIT 134
-#define TK_OFFSET 135
-#define TK_ASC 136
-#define TK_DESC 137
-#define TK_NULLS 138
-#define TK_FIRST 139
-#define TK_LAST 140
+#define TK_ACCOUNT 19
+#define TK_NK_ID 20
+#define TK_PASS 21
+#define TK_NK_STRING 22
+#define TK_ALTER 23
+#define TK_PPS 24
+#define TK_TSERIES 25
+#define TK_STORAGE 26
+#define TK_STREAMS 27
+#define TK_QTIME 28
+#define TK_DBS 29
+#define TK_USERS 30
+#define TK_CONNS 31
+#define TK_STATE 32
+#define TK_USER 33
+#define TK_PRIVILEGE 34
+#define TK_DROP 35
+#define TK_SHOW 36
+#define TK_DNODE 37
+#define TK_PORT 38
+#define TK_NK_INTEGER 39
+#define TK_DNODES 40
+#define TK_NK_IPTOKEN 41
+#define TK_LOCAL 42
+#define TK_QNODE 43
+#define TK_ON 44
+#define TK_QNODES 45
+#define TK_DATABASE 46
+#define TK_DATABASES 47
+#define TK_USE 48
+#define TK_IF 49
+#define TK_NOT 50
+#define TK_EXISTS 51
+#define TK_BLOCKS 52
+#define TK_CACHE 53
+#define TK_CACHELAST 54
+#define TK_COMP 55
+#define TK_DAYS 56
+#define TK_FSYNC 57
+#define TK_MAXROWS 58
+#define TK_MINROWS 59
+#define TK_KEEP 60
+#define TK_PRECISION 61
+#define TK_QUORUM 62
+#define TK_REPLICA 63
+#define TK_TTL 64
+#define TK_WAL 65
+#define TK_VGROUPS 66
+#define TK_SINGLE_STABLE 67
+#define TK_STREAM_MODE 68
+#define TK_RETENTIONS 69
+#define TK_FILE_FACTOR 70
+#define TK_NK_FLOAT 71
+#define TK_TABLE 72
+#define TK_NK_LP 73
+#define TK_NK_RP 74
+#define TK_STABLE 75
+#define TK_TABLES 76
+#define TK_STABLES 77
+#define TK_ADD 78
+#define TK_COLUMN 79
+#define TK_MODIFY 80
+#define TK_RENAME 81
+#define TK_TAG 82
+#define TK_SET 83
+#define TK_NK_EQ 84
+#define TK_USING 85
+#define TK_TAGS 86
+#define TK_NK_DOT 87
+#define TK_NK_COMMA 88
+#define TK_COMMENT 89
+#define TK_BOOL 90
+#define TK_TINYINT 91
+#define TK_SMALLINT 92
+#define TK_INT 93
+#define TK_INTEGER 94
+#define TK_BIGINT 95
+#define TK_FLOAT 96
+#define TK_DOUBLE 97
+#define TK_BINARY 98
+#define TK_TIMESTAMP 99
+#define TK_NCHAR 100
+#define TK_UNSIGNED 101
+#define TK_JSON 102
+#define TK_VARCHAR 103
+#define TK_MEDIUMBLOB 104
+#define TK_BLOB 105
+#define TK_VARBINARY 106
+#define TK_DECIMAL 107
+#define TK_SMA 108
+#define TK_ROLLUP 109
+#define TK_INDEX 110
+#define TK_FULLTEXT 111
+#define TK_FUNCTION 112
+#define TK_INTERVAL 113
+#define TK_TOPIC 114
+#define TK_AS 115
+#define TK_MNODES 116
+#define TK_NK_BOOL 117
+#define TK_NK_VARIABLE 118
+#define TK_BETWEEN 119
+#define TK_IS 120
+#define TK_NULL 121
+#define TK_NK_LT 122
+#define TK_NK_GT 123
+#define TK_NK_LE 124
+#define TK_NK_GE 125
+#define TK_NK_NE 126
+#define TK_LIKE 127
+#define TK_MATCH 128
+#define TK_NMATCH 129
+#define TK_IN 130
+#define TK_FROM 131
+#define TK_JOIN 132
+#define TK_INNER 133
+#define TK_SELECT 134
+#define TK_DISTINCT 135
+#define TK_WHERE 136
+#define TK_PARTITION 137
+#define TK_BY 138
+#define TK_SESSION 139
+#define TK_STATE_WINDOW 140
+#define TK_SLIDING 141
+#define TK_FILL 142
+#define TK_VALUE 143
+#define TK_NONE 144
+#define TK_PREV 145
+#define TK_LINEAR 146
+#define TK_NEXT 147
+#define TK_GROUP 148
+#define TK_HAVING 149
+#define TK_ORDER 150
+#define TK_SLIMIT 151
+#define TK_SOFFSET 152
+#define TK_LIMIT 153
+#define TK_OFFSET 154
+#define TK_ASC 155
+#define TK_DESC 156
+#define TK_NULLS 157
+#define TK_FIRST 158
+#define TK_LAST 159
#define TK_NK_SPACE 300
#define TK_NK_COMMENT 301
diff --git a/include/common/ttypes.h b/include/common/ttypes.h
index 5aa22bdcad..a936ea3b54 100644
--- a/include/common/ttypes.h
+++ b/include/common/ttypes.h
@@ -27,7 +27,7 @@ extern "C" {
typedef int32_t VarDataOffsetT;
typedef uint32_t TDRowLenT;
typedef uint8_t TDRowValT;
-typedef uint16_t col_id_t;
+typedef int16_t col_id_t;
typedef int8_t col_type_t;
#pragma pack(push, 1)
diff --git a/include/common/tvariant.h b/include/common/tvariant.h
index 995015fe63..63f305ab2d 100644
--- a/include/common/tvariant.h
+++ b/include/common/tvariant.h
@@ -31,7 +31,7 @@ typedef struct SVariant {
uint64_t u;
double d;
char *pz;
- wchar_t *wpz;
+ TdUcs4 *ucs4;
SArray *arr; // only for 'in' query to hold value list, not value for a field
};
} SVariant;
diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h
index 5d7174fc08..5dbfd6c2c2 100644
--- a/include/libs/nodes/cmdnodes.h
+++ b/include/libs/nodes/cmdnodes.h
@@ -127,6 +127,18 @@ typedef struct SDropSuperTableStmt {
bool ignoreNotExists;
} SDropSuperTableStmt;
+typedef struct SAlterTableStmt {
+ ENodeType type;
+ char dbName[TSDB_DB_NAME_LEN];
+ char tableName[TSDB_TABLE_NAME_LEN];
+ int8_t alterType;
+ char colName[TSDB_COL_NAME_LEN];
+ char newColName[TSDB_COL_NAME_LEN];
+ STableOptions* pOptions;
+ SDataType dataType;
+ SValueNode* pVal;
+} SAlterTableStmt;
+
typedef struct SCreateUserStmt {
ENodeType type;
char useName[TSDB_USER_LEN];
@@ -158,6 +170,13 @@ typedef struct SDropDnodeStmt {
int32_t port;
} SDropDnodeStmt;
+typedef struct SAlterDnodeStmt {
+ ENodeType type;
+ int32_t dnodeId;
+ char config[TSDB_DNODE_CONFIG_LEN];
+ char value[TSDB_DNODE_VALUE_LEN];
+} SAlterDnodeStmt;
+
typedef struct SShowStmt {
ENodeType type;
char dbName[TSDB_DB_NAME_LEN];
@@ -215,6 +234,12 @@ typedef struct SDropTopicStmt {
bool ignoreNotExists;
} SDropTopicStmt;
+typedef struct SAlterLocalStmt {
+ ENodeType type;
+ char config[TSDB_DNODE_CONFIG_LEN];
+ char value[TSDB_DNODE_VALUE_LEN];
+} SAlterLocalStmt;
+
#ifdef __cplusplus
}
#endif
diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h
index 4ef70fc7ab..d7e67be9e0 100644
--- a/include/libs/nodes/nodes.h
+++ b/include/libs/nodes/nodes.h
@@ -85,6 +85,7 @@ typedef enum ENodeType {
QUERY_NODE_DROP_TABLE_CLAUSE,
QUERY_NODE_DROP_TABLE_STMT,
QUERY_NODE_DROP_SUPER_TABLE_STMT,
+ QUERY_NODE_ALTER_TABLE_STMT,
QUERY_NODE_SHOW_TABLES_STMT, // temp
QUERY_NODE_SHOW_STABLES_STMT,
QUERY_NODE_CREATE_USER_STMT,
@@ -94,6 +95,7 @@ typedef enum ENodeType {
QUERY_NODE_USE_DATABASE_STMT,
QUERY_NODE_CREATE_DNODE_STMT,
QUERY_NODE_DROP_DNODE_STMT,
+ QUERY_NODE_ALTER_DNODE_STMT,
QUERY_NODE_SHOW_DNODES_STMT,
QUERY_NODE_SHOW_VGROUPS_STMT,
QUERY_NODE_SHOW_MNODES_STMT,
@@ -104,6 +106,7 @@ typedef enum ENodeType {
QUERY_NODE_DROP_QNODE_STMT,
QUERY_NODE_CREATE_TOPIC_STMT,
QUERY_NODE_DROP_TOPIC_STMT,
+ QUERY_NODE_ALTER_LOCAL_STMT,
// logic plan node
QUERY_NODE_LOGIC_PLAN_SCAN,
@@ -163,6 +166,7 @@ SNodeList* nodesMakeList();
int32_t nodesListAppend(SNodeList* pList, SNodeptr pNode);
int32_t nodesListStrictAppend(SNodeList* pList, SNodeptr pNode);
int32_t nodesListAppendList(SNodeList* pTarget, SNodeList* pSrc);
+int32_t nodesListStrictAppendList(SNodeList* pTarget, SNodeList* pSrc);
SListCell* nodesListErase(SNodeList* pList, SListCell* pCell);
SNodeptr nodesListGetNode(SNodeList* pList, int32_t index);
void nodesDestroyList(SNodeList* pList);
diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h
index 1d89b07539..18417cb608 100644
--- a/include/libs/nodes/plannodes.h
+++ b/include/libs/nodes/plannodes.h
@@ -26,7 +26,6 @@ extern "C" {
typedef struct SLogicNode {
ENodeType type;
- int32_t id;
SNodeList* pTargets; // SColumnNode
SNode* pConditions;
SNodeList* pChildren;
@@ -167,6 +166,7 @@ typedef struct SScanPhysiNode {
typedef SScanPhysiNode SSystemTableScanPhysiNode;
typedef SScanPhysiNode STagScanPhysiNode;
+typedef SScanPhysiNode SStreamScanPhysiNode;
typedef struct STableScanPhysiNode {
SScanPhysiNode scan;
diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h
index fe44d8666b..a55a0e218d 100644
--- a/include/libs/nodes/querynodes.h
+++ b/include/libs/nodes/querynodes.h
@@ -23,6 +23,9 @@ extern "C" {
#include "nodes.h"
#include "tmsg.h"
+#define TABLE_META_SIZE(pMeta) (NULL == (pMeta) ? 0 : (sizeof(STableMeta) + ((pMeta)->tableInfo.numOfColumns + (pMeta)->tableInfo.numOfTags) * sizeof(SSchema)))
+#define VGROUPS_INFO_SIZE(pInfo) (NULL == (pInfo) ? 0 : (sizeof(SVgroupsInfo) + (pInfo)->numOfVgroups * sizeof(SVgroupInfo)))
+
typedef struct SRawExprNode {
ENodeType nodeType;
char* p;
diff --git a/include/libs/parser/parser.h b/include/libs/parser/parser.h
index 77838c705f..23bcdabb1b 100644
--- a/include/libs/parser/parser.h
+++ b/include/libs/parser/parser.h
@@ -26,6 +26,7 @@ typedef struct SParseContext {
uint64_t requestId;
int32_t acctId;
const char *db;
+ bool streamQuery;
void *pTransporter;
SEpSet mgmtEpSet;
const char *pSql; // sql string
diff --git a/include/libs/qcom/query.h b/include/libs/qcom/query.h
index c8df40aedc..b6f42eeee0 100644
--- a/include/libs/qcom/query.h
+++ b/include/libs/qcom/query.h
@@ -49,6 +49,10 @@ typedef struct STableComInfo {
int32_t rowSize; // row size of the schema
} STableComInfo;
+typedef struct SIndexMeta {
+
+} SIndexMeta;
+
/*
* ASSERT(sizeof(SCTableMeta) == 24)
* ASSERT(tableType == TSDB_CHILD_TABLE)
diff --git a/include/os/osFile.h b/include/os/osFile.h
index 209cecedf8..508a522679 100644
--- a/include/os/osFile.h
+++ b/include/os/osFile.h
@@ -22,15 +22,6 @@ extern "C" {
#include "osSocket.h"
-#if defined(WINDOWS)
-typedef int32_t FileFd;
-typedef int32_t SocketFd;
-#else
-typedef int32_t FileFd;
-typedef int32_t SocketFd;
-#endif
-
-int64_t taosRead(FileFd fd, void *buf, int64_t count);
// If the error is in a third-party library, place this header file under the third-party library header file.
#ifndef ALLOW_FORBID_FUNC
#define open OPEN_FUNC_TAOS_FORBID
@@ -42,6 +33,7 @@ int64_t taosRead(FileFd fd, void *buf, int64_t count);
#define close CLOSE_FUNC_TAOS_FORBID
#define fclose FCLOSE_FUNC_TAOS_FORBID
#define fsync FSYNC_FUNC_TAOS_FORBID
+ #define getline GETLINE_FUNC_TAOS_FORBID
// #define fflush FFLUSH_FUNC_TAOS_FORBID
#endif
@@ -49,15 +41,6 @@ int64_t taosRead(FileFd fd, void *buf, int64_t count);
#define PATH_MAX 256
#endif
-typedef int32_t FileFd;
-
-typedef struct TdFile {
- pthread_rwlock_t rwlock;
- int refId;
- FileFd fd;
- FILE *fp;
-} * TdFilePtr, TdFile;
-
typedef struct TdFile *TdFilePtr;
#define TD_FILE_CTEATE 0x0001
@@ -95,10 +78,6 @@ int64_t taosPReadFile(TdFilePtr pFile, void *buf, int64_t count, int64_t offset)
int64_t taosWriteFile(TdFilePtr pFile, const void *buf, int64_t count);
void taosFprintfFile(TdFilePtr pFile, const char *format, ...);
-#if defined(WINDOWS)
-#define __restrict__
-#endif // WINDOWS
-
int64_t taosGetLineFile(TdFilePtr pFile, char ** __restrict__ ptrBuf);
int32_t taosEOFFile(TdFilePtr pFile);
@@ -111,15 +90,7 @@ int32_t taosRemoveFile(const char *path);
void taosGetTmpfilePath(const char *inputTmpDir, const char *fileNamePrefix, char *dstPath);
-#if defined(_TD_DARWIN_64)
-typedef int32_t SocketFd;
-
-int64_t taosSendFile(SocketFd fdDst, FileFd pFileSrc, int64_t *offset, int64_t size);
-int64_t taosFSendFile(FILE *pFileOut, FILE *pFileIn, int64_t *offset, int64_t size);
-#else
-int64_t taosSendFile(SocketFd fdDst, TdFilePtr pFileSrc, int64_t *offset, int64_t size);
int64_t taosFSendFile(TdFilePtr pFileOut, TdFilePtr pFileIn, int64_t *offset, int64_t size);
-#endif
void *taosMmapReadOnlyFile(TdFilePtr pFile, int64_t length);
bool taosValidFile(TdFilePtr pFile);
diff --git a/include/os/osString.h b/include/os/osString.h
index 88160dd69e..9c6d523ab2 100644
--- a/include/os/osString.h
+++ b/include/os/osString.h
@@ -20,16 +20,28 @@
extern "C" {
#endif
+typedef wchar_t TdWchar;
+typedef int32_t TdUcs4;
+
+// If the error is in a third-party library, place this header file under the third-party library header file.
+#ifndef ALLOW_FORBID_FUNC
+ #define iconv_open ICONV_OPEN_FUNC_TAOS_FORBID
+ #define iconv_close ICONV_CLOSE_FUNC_TAOS_FORBID
+ #define iconv ICONV_FUNC_TAOS_FORBID
+ #define wcwidth WCWIDTH_FUNC_TAOS_FORBID
+ #define wcswidth WCSWIDTH_FUNC_TAOS_FORBID
+ #define mbtowc MBTOWC_FUNC_TAOS_FORBID
+ #define mbstowcs MBSTOWCS_FUNC_TAOS_FORBID
+ #define wctomb WCTOMB_FUNC_TAOS_FORBID
+ #define wcstombs WCSTOMBS_FUNC_TAOS_FORBID
+ #define wcsncpy WCSNCPY_FUNC_TAOS_FORBID
+ #define wchar_t WCHAR_T_FUNC_TAOS_FORBID
+#endif
+
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
#define tstrdup(str) _strdup(str)
- #define tstrndup(str, size) _strndup(str, size)
- int32_t tgetline(char **lineptr, size_t *n, FILE *stream);
- int32_t twcslen(const wchar_t *wcs);
#else
#define tstrdup(str) strdup(str)
- #define tstrndup(str, size) strndup(str, size)
- #define tgetline(lineptr, n, stream) getline(lineptr, n, stream)
- #define twcslen wcslen
#endif
#define tstrncpy(dst, src, size) \
@@ -38,14 +50,22 @@ extern "C" {
(dst)[(size)-1] = 0; \
} while (0)
+int32_t taosUcs4len(TdUcs4 *ucs4);
int64_t taosStr2int64(const char *str);
-// USE_LIBICONV
-int32_t taosUcs4ToMbs(void *ucs4, int32_t ucs4_max_len, char *mbs);
-bool taosMbsToUcs4(const char *mbs, size_t mbs_len, char *ucs4, int32_t ucs4_max_len, int32_t *len);
-int32_t tasoUcs4Compare(void *f1_ucs4, void *f2_ucs4, int32_t bytes, int8_t ncharSize);
+int32_t taosUcs4ToMbs(TdUcs4 *ucs4, int32_t ucs4_max_len, char *mbs);
+bool taosMbsToUcs4(const char *mbs, size_t mbs_len, TdUcs4 *ucs4, int32_t ucs4_max_len, int32_t *len);
+int32_t tasoUcs4Compare(TdUcs4 *f1_ucs4, TdUcs4 *f2_ucs4, int32_t bytes);
+TdUcs4* tasoUcs4Copy(TdUcs4 *target_ucs4, TdUcs4 *source_ucs4, int32_t len_ucs4);
bool taosValidateEncodec(const char *encodec);
+int32_t taosWcharWidth(TdWchar wchar);
+int32_t taosWcharsWidth(TdWchar *pWchar, int32_t size);
+int32_t taosMbToWchar(TdWchar *pWchar, const char *pStr, int32_t size);
+int32_t taosMbsToWchars(TdWchar *pWchars, const char *pStrs, int32_t size);
+int32_t taosWcharToMb(char *pStr, TdWchar wchar);
+int32_t taosWcharsToMbs(char *pStrs, TdWchar *pWchars, int32_t size);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/util/taoserror.h b/include/util/taoserror.h
index fe06a1c4a2..7023691fe0 100644
--- a/include/util/taoserror.h
+++ b/include/util/taoserror.h
@@ -482,6 +482,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_PAR_PASSWD_EMPTY TAOS_DEF_ERROR_CODE(0, 0x2611)
#define TSDB_CODE_PAR_INVALID_PORT TAOS_DEF_ERROR_CODE(0, 0x2612)
#define TSDB_CODE_PAR_INVALID_ENDPOINT TAOS_DEF_ERROR_CODE(0, 0x2613)
+#define TSDB_CODE_PAR_EXPRIE_STATEMENT TAOS_DEF_ERROR_CODE(0, 0x2614)
#ifdef __cplusplus
}
diff --git a/include/util/tcompare.h b/include/util/tcompare.h
index 4c80eeb4f6..cc9e8ae464 100644
--- a/include/util/tcompare.h
+++ b/include/util/tcompare.h
@@ -46,7 +46,7 @@ typedef struct SPatternCompareInfo {
int32_t patternMatch(const char *pattern, const char *str, size_t size, const SPatternCompareInfo *pInfo);
-int32_t WCSPatternMatch(const wchar_t *pattern, const wchar_t *str, size_t size, const SPatternCompareInfo *pInfo);
+int32_t WCSPatternMatch(const TdUcs4 *pattern, const TdUcs4 *str, size_t size, const SPatternCompareInfo *pInfo);
int32_t taosArrayCompareString(const void *a, const void *b);
diff --git a/include/util/tdef.h b/include/util/tdef.h
index f6c4ae8d42..47fc619473 100644
--- a/include/util/tdef.h
+++ b/include/util/tdef.h
@@ -41,7 +41,7 @@ extern const int32_t TYPE_BYTES[15];
#define DOUBLE_BYTES sizeof(double)
#define POINTER_BYTES sizeof(void *) // 8 by default assert(sizeof(ptrdiff_t) == sizseof(void*)
#define TSDB_KEYSIZE sizeof(TSKEY)
-#define TSDB_NCHAR_SIZE sizeof(int32_t)
+#define TSDB_NCHAR_SIZE sizeof(TdUcs4)
// NULL definition
#define TSDB_DATA_BOOL_NULL 0x02
diff --git a/include/util/tjson.h b/include/util/tjson.h
index 1218caae35..b27f3b93ac 100644
--- a/include/util/tjson.h
+++ b/include/util/tjson.h
@@ -44,6 +44,7 @@ int32_t tjsonGetIntValue(const SJson* pJson, const char* pName, int32_t* pVal);
int32_t tjsonGetSmallIntValue(const SJson* pJson, const char* pName, int16_t* pVal);
int32_t tjsonGetTinyIntValue(const SJson* pJson, const char* pName, int8_t* pVal);
int32_t tjsonGetUBigIntValue(const SJson* pJson, const char* pName, uint64_t* pVal);
+int32_t tjsonGetUIntValue(const SJson* pJson, const char* pName, uint32_t* pVal);
int32_t tjsonGetUTinyIntValue(const SJson* pJson, const char* pName, uint8_t* pVal);
int32_t tjsonGetBoolValue(const SJson* pJson, const char* pName, bool* pVal);
int32_t tjsonGetDoubleValue(const SJson* pJson, const char* pName, double* pVal);
@@ -60,6 +61,7 @@ int32_t tjsonAddArray(SJson* pJson, const char* pName, FToJson func, const void*
typedef int32_t (*FToObject)(const SJson* pJson, void* pObj);
int32_t tjsonToObject(const SJson* pJson, const char* pName, FToObject func, void* pObj);
+int32_t tjsonMakeObject(const SJson* pJson, const char* pName, FToObject func, void** pObj, int32_t objSize);
int32_t tjsonToArray(const SJson* pJson, const char* pName, FToObject func, void* pArray, int32_t itemSize);
char* tjsonToString(const SJson* pJson);
diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h
index b672c9bb47..e341729a8f 100644
--- a/source/client/inc/clientInt.h
+++ b/source/client/inc/clientInt.h
@@ -179,6 +179,7 @@ typedef struct SRequestObj {
uint64_t requestId;
int32_t type; // request type
STscObj* pTscObj;
+ char* pDb;
char* sqlstr; // sql string
int32_t sqlLen;
int64_t self;
@@ -229,7 +230,7 @@ void setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32_t
int32_t buildRequest(STscObj* pTscObj, const char* sql, int sqlLen, SRequestObj** pRequest);
-int32_t parseSql(SRequestObj* pRequest, SQuery** pQuery);
+int32_t parseSql(SRequestObj* pRequest, bool streamQuery, SQuery** pQuery);
int32_t getPlan(SRequestObj* pRequest, SQuery* pQuery, SQueryPlan** pPlan, SArray* pNodeList);
// --- heartbeat
diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c
index 525c5f9fb8..2233742625 100644
--- a/source/client/src/clientEnv.c
+++ b/source/client/src/clientEnv.c
@@ -150,6 +150,7 @@ void *createRequest(STscObj *pObj, __taos_async_fn_t fp, void *param, int32_t ty
return NULL;
}
+ pRequest->pDb = getDbOfConnection(pObj);
pRequest->requestId = generateRequestId();
pRequest->metric.start = taosGetTimestampMs();
@@ -180,6 +181,7 @@ static void doDestroyRequest(void *p) {
tfree(pRequest->msgBuf);
tfree(pRequest->sqlstr);
tfree(pRequest->pInfo);
+ tfree(pRequest->pDb);
doFreeReqResultInfo(&pRequest->body.resInfo);
qDestroyQueryPlan(pRequest->body.pDag);
diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c
index fc97f4113c..aa94ed42fd 100644
--- a/source/client/src/clientImpl.c
+++ b/source/client/src/clientImpl.c
@@ -137,13 +137,14 @@ int32_t buildRequest(STscObj* pTscObj, const char* sql, int sqlLen, SRequestObj*
return TSDB_CODE_SUCCESS;
}
-int32_t parseSql(SRequestObj* pRequest, SQuery** pQuery) {
+int32_t parseSql(SRequestObj* pRequest, bool streamQuery, SQuery** pQuery) {
STscObj* pTscObj = pRequest->pTscObj;
SParseContext cxt = {
.requestId = pRequest->requestId,
.acctId = pTscObj->acctId,
- .db = getDbOfConnection(pTscObj),
+ .db = pRequest->pDb,
+ .streamQuery = streamQuery,
.pSql = pRequest->sqlstr,
.sqlLen = pRequest->sqlLen,
.pMsg = pRequest->msgBuf,
@@ -154,7 +155,6 @@ int32_t parseSql(SRequestObj* pRequest, SQuery** pQuery) {
cxt.mgmtEpSet = getEpSet_s(&pTscObj->pAppInfo->mgmtEp);
int32_t code = catalogGetHandle(pTscObj->pAppInfo->clusterId, &cxt.pCatalog);
if (code != TSDB_CODE_SUCCESS) {
- tfree(cxt.db);
return code;
}
@@ -163,7 +163,6 @@ int32_t parseSql(SRequestObj* pRequest, SQuery** pQuery) {
setResSchemaInfo(&pRequest->body.resInfo, (*pQuery)->pResSchema, (*pQuery)->numOfResCols);
}
- tfree(cxt.db);
return code;
}
@@ -249,7 +248,7 @@ TAOS_RES* taos_query_l(TAOS* taos, const char* sql, int sqlLen) {
terrno = TSDB_CODE_SUCCESS;
CHECK_CODE_GOTO(buildRequest(pTscObj, sql, sqlLen, &pRequest), _return);
- CHECK_CODE_GOTO(parseSql(pRequest, &pQuery), _return);
+ CHECK_CODE_GOTO(parseSql(pRequest, false, &pQuery), _return);
if (pQuery->directRpc) {
CHECK_CODE_GOTO(execDdlQuery(pRequest, pQuery), _return);
diff --git a/source/client/src/tmq.c b/source/client/src/tmq.c
index ee13527b96..2aebd67c56 100644
--- a/source/client/src/tmq.c
+++ b/source/client/src/tmq.c
@@ -482,38 +482,24 @@ TAOS_RES* tmq_create_topic(TAOS* taos, const char* topicName, const char* sql, i
}
tscDebug("start to create topic, %s", topicName);
-#if 0
- CHECK_CODE_GOTO(buildRequest(pTscObj, sql, sqlLen, &pRequest), _return);
- CHECK_CODE_GOTO(parseSql(pRequest, &pQueryNode), _return);
- pQueryNode->streamQuery = true;
+ CHECK_CODE_GOTO(buildRequest(pTscObj, sql, sqlLen, &pRequest), _return);
+ CHECK_CODE_GOTO(parseSql(pRequest, true, &pQueryNode), _return);
// todo check for invalid sql statement and return with error code
- SSchema* schema = NULL;
- int32_t numOfCols = 0;
- CHECK_CODE_GOTO(getPlan(pRequest, pQueryNode, &pRequest->body.pDag, NULL), _return);
-
- pStr = qQueryPlanToString(pRequest->body.pDag);
- if (pStr == NULL) {
- goto _return;
- }
+ CHECK_CODE_GOTO(nodesNodeToString(pQueryNode->pRoot, false, &pStr, NULL), _return);
/*printf("%s\n", pStr);*/
- // The topic should be related to a database that the queried table is belonged to.
- SName name = {0};
- char dbName[TSDB_DB_FNAME_LEN] = {0};
- // tNameGetFullDbName(&((SQueryStmtInfo*)pQueryNode)->pTableMetaInfo[0]->name, dbName);
-
- tNameFromString(&name, dbName, T_NAME_ACCT | T_NAME_DB);
- tNameFromString(&name, topicName, T_NAME_TABLE);
+ SName name = { .acctId = pTscObj->acctId, .type = TSDB_TABLE_NAME_T };
+ strcpy(name.dbname, pRequest->pDb);
+ strcpy(name.tname, topicName);
SCMCreateTopicReq req = {
.igExists = 1,
- .physicalPlan = (char*)pStr,
+ .ast = (char*)pStr,
.sql = (char*)sql,
- .logicalPlan = (char*)"no logic plan",
};
tNameExtractFullName(&name, req.name);
@@ -536,7 +522,7 @@ TAOS_RES* tmq_create_topic(TAOS* taos, const char* topicName, const char* sql, i
asyncSendMsgToServer(pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, sendInfo);
tsem_wait(&pRequest->body.rspSem);
-#endif
+
_return:
qDestroyQuery(pQueryNode);
/*if (sendInfo != NULL) {*/
diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c
index 4b649d5f62..31328cc4b2 100644
--- a/source/common/src/tdatablock.c
+++ b/source/common/src/tdatablock.c
@@ -1072,6 +1072,10 @@ void blockDataClearup(SSDataBlock* pDataBlock) {
}
int32_t blockDataEnsureColumnCapacity(SColumnInfoData* pColumn, uint32_t numOfRows) {
+ if (0 == numOfRows) {
+ return TSDB_CODE_SUCCESS;
+ }
+
if (IS_VAR_DATA_TYPE(pColumn->info.type)) {
char* tmp = realloc(pColumn->varmeta.offset, sizeof(int32_t) * numOfRows);
if (tmp == NULL) {
@@ -1092,7 +1096,7 @@ int32_t blockDataEnsureColumnCapacity(SColumnInfoData* pColumn, uint32_t numOfRo
pColumn->nullbitmap = tmp;
memset(pColumn->nullbitmap, 0, BitmapLen(numOfRows));
-
+ assert(pColumn->info.bytes);
tmp = realloc(pColumn->pData, numOfRows * pColumn->info.bytes);
if (tmp == NULL) {
return TSDB_CODE_OUT_OF_MEMORY;
@@ -1137,7 +1141,7 @@ void* blockDataDestroy(SSDataBlock* pBlock) {
taosArrayDestroy(pBlock->pDataBlock);
tfree(pBlock->pBlockAgg);
- tfree(pBlock);
+ // tfree(pBlock);
return NULL;
}
@@ -1190,7 +1194,7 @@ int32_t tEncodeDataBlock(void** buf, const SSDataBlock* pBlock) {
}
int32_t len = colDataGetLength(pColData, rows);
- taosEncodeFixedI32(buf, len);
+ tlen += taosEncodeFixedI32(buf, len);
tlen += taosEncodeBinary(buf, pColData->pData, len);
}
diff --git a/source/common/src/tvariant.c b/source/common/src/tvariant.c
index af6152d3f4..c6aa1cb81d 100644
--- a/source/common/src/tvariant.c
+++ b/source/common/src/tvariant.c
@@ -199,8 +199,8 @@ void taosVariantCreateFromBinary(SVariant *pVar, const char *pz, size_t len, uin
case TSDB_DATA_TYPE_NCHAR: { // here we get the nchar length from raw binary bits length
size_t lenInwchar = len / TSDB_NCHAR_SIZE;
- pVar->wpz = calloc(1, (lenInwchar + 1) * TSDB_NCHAR_SIZE);
- memcpy(pVar->wpz, pz, lenInwchar * TSDB_NCHAR_SIZE);
+ pVar->ucs4 = calloc(1, (lenInwchar + 1) * TSDB_NCHAR_SIZE);
+ memcpy(pVar->ucs4, pz, lenInwchar * TSDB_NCHAR_SIZE);
pVar->nLen = (int32_t)len;
break;
@@ -343,7 +343,7 @@ int32_t taosVariantToString(SVariant *pVar, char *dst) {
case TSDB_DATA_TYPE_NCHAR: {
dst[0] = '\'';
- taosUcs4ToMbs(pVar->wpz, (twcslen(pVar->wpz) + 1) * TSDB_NCHAR_SIZE, dst + 1);
+ taosUcs4ToMbs(pVar->ucs4, (taosUcs4len(pVar->ucs4) + 1) * TSDB_NCHAR_SIZE, dst + 1);
int32_t len = (int32_t)strlen(dst);
dst[len] = '\'';
dst[len + 1] = 0;
@@ -384,7 +384,7 @@ static FORCE_INLINE int32_t convertToBoolImpl(char *pStr, int32_t len) {
}
}
-static FORCE_INLINE int32_t wcsconvertToBoolImpl(wchar_t *pstr, int32_t len) {
+static FORCE_INLINE int32_t wcsconvertToBoolImpl(TdUcs4 *pstr, int32_t len) {
if ((wcsncasecmp(pstr, L"true", len) == 0) && (len == 4)) {
return TSDB_TRUE;
} else if (wcsncasecmp(pstr, L"false", len) == 0 && (len == 5)) {
@@ -412,11 +412,11 @@ static int32_t toBinary(SVariant *pVariant, char **pDest, int32_t *pDestSize) {
pBuf = realloc(pBuf, newSize + 1);
}
- taosUcs4ToMbs(pVariant->wpz, (int32_t)newSize, pBuf);
- free(pVariant->wpz);
+ taosUcs4ToMbs(pVariant->ucs4, (int32_t)newSize, pBuf);
+ free(pVariant->ucs4);
pBuf[newSize] = 0;
} else {
- taosUcs4ToMbs(pVariant->wpz, (int32_t)newSize, *pDest);
+ taosUcs4ToMbs(pVariant->ucs4, (int32_t)newSize, *pDest);
}
} else {
@@ -460,8 +460,8 @@ static int32_t toNchar(SVariant *pVariant, char **pDest, int32_t *pDestSize) {
}
if (*pDest == pVariant->pz) {
- wchar_t *pWStr = calloc(1, (nLen + 1) * TSDB_NCHAR_SIZE);
- bool ret = taosMbsToUcs4(pDst, nLen, (char *)pWStr, (nLen + 1) * TSDB_NCHAR_SIZE, NULL);
+ TdUcs4 *pWStr = calloc(1, (nLen + 1) * TSDB_NCHAR_SIZE);
+ bool ret = taosMbsToUcs4(pDst, nLen, pWStr, (nLen + 1) * TSDB_NCHAR_SIZE, NULL);
if (!ret) {
tfree(pWStr);
return -1;
@@ -469,21 +469,21 @@ static int32_t toNchar(SVariant *pVariant, char **pDest, int32_t *pDestSize) {
// free the binary buffer in the first place
if (pVariant->nType == TSDB_DATA_TYPE_BINARY) {
- free(pVariant->wpz);
+ free(pVariant->ucs4);
}
- pVariant->wpz = pWStr;
- *pDestSize = twcslen(pVariant->wpz);
+ pVariant->ucs4 = pWStr;
+ *pDestSize = taosUcs4len(pVariant->ucs4);
// shrink the allocate memory, no need to check here.
- char *tmp = realloc(pVariant->wpz, (*pDestSize + 1) * TSDB_NCHAR_SIZE);
+ char *tmp = realloc(pVariant->ucs4, (*pDestSize + 1) * TSDB_NCHAR_SIZE);
assert(tmp != NULL);
- pVariant->wpz = (wchar_t *)tmp;
+ pVariant->ucs4 = (TdUcs4 *)tmp;
} else {
int32_t output = 0;
- bool ret = taosMbsToUcs4(pDst, nLen, *pDest, (nLen + 1) * TSDB_NCHAR_SIZE, &output);
+ bool ret = taosMbsToUcs4(pDst, nLen, (TdUcs4*)*pDest, (nLen + 1) * TSDB_NCHAR_SIZE, &output);
if (!ret) {
return -1;
}
@@ -554,7 +554,7 @@ static FORCE_INLINE int32_t convertToInteger(SVariant *pVariant, int64_t *result
*result = res;
} else if (pVariant->nType == TSDB_DATA_TYPE_NCHAR) {
errno = 0;
- wchar_t *endPtr = NULL;
+ TdUcs4 *endPtr = NULL;
SToken token = {0};
token.n = tGetToken(pVariant->pz, &token.type);
@@ -564,7 +564,7 @@ static FORCE_INLINE int32_t convertToInteger(SVariant *pVariant, int64_t *result
}
if (token.type == TK_FLOAT) {
- double v = wcstod(pVariant->wpz, &endPtr);
+ double v = wcstod(pVariant->ucs4, &endPtr);
if (releaseVariantPtr) {
free(pVariant->pz);
pVariant->nLen = 0;
@@ -583,7 +583,7 @@ static FORCE_INLINE int32_t convertToInteger(SVariant *pVariant, int64_t *result
setNull((char *)result, type, tDataTypes[type].bytes);
return 0;
} else {
- int64_t val = wcstoll(pVariant->wpz, &endPtr, 10);
+ int64_t val = wcstoll(pVariant->ucs4, &endPtr, 10);
if (releaseVariantPtr) {
free(pVariant->pz);
pVariant->nLen = 0;
@@ -649,7 +649,7 @@ static int32_t convertToBool(SVariant *pVariant, int64_t *pDest) {
*pDest = ret;
} else if (pVariant->nType == TSDB_DATA_TYPE_NCHAR) {
int32_t ret = 0;
- if ((ret = wcsconvertToBoolImpl(pVariant->wpz, pVariant->nLen)) < 0) {
+ if ((ret = wcsconvertToBoolImpl(pVariant->ucs4, pVariant->nLen)) < 0) {
return ret;
}
*pDest = ret;
@@ -899,7 +899,7 @@ int32_t tVariantDumpEx(SVariant *pVariant, char *payload, int16_t type, bool inc
return -1;
}
} else {
- wcsncpy((wchar_t *)payload, pVariant->wpz, pVariant->nLen);
+ tasoUcs4Copy((TdUcs4*)payload, pVariant->ucs4, pVariant->nLen);
}
}
} else {
@@ -913,7 +913,7 @@ int32_t tVariantDumpEx(SVariant *pVariant, char *payload, int16_t type, bool inc
return -1;
}
} else {
- memcpy(p, pVariant->wpz, pVariant->nLen);
+ memcpy(p, pVariant->ucs4, pVariant->nLen);
newlen = pVariant->nLen;
}
@@ -979,7 +979,7 @@ int32_t taosVariantTypeSetType(SVariant *pVariant, char type) {
pVariant->d = v;
} else if (pVariant->nType == TSDB_DATA_TYPE_NCHAR) {
errno = 0;
- double v = wcstod(pVariant->wpz, NULL);
+ double v = wcstod(pVariant->ucs4, NULL);
if ((errno == ERANGE && v == -1) || (isinf(v) || isnan(v))) {
free(pVariant->pz);
return -1;
diff --git a/source/dnode/vnode/src/inc/tsdbDBDef.h b/source/dnode/vnode/src/inc/tsdbDBDef.h
index 2e37b0ba45..ca9b60049e 100644
--- a/source/dnode/vnode/src/inc/tsdbDBDef.h
+++ b/source/dnode/vnode/src/inc/tsdbDBDef.h
@@ -26,8 +26,9 @@ typedef struct SDBFile SDBFile;
typedef DB_ENV* TDBEnv;
struct SDBFile {
- DB* pDB;
- char* path;
+ int32_t fid;
+ DB* pDB;
+ char* path;
};
int32_t tsdbOpenDBF(TDBEnv pEnv, SDBFile* pDBF);
diff --git a/source/dnode/vnode/src/meta/metaBDBImpl.c b/source/dnode/vnode/src/meta/metaBDBImpl.c
index df2d9604d2..99a2b272ed 100644
--- a/source/dnode/vnode/src/meta/metaBDBImpl.c
+++ b/source/dnode/vnode/src/meta/metaBDBImpl.c
@@ -884,7 +884,7 @@ const char *metaSmaCursorNext(SMSmaCursor *pCur) {
STSmaWrapper *metaGetSmaInfoByTable(SMeta *pMeta, tb_uid_t uid) {
STSmaWrapper *pSW = NULL;
- pSW = calloc(sizeof(*pSW), 1);
+ pSW = calloc(1, sizeof(*pSW));
if (pSW == NULL) {
return NULL;
}
diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c
index a2342ec85a..0c4b933c19 100644
--- a/source/dnode/vnode/src/tq/tqRead.c
+++ b/source/dnode/vnode/src/tq/tqRead.c
@@ -13,6 +13,7 @@
* along with this program. If not, see .
*/
+#include "tdatablock.h"
#include "vnode.h"
STqReadHandle* tqInitSubmitMsgScanner(SMeta* pMeta) {
@@ -128,10 +129,13 @@ SArray* tqRetrieveDataBlock(STqReadHandle* pHandle) {
int j = 0;
for (int32_t i = 0; i < colNumNeed; i++) {
- int32_t colId = *(int32_t*)taosArrayGet(pHandle->pColIdList, i);
+ int16_t colId = *(int16_t*)taosArrayGet(pHandle->pColIdList, i);
while (j < pSchemaWrapper->nCols && pSchemaWrapper->pSchema[j].colId < colId) {
j++;
}
+ if (j >= pSchemaWrapper->nCols) {
+ continue;
+ }
SSchema* pColSchema = &pSchemaWrapper->pSchema[j];
SColumnInfoData colInfo = {0};
int sz = numOfRows * pColSchema->bytes;
@@ -145,6 +149,8 @@ SArray* tqRetrieveDataBlock(STqReadHandle* pHandle) {
taosArrayDestroy(pArray);
return NULL;
}
+
+ blockDataEnsureColumnCapacity(&colInfo, numOfRows);
taosArrayPush(pArray, &colInfo);
}
diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c
index 97c52f44eb..6b2857c411 100644
--- a/source/dnode/vnode/src/tsdb/tsdbRead.c
+++ b/source/dnode/vnode/src/tsdb/tsdbRead.c
@@ -3386,7 +3386,7 @@ void filterPrepare(void* expr, void* param) {
if (size < (uint32_t)pSchema->bytes) {
size = pSchema->bytes;
}
- // to make sure tonchar does not cause invalid write, since the '\0' needs at least sizeof(wchar_t) space.
+ // to make sure tonchar does not cause invalid write, since the '\0' needs at least sizeof(TdUcs4) space.
pInfo->q = calloc(1, size + TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE);
tVariantDump(pCond, pInfo->q, pSchema->type, true);
}
diff --git a/source/dnode/vnode/src/tsdb/tsdbSma.c b/source/dnode/vnode/src/tsdb/tsdbSma.c
index f3135c690e..02a0b587d5 100644
--- a/source/dnode/vnode/src/tsdb/tsdbSma.c
+++ b/source/dnode/vnode/src/tsdb/tsdbSma.c
@@ -156,10 +156,6 @@ static int32_t tsdbInitSmaEnv(STsdb *pTsdb, const char *path, SSmaEnv **pEnv) {
return TSDB_CODE_FAILED;
}
- if (*pEnv) {
- return TSDB_CODE_SUCCESS;
- }
-
if (*pEnv == NULL) {
if ((*pEnv = tsdbNewSmaEnv(pTsdb, path)) == NULL) {
return TSDB_CODE_FAILED;
@@ -213,11 +209,14 @@ static int32_t tsdbInitSmaStat(SSmaStat **pSmaStat) {
return TSDB_CODE_SUCCESS;
}
- // TODO: lock. lazy mode when update expired window, or hungry mode during tsdbNew.
+ /**
+ * 1. Lazy mode utilized when init SSmaStat to update expired window(or hungry mode when tsdbNew).
+ * 2. Currently, there is mutex lock when init SSmaEnv, thus no need add lock on SSmaStat, and please add lock if
+ * tsdbInitSmaStat invoked in other multithread environment later.
+ */
if (*pSmaStat == NULL) {
*pSmaStat = (SSmaStat *)calloc(1, sizeof(SSmaStat));
if (*pSmaStat == NULL) {
- // TODO: unlock
terrno = TSDB_CODE_OUT_OF_MEMORY;
return TSDB_CODE_FAILED;
}
@@ -227,11 +226,9 @@ static int32_t tsdbInitSmaStat(SSmaStat **pSmaStat) {
if ((*pSmaStat)->smaStatItems == NULL) {
tfree(*pSmaStat);
- // TODO: unlock
return TSDB_CODE_FAILED;
}
}
- // TODO: unlock
return TSDB_CODE_SUCCESS;
}
@@ -259,10 +256,15 @@ static SSmaStatItem *tsdbNewSmaStatItem(int8_t state) {
int32_t tsdbDestroySmaState(SSmaStat *pSmaStat) {
if (pSmaStat) {
// TODO: use taosHashSetFreeFp when taosHashSetFreeFp is ready.
- SSmaStatItem *item = taosHashIterate(pSmaStat->smaStatItems, NULL);
+ void *item = taosHashIterate(pSmaStat->smaStatItems, NULL);
while (item != NULL) {
- tfree(item->pSma);
- taosHashCleanup(item->expiredWindows);
+ SSmaStatItem *pItem = *(SSmaStatItem **)item;
+ if (pItem != NULL) {
+ tdDestroyTSma(pItem->pSma);
+ tfree(pItem->pSma);
+ taosHashCleanup(pItem->expiredWindows);
+ tfree(pItem);
+ }
item = taosHashIterate(pSmaStat->smaStatItems, item);
}
taosHashCleanup(pSmaStat->smaStatItems);
@@ -270,15 +272,17 @@ int32_t tsdbDestroySmaState(SSmaStat *pSmaStat) {
}
static int32_t tsdbCheckAndInitSmaEnv(STsdb *pTsdb, int8_t smaType) {
+ SSmaEnv *pEnv = NULL;
+
// return if already init
switch (smaType) {
case TSDB_SMA_TYPE_TIME_RANGE:
- if (pTsdb->pTSmaEnv) {
+ if ((pEnv = (SSmaEnv *)atomic_load_ptr(&pTsdb->pTSmaEnv)) != NULL) {
return TSDB_CODE_SUCCESS;
}
break;
case TSDB_SMA_TYPE_ROLLUP:
- if (pTsdb->pRSmaEnv) {
+ if ((pEnv = (SSmaEnv *)atomic_load_ptr(&pTsdb->pRSmaEnv)) != NULL) {
return TSDB_CODE_SUCCESS;
}
break;
@@ -289,9 +293,10 @@ static int32_t tsdbCheckAndInitSmaEnv(STsdb *pTsdb, int8_t smaType) {
// init sma env
tsdbLockRepo(pTsdb);
- if (pTsdb->pTSmaEnv == NULL) {
+ pEnv = (smaType == TSDB_SMA_TYPE_TIME_RANGE) ? atomic_load_ptr(&pTsdb->pTSmaEnv) : atomic_load_ptr(&pTsdb->pRSmaEnv);
+ if (pEnv == NULL) {
char rname[TSDB_FILENAME_LEN] = {0};
- char aname[TSDB_FILENAME_LEN * 2 + 32] = {0}; // TODO: make TMPNAME_LEN public as TSDB_FILENAME_LEN?
+ char aname[TSDB_FILENAME_LEN] = {0}; // use TSDB_FILENAME_LEN currently
SDiskID did = {0};
tfsAllocDisk(pTsdb->pTfs, TFS_PRIMARY_LEVEL, &did);
@@ -307,17 +312,13 @@ static int32_t tsdbCheckAndInitSmaEnv(STsdb *pTsdb, int8_t smaType) {
return TSDB_CODE_FAILED;
}
- SSmaEnv *pEnv = NULL;
if (tsdbInitSmaEnv(pTsdb, aname, &pEnv) != TSDB_CODE_SUCCESS) {
tsdbUnlockRepo(pTsdb);
return TSDB_CODE_FAILED;
}
- if (smaType == TSDB_SMA_TYPE_TIME_RANGE) {
- pTsdb->pTSmaEnv = pEnv;
- } else {
- pTsdb->pRSmaEnv = pEnv;
- }
+ (smaType == TSDB_SMA_TYPE_TIME_RANGE) ? atomic_store_ptr(&pTsdb->pTSmaEnv, pEnv)
+ : atomic_store_ptr(&pTsdb->pRSmaEnv, pEnv);
}
tsdbUnlockRepo(pTsdb);
@@ -357,8 +358,10 @@ int32_t tsdbUpdateExpiredWindow(STsdb *pTsdb, ETsdbSmaType smaType, char *msg) {
SSmaStat *pStat = SMA_ENV_STAT(pEnv);
SHashObj *pItemsHash = SMA_ENV_STAT_ITEMS(pEnv);
+ TASSERT(pEnv != NULL && pStat != NULL && pItemsHash != NULL);
+
tsdbRefSmaStat(pTsdb, pStat);
- SSmaStatItem *pItem = (SSmaStatItem *)taosHashGet(pItemsHash, &indexUid, sizeof(indexUid));
+ SSmaStatItem *pItem = taosHashGet(pItemsHash, &indexUid, sizeof(indexUid));
if (pItem == NULL) {
pItem = tsdbNewSmaStatItem(TSDB_SMA_STAT_EXPIRED); // TODO use the real state
if (pItem == NULL) {
@@ -419,9 +422,9 @@ static int32_t tsdbResetExpiredWindow(STsdb *pTsdb, SSmaStat *pStat, int64_t ind
tsdbRefSmaStat(pTsdb, pStat);
if (pStat && pStat->smaStatItems) {
- pItem = *(SSmaStatItem **)taosHashGet(pStat->smaStatItems, &indexUid, sizeof(indexUid));
+ pItem = taosHashGet(pStat->smaStatItems, &indexUid, sizeof(indexUid));
}
- if (pItem != NULL) {
+ if ((pItem != NULL) && ((pItem = *(SSmaStatItem **)pItem) != NULL)) {
// pItem resides in hash buffer all the time unless drop sma index
// TODO: multithread protect
if (taosHashRemove(pItem->expiredWindows, &skey, sizeof(TSKEY)) != 0) {
@@ -492,7 +495,7 @@ static int32_t tsdbGetSmaStorageLevel(int64_t interval, int8_t intervalUnit) {
* @brief Insert TSma data blocks to DB File build by B+Tree
*
* @param pSmaH
- * @param smaKey
+ * @param smaKey tableUid-colId-skeyOfWindow(8-2-8)
* @param keyLen
* @param pData
* @param dataLen
@@ -500,12 +503,11 @@ static int32_t tsdbGetSmaStorageLevel(int64_t interval, int8_t intervalUnit) {
*/
static int32_t tsdbInsertTSmaBlocks(STSmaWriteH *pSmaH, void *smaKey, uint32_t keyLen, void *pData, uint32_t dataLen) {
SDBFile *pDBFile = &pSmaH->dFile;
-
- // TODO: insert sma data blocks into B+Tree
tsdbDebug("vgId:%d insert sma data blocks into %s: smaKey %" PRIx64 "-%" PRIu16 "-%" PRIx64 ", dataLen %d",
REPO_ID(pSmaH->pTsdb), pDBFile->path, *(tb_uid_t *)smaKey, *(uint16_t *)POINTER_SHIFT(smaKey, 8),
*(int64_t *)POINTER_SHIFT(smaKey, 10), dataLen);
+ // TODO: insert sma data blocks into B+Tree(TDB)
if (tsdbSaveSmaToDB(pDBFile, smaKey, keyLen, pData, dataLen) != 0) {
return TSDB_CODE_FAILED;
}
@@ -562,34 +564,34 @@ static int64_t tsdbGetIntervalByPrecision(int64_t interval, uint8_t intervalUnit
return interval / 1e3;
} else if (TIME_UNIT_NANOSECOND == intervalUnit) { // nano second
return interval / 1e6;
- } else {
+ } else { // ms
return interval;
}
break;
case TSDB_TIME_PRECISION_MICRO:
if (TIME_UNIT_MICROSECOND == intervalUnit) { // us
return interval;
- } else if (TIME_UNIT_NANOSECOND == intervalUnit) { // nano second
+ } else if (TIME_UNIT_NANOSECOND == intervalUnit) { // ns
return interval / 1e3;
- } else {
+ } else { // ms
return interval * 1e3;
}
break;
case TSDB_TIME_PRECISION_NANO:
- if (TIME_UNIT_MICROSECOND == intervalUnit) {
+ if (TIME_UNIT_MICROSECOND == intervalUnit) { // us
return interval * 1e3;
- } else if (TIME_UNIT_NANOSECOND == intervalUnit) { // nano second
+ } else if (TIME_UNIT_NANOSECOND == intervalUnit) { // ns
return interval;
- } else {
+ } else { // ms
return interval * 1e6;
}
break;
default: // ms
if (TIME_UNIT_MICROSECOND == intervalUnit) { // us
return interval / 1e3;
- } else if (TIME_UNIT_NANOSECOND == intervalUnit) { // nano second
+ } else if (TIME_UNIT_NANOSECOND == intervalUnit) { // ns
return interval / 1e6;
- } else {
+ } else { // ms
return interval;
}
break;
@@ -661,9 +663,13 @@ static void tsdbDestroyTSmaWriteH(STSmaWriteH *pSmaH) {
static int32_t tsdbSetTSmaDataFile(STSmaWriteH *pSmaH, STSmaDataWrapper *pData, int32_t storageLevel, int32_t fid) {
STsdb *pTsdb = pSmaH->pTsdb;
ASSERT(pSmaH->dFile.path == NULL && pSmaH->dFile.pDB == NULL);
+
+ pSmaH->dFile.fid = fid;
+
char tSmaFile[TSDB_FILENAME_LEN] = {0};
snprintf(tSmaFile, TSDB_FILENAME_LEN, "v%df%d.tsma", REPO_ID(pTsdb), fid);
pSmaH->dFile.path = strdup(tSmaFile);
+
return TSDB_CODE_SUCCESS;
}
@@ -703,7 +709,7 @@ static int32_t tsdbInsertTSmaDataImpl(STsdb *pTsdb, char *msg) {
STsdbCfg * pCfg = REPO_CFG(pTsdb);
STSmaDataWrapper *pData = (STSmaDataWrapper *)msg;
- if (!pTsdb->pTSmaEnv) {
+ if (!atomic_load_ptr(&pTsdb->pTSmaEnv)) {
terrno = TSDB_CODE_INVALID_PTR;
tsdbWarn("vgId:%d insert tSma data failed since pTSmaEnv is NULL", REPO_ID(pTsdb));
return terrno;
@@ -881,15 +887,15 @@ static bool tsdbSetAndOpenTSmaFile(STSmaReadH *pReadH, TSKEY *queryKey) {
static int32_t tsdbGetTSmaDataImpl(STsdb *pTsdb, STSmaDataWrapper *pData, int64_t indexUid, int64_t interval,
int8_t intervalUnit, tb_uid_t tableUid, col_id_t colId, TSKEY querySKey,
int32_t nMaxResult) {
- if (!pTsdb->pTSmaEnv) {
+ if (!atomic_load_ptr(&pTsdb->pTSmaEnv)) {
terrno = TSDB_CODE_INVALID_PTR;
tsdbWarn("vgId:%d getTSmaDataImpl failed since pTSmaEnv is NULL", REPO_ID(pTsdb));
return TSDB_CODE_FAILED;
}
tsdbRefSmaStat(pTsdb, SMA_ENV_STAT(pTsdb->pTSmaEnv));
- SSmaStatItem *pItem = *(SSmaStatItem **)taosHashGet(SMA_ENV_STAT_ITEMS(pTsdb->pTSmaEnv), &indexUid, sizeof(indexUid));
- if (pItem == NULL) {
+ SSmaStatItem *pItem = taosHashGet(SMA_ENV_STAT_ITEMS(pTsdb->pTSmaEnv), &indexUid, sizeof(indexUid));
+ if ((pItem == NULL) || ((pItem = *(SSmaStatItem **)pItem) == NULL)) {
// Normally pItem should not be NULL, mark all windows as expired and notify query module to fetch raw TS data if
// it's NULL.
tsdbUnRefSmaStat(pTsdb, SMA_ENV_STAT(pTsdb->pTSmaEnv));
diff --git a/source/dnode/vnode/src/vnd/vnodeWrite.c b/source/dnode/vnode/src/vnd/vnodeWrite.c
index 218b53c2ab..8285020e14 100644
--- a/source/dnode/vnode/src/vnd/vnodeWrite.c
+++ b/source/dnode/vnode/src/vnd/vnodeWrite.c
@@ -144,6 +144,9 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
return -1;
}
+ // record current timezone of server side
+ tstrncpy(vCreateSmaReq.tSma.timezone, tsTimezone, TD_TIMEZONE_LEN);
+
if (metaCreateTSma(pVnode->pMeta, &vCreateSmaReq) < 0) {
// TODO: handle error
tdDestroyTSma(&vCreateSmaReq.tSma);
diff --git a/source/dnode/vnode/test/tsdbSmaTest.cpp b/source/dnode/vnode/test/tsdbSmaTest.cpp
index 86958da406..5a87c180b6 100644
--- a/source/dnode/vnode/test/tsdbSmaTest.cpp
+++ b/source/dnode/vnode/test/tsdbSmaTest.cpp
@@ -49,7 +49,7 @@ TEST(testCase, tSma_Meta_Encode_Decode_Test) {
STSmaWrapper tSmaWrapper = {.number = 1, .tSma = &tSma};
uint32_t bufLen = tEncodeTSmaWrapper(NULL, &tSmaWrapper);
- void *buf = calloc(bufLen, 1);
+ void *buf = calloc(1, bufLen);
ASSERT_NE(buf, nullptr);
STSmaWrapper *pSW = (STSmaWrapper *)buf;
@@ -84,6 +84,7 @@ TEST(testCase, tSma_Meta_Encode_Decode_Test) {
}
// resource release
+ tfree(pSW);
tdDestroyTSma(&tSma);
tdDestroyTSmaWrapper(&dstTSmaWrapper);
}
@@ -113,7 +114,7 @@ TEST(testCase, tSma_metaDB_Put_Get_Del_Test) {
tSma.tableUid = tbUid;
tSma.exprLen = strlen(expr);
- tSma.expr = (char *)calloc(tSma.exprLen + 1, 1);
+ tSma.expr = (char *)calloc(1, tSma.exprLen + 1);
ASSERT_NE(tSma.expr, nullptr);
tstrncpy(tSma.expr, expr, tSma.exprLen + 1);
@@ -251,12 +252,12 @@ TEST(testCase, tSma_Data_Insert_Query_Test) {
tSma.tableUid = tbUid;
tSma.exprLen = strlen(expr);
- tSma.expr = (char *)calloc(tSma.exprLen + 1, 1);
+ tSma.expr = (char *)calloc(1, tSma.exprLen + 1);
ASSERT_NE(tSma.expr, nullptr);
tstrncpy(tSma.expr, expr, tSma.exprLen + 1);
tSma.tagsFilterLen = strlen(tagsFilter);
- tSma.tagsFilter = (char *)calloc(tSma.tagsFilterLen + 1, 1);
+ tSma.tagsFilter = (char *)calloc(1, tSma.tagsFilterLen + 1);
ASSERT_NE(tSma.tagsFilter, nullptr);
tstrncpy(tSma.tagsFilter, tagsFilter, tSma.tagsFilterLen + 1);
@@ -273,20 +274,20 @@ TEST(testCase, tSma_Data_Insert_Query_Test) {
// step 2: insert data
STSmaDataWrapper *pSmaData = NULL;
- STsdb tsdb = {0};
- STsdbCfg * pCfg = &tsdb.config;
+ STsdb * pTsdb = (STsdb *)calloc(1, sizeof(STsdb));
+ STsdbCfg * pCfg = &pTsdb->config;
- tsdb.pMeta = pMeta;
- tsdb.vgId = 2;
- tsdb.config.daysPerFile = 10; // default days is 10
- tsdb.config.keep1 = 30;
- tsdb.config.keep2 = 90;
- tsdb.config.keep = 365;
- tsdb.config.precision = TSDB_TIME_PRECISION_MILLI;
- tsdb.config.update = TD_ROW_OVERWRITE_UPDATE;
- tsdb.config.compression = TWO_STAGE_COMP;
+ pTsdb->pMeta = pMeta;
+ pTsdb->vgId = 2;
+ pTsdb->config.daysPerFile = 10; // default days is 10
+ pTsdb->config.keep1 = 30;
+ pTsdb->config.keep2 = 90;
+ pTsdb->config.keep = 365;
+ pTsdb->config.precision = TSDB_TIME_PRECISION_MILLI;
+ pTsdb->config.update = TD_ROW_OVERWRITE_UPDATE;
+ pTsdb->config.compression = TWO_STAGE_COMP;
- switch (tsdb.config.precision) {
+ switch (pTsdb->config.precision) {
case TSDB_TIME_PRECISION_MILLI:
skey1 *= 1e3;
break;
@@ -304,12 +305,12 @@ TEST(testCase, tSma_Data_Insert_Query_Test) {
SDiskCfg pDisks = {.level = 0, .primary = 1};
strncpy(pDisks.dir, "/var/lib/taos", TSDB_FILENAME_LEN);
int32_t numOfDisks = 1;
- tsdb.pTfs = tfsOpen(&pDisks, numOfDisks);
- ASSERT_NE(tsdb.pTfs, nullptr);
+ pTsdb->pTfs = tfsOpen(&pDisks, numOfDisks);
+ ASSERT_NE(pTsdb->pTfs, nullptr);
char *msg = (char *)calloc(1, 100);
ASSERT_NE(msg, nullptr);
- ASSERT_EQ(tsdbUpdateSmaWindow(&tsdb, TSDB_SMA_TYPE_TIME_RANGE, msg), 0);
+ ASSERT_EQ(tsdbUpdateSmaWindow(pTsdb, TSDB_SMA_TYPE_TIME_RANGE, msg), 0);
// init
int32_t allocCnt = 0;
@@ -367,13 +368,13 @@ TEST(testCase, tSma_Data_Insert_Query_Test) {
ASSERT_GE(bufSize, pSmaData->dataLen);
// execute
- ASSERT_EQ(tsdbInsertTSmaData(&tsdb, (char *)pSmaData), TSDB_CODE_SUCCESS);
+ ASSERT_EQ(tsdbInsertTSmaData(pTsdb, (char *)pSmaData), TSDB_CODE_SUCCESS);
// step 3: query
uint32_t checkDataCnt = 0;
for (int32_t t = 0; t < numOfTables; ++t) {
for (col_id_t c = 0; c < numOfCols; ++c) {
- ASSERT_EQ(tsdbGetTSmaData(&tsdb, NULL, indexUid1, interval1, intervalUnit1, tbUid + t,
+ ASSERT_EQ(tsdbGetTSmaData(pTsdb, NULL, indexUid1, interval1, intervalUnit1, tbUid + t,
c + PRIMARYKEY_TIMESTAMP_COL_ID, skey1, 1),
TSDB_CODE_SUCCESS);
++checkDataCnt;
@@ -383,9 +384,12 @@ TEST(testCase, tSma_Data_Insert_Query_Test) {
printf("%s:%d The sma data check count for insert and query is %" PRIu32 "\n", __FILE__, __LINE__, checkDataCnt);
// release data
+ tfree(msg);
taosTZfree(buf);
// release meta
tdDestroyTSma(&tSma);
+ tfsClose(pTsdb->pTfs);
+ tsdbClose(pTsdb);
metaClose(pMeta);
}
#endif
diff --git a/source/libs/catalog/src/catalog.c b/source/libs/catalog/src/catalog.c
index 80a0b3554c..08e0ac55d7 100644
--- a/source/libs/catalog/src/catalog.c
+++ b/source/libs/catalog/src/catalog.c
@@ -2349,6 +2349,9 @@ _return:
CTG_API_LEAVE(code);
}
+int32_t catalogUpdateVgEpSet(SCatalog* pCtg, const char* dbFName, int32_t vgId, SEpSet *epSet) {
+
+}
int32_t catalogRemoveDB(SCatalog* pCtg, const char* dbFName, uint64_t dbId) {
CTG_API_ENTER();
@@ -2394,6 +2397,9 @@ _return:
CTG_API_LEAVE(code);
}
+int32_t catalogGetIndexMeta(SCatalog* pCtg, void *pTrans, const SEpSet* pMgmtEps, const SName* pTableName, const char *pIndexName, SIndexMeta** pIndexMeta) {
+
+}
int32_t catalogGetTableMeta(SCatalog* pCtg, void *pTrans, const SEpSet* pMgmtEps, const SName* pTableName, STableMeta** pTableMeta) {
CTG_API_ENTER();
@@ -2662,12 +2668,15 @@ _return:
int32_t catalogGetQnodeList(SCatalog* pCtg, void *pRpc, const SEpSet* pMgmtEps, SArray* pQnodeList) {
CTG_API_ENTER();
-
+
+ int32_t code = 0;
if (NULL == pCtg || NULL == pRpc || NULL == pMgmtEps || NULL == pQnodeList) {
CTG_API_LEAVE(TSDB_CODE_CTG_INVALID_INPUT);
}
- //TODO
+ CTG_ERR_JRET(ctgGetQnodeListFromMnode(pCtg, pRpc, pMgmtEps, &pQnodeList));
+
+_return:
CTG_API_LEAVE(TSDB_CODE_SUCCESS);
}
diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c
index 34c211561b..d66203eb40 100644
--- a/source/libs/nodes/src/nodesCloneFuncs.c
+++ b/source/libs/nodes/src/nodesCloneFuncs.c
@@ -190,7 +190,6 @@ static SNode* fillNodeCopy(const SFillNode* pSrc, SFillNode* pDst) {
}
static SNode* logicNodeCopy(const SLogicNode* pSrc, SLogicNode* pDst) {
- COPY_SCALAR_FIELD(id);
CLONE_NODE_LIST_FIELD(pTargets);
CLONE_NODE_FIELD(pConditions);
CLONE_NODE_LIST_FIELD(pChildren);
@@ -198,7 +197,7 @@ static SNode* logicNodeCopy(const SLogicNode* pSrc, SLogicNode* pDst) {
}
static STableMeta* tableMetaClone(const STableMeta* pSrc) {
- int32_t len = sizeof(STableMeta) + (pSrc->tableInfo.numOfTags + pSrc->tableInfo.numOfColumns) * sizeof(SSchema);
+ int32_t len = TABLE_META_SIZE(pSrc);
STableMeta* pDst = malloc(len);
if (NULL == pDst) {
return NULL;
@@ -208,7 +207,7 @@ static STableMeta* tableMetaClone(const STableMeta* pSrc) {
}
static SVgroupsInfo* vgroupsInfoClone(const SVgroupsInfo* pSrc) {
- int32_t len = sizeof(SVgroupsInfo) + pSrc->numOfVgroups * sizeof(SVgroupInfo);
+ int32_t len = VGROUPS_INFO_SIZE(pSrc);
SVgroupsInfo* pDst = malloc(len);
if (NULL == pDst) {
return NULL;
diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c
index a2fd32d238..c61a2d71fb 100644
--- a/source/libs/nodes/src/nodesCodeFuncs.c
+++ b/source/libs/nodes/src/nodesCodeFuncs.c
@@ -193,7 +193,17 @@ static int32_t tableMetaToJson(const void* pObj, SJson* pJson) {
return code;
}
-static const char* jkLogicPlanId = "Id";
+static int32_t jsonToTableMeta(const SJson* pJson, void* pObj) {
+ STableMeta* pNode = (STableMeta*)pObj;
+
+ int32_t code = tjsonGetUBigIntValue(pJson, jkTableMetaUid, &pNode->uid);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonGetUBigIntValue(pJson, jkTableMetaSuid, &pNode->suid);
+ }
+
+ return code;
+}
+
static const char* jkLogicPlanTargets = "Targets";
static const char* jkLogicPlanConditions = "Conditions";
static const char* jkLogicPlanChildren = "Children";
@@ -201,10 +211,7 @@ static const char* jkLogicPlanChildren = "Children";
static int32_t logicPlanNodeToJson(const void* pObj, SJson* pJson) {
const SLogicNode* pNode = (const SLogicNode*)pObj;
- int32_t code = tjsonAddIntegerToObject(pJson, jkLogicPlanId, pNode->id);
- if (TSDB_CODE_SUCCESS == code) {
- code = nodeListToJson(pJson, jkLogicPlanTargets, pNode->pTargets);
- }
+ int32_t code = nodeListToJson(pJson, jkLogicPlanTargets, pNode->pTargets);
if (TSDB_CODE_SUCCESS == code) {
code = tjsonAddObject(pJson, jkLogicPlanConditions, nodeToJson, pNode->pConditions);
}
@@ -445,6 +452,14 @@ static int32_t jsonToPhysiTableScanNode(const SJson* pJson, void* pObj) {
return code;
}
+static int32_t physiStreamScanNodeToJson(const void* pObj, SJson* pJson) {
+ return physiScanNodeToJson(pObj, pJson);
+}
+
+static int32_t jsonToPhysiStreamScanNode(const SJson* pJson, void* pObj) {
+ return jsonToPhysiScanNode(pJson, pObj);
+}
+
static const char* jkProjectPhysiPlanProjections = "Projections";
static int32_t physiProjectNodeToJson(const void* pObj, SJson* pJson) {
@@ -1273,6 +1288,193 @@ static int32_t jsonToFunctionNode(const SJson* pJson, void* pObj) {
return code;
}
+static const char* jkTableDbName = "DbName";
+static const char* jkTableTableName = "tableName";
+static const char* jkTableTableAlias = "tableAlias";
+
+static int32_t tableNodeToJson(const void* pObj, SJson* pJson) {
+ const STableNode* pNode = (const STableNode*)pObj;
+
+ int32_t code = exprNodeToJson(pObj, pJson);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddStringToObject(pJson, jkTableDbName, pNode->dbName);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddStringToObject(pJson, jkTableTableName, pNode->tableName);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddStringToObject(pJson, jkTableTableAlias, pNode->tableAlias);
+ }
+
+ return code;
+}
+
+static int32_t jsonToTableNode(const SJson* pJson, void* pObj) {
+ STableNode* pNode = (STableNode*)pObj;
+
+ int32_t code = jsonToExprNode(pJson, pObj);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonGetStringValue(pJson, jkTableDbName, pNode->dbName);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonGetStringValue(pJson, jkTableTableName, pNode->tableName);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonGetStringValue(pJson, jkTableTableAlias, pNode->tableAlias);
+ }
+
+ return code;
+}
+
+static const char* jkEpSetInUse = "InUse";
+static const char* jkEpSetNumOfEps = "NumOfEps";
+static const char* jkEpSetEps = "Eps";
+
+static int32_t epSetToJson(const void* pObj, SJson* pJson) {
+ const SEpSet* pNode = (const SEpSet*)pObj;
+
+ int32_t code = tjsonAddIntegerToObject(pJson, jkEpSetInUse, pNode->inUse);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddIntegerToObject(pJson, jkEpSetNumOfEps, pNode->numOfEps);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddArray(pJson, jkEpSetEps, epToJson, pNode->eps, sizeof(SEp), pNode->numOfEps);
+ }
+
+ return code;
+}
+
+static int32_t jsonToEpSet(const SJson* pJson, void* pObj) {
+ SEpSet* pNode = (SEpSet*)pObj;
+
+ int32_t code = tjsonGetTinyIntValue(pJson, jkEpSetInUse, &pNode->inUse);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonGetTinyIntValue(pJson, jkEpSetNumOfEps, &pNode->numOfEps);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonToArray(pJson, jkEpSetEps, jsonToEp, pNode->eps, sizeof(SEp));
+ }
+
+ return code;
+}
+
+static const char* jkVgroupInfoVgId = "VgId";
+static const char* jkVgroupInfoHashBegin = "HashBegin";
+static const char* jkVgroupInfoHashEnd = "HashEnd";
+static const char* jkVgroupInfoEpSet = "EpSet";
+static const char* jkVgroupInfoNumOfTable = "NumOfTable";
+
+static int32_t vgroupInfoToJson(const void* pObj, SJson* pJson) {
+ const SVgroupInfo* pNode = (const SVgroupInfo*)pObj;
+
+ int32_t code = tjsonAddIntegerToObject(pJson, jkVgroupInfoVgId, pNode->vgId);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddIntegerToObject(pJson, jkVgroupInfoHashBegin, pNode->hashBegin);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddIntegerToObject(pJson, jkVgroupInfoHashEnd, pNode->hashEnd);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddObject(pJson, jkVgroupInfoEpSet, epSetToJson, &pNode->epSet);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddIntegerToObject(pJson, jkVgroupInfoNumOfTable, pNode->numOfTable);
+ }
+
+ return code;
+}
+
+static int32_t jsonToVgroupInfo(const SJson* pJson, void* pObj) {
+ SVgroupInfo* pNode = (SVgroupInfo*)pObj;
+
+ int32_t code = tjsonGetIntValue(pJson, jkVgroupInfoVgId, &pNode->vgId);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonGetUIntValue(pJson, jkVgroupInfoHashBegin, &pNode->hashBegin);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonGetUIntValue(pJson, jkVgroupInfoHashEnd, &pNode->hashEnd);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonToObject(pJson, jkVgroupInfoEpSet, jsonToEpSet, &pNode->epSet);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonGetIntValue(pJson, jkVgroupInfoNumOfTable, &pNode->numOfTable);
+ }
+
+ return code;
+}
+
+static const char* jkVgroupsInfoNum = "Num";
+static const char* jkVgroupsInfoVgroups = "Vgroups";
+
+static int32_t vgroupsInfoToJson(const void* pObj, SJson* pJson) {
+ const SVgroupsInfo* pNode = (const SVgroupsInfo*)pObj;
+
+ int32_t code = tjsonAddIntegerToObject(pJson, jkVgroupsInfoNum, pNode->numOfVgroups);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddArray(pJson, jkVgroupsInfoVgroups, vgroupInfoToJson, pNode->vgroups, sizeof(SVgroupInfo), pNode->numOfVgroups);
+ }
+
+ return code;
+}
+
+static int32_t jsonToVgroupsInfo(const SJson* pJson, void* pObj) {
+ SVgroupsInfo* pNode = (SVgroupsInfo*)pObj;
+
+ int32_t code = tjsonGetIntValue(pJson, jkVgroupsInfoNum, &pNode->numOfVgroups);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonToArray(pJson, jkVgroupsInfoVgroups, jsonToVgroupInfo, pNode->vgroups, sizeof(SVgroupInfo));
+ }
+
+ return code;
+}
+
+static const char* jkRealTableMetaSize = "MetaSize";
+static const char* jkRealTableMeta = "Meta";
+static const char* jkRealTableVgroupsInfoSize = "VgroupsInfoSize";
+static const char* jkRealTableVgroupsInfo = "VgroupsInfo";
+
+static int32_t realTableNodeToJson(const void* pObj, SJson* pJson) {
+ const SRealTableNode* pNode = (const SRealTableNode*)pObj;
+
+ int32_t code = tableNodeToJson(pObj, pJson);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddIntegerToObject(pJson, jkRealTableMetaSize, TABLE_META_SIZE(pNode->pMeta));
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddObject(pJson, jkRealTableMeta, tableMetaToJson, pNode->pMeta);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddIntegerToObject(pJson, jkRealTableVgroupsInfoSize, VGROUPS_INFO_SIZE(pNode->pVgroupList));
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddObject(pJson, jkRealTableVgroupsInfo, vgroupsInfoToJson, pNode->pVgroupList);
+ }
+
+ return code;
+}
+
+static int32_t jsonToRealTableNode(const SJson* pJson, void* pObj) {
+ SRealTableNode* pNode = (SRealTableNode*)pObj;
+
+ int32_t objSize = 0;
+ int32_t code = jsonToTableNode(pJson, pObj);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonGetIntValue(pJson, jkRealTableMetaSize, &objSize);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonMakeObject(pJson, jkRealTableMeta, jsonToTableMeta, (void**)&pNode->pMeta, objSize);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonGetIntValue(pJson, jkRealTableVgroupsInfoSize, &objSize);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonMakeObject(pJson, jkRealTableVgroupsInfo, jsonToVgroupsInfo, (void**)&pNode->pVgroupList, objSize);
+ }
+
+ return code;
+}
+
static const char* jkGroupingSetType = "GroupingSetType";
static const char* jkGroupingSetParameter = "Parameters";
@@ -1464,7 +1666,7 @@ static const char* jkSelectStmtSlimit = "Slimit";
static int32_t selectStmtTojson(const void* pObj, SJson* pJson) {
const SSelectStmt* pNode = (const SSelectStmt*)pObj;
- int32_t code = tjsonAddIntegerToObject(pJson, jkSelectStmtDistinct, pNode->isDistinct);
+ int32_t code = tjsonAddBoolToObject(pJson, jkSelectStmtDistinct, pNode->isDistinct);
if (TSDB_CODE_SUCCESS == code) {
code = nodeListToJson(pJson, jkSelectStmtProjections, pNode->pProjectionList);
}
@@ -1499,6 +1701,44 @@ static int32_t selectStmtTojson(const void* pObj, SJson* pJson) {
return code;
}
+static int32_t jsonToSelectStmt(const SJson* pJson, void* pObj) {
+ SSelectStmt* pNode = (SSelectStmt*)pObj;
+
+ int32_t code = tjsonGetBoolValue(pJson, jkSelectStmtDistinct, &pNode->isDistinct);
+ if (TSDB_CODE_SUCCESS == code) {
+ code = jsonToNodeList(pJson, jkSelectStmtProjections, &pNode->pProjectionList);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = jsonToNodeObject(pJson, jkSelectStmtFrom, &pNode->pFromTable);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = jsonToNodeObject(pJson, jkSelectStmtWhere, &pNode->pWhere);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = jsonToNodeList(pJson, jkSelectStmtPartitionBy, &pNode->pPartitionByList);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = jsonToNodeObject(pJson, jkSelectStmtWindow, &pNode->pWindow);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = jsonToNodeList(pJson, jkSelectStmtGroupBy, &pNode->pGroupByList);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = jsonToNodeObject(pJson, jkSelectStmtHaving, &pNode->pHaving);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = jsonToNodeList(pJson, jkSelectStmtOrderBy, &pNode->pOrderByList);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = jsonToNodeObject(pJson, jkSelectStmtLimit, &pNode->pLimit);
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = jsonToNodeObject(pJson, jkSelectStmtSlimit, &pNode->pSlimit);
+ }
+
+ return code;
+}
+
static int32_t specificNodeToJson(const void* pObj, SJson* pJson) {
switch (nodeType(pObj)) {
case QUERY_NODE_COLUMN:
@@ -1512,6 +1752,7 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) {
case QUERY_NODE_FUNCTION:
return functionNodeToJson(pObj, pJson);
case QUERY_NODE_REAL_TABLE:
+ return realTableNodeToJson(pObj, pJson);
case QUERY_NODE_TEMP_TABLE:
case QUERY_NODE_JOIN_TABLE:
break;
@@ -1565,9 +1806,8 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) {
return physiTagScanNodeToJson(pObj, pJson);
case QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN:
return physiTableScanNodeToJson(pObj, pJson);
- case QUERY_NODE_PHYSICAL_PLAN_TABLE_SEQ_SCAN:
case QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN:
- break;
+ return physiStreamScanNodeToJson(pObj, pJson);
case QUERY_NODE_PHYSICAL_PLAN_PROJECT:
return physiProjectNodeToJson(pObj, pJson);
case QUERY_NODE_PHYSICAL_PLAN_JOIN:
@@ -1589,6 +1829,7 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) {
case QUERY_NODE_PHYSICAL_PLAN:
return planToJson(pObj, pJson);
default:
+ assert(0);
break;
}
nodesWarn("specificNodeToJson unknown node = %s", nodesNodeName(nodeType(pObj)));
@@ -1607,7 +1848,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) {
return jsonToLogicConditionNode(pJson, pObj);
case QUERY_NODE_FUNCTION:
return jsonToFunctionNode(pJson, pObj);
- // case QUERY_NODE_REAL_TABLE:
+ case QUERY_NODE_REAL_TABLE:
+ return jsonToRealTableNode(pJson, pObj);
// case QUERY_NODE_TEMP_TABLE:
// case QUERY_NODE_JOIN_TABLE:
// break;
@@ -1633,8 +1875,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) {
return jsonToDownstreamSourceNode(pJson, pObj);
// case QUERY_NODE_SET_OPERATOR:
// break;
- // case QUERY_NODE_SELECT_STMT:
- // return jsonToSelectStmt(pJson, pObj);
+ case QUERY_NODE_SELECT_STMT:
+ return jsonToSelectStmt(pJson, pObj);
// case QUERY_NODE_LOGIC_PLAN_SCAN:
// return jsonToLogicScanNode(pJson, pObj);
// case QUERY_NODE_LOGIC_PLAN_JOIN:
@@ -1647,6 +1889,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) {
return jsonToPhysiTagScanNode(pJson, pObj);
case QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN:
return jsonToPhysiTableScanNode(pJson, pObj);
+ case QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN:
+ return jsonToPhysiStreamScanNode(pJson, pObj);
case QUERY_NODE_PHYSICAL_PLAN_PROJECT:
return jsonToPhysiProjectNode(pJson, pObj);
case QUERY_NODE_PHYSICAL_PLAN_JOIN:
@@ -1768,6 +2012,7 @@ int32_t nodesStringToNode(const char* pStr, SNode** pNode) {
int32_t code = makeNodeByJson(pJson, pNode);
if (TSDB_CODE_SUCCESS != code) {
nodesDestroyNode(*pNode);
+ *pNode = NULL;
terrno = code;
return code;
}
diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c
index 75568019cb..0d48202f73 100644
--- a/source/libs/nodes/src/nodesUtilFuncs.c
+++ b/source/libs/nodes/src/nodesUtilFuncs.c
@@ -125,6 +125,8 @@ SNodeptr nodesMakeNode(ENodeType type) {
return makeNode(type, sizeof(SCreateDnodeStmt));
case QUERY_NODE_DROP_DNODE_STMT:
return makeNode(type, sizeof(SDropDnodeStmt));
+ case QUERY_NODE_ALTER_DNODE_STMT:
+ return makeNode(type, sizeof(SAlterDnodeStmt));
case QUERY_NODE_SHOW_DNODES_STMT:
return makeNode(type, sizeof(SShowStmt));
case QUERY_NODE_SHOW_VGROUPS_STMT:
@@ -168,7 +170,7 @@ SNodeptr nodesMakeNode(ENodeType type) {
case QUERY_NODE_PHYSICAL_PLAN_TABLE_SEQ_SCAN:
return makeNode(type, sizeof(STableSeqScanPhysiNode));
case QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN:
- return makeNode(type, sizeof(SNode));
+ return makeNode(type, sizeof(SStreamScanPhysiNode));
case QUERY_NODE_PHYSICAL_PLAN_PROJECT:
return makeNode(type, sizeof(SProjectPhysiNode));
case QUERY_NODE_PHYSICAL_PLAN_JOIN:
@@ -357,6 +359,17 @@ int32_t nodesListAppendList(SNodeList* pTarget, SNodeList* pSrc) {
return TSDB_CODE_SUCCESS;
}
+int32_t nodesListStrictAppendList(SNodeList* pTarget, SNodeList* pSrc) {
+ if (NULL == pSrc) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+ int32_t code = nodesListAppendList(pTarget, pSrc);
+ if (TSDB_CODE_SUCCESS != code) {
+ nodesDestroyList(pSrc);
+ }
+ return code;
+}
+
SListCell* nodesListErase(SNodeList* pList, SListCell* pCell) {
if (NULL == pCell->pPrev) {
pList->pHead = pCell->pNext;
@@ -571,7 +584,7 @@ typedef struct SCollectFuncsCxt {
static EDealRes collectFuncs(SNode* pNode, void* pContext) {
SCollectFuncsCxt* pCxt = (SCollectFuncsCxt*)pContext;
if (QUERY_NODE_FUNCTION == nodeType(pNode) && pCxt->classifier(((SFunctionNode*)pNode)->funcId)) {
- pCxt->errCode = nodesListAppend(pCxt->pFuncs, pNode);
+ pCxt->errCode = nodesListStrictAppend(pCxt->pFuncs, nodesCloneNode(pNode));
return (TSDB_CODE_SUCCESS == pCxt->errCode ? DEAL_RES_IGNORE_CHILD : DEAL_RES_ERROR);
}
return DEAL_RES_CONTINUE;
diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h
index 31d7331d0e..46bed1d61e 100644
--- a/source/libs/parser/inc/parAst.h
+++ b/source/libs/parser/inc/parAst.h
@@ -50,8 +50,10 @@ typedef enum EDatabaseOptionType {
DB_OPTION_TTL,
DB_OPTION_WAL,
DB_OPTION_VGROUPS,
- DB_OPTION_SINGLESTABLE,
- DB_OPTION_STREAMMODE,
+ DB_OPTION_SINGLE_STABLE,
+ DB_OPTION_STREAM_MODE,
+ DB_OPTION_RETENTIONS,
+ DB_OPTION_FILE_FACTOR,
DB_OPTION_MAX
} EDatabaseOptionType;
@@ -65,6 +67,11 @@ typedef enum ETableOptionType {
TABLE_OPTION_MAX
} ETableOptionType;
+typedef struct SAlterOption {
+ int32_t type;
+ SToken val;
+} SAlterOption;
+
extern SToken nil_token;
void initAstCreateContext(SParseContext* pParseCxt, SAstCreateContext* pCxt);
@@ -110,13 +117,16 @@ SNode* createSelectStmt(SAstCreateContext* pCxt, bool isDistinct, SNodeList* pPr
SNode* createSetOperator(SAstCreateContext* pCxt, ESetOperatorType type, SNode* pLeft, SNode* pRight);
SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt);
+SNode* createDefaultAlterDatabaseOptions(SAstCreateContext* pCxt);
SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOptionType type, const SToken* pVal);
SNode* createCreateDatabaseStmt(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pDbName, SNode* pOptions);
SNode* createDropDatabaseStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pDbName);
SNode* createAlterDatabaseStmt(SAstCreateContext* pCxt, const SToken* pDbName, SNode* pOptions);
SNode* createDefaultTableOptions(SAstCreateContext* pCxt);
+SNode* createDefaultAlterTableOptions(SAstCreateContext* pCxt);
SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType type, const SToken* pVal);
SNode* setTableSmaOption(SAstCreateContext* pCxt, SNode* pOptions, SNodeList* pSma);
+SNode* setTableRollupOption(SAstCreateContext* pCxt, SNode* pOptions, SNodeList* pFuncs);
SNode* createColumnDefNode(SAstCreateContext* pCxt, const SToken* pColName, SDataType dataType, const SToken* pComment);
SDataType createDataType(uint8_t type);
SDataType createVarLenDataType(uint8_t type, const SToken* pLen);
@@ -126,6 +136,11 @@ SNode* createCreateMultiTableStmt(SAstCreateContext* pCxt, SNodeList* pSubTables
SNode* createDropTableClause(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable);
SNode* createDropTableStmt(SAstCreateContext* pCxt, SNodeList* pTables);
SNode* createDropSuperTableStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable);
+SNode* createAlterTableOption(SAstCreateContext* pCxt, SNode* pRealTable, SNode* pOptions);
+SNode* createAlterTableAddModifyCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, const SToken* pColName, SDataType dataType);
+SNode* createAlterTableDropCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, const SToken* pColName);
+SNode* createAlterTableRenameCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, const SToken* pOldColName, const SToken* pNewColName);
+SNode* createAlterTableSetTag(SAstCreateContext* pCxt, SNode* pRealTable, const SToken* pTagName, SNode* pVal);
SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, const SToken* pDbName);
SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDbName);
SNode* createCreateUserStmt(SAstCreateContext* pCxt, const SToken* pUserName, const SToken* pPassword);
@@ -133,6 +148,7 @@ SNode* createAlterUserStmt(SAstCreateContext* pCxt, const SToken* pUserName, int
SNode* createDropUserStmt(SAstCreateContext* pCxt, const SToken* pUserName);
SNode* createCreateDnodeStmt(SAstCreateContext* pCxt, const SToken* pFqdn, const SToken* pPort);
SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode);
+SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const SToken* pConfig, const SToken* pValue);
SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, const SToken* pIndexName, const SToken* pTableName, SNodeList* pCols, SNode* pOptions);
SNode* createIndexOption(SAstCreateContext* pCxt, SNodeList* pFuncs, SNode* pInterval, SNode* pOffset, SNode* pSliding);
SNode* createDropIndexStmt(SAstCreateContext* pCxt, const SToken* pIndexName, const SToken* pTableName);
@@ -140,6 +156,7 @@ SNode* createCreateQnodeStmt(SAstCreateContext* pCxt, const SToken* pDnodeId);
SNode* createDropQnodeStmt(SAstCreateContext* pCxt, const SToken* pDnodeId);
SNode* createCreateTopicStmt(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pTopicName, SNode* pQuery, const SToken* pSubscribeDbName);
SNode* createDropTopicStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pTopicName);
+SNode* createAlterLocalStmt(SAstCreateContext* pCxt, const SToken* pConfig, const SToken* pValue);
#ifdef __cplusplus
}
diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y
index 31c26e1e40..2298ae0761 100644
--- a/source/libs/parser/inc/sql.y
+++ b/source/libs/parser/inc/sql.y
@@ -21,13 +21,15 @@
#include "parAst.h"
}
-%syntax_error {
- if(TOKEN.z) {
- generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z);
- } else {
- generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL);
+%syntax_error {
+ if (pCxt->valid) {
+ if(TOKEN.z) {
+ generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z);
+ } else {
+ generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL);
+ }
+ pCxt->valid = false;
}
- pCxt->valid = false;
}
%left OR.
@@ -41,6 +43,41 @@
%left NK_CONCAT.
//%right NK_BITNOT.
+/************************************************ create/alter account *****************************************/
+cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options. { pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
+cmd ::= ALTER ACCOUNT NK_ID alter_account_options. { pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
+
+%type account_options { int32_t }
+%destructor account_options { }
+account_options ::= . { }
+account_options ::= account_options PPS literal. { }
+account_options ::= account_options TSERIES literal. { }
+account_options ::= account_options STORAGE literal. { }
+account_options ::= account_options STREAMS literal. { }
+account_options ::= account_options QTIME literal. { }
+account_options ::= account_options DBS literal. { }
+account_options ::= account_options USERS literal. { }
+account_options ::= account_options CONNS literal. { }
+account_options ::= account_options STATE literal. { }
+
+%type alter_account_options { int32_t }
+%destructor alter_account_options { }
+alter_account_options ::= alter_account_option. { }
+alter_account_options ::= alter_account_options alter_account_option. { }
+
+%type alter_account_option { int32_t }
+%destructor alter_account_option { }
+alter_account_option ::= PASS literal. { }
+alter_account_option ::= PPS literal. { }
+alter_account_option ::= TSERIES literal. { }
+alter_account_option ::= STORAGE literal. { }
+alter_account_option ::= STREAMS literal. { }
+alter_account_option ::= QTIME literal. { }
+alter_account_option ::= DBS literal. { }
+alter_account_option ::= USERS literal. { }
+alter_account_option ::= CONNS literal. { }
+alter_account_option ::= STATE literal. { }
+
/************************************************ create/alter/drop/show user *****************************************/
cmd ::= CREATE USER user_name(A) PASS NK_STRING(B). { pCxt->pRootNode = createCreateUserStmt(pCxt, &A, &B); }
cmd ::= ALTER USER user_name(A) PASS NK_STRING(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_PASSWD, &B); }
@@ -48,12 +85,16 @@ cmd ::= ALTER USER user_name(A) PRIVILEGE NK_STRING(B).
cmd ::= DROP USER user_name(A). { pCxt->pRootNode = createDropUserStmt(pCxt, &A); }
cmd ::= SHOW USERS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL); }
-/************************************************ create/drop/show dnode **********************************************/
+/************************************************ create/drop/alter/show dnode ****************************************/
cmd ::= CREATE DNODE dnode_endpoint(A). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, NULL); }
cmd ::= CREATE DNODE dnode_host_name(A) PORT NK_INTEGER(B). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, &B); }
cmd ::= DROP DNODE NK_INTEGER(A). { pCxt->pRootNode = createDropDnodeStmt(pCxt, &A); }
cmd ::= DROP DNODE dnode_endpoint(A). { pCxt->pRootNode = createDropDnodeStmt(pCxt, &A); }
cmd ::= SHOW DNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL); }
+cmd ::= ALTER DNODE NK_INTEGER(A) NK_STRING(B). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &A, &B, NULL); }
+cmd ::= ALTER DNODE NK_INTEGER(A) NK_STRING(B) NK_STRING(C). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &A, &B, &C); }
+cmd ::= ALTER ALL DNODES NK_STRING(A). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &A, NULL); }
+cmd ::= ALTER ALL DNODES NK_STRING(A) NK_STRING(B). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &A, &B); }
%type dnode_endpoint { SToken }
%destructor dnode_endpoint { }
@@ -64,9 +105,13 @@ dnode_endpoint(A) ::= NK_STRING(B).
dnode_host_name(A) ::= NK_ID(B). { A = B; }
dnode_host_name(A) ::= NK_IPTOKEN(B). { A = B; }
+/************************************************ alter local *********************************************************/
+cmd ::= ALTER LOCAL NK_STRING(A). { pCxt->pRootNode = createAlterLocalStmt(pCxt, &A, NULL); }
+cmd ::= ALTER LOCAL NK_STRING(A) NK_STRING(B). { pCxt->pRootNode = createAlterLocalStmt(pCxt, &A, &B); }
+
/************************************************ create/drop qnode ***************************************************/
cmd ::= CREATE QNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createCreateQnodeStmt(pCxt, &A); }
-cmd ::= DROP QNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createDropQnodeStmt(pCxt, &A); }
+cmd ::= DROP QNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createDropQnodeStmt(pCxt, &A); }
cmd ::= SHOW QNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL); }
/************************************************ create/drop/show/use database ***************************************/
@@ -74,7 +119,7 @@ cmd ::= CREATE DATABASE not_exists_opt(A) db_name(B) db_options(C).
cmd ::= DROP DATABASE exists_opt(A) db_name(B). { pCxt->pRootNode = createDropDatabaseStmt(pCxt, A, &B); }
cmd ::= SHOW DATABASES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL); }
cmd ::= USE db_name(A). { pCxt->pRootNode = createUseDatabaseStmt(pCxt, &A); }
-cmd ::= ALTER DATABASE db_name(A) db_options(B). { pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &A, B); }
+cmd ::= ALTER DATABASE db_name(A) alter_db_options(B). { pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &A, B); }
%type not_exists_opt { bool }
%destructor not_exists_opt { }
@@ -102,20 +147,55 @@ db_options(A) ::= db_options(B) REPLICA NK_INTEGER(C).
db_options(A) ::= db_options(B) TTL NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_TTL, &C); }
db_options(A) ::= db_options(B) WAL NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_WAL, &C); }
db_options(A) ::= db_options(B) VGROUPS NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_VGROUPS, &C); }
-db_options(A) ::= db_options(B) SINGLE_STABLE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_SINGLESTABLE, &C); }
-db_options(A) ::= db_options(B) STREAM_MODE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_STREAMMODE, &C); }
+db_options(A) ::= db_options(B) SINGLE_STABLE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_SINGLE_STABLE, &C); }
+db_options(A) ::= db_options(B) STREAM_MODE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_STREAM_MODE, &C); }
+db_options(A) ::= db_options(B) RETENTIONS NK_STRING(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_RETENTIONS, &C); }
+db_options(A) ::= db_options(B) FILE_FACTOR NK_FLOAT(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_FILE_FACTOR, &C); }
+
+alter_db_options(A) ::= alter_db_option(B). { A = createDefaultAlterDatabaseOptions(pCxt); A = setDatabaseOption(pCxt, A, B.type, &B.val); }
+alter_db_options(A) ::= alter_db_options(B) alter_db_option(C). { A = setDatabaseOption(pCxt, B, C.type, &C.val); }
+
+%type alter_db_option { SAlterOption }
+%destructor alter_db_option { }
+alter_db_option(A) ::= BLOCKS NK_INTEGER(B). { A.type = DB_OPTION_BLOCKS; A.val = B; }
+alter_db_option(A) ::= FSYNC NK_INTEGER(B). { A.type = DB_OPTION_FSYNC; A.val = B; }
+alter_db_option(A) ::= KEEP NK_INTEGER(B). { A.type = DB_OPTION_KEEP; A.val = B; }
+alter_db_option(A) ::= WAL NK_INTEGER(B). { A.type = DB_OPTION_WAL; A.val = B; }
+alter_db_option(A) ::= QUORUM NK_INTEGER(B). { A.type = DB_OPTION_QUORUM; A.val = B; }
+alter_db_option(A) ::= CACHELAST NK_INTEGER(B). { A.type = DB_OPTION_CACHELAST; A.val = B; }
/************************************************ create/drop/show table/stable ***************************************/
cmd ::= CREATE TABLE not_exists_opt(A) full_table_name(B)
- NK_LP column_def_list(C) NK_RP tags_def_opt(D) table_options(E). { pCxt->pRootNode = createCreateTableStmt(pCxt, A, B, C, D, E);}
-cmd ::= CREATE TABLE multi_create_clause(A). { pCxt->pRootNode = createCreateMultiTableStmt(pCxt, A);}
+ NK_LP column_def_list(C) NK_RP tags_def_opt(D) table_options(E). { pCxt->pRootNode = createCreateTableStmt(pCxt, A, B, C, D, E); }
+cmd ::= CREATE TABLE multi_create_clause(A). { pCxt->pRootNode = createCreateMultiTableStmt(pCxt, A); }
cmd ::= CREATE STABLE not_exists_opt(A) full_table_name(B)
- NK_LP column_def_list(C) NK_RP tags_def(D) table_options(E). { pCxt->pRootNode = createCreateTableStmt(pCxt, A, B, C, D, E);}
+ NK_LP column_def_list(C) NK_RP tags_def(D) table_options(E). { pCxt->pRootNode = createCreateTableStmt(pCxt, A, B, C, D, E); }
cmd ::= DROP TABLE multi_drop_clause(A). { pCxt->pRootNode = createDropTableStmt(pCxt, A); }
cmd ::= DROP STABLE exists_opt(A) full_table_name(B). { pCxt->pRootNode = createDropSuperTableStmt(pCxt, A, B); }
cmd ::= SHOW TABLES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, NULL); }
cmd ::= SHOW STABLES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, NULL); }
+cmd ::= ALTER TABLE alter_table_clause(A). { pCxt->pRootNode = A; }
+cmd ::= ALTER STABLE alter_table_clause(A). { pCxt->pRootNode = A; }
+
+alter_table_clause(A) ::= full_table_name(B) alter_table_options(C). { A = createAlterTableOption(pCxt, B, C); }
+alter_table_clause(A) ::=
+ full_table_name(B) ADD COLUMN column_name(C) type_name(D). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_ADD_COLUMN, &C, D); }
+alter_table_clause(A) ::= full_table_name(B) DROP COLUMN column_name(C). { A = createAlterTableDropCol(pCxt, B, TSDB_ALTER_TABLE_DROP_COLUMN, &C); }
+alter_table_clause(A) ::=
+ full_table_name(B) MODIFY COLUMN column_name(C) type_name(D). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &C, D); }
+alter_table_clause(A) ::=
+ full_table_name(B) RENAME COLUMN column_name(C) column_name(D). { A = createAlterTableRenameCol(pCxt, B, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &C, &D); }
+alter_table_clause(A) ::=
+ full_table_name(B) ADD TAG column_name(C) type_name(D). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_ADD_TAG, &C, D); }
+alter_table_clause(A) ::= full_table_name(B) DROP TAG column_name(C). { A = createAlterTableDropCol(pCxt, B, TSDB_ALTER_TABLE_DROP_TAG, &C); }
+alter_table_clause(A) ::=
+ full_table_name(B) MODIFY TAG column_name(C) type_name(D). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &C, D); }
+alter_table_clause(A) ::=
+ full_table_name(B) RENAME TAG column_name(C) column_name(D). { A = createAlterTableRenameCol(pCxt, B, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &C, &D); }
+alter_table_clause(A) ::=
+ full_table_name(B) SET TAG column_name(C) NK_EQ literal(D). { A = createAlterTableSetTag(pCxt, B, &C, D); }
+
%type multi_create_clause { SNodeList* }
%destructor multi_create_clause { nodesDestroyList($$); }
multi_create_clause(A) ::= create_subtable_clause(B). { A = createNodeList(pCxt, B); }
@@ -183,11 +263,21 @@ tags_def_opt(A) ::= tags_def(B).
%destructor tags_def { nodesDestroyList($$); }
tags_def(A) ::= TAGS NK_LP column_def_list(B) NK_RP. { A = B; }
-table_options(A) ::= . { A = createDefaultTableOptions(pCxt);}
+table_options(A) ::= . { A = createDefaultTableOptions(pCxt); }
table_options(A) ::= table_options(B) COMMENT NK_STRING(C). { A = setTableOption(pCxt, B, TABLE_OPTION_COMMENT, &C); }
table_options(A) ::= table_options(B) KEEP NK_INTEGER(C). { A = setTableOption(pCxt, B, TABLE_OPTION_KEEP, &C); }
table_options(A) ::= table_options(B) TTL NK_INTEGER(C). { A = setTableOption(pCxt, B, TABLE_OPTION_TTL, &C); }
table_options(A) ::= table_options(B) SMA NK_LP col_name_list(C) NK_RP. { A = setTableSmaOption(pCxt, B, C); }
+table_options(A) ::= table_options(B) ROLLUP NK_LP func_name_list(C) NK_RP. { A = setTableRollupOption(pCxt, B, C); }
+
+alter_table_options(A) ::= alter_table_option(B). { A = createDefaultAlterTableOptions(pCxt); A = setTableOption(pCxt, A, B.type, &B.val); }
+alter_table_options(A) ::= alter_table_options(B) alter_table_option(C). { A = setTableOption(pCxt, B, C.type, &C.val); }
+
+%type alter_table_option { SAlterOption }
+%destructor alter_table_option { }
+alter_table_option(A) ::= COMMENT NK_STRING(B). { A.type = TABLE_OPTION_COMMENT; A.val = B; }
+alter_table_option(A) ::= KEEP NK_INTEGER(B). { A.type = TABLE_OPTION_KEEP; A.val = B; }
+alter_table_option(A) ::= TTL NK_INTEGER(B). { A.type = TABLE_OPTION_TTL; A.val = B; }
%type col_name_list { SNodeList* }
%destructor col_name_list { nodesDestroyList($$); }
@@ -196,6 +286,13 @@ col_name_list(A) ::= col_name_list(B) NK_COMMA col_name(C).
col_name(A) ::= column_name(B). { A = createColumnNode(pCxt, NULL, &B); }
+%type func_name_list { SNodeList* }
+%destructor func_name_list { nodesDestroyList($$); }
+func_name_list(A) ::= func_name(B). { A = createNodeList(pCxt, B); }
+func_name_list(A) ::= func_name_list(B) NK_COMMA col_name(C). { A = addNodeToList(pCxt, B, C); }
+
+func_name(A) ::= function_name(B). { A = createFunctionNode(pCxt, &B, NULL); }
+
/************************************************ create index ********************************************************/
cmd ::= CREATE SMA INDEX index_name(A) ON table_name(B) index_options(C). { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, &A, &B, NULL, C); }
cmd ::= CREATE FULLTEXT INDEX
@@ -546,7 +643,7 @@ query_expression_body(A) ::=
query_primary(A) ::= query_specification(B). { A = B; }
//query_primary(A) ::=
// NK_LP query_expression_body(B)
-// order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP. { A = B;}
+// order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP. { A = B; }
%type order_by_clause_opt { SNodeList* }
%destructor order_by_clause_opt { nodesDestroyList($$); }
diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c
index 034346362c..eed6391d5c 100644
--- a/source/libs/parser/src/parAstCreater.c
+++ b/source/libs/parser/src/parAstCreater.c
@@ -246,6 +246,16 @@ static SDatabaseOptions* setDbStreamMode(SAstCreateContext* pCxt, SDatabaseOptio
return pOptions;
}
+static SDatabaseOptions* setDbRetentions(SAstCreateContext* pCxt, SDatabaseOptions* pOptions, const SToken* pVal) {
+ // todo
+ return pOptions;
+}
+
+static SDatabaseOptions* setDbFileFactor(SAstCreateContext* pCxt, SDatabaseOptions* pOptions, const SToken* pVal) {
+ // todo
+ return pOptions;
+}
+
static void initSetDatabaseOptionFp() {
setDbOptionFuncs[DB_OPTION_BLOCKS] = setDbBlocks;
setDbOptionFuncs[DB_OPTION_CACHE] = setDbCache;
@@ -262,8 +272,10 @@ static void initSetDatabaseOptionFp() {
setDbOptionFuncs[DB_OPTION_TTL] = setDbTtl;
setDbOptionFuncs[DB_OPTION_WAL] = setDbWal;
setDbOptionFuncs[DB_OPTION_VGROUPS] = setDbVgroups;
- setDbOptionFuncs[DB_OPTION_SINGLESTABLE] = setDbSingleStable;
- setDbOptionFuncs[DB_OPTION_STREAMMODE] = setDbStreamMode;
+ setDbOptionFuncs[DB_OPTION_SINGLE_STABLE] = setDbSingleStable;
+ setDbOptionFuncs[DB_OPTION_STREAM_MODE] = setDbStreamMode;
+ setDbOptionFuncs[DB_OPTION_RETENTIONS] = setDbRetentions;
+ setDbOptionFuncs[DB_OPTION_FILE_FACTOR] = setDbFileFactor;
}
static STableOptions* setTableKeep(SAstCreateContext* pCxt, STableOptions* pOptions, const SToken* pVal) {
@@ -772,6 +784,29 @@ SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt) {
return (SNode*)pOptions;
}
+SNode* createDefaultAlterDatabaseOptions(SAstCreateContext* pCxt) {
+ SDatabaseOptions* pOptions = nodesMakeNode(QUERY_NODE_DATABASE_OPTIONS);
+ CHECK_OUT_OF_MEM(pOptions);
+ pOptions->numOfBlocks = -1;
+ pOptions->cacheBlockSize = -1;
+ pOptions->cachelast = -1;
+ pOptions->compressionLevel = -1;
+ pOptions->daysPerFile = -1;
+ pOptions->fsyncPeriod = -1;
+ pOptions->maxRowsPerBlock = -1;
+ pOptions->minRowsPerBlock = -1;
+ pOptions->keep = -1;
+ pOptions->precision = -1;
+ pOptions->quorum = -1;
+ pOptions->replica = -1;
+ pOptions->ttl = -1;
+ pOptions->walLevel = -1;
+ pOptions->numOfVgroups = -1;
+ pOptions->singleStable = -1;
+ pOptions->streamMode = -1;
+ return (SNode*)pOptions;
+}
+
SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOptionType type, const SToken* pVal) {
return (SNode*)setDbOptionFuncs[type](pCxt, (SDatabaseOptions*)pOptions, pVal);
}
@@ -818,6 +853,14 @@ SNode* createDefaultTableOptions(SAstCreateContext* pCxt) {
return (SNode*)pOptions;
}
+SNode* createDefaultAlterTableOptions(SAstCreateContext* pCxt) {
+ STableOptions* pOptions = nodesMakeNode(QUERY_NODE_TABLE_OPTIONS);
+ CHECK_OUT_OF_MEM(pOptions);
+ pOptions->keep = -1;
+ pOptions->ttl = -1;
+ return (SNode*)pOptions;
+}
+
SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType type, const SToken* pVal) {
return (SNode*)setTableOptionFuncs[type](pCxt, (STableOptions*)pOptions, pVal);
}
@@ -827,6 +870,11 @@ SNode* setTableSmaOption(SAstCreateContext* pCxt, SNode* pOptions, SNodeList* pS
return pOptions;
}
+SNode* setTableRollupOption(SAstCreateContext* pCxt, SNode* pOptions, SNodeList* pFuncs) {
+ // todo
+ return pOptions;
+}
+
SNode* createColumnDefNode(SAstCreateContext* pCxt, const SToken* pColName, SDataType dataType, const SToken* pComment) {
SColumnDefNode* pCol = (SColumnDefNode*)nodesMakeNode(QUERY_NODE_COLUMN_DEF);
CHECK_OUT_OF_MEM(pCol);
@@ -912,6 +960,49 @@ SNode* createDropSuperTableStmt(SAstCreateContext* pCxt, bool ignoreNotExists, S
return (SNode*)pStmt;
}
+SNode* createAlterTableOption(SAstCreateContext* pCxt, SNode* pRealTable, SNode* pOptions) {
+ SAlterTableStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT);
+ CHECK_OUT_OF_MEM(pStmt);
+ pStmt->alterType = TSDB_ALTER_TABLE_UPDATE_OPTIONS;
+ pStmt->pOptions = (STableOptions*)pOptions;
+ return (SNode*)pStmt;
+}
+
+SNode* createAlterTableAddModifyCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, const SToken* pColName, SDataType dataType) {
+ SAlterTableStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT);
+ CHECK_OUT_OF_MEM(pStmt);
+ pStmt->alterType = alterType;
+ strncpy(pStmt->colName, pColName->z, pColName->n);
+ pStmt->dataType = dataType;
+ return (SNode*)pStmt;
+}
+
+SNode* createAlterTableDropCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, const SToken* pColName) {
+ SAlterTableStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT);
+ CHECK_OUT_OF_MEM(pStmt);
+ pStmt->alterType = alterType;
+ strncpy(pStmt->colName, pColName->z, pColName->n);
+ return (SNode*)pStmt;
+}
+
+SNode* createAlterTableRenameCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, const SToken* pOldColName, const SToken* pNewColName) {
+ SAlterTableStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT);
+ CHECK_OUT_OF_MEM(pStmt);
+ pStmt->alterType = alterType;
+ strncpy(pStmt->colName, pOldColName->z, pOldColName->n);
+ strncpy(pStmt->newColName, pNewColName->z, pNewColName->n);
+ return (SNode*)pStmt;
+}
+
+SNode* createAlterTableSetTag(SAstCreateContext* pCxt, SNode* pRealTable, const SToken* pTagName, SNode* pVal) {
+ SAlterTableStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT);
+ CHECK_OUT_OF_MEM(pStmt);
+ pStmt->alterType = TSDB_ALTER_TABLE_UPDATE_TAG_VAL;
+ strncpy(pStmt->colName, pTagName->z, pTagName->n);
+ pStmt->pVal = (SValueNode*)pVal;
+ return (SNode*)pStmt;
+}
+
SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, const SToken* pDbName) {
SUseDatabaseStmt* pStmt = (SUseDatabaseStmt*)nodesMakeNode(QUERY_NODE_USE_DATABASE_STMT);
CHECK_OUT_OF_MEM(pStmt);
@@ -1009,6 +1100,17 @@ SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode) {
return (SNode*)pStmt;
}
+SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const SToken* pConfig, const SToken* pValue) {
+ SAlterDnodeStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_DNODE_STMT);
+ CHECK_OUT_OF_MEM(pStmt);
+ pStmt->dnodeId = strtol(pDnode->z, NULL, 10);
+ trimString(pConfig->z, pConfig->n, pStmt->config, sizeof(pStmt->config));
+ if (NULL != pValue) {
+ trimString(pValue->z, pValue->n, pStmt->value, sizeof(pStmt->value));
+ }
+ return (SNode*)pStmt;
+}
+
SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, const SToken* pIndexName, const SToken* pTableName, SNodeList* pCols, SNode* pOptions) {
if (!checkIndexName(pCxt, pIndexName) || !checkTableName(pCxt, pTableName)) {
return NULL;
@@ -1077,3 +1179,13 @@ SNode* createDropTopicStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const
pStmt->ignoreNotExists = ignoreNotExists;
return (SNode*)pStmt;
}
+
+SNode* createAlterLocalStmt(SAstCreateContext* pCxt, const SToken* pConfig, const SToken* pValue) {
+ SAlterLocalStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_LOCAL_STMT);
+ CHECK_OUT_OF_MEM(pStmt);
+ trimString(pConfig->z, pConfig->n, pStmt->config, sizeof(pStmt->config));
+ if (NULL != pValue) {
+ trimString(pValue->z, pValue->n, pStmt->value, sizeof(pStmt->value));
+ }
+ return (SNode*)pStmt;
+}
diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c
index 6db3abb9d6..a37820634f 100644
--- a/source/libs/parser/src/parInsert.c
+++ b/source/libs/parser/src/parInsert.c
@@ -622,7 +622,7 @@ static FORCE_INLINE int32_t MemRowAppend(const void* value, int32_t len, void* p
// if the converted output len is over than pColumnModel->bytes, return error: 'Argument list too long'
int32_t output = 0;
const char* rowEnd = tdRowEnd(rb->pBuf);
- if (!taosMbsToUcs4(value, len, (char*)varDataVal(rowEnd), pa->schema->bytes - VARSTR_HEADER_SIZE, &output)) {
+ if (!taosMbsToUcs4(value, len, (TdUcs4*)varDataVal(rowEnd), pa->schema->bytes - VARSTR_HEADER_SIZE, &output)) {
return TSDB_CODE_TSC_SQL_SYNTAX_ERROR;
}
varDataSetLen(rowEnd, output);
@@ -725,7 +725,7 @@ static int32_t KvRowAppend(const void *value, int32_t len, void *param) {
} else if (TSDB_DATA_TYPE_NCHAR == type) {
// if the converted output len is over than pColumnModel->bytes, return error: 'Argument list too long'
int32_t output = 0;
- if (!taosMbsToUcs4(value, len, varDataVal(pa->buf), pa->schema->bytes - VARSTR_HEADER_SIZE, &output)) {
+ if (!taosMbsToUcs4(value, len, (TdUcs4*)varDataVal(pa->buf), pa->schema->bytes - VARSTR_HEADER_SIZE, &output)) {
return TSDB_CODE_TSC_SQL_SYNTAX_ERROR;
}
diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c
index 2d58d4e1e3..4549660c76 100644
--- a/source/libs/parser/src/parTokenizer.c
+++ b/source/libs/parser/src/parTokenizer.c
@@ -28,6 +28,7 @@ typedef struct SKeyword {
// keywords in sql string
static SKeyword keywordTable[] = {
+ {"ACCOUNT", TK_ACCOUNT},
{"ALL", TK_ALL},
{"ALTER", TK_ALTER},
{"AND", TK_AND},
@@ -168,7 +169,6 @@ static SKeyword keywordTable[] = {
// {"SCORES", TK_SCORES},
// {"GRANTS", TK_GRANTS},
// {"DOT", TK_DOT},
- // {"ACCOUNT", TK_ACCOUNT},
// {"DESCRIBE", TK_DESCRIBE},
// {"SYNCDB", TK_SYNCDB},
// {"LOCAL", TK_LOCAL},
diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c
index af7a38b702..171ec81ca2 100644
--- a/source/libs/parser/src/parTranslater.c
+++ b/source/libs/parser/src/parTranslater.c
@@ -126,7 +126,7 @@ static void setColumnInfoByExpr(const STableNode* pTable, SExprNode* pExpr, SCol
static int32_t createColumnNodeByTable(STranslateContext* pCxt, const STableNode* pTable, SNodeList* pList) {
if (QUERY_NODE_REAL_TABLE == nodeType(pTable)) {
const STableMeta* pMeta = ((SRealTableNode*)pTable)->pMeta;
- int32_t nums = pMeta->tableInfo.numOfColumns + ((TSDB_SUPER_TABLE == pMeta->tableType)? pMeta->tableInfo.numOfTags:0);
+ int32_t nums = pMeta->tableInfo.numOfColumns + ((TSDB_SUPER_TABLE == pMeta->tableType) ? pMeta->tableInfo.numOfTags : 0);
for (int32_t i = 0; i < nums; ++i) {
SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN);
if (NULL == pCol) {
@@ -499,6 +499,10 @@ static int32_t checkAggColCoexist(STranslateContext* pCxt, SSelectStmt* pSelect)
}
static int32_t setTableVgroupList(SParseContext* pCxt, SName* name, SRealTableNode* pRealTable) {
+ if (pCxt->streamQuery) {
+ return TSDB_CODE_SUCCESS;
+ }
+
if (TSDB_SUPER_TABLE == pRealTable->pMeta->tableType) {
SArray* vgroupList = NULL;
int32_t code = catalogGetTableDistVgInfo(pCxt->pCatalog, pCxt->pTransporter, &pCxt->mgmtEpSet, name, &vgroupList);
@@ -962,6 +966,73 @@ static int32_t translateDropSuperTable(STranslateContext* pCxt, SDropSuperTableS
return doTranslateDropSuperTable(pCxt, &tableName, pStmt->ignoreNotExists);
}
+static int32_t setAlterTableField(SAlterTableStmt* pStmt, SMAltertbReq* pAlterReq) {
+ pAlterReq->pFields = taosArrayInit(2, sizeof(TAOS_FIELD));
+ if (NULL == pAlterReq->pFields) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+
+ switch (pStmt->alterType) {
+ case TSDB_ALTER_TABLE_ADD_TAG:
+ case TSDB_ALTER_TABLE_DROP_TAG:
+ case TSDB_ALTER_TABLE_ADD_COLUMN:
+ case TSDB_ALTER_TABLE_DROP_COLUMN:
+ case TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES:
+ case TSDB_ALTER_TABLE_UPDATE_TAG_BYTES: {
+ TAOS_FIELD field = { .type = pStmt->dataType.type, .bytes = pStmt->dataType.bytes };
+ strcpy(field.name, pStmt->colName);
+ taosArrayPush(pAlterReq->pFields, &field);
+ break;
+ }
+ case TSDB_ALTER_TABLE_UPDATE_TAG_NAME:
+ case TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME: {
+ TAOS_FIELD oldField = {0};
+ strcpy(oldField.name, pStmt->colName);
+ taosArrayPush(pAlterReq->pFields, &oldField);
+ TAOS_FIELD newField = {0};
+ strcpy(oldField.name, pStmt->newColName);
+ taosArrayPush(pAlterReq->pFields, &newField);
+ break;
+ }
+ default:
+ break;
+ }
+
+ return TSDB_CODE_SUCCESS;
+}
+
+static int32_t translateAlterTable(STranslateContext* pCxt, SAlterTableStmt* pStmt) {
+ SMAltertbReq alterReq = {0};
+ SName tableName = { .type = TSDB_TABLE_NAME_T, .acctId = pCxt->pParseCxt->acctId };
+ strcpy(tableName.dbname, pStmt->dbName);
+ strcpy(tableName.tname, pStmt->tableName);
+ tNameExtractFullName(&tableName, alterReq.name);
+ alterReq.alterType = pStmt->alterType;
+ alterReq.numOfFields = 1;
+ if (TSDB_ALTER_TABLE_UPDATE_OPTIONS == pStmt->alterType) {
+ // todo
+ } else {
+ if (TSDB_CODE_SUCCESS != setAlterTableField(pStmt, &alterReq)) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+ }
+
+ pCxt->pCmdMsg = malloc(sizeof(SCmdMsgInfo));
+ if (NULL == pCxt->pCmdMsg) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+ pCxt->pCmdMsg->epSet = pCxt->pParseCxt->mgmtEpSet;
+ pCxt->pCmdMsg->msgType = TDMT_MND_ALTER_STB;
+ pCxt->pCmdMsg->msgLen = tSerializeSMAlterStbReq(NULL, 0, &alterReq);
+ pCxt->pCmdMsg->pMsg = malloc(pCxt->pCmdMsg->msgLen);
+ if (NULL == pCxt->pCmdMsg->pMsg) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+ tSerializeSMAlterStbReq(pCxt->pCmdMsg->pMsg, pCxt->pCmdMsg->msgLen, &alterReq);
+
+ return TSDB_CODE_SUCCESS;
+}
+
static int32_t translateUseDatabase(STranslateContext* pCxt, SUseDatabaseStmt* pStmt) {
SName name = {0};
tNameSetDbName(&name, pCxt->pParseCxt->acctId, pStmt->dbName, strlen(pStmt->dbName));
@@ -1099,6 +1170,28 @@ static int32_t translateDropDnode(STranslateContext* pCxt, SDropDnodeStmt* pStmt
return TSDB_CODE_SUCCESS;
}
+static int32_t translateAlterDnode(STranslateContext* pCxt, SAlterDnodeStmt* pStmt) {
+ SMCfgDnodeReq cfgReq = {0};
+ cfgReq.dnodeId = pStmt->dnodeId;
+ strcpy(cfgReq.config, pStmt->config);
+ strcpy(cfgReq.value, pStmt->value);
+
+ pCxt->pCmdMsg = malloc(sizeof(SCmdMsgInfo));
+ if (NULL == pCxt->pCmdMsg) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+ pCxt->pCmdMsg->epSet = pCxt->pParseCxt->mgmtEpSet;
+ pCxt->pCmdMsg->msgType = TDMT_MND_CONFIG_DNODE;
+ pCxt->pCmdMsg->msgLen = tSerializeSMCfgDnodeReq(NULL, 0, &cfgReq);
+ pCxt->pCmdMsg->pMsg = malloc(pCxt->pCmdMsg->msgLen);
+ if (NULL == pCxt->pCmdMsg->pMsg) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+ tSerializeSMCfgDnodeReq(pCxt->pCmdMsg->pMsg, pCxt->pCmdMsg->msgLen, &cfgReq);
+
+ return TSDB_CODE_SUCCESS;
+}
+
static int32_t nodeTypeToShowType(ENodeType nt) {
switch (nt) {
case QUERY_NODE_SHOW_DATABASES_STMT:
@@ -1300,6 +1393,7 @@ static int32_t translateCreateTopic(STranslateContext* pCxt, SCreateTopicStmt* p
SCMCreateTopicReq createReq = {0};
if (NULL != pStmt->pQuery) {
+ pCxt->pParseCxt->streamQuery = true;
int32_t code = translateQuery(pCxt, pStmt->pQuery);
if (TSDB_CODE_SUCCESS == code) {
code = nodesNodeToString(pStmt->pQuery, false, &createReq.ast, NULL);
@@ -1364,6 +1458,11 @@ static int32_t translateDropTopic(STranslateContext* pCxt, SDropTopicStmt* pStmt
return TSDB_CODE_SUCCESS;
}
+static int32_t translateAlterLocal(STranslateContext* pCxt, SAlterLocalStmt* pStmt) {
+ // todo
+ return TSDB_CODE_SUCCESS;
+}
+
static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) {
int32_t code = TSDB_CODE_SUCCESS;
switch (nodeType(pNode)) {
@@ -1388,6 +1487,9 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) {
case QUERY_NODE_DROP_SUPER_TABLE_STMT:
code = translateDropSuperTable(pCxt, (SDropSuperTableStmt*)pNode);
break;
+ case QUERY_NODE_ALTER_TABLE_STMT:
+ code = translateAlterTable(pCxt, (SAlterTableStmt*)pNode);
+ break;
case QUERY_NODE_CREATE_USER_STMT:
code = translateCreateUser(pCxt, (SCreateUserStmt*)pNode);
break;
@@ -1406,6 +1508,9 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) {
case QUERY_NODE_DROP_DNODE_STMT:
code = translateDropDnode(pCxt, (SDropDnodeStmt*)pNode);
break;
+ case QUERY_NODE_ALTER_DNODE_STMT:
+ code = translateAlterDnode(pCxt, (SAlterDnodeStmt*)pNode);
+ break;
case QUERY_NODE_SHOW_DATABASES_STMT:
case QUERY_NODE_SHOW_STABLES_STMT:
case QUERY_NODE_SHOW_USERS_STMT:
@@ -1436,6 +1541,9 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) {
case QUERY_NODE_DROP_TOPIC_STMT:
code = translateDropTopic(pCxt, (SDropTopicStmt*)pNode);
break;
+ case QUERY_NODE_ALTER_LOCAL_STMT:
+ code = translateAlterLocal(pCxt, (SAlterLocalStmt*)pNode);
+ break;
default:
break;
}
@@ -1855,6 +1963,11 @@ static int32_t rewriteCreateMultiTable(STranslateContext* pCxt, SQuery* pQuery)
return rewriteToVnodeModifOpStmt(pQuery, pBufArray);
}
+static int32_t rewriteAlterTable(STranslateContext* pCxt, SQuery* pQuery) {
+ // todo
+ return TSDB_CODE_SUCCESS;
+}
+
static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) {
int32_t code = TSDB_CODE_SUCCESS;
switch (nodeType(pQuery->pRoot)) {
@@ -1866,6 +1979,11 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) {
case QUERY_NODE_CREATE_MULTI_TABLE_STMT:
code = rewriteCreateMultiTable(pCxt, pQuery);
break;
+ case QUERY_NODE_ALTER_TABLE_STMT:
+ if (TSDB_ALTER_TABLE_UPDATE_TAG_VAL == ((SAlterTableStmt*)pQuery->pRoot)->alterType) {
+ code = rewriteAlterTable(pCxt, pQuery);
+ }
+ break;
default:
break;
}
diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c
index aa2516e2b9..69c2380b45 100644
--- a/source/libs/parser/src/parUtil.c
+++ b/source/libs/parser/src/parUtil.c
@@ -46,17 +46,19 @@ static char* getSyntaxErrFormat(int32_t errCode) {
case TSDB_CODE_PAR_NOT_SINGLE_GROUP:
return "Not a single-group group function";
case TSDB_CODE_PAR_TAGS_NOT_MATCHED:
- return "tags number not matched";
+ return "Tags number not matched";
case TSDB_CODE_PAR_INVALID_TAG_NAME:
- return "invalid tag name : %s";
+ return "Invalid tag name : %s";
case TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG:
- return "name or password too long";
+ return "Name or password too long";
case TSDB_CODE_PAR_PASSWD_EMPTY:
- return "password can not be empty";
+ return "Password can not be empty";
case TSDB_CODE_PAR_INVALID_PORT:
- return "port should be an integer that is less than 65535 and greater than 0";
+ return "Port should be an integer that is less than 65535 and greater than 0";
case TSDB_CODE_PAR_INVALID_ENDPOINT:
- return "endpoint should be in the format of 'fqdn:port'";
+ return "Endpoint should be in the format of 'fqdn:port'";
+ case TSDB_CODE_PAR_EXPRIE_STATEMENT:
+ return "This statement is no longer supported";
case TSDB_CODE_OUT_OF_MEMORY:
return "Out of memory";
default:
diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c
index 18b507c1b0..3d88eb5336 100644
--- a/source/libs/parser/src/sql.c
+++ b/source/libs/parser/src/sql.c
@@ -99,22 +99,24 @@
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned char
-#define YYNOCODE 220
+#define YYNOCODE 249
#define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SToken
typedef union {
int yyinit;
ParseTOKENTYPE yy0;
- SNodeList* yy24;
- bool yy97;
- SToken yy129;
- SDataType yy224;
- ENullOrder yy257;
- EOperatorType yy260;
- EFillMode yy294;
- EJoinType yy332;
- EOrder yy378;
- SNode* yy432;
+ SNode* yy26;
+ EOrder yy32;
+ SNodeList* yy64;
+ EOperatorType yy80;
+ bool yy107;
+ EFillMode yy192;
+ SToken yy353;
+ SDataType yy370;
+ EJoinType yy372;
+ ENullOrder yy391;
+ SAlterOption yy443;
+ int32_t yy448;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
@@ -129,17 +131,17 @@ typedef union {
#define ParseCTX_PARAM
#define ParseCTX_FETCH
#define ParseCTX_STORE
-#define YYNSTATE 333
-#define YYNRULE 255
-#define YYNTOKEN 141
-#define YY_MAX_SHIFT 332
-#define YY_MIN_SHIFTREDUCE 501
-#define YY_MAX_SHIFTREDUCE 755
-#define YY_ERROR_ACTION 756
-#define YY_ACCEPT_ACTION 757
-#define YY_NO_ACTION 758
-#define YY_MIN_REDUCE 759
-#define YY_MAX_REDUCE 1013
+#define YYNSTATE 414
+#define YYNRULE 316
+#define YYNTOKEN 160
+#define YY_MAX_SHIFT 413
+#define YY_MIN_SHIFTREDUCE 631
+#define YY_MAX_SHIFTREDUCE 946
+#define YY_ERROR_ACTION 947
+#define YY_ACCEPT_ACTION 948
+#define YY_NO_ACTION 949
+#define YY_MIN_REDUCE 950
+#define YY_MAX_REDUCE 1265
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
@@ -206,322 +208,379 @@ typedef union {
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
-#define YY_ACTTAB_COUNT (1012)
+#define YY_ACTTAB_COUNT (1182)
static const YYACTIONTYPE yy_action[] = {
- /* 0 */ 163, 856, 240, 855, 272, 162, 272, 200, 856, 814,
- /* 10 */ 854, 878, 31, 29, 27, 26, 25, 65, 880, 817,
- /* 20 */ 178, 817, 256, 176, 906, 31, 29, 27, 26, 25,
- /* 30 */ 779, 878, 40, 705, 55, 819, 71, 63, 880, 62,
- /* 40 */ 155, 229, 66, 812, 243, 809, 906, 79, 938, 939,
- /* 50 */ 626, 943, 878, 155, 175, 258, 511, 863, 259, 891,
- /* 60 */ 511, 638, 58, 892, 895, 931, 512, 513, 208, 165,
- /* 70 */ 927, 77, 321, 320, 319, 318, 317, 316, 315, 314,
- /* 80 */ 313, 312, 311, 310, 309, 308, 307, 306, 305, 775,
- /* 90 */ 959, 27, 26, 25, 31, 29, 27, 26, 25, 23,
- /* 100 */ 170, 271, 656, 657, 658, 659, 660, 661, 662, 664,
- /* 110 */ 665, 666, 23, 170, 271, 656, 657, 658, 659, 660,
- /* 120 */ 661, 662, 664, 665, 666, 31, 29, 27, 26, 25,
- /* 130 */ 10, 321, 320, 319, 318, 317, 316, 315, 314, 313,
- /* 140 */ 312, 311, 310, 309, 308, 307, 306, 305, 565, 295,
- /* 150 */ 294, 293, 569, 292, 571, 572, 291, 574, 288, 804,
- /* 160 */ 580, 285, 582, 583, 282, 279, 24, 117, 256, 196,
- /* 170 */ 906, 992, 626, 195, 624, 256, 177, 906, 194, 856,
- /* 180 */ 193, 854, 83, 878, 991, 83, 258, 233, 990, 244,
- /* 190 */ 891, 180, 271, 57, 892, 895, 931, 54, 182, 190,
- /* 200 */ 154, 927, 51, 819, 71, 272, 192, 191, 269, 301,
- /* 210 */ 819, 71, 992, 300, 805, 243, 624, 906, 751, 752,
- /* 220 */ 817, 10, 234, 878, 298, 82, 258, 945, 302, 990,
- /* 230 */ 891, 757, 627, 58, 892, 895, 931, 256, 186, 906,
- /* 240 */ 165, 927, 77, 228, 942, 878, 201, 299, 258, 628,
- /* 250 */ 30, 28, 891, 201, 113, 58, 892, 895, 931, 617,
- /* 260 */ 221, 958, 165, 927, 1004, 184, 256, 615, 906, 172,
- /* 270 */ 629, 235, 230, 965, 878, 304, 878, 258, 12, 272,
- /* 280 */ 297, 891, 270, 881, 58, 892, 895, 931, 992, 9,
- /* 290 */ 8, 165, 927, 1004, 817, 256, 272, 906, 1, 130,
- /* 300 */ 83, 82, 988, 878, 181, 990, 258, 856, 40, 854,
- /* 310 */ 891, 817, 112, 58, 892, 895, 931, 273, 21, 813,
- /* 320 */ 165, 927, 1004, 30, 28, 698, 272, 663, 189, 183,
- /* 330 */ 667, 949, 617, 99, 616, 618, 621, 114, 30, 28,
- /* 340 */ 615, 817, 172, 329, 328, 803, 247, 617, 256, 674,
- /* 350 */ 906, 12, 722, 83, 140, 615, 878, 172, 161, 258,
- /* 360 */ 141, 72, 244, 891, 30, 28, 144, 892, 895, 49,
- /* 370 */ 945, 1, 945, 617, 84, 225, 720, 721, 723, 724,
- /* 380 */ 810, 615, 226, 172, 304, 992, 7, 941, 6, 940,
- /* 390 */ 273, 697, 12, 864, 259, 256, 248, 906, 82, 820,
- /* 400 */ 71, 136, 990, 878, 847, 273, 258, 616, 618, 621,
- /* 410 */ 891, 240, 1, 59, 892, 895, 931, 256, 107, 906,
- /* 420 */ 930, 927, 616, 618, 621, 878, 65, 217, 258, 950,
- /* 430 */ 693, 273, 891, 251, 69, 59, 892, 895, 931, 207,
- /* 440 */ 244, 83, 254, 927, 213, 961, 63, 211, 616, 618,
- /* 450 */ 621, 83, 94, 30, 28, 257, 110, 938, 239, 241,
- /* 460 */ 238, 249, 617, 992, 719, 617, 30, 28, 693, 93,
- /* 470 */ 615, 60, 172, 615, 246, 617, 82, 104, 907, 256,
- /* 480 */ 990, 906, 668, 615, 102, 172, 116, 878, 255, 32,
- /* 490 */ 258, 2, 754, 755, 891, 635, 624, 73, 892, 895,
- /* 500 */ 252, 7, 32, 696, 607, 9, 8, 30, 28, 185,
- /* 510 */ 256, 32, 906, 632, 7, 885, 617, 625, 878, 85,
- /* 520 */ 273, 258, 883, 273, 615, 891, 172, 631, 59, 892,
- /* 530 */ 895, 931, 214, 273, 245, 1005, 928, 616, 618, 621,
- /* 540 */ 616, 618, 621, 197, 198, 256, 199, 906, 39, 653,
- /* 550 */ 616, 618, 621, 878, 202, 1, 258, 171, 90, 122,
- /* 560 */ 891, 215, 209, 148, 892, 895, 120, 256, 630, 906,
- /* 570 */ 264, 134, 160, 127, 273, 878, 558, 67, 258, 222,
- /* 580 */ 68, 216, 891, 69, 992, 148, 892, 895, 256, 218,
- /* 590 */ 906, 616, 618, 621, 629, 553, 878, 82, 95, 258,
- /* 600 */ 962, 990, 60, 891, 586, 133, 147, 892, 895, 590,
- /* 610 */ 256, 277, 906, 61, 802, 227, 68, 219, 878, 325,
- /* 620 */ 972, 258, 132, 262, 256, 891, 906, 100, 73, 892,
- /* 630 */ 895, 621, 878, 224, 971, 258, 169, 236, 256, 891,
- /* 640 */ 906, 103, 148, 892, 895, 56, 878, 164, 128, 258,
- /* 650 */ 173, 5, 256, 891, 906, 952, 148, 892, 895, 237,
- /* 660 */ 878, 75, 106, 258, 301, 223, 1006, 891, 300, 108,
- /* 670 */ 146, 892, 895, 240, 268, 4, 220, 64, 256, 96,
- /* 680 */ 906, 693, 628, 302, 595, 946, 878, 33, 65, 258,
- /* 690 */ 253, 69, 256, 891, 906, 109, 149, 892, 895, 70,
- /* 700 */ 878, 989, 299, 258, 1007, 250, 68, 891, 63, 166,
- /* 710 */ 142, 892, 895, 256, 17, 906, 115, 242, 78, 938,
- /* 720 */ 939, 878, 943, 913, 258, 862, 260, 256, 891, 906,
- /* 730 */ 261, 150, 892, 895, 861, 878, 265, 174, 258, 266,
- /* 740 */ 124, 256, 891, 906, 267, 143, 892, 895, 48, 878,
- /* 750 */ 135, 818, 258, 50, 275, 256, 891, 906, 137, 151,
- /* 760 */ 892, 895, 131, 878, 872, 138, 258, 332, 152, 256,
- /* 770 */ 891, 906, 153, 903, 892, 895, 139, 878, 778, 871,
- /* 780 */ 258, 870, 187, 256, 891, 906, 188, 902, 892, 895,
- /* 790 */ 869, 878, 808, 807, 258, 777, 774, 256, 891, 906,
- /* 800 */ 768, 901, 892, 895, 763, 878, 868, 859, 258, 87,
- /* 810 */ 806, 256, 891, 906, 524, 158, 892, 895, 776, 878,
- /* 820 */ 773, 205, 258, 203, 204, 256, 891, 906, 767, 157,
- /* 830 */ 892, 895, 766, 878, 762, 761, 258, 210, 760, 867,
- /* 840 */ 891, 866, 212, 159, 892, 895, 36, 858, 256, 42,
- /* 850 */ 906, 97, 98, 3, 240, 14, 878, 15, 74, 258,
- /* 860 */ 101, 105, 256, 891, 906, 43, 156, 892, 895, 65,
- /* 870 */ 878, 32, 231, 258, 718, 712, 92, 891, 34, 37,
- /* 880 */ 145, 892, 895, 711, 76, 44, 11, 232, 690, 63,
- /* 890 */ 206, 883, 689, 91, 19, 45, 20, 111, 745, 80,
- /* 900 */ 938, 939, 740, 943, 35, 739, 31, 29, 27, 26,
- /* 910 */ 25, 22, 81, 167, 16, 744, 41, 743, 168, 89,
- /* 920 */ 8, 31, 29, 27, 26, 25, 118, 636, 13, 31,
- /* 930 */ 29, 27, 26, 25, 654, 18, 263, 857, 119, 716,
- /* 940 */ 121, 123, 46, 126, 125, 47, 88, 619, 51, 276,
- /* 950 */ 86, 179, 38, 280, 882, 579, 587, 129, 278, 274,
- /* 960 */ 584, 281, 283, 581, 284, 286, 575, 287, 289, 573,
- /* 970 */ 564, 290, 52, 53, 594, 296, 593, 578, 638, 592,
- /* 980 */ 303, 577, 522, 543, 576, 542, 541, 536, 540, 539,
- /* 990 */ 538, 537, 535, 534, 533, 772, 532, 531, 530, 529,
- /* 1000 */ 528, 527, 322, 323, 765, 764, 326, 327, 324, 759,
- /* 1010 */ 330, 331,
+ /* 0 */ 996, 347, 347, 24, 162, 334, 253, 1057, 227, 1049,
+ /* 10 */ 108, 1115, 1158, 31, 29, 27, 26, 25, 951, 331,
+ /* 20 */ 347, 1098, 1060, 1060, 103, 64, 962, 31, 29, 27,
+ /* 30 */ 26, 25, 263, 233, 1051, 973, 1106, 1108, 304, 76,
+ /* 40 */ 346, 1060, 75, 74, 73, 72, 71, 70, 69, 68,
+ /* 50 */ 67, 201, 398, 397, 396, 395, 394, 393, 392, 391,
+ /* 60 */ 390, 389, 388, 387, 386, 385, 384, 383, 382, 381,
+ /* 70 */ 380, 1130, 1130, 30, 28, 829, 31, 29, 27, 26,
+ /* 80 */ 25, 224, 346, 808, 76, 852, 42, 75, 74, 73,
+ /* 90 */ 72, 71, 70, 69, 68, 67, 275, 102, 270, 42,
+ /* 100 */ 806, 274, 1244, 1056, 273, 1063, 271, 1105, 88, 272,
+ /* 110 */ 289, 12, 950, 214, 201, 1243, 1055, 815, 1103, 1242,
+ /* 120 */ 23, 222, 346, 847, 848, 849, 850, 851, 853, 855,
+ /* 130 */ 856, 857, 807, 254, 1, 10, 86, 85, 84, 83,
+ /* 140 */ 82, 81, 80, 79, 78, 1132, 290, 303, 852, 747,
+ /* 150 */ 369, 368, 367, 751, 366, 753, 754, 365, 756, 362,
+ /* 160 */ 410, 762, 359, 764, 765, 356, 353, 287, 1244, 215,
+ /* 170 */ 942, 943, 817, 310, 305, 10, 913, 1143, 809, 812,
+ /* 180 */ 285, 116, 1130, 23, 222, 1242, 847, 848, 849, 850,
+ /* 190 */ 851, 853, 855, 856, 857, 117, 117, 1158, 300, 911,
+ /* 200 */ 912, 914, 915, 1132, 331, 31, 29, 27, 26, 25,
+ /* 210 */ 333, 347, 347, 888, 1130, 1143, 344, 345, 815, 319,
+ /* 220 */ 105, 1025, 60, 1144, 1147, 1183, 948, 230, 249, 200,
+ /* 230 */ 1179, 117, 1060, 1060, 347, 1158, 972, 292, 248, 64,
+ /* 240 */ 1130, 1244, 318, 247, 315, 246, 269, 309, 333, 379,
+ /* 250 */ 1158, 96, 1130, 1197, 116, 1060, 180, 331, 1242, 1090,
+ /* 260 */ 61, 1144, 1147, 1183, 243, 91, 1105, 217, 1179, 111,
+ /* 270 */ 1194, 237, 229, 1130, 245, 244, 308, 1103, 1143, 406,
+ /* 280 */ 405, 158, 30, 28, 889, 89, 347, 296, 1210, 819,
+ /* 290 */ 224, 175, 808, 1244, 317, 112, 1190, 1191, 1158, 1195,
+ /* 300 */ 228, 315, 27, 26, 25, 318, 116, 1060, 102, 806,
+ /* 310 */ 1242, 333, 51, 1143, 239, 1130, 1062, 58, 1202, 884,
+ /* 320 */ 12, 818, 91, 61, 1144, 1147, 1183, 92, 1036, 1053,
+ /* 330 */ 217, 1179, 111, 1158, 1052, 31, 29, 27, 26, 25,
+ /* 340 */ 331, 807, 89, 1, 887, 267, 333, 232, 1143, 266,
+ /* 350 */ 1130, 1211, 113, 1190, 1191, 102, 1195, 910, 61, 1144,
+ /* 360 */ 1147, 1183, 235, 1062, 117, 217, 1179, 1256, 1158, 410,
+ /* 370 */ 102, 77, 372, 971, 268, 331, 1217, 254, 1062, 1143,
+ /* 380 */ 1105, 333, 30, 28, 157, 1130, 234, 809, 812, 1035,
+ /* 390 */ 224, 1103, 808, 61, 1144, 1147, 1183, 829, 347, 1158,
+ /* 400 */ 217, 1179, 1256, 236, 9, 8, 331, 30, 28, 806,
+ /* 410 */ 1130, 1240, 333, 30, 28, 224, 1130, 808, 1143, 1060,
+ /* 420 */ 12, 224, 334, 808, 61, 1144, 1147, 1183, 1116, 1197,
+ /* 430 */ 808, 217, 1179, 1256, 806, 669, 970, 670, 1158, 669,
+ /* 440 */ 806, 807, 1201, 1, 1045, 331, 1193, 806, 1047, 376,
+ /* 450 */ 1105, 333, 261, 375, 969, 1130, 1143, 1034, 671, 21,
+ /* 460 */ 319, 1107, 322, 190, 1144, 1147, 807, 854, 7, 410,
+ /* 470 */ 858, 149, 807, 1130, 7, 1105, 1158, 865, 377, 807,
+ /* 480 */ 57, 6, 1244, 331, 968, 147, 1104, 809, 812, 333,
+ /* 490 */ 1143, 1130, 53, 1130, 410, 116, 967, 374, 373, 1242,
+ /* 500 */ 410, 62, 1144, 1147, 1183, 820, 379, 410, 1182, 1179,
+ /* 510 */ 1158, 315, 809, 812, 30, 28, 332, 331, 809, 812,
+ /* 520 */ 966, 1130, 224, 333, 808, 809, 812, 1130, 896, 117,
+ /* 530 */ 965, 964, 91, 1130, 817, 62, 1144, 1147, 1183, 1133,
+ /* 540 */ 961, 806, 329, 1179, 960, 30, 28, 319, 945, 946,
+ /* 550 */ 959, 1143, 89, 224, 958, 808, 957, 1130, 131, 9,
+ /* 560 */ 8, 129, 155, 1190, 314, 413, 313, 1130, 1130, 1244,
+ /* 570 */ 884, 1158, 806, 807, 956, 7, 1130, 1130, 331, 178,
+ /* 580 */ 1043, 1130, 116, 87, 333, 955, 1242, 1130, 1130, 402,
+ /* 590 */ 1143, 1130, 177, 1130, 954, 323, 106, 1144, 1147, 330,
+ /* 600 */ 144, 410, 953, 126, 807, 326, 1, 110, 1197, 321,
+ /* 610 */ 1158, 1130, 371, 259, 963, 242, 125, 331, 59, 809,
+ /* 620 */ 812, 173, 1130, 333, 1026, 1192, 133, 1130, 1143, 132,
+ /* 630 */ 159, 1130, 410, 320, 1257, 62, 1144, 1147, 1183, 1130,
+ /* 640 */ 991, 135, 43, 1180, 134, 123, 137, 301, 1158, 136,
+ /* 650 */ 809, 812, 1143, 859, 343, 331, 986, 295, 152, 324,
+ /* 660 */ 141, 333, 276, 1143, 185, 1130, 984, 32, 223, 187,
+ /* 670 */ 844, 327, 1158, 196, 1144, 1147, 1099, 826, 278, 331,
+ /* 680 */ 122, 186, 104, 1158, 120, 333, 1143, 260, 281, 1130,
+ /* 690 */ 331, 32, 297, 1137, 118, 1213, 333, 196, 1144, 1147,
+ /* 700 */ 1130, 1143, 316, 798, 167, 1159, 1158, 1135, 195, 1144,
+ /* 710 */ 1147, 1033, 339, 331, 161, 172, 1143, 32, 165, 333,
+ /* 720 */ 2, 1158, 250, 1130, 238, 815, 93, 823, 331, 94,
+ /* 730 */ 119, 106, 1144, 1147, 333, 816, 1158, 1143, 1130, 311,
+ /* 740 */ 251, 221, 252, 331, 740, 735, 196, 1144, 1147, 333,
+ /* 750 */ 822, 41, 1143, 1130, 255, 124, 225, 1158, 96, 77,
+ /* 760 */ 821, 196, 1144, 1147, 331, 262, 264, 768, 1143, 1258,
+ /* 770 */ 333, 376, 1158, 772, 1130, 375, 778, 1050, 777, 331,
+ /* 780 */ 117, 351, 194, 1144, 1147, 333, 66, 94, 1158, 1130,
+ /* 790 */ 95, 1143, 96, 128, 97, 331, 1143, 197, 1144, 1147,
+ /* 800 */ 377, 333, 1046, 291, 130, 1130, 98, 1143, 94, 99,
+ /* 810 */ 1048, 1158, 1143, 188, 1144, 1147, 1158, 1044, 331, 374,
+ /* 820 */ 373, 140, 100, 331, 333, 101, 213, 1158, 1130, 333,
+ /* 830 */ 820, 1214, 1158, 1130, 331, 293, 198, 1144, 1147, 331,
+ /* 840 */ 333, 189, 1144, 1147, 1130, 333, 1224, 1143, 294, 1130,
+ /* 850 */ 1143, 302, 199, 1144, 1147, 337, 145, 1155, 1144, 1147,
+ /* 860 */ 812, 148, 299, 216, 298, 5, 1204, 1158, 1223, 312,
+ /* 870 */ 1158, 4, 884, 90, 331, 819, 151, 331, 109, 1198,
+ /* 880 */ 333, 33, 153, 333, 1130, 1143, 154, 1130, 218, 328,
+ /* 890 */ 17, 1241, 1154, 1144, 1147, 1153, 1144, 1147, 1259, 325,
+ /* 900 */ 1143, 160, 1165, 340, 1114, 1158, 335, 169, 336, 50,
+ /* 910 */ 341, 1113, 331, 226, 1061, 342, 1143, 179, 333, 52,
+ /* 920 */ 1158, 1143, 1130, 315, 181, 176, 409, 331, 191, 349,
+ /* 930 */ 204, 1144, 1147, 333, 183, 184, 1158, 1130, 1124, 192,
+ /* 940 */ 999, 1158, 1123, 331, 91, 203, 1144, 1147, 331, 333,
+ /* 950 */ 1122, 240, 1143, 1130, 333, 241, 1121, 208, 1130, 1039,
+ /* 960 */ 1038, 205, 1144, 1147, 89, 998, 202, 1144, 1147, 1000,
+ /* 970 */ 995, 983, 1158, 121, 114, 1190, 1191, 280, 1195, 331,
+ /* 980 */ 978, 1120, 267, 1111, 1037, 333, 266, 684, 997, 1130,
+ /* 990 */ 994, 256, 288, 258, 257, 982, 981, 193, 1144, 1147,
+ /* 1000 */ 209, 977, 207, 206, 1041, 265, 139, 65, 127, 781,
+ /* 1010 */ 283, 268, 1040, 783, 782, 277, 713, 712, 711, 138,
+ /* 1020 */ 992, 275, 210, 270, 710, 709, 274, 987, 708, 273,
+ /* 1030 */ 211, 271, 279, 985, 272, 212, 282, 976, 284, 975,
+ /* 1040 */ 286, 63, 1119, 1118, 1110, 38, 36, 142, 37, 44,
+ /* 1050 */ 3, 20, 32, 143, 14, 39, 146, 15, 306, 34,
+ /* 1060 */ 307, 31, 29, 27, 26, 25, 22, 909, 903, 47,
+ /* 1070 */ 11, 107, 150, 931, 930, 45, 31, 29, 27, 26,
+ /* 1080 */ 25, 902, 46, 8, 881, 880, 219, 935, 1109, 934,
+ /* 1090 */ 220, 993, 1135, 980, 19, 949, 936, 170, 827, 164,
+ /* 1100 */ 350, 156, 13, 35, 115, 18, 231, 354, 357, 360,
+ /* 1110 */ 907, 16, 845, 163, 166, 363, 53, 746, 168, 48,
+ /* 1120 */ 774, 704, 776, 775, 348, 49, 400, 1134, 769, 40,
+ /* 1130 */ 352, 399, 766, 355, 401, 378, 763, 757, 682, 358,
+ /* 1140 */ 171, 338, 174, 703, 361, 702, 755, 364, 701, 700,
+ /* 1150 */ 699, 698, 54, 55, 697, 56, 696, 705, 695, 694,
+ /* 1160 */ 761, 693, 692, 691, 690, 689, 403, 370, 688, 687,
+ /* 1170 */ 404, 979, 974, 407, 760, 408, 759, 810, 758, 182,
+ /* 1180 */ 411, 412,
};
static const YYCODETYPE yy_lookahead[] = {
- /* 0 */ 158, 163, 146, 165, 146, 160, 146, 149, 163, 149,
- /* 10 */ 165, 169, 12, 13, 14, 15, 16, 161, 176, 161,
- /* 20 */ 158, 161, 161, 150, 163, 12, 13, 14, 15, 16,
- /* 30 */ 0, 169, 148, 14, 145, 162, 163, 181, 176, 155,
- /* 40 */ 40, 180, 153, 159, 161, 156, 163, 191, 192, 193,
- /* 50 */ 31, 195, 169, 40, 168, 172, 21, 171, 172, 176,
- /* 60 */ 21, 61, 179, 180, 181, 182, 31, 32, 29, 186,
- /* 70 */ 187, 188, 42, 43, 44, 45, 46, 47, 48, 49,
- /* 80 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 0,
- /* 90 */ 207, 14, 15, 16, 12, 13, 14, 15, 16, 99,
- /* 100 */ 100, 31, 102, 103, 104, 105, 106, 107, 108, 109,
- /* 110 */ 110, 111, 99, 100, 31, 102, 103, 104, 105, 106,
- /* 120 */ 107, 108, 109, 110, 111, 12, 13, 14, 15, 16,
- /* 130 */ 60, 42, 43, 44, 45, 46, 47, 48, 49, 50,
- /* 140 */ 51, 52, 53, 54, 55, 56, 57, 58, 70, 71,
- /* 150 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 0,
- /* 160 */ 82, 83, 84, 85, 86, 87, 183, 184, 161, 26,
- /* 170 */ 163, 198, 31, 30, 31, 161, 160, 163, 35, 163,
- /* 180 */ 37, 165, 115, 169, 211, 115, 172, 180, 215, 175,
- /* 190 */ 176, 150, 31, 179, 180, 181, 182, 60, 150, 56,
- /* 200 */ 186, 187, 65, 162, 163, 146, 63, 64, 149, 50,
- /* 210 */ 162, 163, 198, 54, 0, 161, 31, 163, 136, 137,
- /* 220 */ 161, 60, 31, 169, 66, 211, 172, 177, 69, 215,
- /* 230 */ 176, 141, 31, 179, 180, 181, 182, 161, 95, 163,
- /* 240 */ 186, 187, 188, 92, 194, 169, 39, 88, 172, 31,
- /* 250 */ 12, 13, 176, 39, 200, 179, 180, 181, 182, 21,
- /* 260 */ 206, 207, 186, 187, 188, 175, 161, 29, 163, 31,
- /* 270 */ 31, 120, 121, 197, 169, 39, 169, 172, 40, 146,
- /* 280 */ 164, 176, 149, 176, 179, 180, 181, 182, 198, 1,
- /* 290 */ 2, 186, 187, 188, 161, 161, 146, 163, 60, 149,
- /* 300 */ 115, 211, 197, 169, 160, 215, 172, 163, 148, 165,
- /* 310 */ 176, 161, 94, 179, 180, 181, 182, 79, 99, 159,
- /* 320 */ 186, 187, 188, 12, 13, 14, 146, 108, 146, 149,
- /* 330 */ 111, 197, 21, 94, 96, 97, 98, 218, 12, 13,
- /* 340 */ 29, 161, 31, 143, 144, 0, 3, 21, 161, 61,
- /* 350 */ 163, 40, 101, 115, 18, 29, 169, 31, 22, 172,
- /* 360 */ 24, 25, 175, 176, 12, 13, 179, 180, 181, 145,
- /* 370 */ 177, 60, 177, 21, 38, 124, 125, 126, 127, 128,
- /* 380 */ 156, 29, 209, 31, 39, 198, 60, 194, 34, 194,
- /* 390 */ 79, 4, 40, 171, 172, 161, 68, 163, 211, 162,
- /* 400 */ 163, 151, 215, 169, 154, 79, 172, 96, 97, 98,
- /* 410 */ 176, 146, 60, 179, 180, 181, 182, 161, 203, 163,
- /* 420 */ 186, 187, 96, 97, 98, 169, 161, 61, 172, 113,
- /* 430 */ 114, 79, 176, 68, 68, 179, 180, 181, 182, 143,
- /* 440 */ 175, 115, 186, 187, 20, 178, 181, 23, 96, 97,
- /* 450 */ 98, 115, 19, 12, 13, 14, 191, 192, 193, 196,
- /* 460 */ 195, 133, 21, 198, 61, 21, 12, 13, 114, 36,
- /* 470 */ 29, 68, 31, 29, 131, 21, 211, 61, 163, 161,
- /* 480 */ 215, 163, 61, 29, 68, 31, 212, 169, 40, 68,
- /* 490 */ 172, 199, 139, 140, 176, 61, 31, 179, 180, 181,
- /* 500 */ 135, 60, 68, 116, 61, 1, 2, 12, 13, 146,
- /* 510 */ 161, 68, 163, 31, 60, 60, 21, 31, 169, 148,
- /* 520 */ 79, 172, 67, 79, 29, 176, 31, 31, 179, 180,
- /* 530 */ 181, 182, 146, 79, 216, 217, 187, 96, 97, 98,
- /* 540 */ 96, 97, 98, 174, 161, 161, 166, 163, 148, 101,
- /* 550 */ 96, 97, 98, 169, 146, 60, 172, 173, 148, 61,
- /* 560 */ 176, 175, 142, 179, 180, 181, 68, 161, 31, 163,
- /* 570 */ 61, 146, 142, 61, 79, 169, 61, 68, 172, 173,
- /* 580 */ 68, 174, 176, 68, 198, 179, 180, 181, 161, 161,
- /* 590 */ 163, 96, 97, 98, 31, 61, 169, 211, 145, 172,
- /* 600 */ 178, 215, 68, 176, 61, 19, 179, 180, 181, 61,
- /* 610 */ 161, 68, 163, 27, 0, 123, 68, 166, 169, 33,
- /* 620 */ 208, 172, 36, 122, 161, 176, 163, 170, 179, 180,
- /* 630 */ 181, 98, 169, 169, 208, 172, 173, 210, 161, 176,
- /* 640 */ 163, 170, 179, 180, 181, 59, 169, 169, 62, 172,
- /* 650 */ 173, 130, 161, 176, 163, 205, 179, 180, 181, 129,
- /* 660 */ 169, 202, 204, 172, 50, 118, 217, 176, 54, 201,
- /* 670 */ 179, 180, 181, 146, 88, 117, 90, 161, 161, 93,
- /* 680 */ 163, 114, 31, 69, 61, 177, 169, 112, 161, 172,
- /* 690 */ 134, 68, 161, 176, 163, 189, 179, 180, 181, 61,
- /* 700 */ 169, 214, 88, 172, 219, 132, 68, 176, 181, 138,
- /* 710 */ 179, 180, 181, 161, 60, 163, 213, 190, 191, 192,
- /* 720 */ 193, 169, 195, 185, 172, 170, 169, 161, 176, 163,
- /* 730 */ 169, 179, 180, 181, 170, 169, 91, 169, 172, 167,
- /* 740 */ 161, 161, 176, 163, 166, 179, 180, 181, 145, 169,
- /* 750 */ 154, 161, 172, 60, 157, 161, 176, 163, 146, 179,
- /* 760 */ 180, 181, 145, 169, 0, 147, 172, 142, 152, 161,
- /* 770 */ 176, 163, 152, 179, 180, 181, 147, 169, 0, 0,
- /* 780 */ 172, 0, 56, 161, 176, 163, 67, 179, 180, 181,
- /* 790 */ 0, 169, 0, 0, 172, 0, 0, 161, 176, 163,
- /* 800 */ 0, 179, 180, 181, 0, 169, 0, 0, 172, 34,
- /* 810 */ 0, 161, 176, 163, 41, 179, 180, 181, 0, 169,
- /* 820 */ 0, 34, 172, 29, 27, 161, 176, 163, 0, 179,
- /* 830 */ 180, 181, 0, 169, 0, 0, 172, 21, 0, 0,
- /* 840 */ 176, 0, 21, 179, 180, 181, 94, 0, 161, 60,
- /* 850 */ 163, 34, 89, 68, 146, 119, 169, 119, 60, 172,
- /* 860 */ 61, 60, 161, 176, 163, 60, 179, 180, 181, 161,
- /* 870 */ 169, 68, 29, 172, 61, 61, 19, 176, 113, 68,
- /* 880 */ 179, 180, 181, 61, 27, 60, 119, 68, 61, 181,
- /* 890 */ 33, 67, 61, 36, 68, 4, 2, 67, 61, 191,
- /* 900 */ 192, 193, 29, 195, 68, 29, 12, 13, 14, 15,
- /* 910 */ 16, 2, 67, 29, 68, 29, 59, 29, 29, 62,
- /* 920 */ 2, 12, 13, 14, 15, 16, 67, 61, 60, 12,
- /* 930 */ 13, 14, 15, 16, 101, 60, 92, 0, 61, 61,
- /* 940 */ 60, 60, 60, 89, 34, 60, 89, 21, 65, 29,
- /* 950 */ 93, 29, 60, 29, 67, 81, 61, 67, 60, 66,
- /* 960 */ 61, 60, 29, 61, 60, 29, 61, 60, 29, 61,
- /* 970 */ 21, 60, 60, 60, 29, 69, 29, 81, 61, 21,
- /* 980 */ 40, 81, 41, 29, 81, 29, 29, 21, 29, 29,
- /* 990 */ 29, 29, 29, 29, 29, 0, 29, 29, 29, 29,
- /* 1000 */ 29, 29, 29, 27, 0, 0, 29, 28, 34, 0,
- /* 1010 */ 21, 20, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1020 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1030 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1040 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1050 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1060 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1070 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1080 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1090 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1100 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1110 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1120 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1130 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1140 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
- /* 1150 */ 220, 220, 220,
+ /* 0 */ 0, 169, 169, 212, 213, 196, 174, 174, 199, 184,
+ /* 10 */ 182, 202, 183, 12, 13, 14, 15, 16, 0, 190,
+ /* 20 */ 169, 193, 190, 190, 162, 174, 164, 12, 13, 14,
+ /* 30 */ 15, 16, 181, 192, 163, 163, 195, 196, 209, 21,
+ /* 40 */ 20, 190, 24, 25, 26, 27, 28, 29, 30, 31,
+ /* 50 */ 32, 50, 52, 53, 54, 55, 56, 57, 58, 59,
+ /* 60 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
+ /* 70 */ 70, 200, 200, 12, 13, 74, 12, 13, 14, 15,
+ /* 80 */ 16, 20, 20, 22, 21, 84, 171, 24, 25, 26,
+ /* 90 */ 27, 28, 29, 30, 31, 32, 52, 183, 54, 171,
+ /* 100 */ 39, 57, 227, 188, 60, 191, 62, 183, 180, 65,
+ /* 110 */ 169, 50, 0, 189, 50, 240, 188, 20, 194, 244,
+ /* 120 */ 119, 120, 20, 122, 123, 124, 125, 126, 127, 128,
+ /* 130 */ 129, 130, 71, 49, 73, 73, 24, 25, 26, 27,
+ /* 140 */ 28, 29, 30, 31, 32, 163, 205, 113, 84, 90,
+ /* 150 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
+ /* 160 */ 99, 102, 103, 104, 105, 106, 107, 21, 227, 187,
+ /* 170 */ 155, 156, 20, 139, 140, 73, 121, 163, 117, 118,
+ /* 180 */ 34, 240, 200, 119, 120, 244, 122, 123, 124, 125,
+ /* 190 */ 126, 127, 128, 129, 130, 134, 134, 183, 143, 144,
+ /* 200 */ 145, 146, 147, 163, 190, 12, 13, 14, 15, 16,
+ /* 210 */ 196, 169, 169, 4, 200, 163, 174, 174, 20, 205,
+ /* 220 */ 172, 173, 208, 209, 210, 211, 160, 187, 30, 215,
+ /* 230 */ 216, 134, 190, 190, 169, 183, 163, 74, 40, 174,
+ /* 240 */ 200, 227, 190, 45, 169, 47, 181, 20, 196, 49,
+ /* 250 */ 183, 88, 200, 206, 240, 190, 176, 190, 244, 179,
+ /* 260 */ 208, 209, 210, 211, 66, 190, 183, 215, 216, 217,
+ /* 270 */ 223, 205, 189, 200, 76, 77, 209, 194, 163, 166,
+ /* 280 */ 167, 229, 12, 13, 14, 210, 169, 235, 236, 20,
+ /* 290 */ 20, 174, 22, 227, 219, 220, 221, 222, 183, 224,
+ /* 300 */ 175, 169, 14, 15, 16, 190, 240, 190, 183, 39,
+ /* 310 */ 244, 196, 168, 163, 116, 200, 191, 168, 132, 133,
+ /* 320 */ 50, 20, 190, 208, 209, 210, 211, 178, 0, 185,
+ /* 330 */ 215, 216, 217, 183, 185, 12, 13, 14, 15, 16,
+ /* 340 */ 190, 71, 210, 73, 135, 60, 196, 175, 163, 64,
+ /* 350 */ 200, 236, 220, 221, 222, 183, 224, 74, 208, 209,
+ /* 360 */ 210, 211, 175, 191, 134, 215, 216, 217, 183, 99,
+ /* 370 */ 183, 88, 86, 163, 89, 190, 226, 49, 191, 163,
+ /* 380 */ 183, 196, 12, 13, 115, 200, 189, 117, 118, 0,
+ /* 390 */ 20, 194, 22, 208, 209, 210, 211, 74, 169, 183,
+ /* 400 */ 215, 216, 217, 174, 1, 2, 190, 12, 13, 39,
+ /* 410 */ 200, 226, 196, 12, 13, 20, 200, 22, 163, 190,
+ /* 420 */ 50, 20, 196, 22, 208, 209, 210, 211, 202, 206,
+ /* 430 */ 22, 215, 216, 217, 39, 22, 163, 20, 183, 22,
+ /* 440 */ 39, 71, 226, 73, 184, 190, 223, 39, 184, 60,
+ /* 450 */ 183, 196, 39, 64, 163, 200, 163, 0, 41, 119,
+ /* 460 */ 205, 194, 3, 208, 209, 210, 71, 127, 73, 99,
+ /* 470 */ 130, 74, 71, 200, 73, 183, 183, 74, 89, 71,
+ /* 480 */ 73, 44, 227, 190, 163, 88, 194, 117, 118, 196,
+ /* 490 */ 163, 200, 85, 200, 99, 240, 163, 108, 109, 244,
+ /* 500 */ 99, 208, 209, 210, 211, 20, 49, 99, 215, 216,
+ /* 510 */ 183, 169, 117, 118, 12, 13, 14, 190, 117, 118,
+ /* 520 */ 163, 200, 20, 196, 22, 117, 118, 200, 14, 134,
+ /* 530 */ 163, 163, 190, 200, 20, 208, 209, 210, 211, 163,
+ /* 540 */ 163, 39, 215, 216, 163, 12, 13, 205, 158, 159,
+ /* 550 */ 163, 163, 210, 20, 163, 22, 163, 200, 79, 1,
+ /* 560 */ 2, 82, 220, 221, 222, 19, 224, 200, 200, 227,
+ /* 570 */ 133, 183, 39, 71, 163, 73, 200, 200, 190, 33,
+ /* 580 */ 184, 200, 240, 37, 196, 163, 244, 200, 200, 43,
+ /* 590 */ 163, 200, 46, 200, 163, 88, 208, 209, 210, 50,
+ /* 600 */ 115, 99, 163, 33, 71, 88, 73, 37, 206, 150,
+ /* 610 */ 183, 200, 184, 43, 164, 169, 46, 190, 72, 117,
+ /* 620 */ 118, 75, 200, 196, 173, 223, 79, 200, 163, 82,
+ /* 630 */ 247, 200, 99, 245, 246, 208, 209, 210, 211, 200,
+ /* 640 */ 0, 79, 72, 216, 82, 75, 79, 238, 183, 82,
+ /* 650 */ 117, 118, 163, 74, 108, 190, 0, 111, 232, 152,
+ /* 660 */ 114, 196, 22, 163, 18, 200, 0, 88, 203, 23,
+ /* 670 */ 121, 154, 183, 208, 209, 210, 193, 74, 22, 190,
+ /* 680 */ 110, 35, 36, 183, 114, 196, 163, 166, 22, 200,
+ /* 690 */ 190, 88, 203, 73, 48, 207, 196, 208, 209, 210,
+ /* 700 */ 200, 163, 225, 74, 74, 183, 183, 87, 208, 209,
+ /* 710 */ 210, 0, 74, 190, 241, 74, 163, 88, 88, 196,
+ /* 720 */ 228, 183, 204, 200, 169, 20, 88, 20, 190, 88,
+ /* 730 */ 171, 208, 209, 210, 196, 20, 183, 163, 200, 239,
+ /* 740 */ 190, 203, 197, 190, 74, 74, 208, 209, 210, 196,
+ /* 750 */ 20, 171, 163, 200, 169, 171, 203, 183, 88, 88,
+ /* 760 */ 20, 208, 209, 210, 190, 165, 183, 74, 163, 246,
+ /* 770 */ 196, 60, 183, 74, 200, 64, 74, 183, 74, 190,
+ /* 780 */ 134, 88, 208, 209, 210, 196, 169, 88, 183, 200,
+ /* 790 */ 88, 163, 88, 183, 74, 190, 163, 208, 209, 210,
+ /* 800 */ 89, 196, 183, 204, 183, 200, 183, 163, 88, 183,
+ /* 810 */ 183, 183, 163, 208, 209, 210, 183, 183, 190, 108,
+ /* 820 */ 109, 168, 183, 190, 196, 183, 165, 183, 200, 196,
+ /* 830 */ 20, 207, 183, 200, 190, 190, 208, 209, 210, 190,
+ /* 840 */ 196, 208, 209, 210, 200, 196, 237, 163, 197, 200,
+ /* 850 */ 163, 142, 208, 209, 210, 141, 201, 208, 209, 210,
+ /* 860 */ 118, 201, 200, 200, 137, 149, 234, 183, 237, 148,
+ /* 870 */ 183, 136, 133, 190, 190, 20, 233, 190, 231, 206,
+ /* 880 */ 196, 131, 230, 196, 200, 163, 218, 200, 157, 153,
+ /* 890 */ 73, 243, 208, 209, 210, 208, 209, 210, 248, 151,
+ /* 900 */ 163, 242, 214, 112, 201, 183, 200, 190, 200, 168,
+ /* 910 */ 198, 201, 190, 200, 190, 197, 163, 179, 196, 73,
+ /* 920 */ 183, 163, 200, 169, 169, 168, 165, 190, 177, 186,
+ /* 930 */ 208, 209, 210, 196, 170, 161, 183, 200, 0, 177,
+ /* 940 */ 0, 183, 0, 190, 190, 208, 209, 210, 190, 196,
+ /* 950 */ 0, 66, 163, 200, 196, 87, 0, 35, 200, 0,
+ /* 960 */ 0, 208, 209, 210, 210, 0, 208, 209, 210, 0,
+ /* 970 */ 0, 0, 183, 44, 220, 221, 222, 4, 224, 190,
+ /* 980 */ 0, 0, 60, 0, 0, 196, 64, 51, 0, 200,
+ /* 990 */ 0, 39, 19, 44, 37, 0, 0, 208, 209, 210,
+ /* 1000 */ 78, 0, 80, 81, 0, 83, 33, 84, 82, 22,
+ /* 1010 */ 37, 89, 0, 39, 39, 42, 39, 39, 39, 46,
+ /* 1020 */ 0, 52, 22, 54, 39, 39, 57, 0, 39, 60,
+ /* 1030 */ 22, 62, 40, 0, 65, 22, 39, 0, 22, 0,
+ /* 1040 */ 22, 20, 0, 0, 0, 72, 115, 44, 75, 73,
+ /* 1050 */ 88, 2, 88, 110, 138, 88, 74, 138, 39, 132,
+ /* 1060 */ 88, 12, 13, 14, 15, 16, 2, 74, 74, 4,
+ /* 1070 */ 138, 73, 73, 39, 39, 73, 12, 13, 14, 15,
+ /* 1080 */ 16, 74, 73, 2, 74, 74, 39, 39, 0, 39,
+ /* 1090 */ 39, 0, 87, 0, 88, 249, 74, 44, 74, 74,
+ /* 1100 */ 39, 87, 73, 88, 87, 73, 39, 39, 39, 39,
+ /* 1110 */ 74, 88, 121, 87, 73, 39, 85, 22, 73, 73,
+ /* 1120 */ 22, 22, 39, 39, 86, 73, 37, 87, 74, 73,
+ /* 1130 */ 73, 39, 74, 73, 44, 50, 74, 74, 51, 73,
+ /* 1140 */ 110, 113, 87, 39, 73, 39, 74, 73, 39, 39,
+ /* 1150 */ 39, 39, 73, 73, 39, 73, 22, 71, 39, 39,
+ /* 1160 */ 101, 39, 39, 39, 39, 39, 39, 89, 39, 39,
+ /* 1170 */ 38, 0, 0, 22, 101, 21, 101, 22, 101, 22,
+ /* 1180 */ 21, 20, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1190 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1200 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1210 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1220 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1230 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1240 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1250 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1260 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1270 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1280 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1290 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1300 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1310 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1320 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1330 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
+ /* 1340 */ 249, 249,
};
-#define YY_SHIFT_COUNT (332)
+#define YY_SHIFT_COUNT (413)
#define YY_SHIFT_MIN (0)
-#define YY_SHIFT_MAX (1009)
+#define YY_SHIFT_MAX (1172)
static const unsigned short int yy_shift_ofst[] = {
- /* 0 */ 336, 238, 311, 352, 352, 352, 352, 326, 352, 352,
- /* 10 */ 70, 454, 495, 441, 454, 454, 454, 454, 454, 454,
- /* 20 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454,
- /* 30 */ 454, 454, 454, 161, 161, 161, 185, 444, 444, 83,
- /* 40 */ 83, 207, 141, 191, 191, 67, 201, 141, 83, 83,
- /* 50 */ 141, 83, 141, 141, 141, 83, 236, 0, 13, 13,
- /* 60 */ 444, 35, 214, 218, 218, 218, 345, 201, 141, 141,
- /* 70 */ 158, 78, 143, 82, 251, 151, 39, 239, 316, 354,
- /* 80 */ 316, 19, 343, 387, 465, 482, 207, 486, 496, 207,
- /* 90 */ 465, 207, 537, 465, 537, 482, 236, 486, 496, 563,
- /* 100 */ 492, 501, 533, 492, 501, 533, 521, 530, 547, 558,
- /* 110 */ 567, 486, 651, 575, 571, 556, 573, 654, 141, 501,
- /* 120 */ 533, 533, 501, 533, 645, 486, 496, 158, 236, 486,
- /* 130 */ 693, 465, 236, 537, 1012, 1012, 1012, 1012, 30, 89,
- /* 140 */ 586, 857, 894, 909, 917, 113, 113, 113, 113, 113,
- /* 150 */ 113, 113, 159, 614, 288, 219, 77, 77, 77, 77,
- /* 160 */ 424, 433, 366, 403, 416, 504, 353, 328, 365, 421,
- /* 170 */ 448, 434, 455, 443, 498, 509, 512, 515, 534, 543,
- /* 180 */ 548, 623, 638, 137, 764, 778, 779, 781, 726, 719,
- /* 190 */ 790, 792, 793, 795, 796, 800, 804, 806, 807, 775,
- /* 200 */ 810, 773, 818, 820, 794, 797, 787, 828, 832, 834,
- /* 210 */ 835, 816, 838, 821, 839, 841, 752, 847, 789, 817,
- /* 220 */ 763, 785, 803, 736, 799, 811, 813, 798, 801, 814,
- /* 230 */ 805, 822, 843, 819, 824, 825, 826, 738, 827, 831,
- /* 240 */ 830, 765, 836, 845, 837, 846, 767, 891, 873, 876,
- /* 250 */ 884, 886, 888, 889, 918, 833, 859, 866, 868, 875,
- /* 260 */ 877, 878, 880, 881, 844, 882, 937, 910, 854, 885,
- /* 270 */ 883, 887, 890, 926, 892, 893, 895, 920, 922, 898,
- /* 280 */ 899, 924, 901, 902, 933, 904, 905, 936, 907, 908,
- /* 290 */ 939, 911, 874, 896, 900, 903, 949, 906, 912, 913,
- /* 300 */ 945, 947, 958, 941, 940, 954, 956, 957, 959, 960,
- /* 310 */ 961, 962, 966, 963, 964, 965, 967, 968, 969, 970,
- /* 320 */ 971, 972, 995, 973, 976, 974, 1004, 977, 979, 1005,
- /* 330 */ 1009, 989, 991,
+ /* 0 */ 646, 61, 270, 370, 370, 370, 370, 395, 370, 370,
+ /* 10 */ 62, 401, 533, 502, 401, 401, 401, 401, 401, 401,
+ /* 20 */ 401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
+ /* 30 */ 401, 401, 401, 102, 102, 102, 97, 20, 20, 408,
+ /* 40 */ 408, 20, 20, 84, 152, 227, 227, 230, 301, 152,
+ /* 50 */ 20, 20, 152, 20, 152, 301, 152, 152, 20, 200,
+ /* 60 */ 1, 64, 64, 63, 922, 408, 44, 408, 408, 408,
+ /* 70 */ 408, 408, 408, 408, 408, 408, 408, 408, 408, 408,
+ /* 80 */ 408, 408, 408, 408, 408, 408, 408, 417, 328, 269,
+ /* 90 */ 269, 269, 457, 301, 152, 152, 152, 286, 59, 59,
+ /* 100 */ 59, 59, 59, 18, 198, 969, 15, 55, 285, 34,
+ /* 110 */ 413, 485, 186, 437, 186, 514, 459, 209, 705, 707,
+ /* 120 */ 84, 715, 730, 84, 705, 84, 740, 152, 152, 152,
+ /* 130 */ 152, 152, 152, 152, 152, 152, 152, 152, 705, 740,
+ /* 140 */ 707, 200, 715, 730, 810, 709, 714, 742, 709, 714,
+ /* 150 */ 742, 716, 721, 727, 735, 739, 715, 855, 750, 731,
+ /* 160 */ 736, 748, 817, 152, 714, 742, 742, 714, 742, 791,
+ /* 170 */ 715, 730, 286, 200, 715, 846, 705, 200, 740, 1182,
+ /* 180 */ 1182, 1182, 1182, 0, 112, 546, 570, 973, 1049, 1064,
+ /* 190 */ 323, 389, 711, 193, 193, 193, 193, 193, 193, 193,
+ /* 200 */ 403, 340, 288, 288, 288, 288, 479, 547, 562, 567,
+ /* 210 */ 640, 656, 666, 146, 163, 283, 397, 558, 390, 507,
+ /* 220 */ 517, 579, 549, 603, 620, 629, 630, 638, 641, 670,
+ /* 230 */ 671, 693, 699, 702, 704, 720, 407, 938, 940, 942,
+ /* 240 */ 950, 885, 868, 956, 959, 960, 965, 970, 971, 980,
+ /* 250 */ 981, 983, 929, 984, 936, 988, 990, 952, 957, 949,
+ /* 260 */ 995, 996, 1001, 1004, 923, 926, 974, 975, 987, 1012,
+ /* 270 */ 977, 978, 979, 985, 986, 989, 1020, 1000, 1027, 1008,
+ /* 280 */ 992, 1033, 1013, 997, 1037, 1016, 1039, 1018, 1021, 1042,
+ /* 290 */ 1043, 931, 1044, 976, 1003, 943, 962, 964, 916, 982,
+ /* 300 */ 967, 993, 998, 999, 994, 1002, 1007, 1019, 972, 1005,
+ /* 310 */ 1009, 1006, 919, 1010, 1011, 1014, 927, 1015, 1017, 1022,
+ /* 320 */ 1023, 932, 1065, 1034, 1035, 1047, 1048, 1050, 1051, 1081,
+ /* 330 */ 991, 1026, 1024, 1029, 1032, 1025, 1036, 1041, 1045, 1028,
+ /* 340 */ 1046, 1088, 1053, 1030, 1052, 1031, 1040, 1055, 1056, 1038,
+ /* 350 */ 1054, 1061, 1067, 1057, 1058, 1068, 1060, 1062, 1069, 1066,
+ /* 360 */ 1063, 1070, 1071, 1072, 1076, 1074, 1059, 1073, 1075, 1077,
+ /* 370 */ 1095, 1078, 1079, 1080, 1082, 1083, 1084, 1098, 1087, 1085,
+ /* 380 */ 1086, 1099, 1104, 1106, 1109, 1110, 1111, 1112, 1115, 1134,
+ /* 390 */ 1119, 1120, 1122, 1123, 1124, 1125, 1126, 1129, 1130, 1091,
+ /* 400 */ 1092, 1089, 1090, 1093, 1127, 1132, 1171, 1172, 1151, 1154,
+ /* 410 */ 1155, 1157, 1159, 1161,
};
-#define YY_REDUCE_COUNT (137)
-#define YY_REDUCE_MIN (-162)
-#define YY_REDUCE_MAX (708)
+#define YY_REDUCE_COUNT (182)
+#define YY_REDUCE_MIN (-209)
+#define YY_REDUCE_MAX (789)
static const short yy_reduce_ofst[] = {
- /* 0 */ 90, 14, 54, -117, 76, 105, 134, 187, 234, 256,
- /* 10 */ 265, 318, 349, 384, 406, 427, 449, 463, 477, 491,
- /* 20 */ 517, 531, 552, 566, 580, 594, 608, 622, 636, 650,
- /* 30 */ 664, 687, 701, 527, -144, 708, 386, -158, -138, -142,
- /* 40 */ -140, -116, -155, -139, 7, -27, -114, -127, 59, 133,
- /* 50 */ 16, 150, 41, 144, 48, 180, -111, -17, -17, -17,
- /* 60 */ 107, 200, 160, 50, 193, 195, 224, 222, 237, -162,
- /* 70 */ 250, 116, 182, 119, 173, 215, 296, 267, 263, 263,
- /* 80 */ 263, 315, 274, 292, 363, 369, 371, 383, 380, 400,
- /* 90 */ 408, 410, 420, 425, 430, 407, 453, 428, 451, 422,
- /* 100 */ 412, 457, 464, 426, 471, 478, 450, 458, 459, 468,
- /* 110 */ 263, 516, 508, 506, 485, 487, 503, 538, 315, 555,
- /* 120 */ 557, 561, 564, 568, 572, 579, 578, 596, 603, 590,
- /* 130 */ 597, 612, 617, 625, 618, 616, 620, 629,
+ /* 0 */ 66, 14, 52, 115, 150, 185, 216, 255, 293, 327,
+ /* 10 */ 342, 388, 427, 465, 489, 500, 523, 538, 553, 574,
+ /* 20 */ 589, 605, 628, 633, 644, 649, 684, 687, 722, 737,
+ /* 30 */ 753, 758, 789, 75, 132, 754, -59, -149, 65, -18,
+ /* 40 */ 40, -168, -167, -72, -76, -171, 67, -125, -191, 125,
+ /* 50 */ 42, 43, 83, 117, 172, -159, 197, 187, 229, 149,
+ /* 60 */ -209, -209, -209, -138, -172, -129, 48, -128, 73, 210,
+ /* 70 */ 273, 291, 321, 333, 357, 367, 368, 376, 377, 381,
+ /* 80 */ 387, 391, 393, 411, 422, 431, 439, 113, -85, 47,
+ /* 90 */ 223, 402, 144, 226, -86, 267, 292, 80, -175, 260,
+ /* 100 */ 264, 396, 428, 450, 446, 451, 383, 409, 483, 426,
+ /* 110 */ 521, 488, 477, 477, 477, 522, 473, 492, 555, 518,
+ /* 120 */ 559, 550, 545, 580, 585, 584, 600, 583, 594, 610,
+ /* 130 */ 619, 621, 623, 626, 627, 634, 639, 642, 617, 661,
+ /* 140 */ 599, 653, 645, 651, 624, 609, 655, 662, 631, 660,
+ /* 150 */ 663, 632, 643, 647, 652, 477, 683, 673, 668, 650,
+ /* 160 */ 648, 659, 688, 522, 703, 706, 708, 710, 713, 712,
+ /* 170 */ 717, 718, 738, 741, 724, 743, 755, 757, 761, 751,
+ /* 180 */ 762, 764, 774,
};
static const YYACTIONTYPE yy_default[] = {
- /* 0 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 10 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 20 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 30 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 40 */ 756, 783, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 50 */ 756, 756, 756, 756, 756, 756, 781, 756, 933, 756,
- /* 60 */ 756, 756, 783, 944, 944, 944, 781, 756, 756, 756,
- /* 70 */ 846, 756, 756, 1008, 756, 968, 756, 960, 936, 950,
- /* 80 */ 937, 756, 993, 953, 756, 756, 783, 756, 756, 783,
- /* 90 */ 756, 783, 756, 756, 756, 756, 781, 756, 756, 756,
- /* 100 */ 975, 973, 756, 975, 973, 756, 987, 983, 966, 964,
- /* 110 */ 950, 756, 756, 756, 1011, 999, 995, 756, 756, 973,
- /* 120 */ 756, 756, 973, 756, 860, 756, 756, 756, 781, 756,
- /* 130 */ 815, 756, 781, 756, 784, 849, 849, 784, 756, 756,
- /* 140 */ 756, 756, 756, 756, 756, 905, 986, 985, 904, 910,
- /* 150 */ 909, 908, 756, 756, 756, 756, 899, 900, 898, 897,
- /* 160 */ 756, 756, 756, 756, 756, 934, 756, 996, 1000, 756,
- /* 170 */ 756, 756, 884, 756, 756, 756, 756, 756, 756, 756,
- /* 180 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 190 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 200 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 210 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 220 */ 756, 957, 967, 756, 756, 756, 756, 756, 756, 756,
- /* 230 */ 756, 756, 756, 756, 884, 756, 984, 756, 943, 939,
- /* 240 */ 756, 756, 935, 756, 756, 994, 756, 756, 756, 756,
- /* 250 */ 756, 756, 756, 756, 929, 756, 756, 756, 756, 756,
- /* 260 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 270 */ 756, 883, 756, 756, 756, 756, 756, 756, 756, 843,
- /* 280 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 290 */ 756, 756, 828, 826, 825, 824, 756, 821, 756, 756,
- /* 300 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 310 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 320 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756,
- /* 330 */ 756, 756, 756,
+ /* 0 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 10 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 20 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 30 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 40 */ 947, 947, 947, 1004, 947, 947, 947, 947, 947, 947,
+ /* 50 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 1002,
+ /* 60 */ 947, 1185, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 70 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 80 */ 947, 947, 947, 947, 947, 947, 947, 947, 1004, 1196,
+ /* 90 */ 1196, 1196, 1002, 947, 947, 947, 947, 1089, 947, 947,
+ /* 100 */ 947, 947, 947, 947, 947, 947, 1260, 947, 1042, 1220,
+ /* 110 */ 947, 1212, 1188, 1202, 1189, 947, 1245, 1205, 947, 947,
+ /* 120 */ 1004, 947, 947, 1004, 947, 1004, 947, 947, 947, 947,
+ /* 130 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 140 */ 947, 1002, 947, 947, 947, 1227, 1225, 947, 1227, 1225,
+ /* 150 */ 947, 1239, 1235, 1218, 1216, 1202, 947, 947, 947, 1263,
+ /* 160 */ 1251, 1247, 947, 947, 1225, 947, 947, 1225, 947, 1112,
+ /* 170 */ 947, 947, 947, 1002, 947, 1058, 947, 1002, 947, 1092,
+ /* 180 */ 1092, 1005, 952, 947, 947, 947, 947, 947, 947, 947,
+ /* 190 */ 947, 947, 947, 1157, 1238, 1237, 1156, 1162, 1161, 1160,
+ /* 200 */ 947, 947, 1151, 1152, 1150, 1149, 947, 947, 947, 947,
+ /* 210 */ 947, 947, 947, 947, 947, 947, 947, 1186, 947, 1248,
+ /* 220 */ 1252, 947, 947, 947, 1136, 947, 947, 947, 947, 947,
+ /* 230 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 240 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 250 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 260 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 270 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 280 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 290 */ 947, 947, 947, 947, 947, 947, 1209, 1219, 947, 947,
+ /* 300 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 1136,
+ /* 310 */ 947, 1236, 947, 1195, 1191, 947, 947, 1187, 947, 947,
+ /* 320 */ 1246, 947, 947, 947, 947, 947, 947, 947, 947, 1181,
+ /* 330 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 340 */ 947, 947, 947, 947, 947, 947, 1135, 947, 947, 947,
+ /* 350 */ 947, 947, 947, 1086, 947, 947, 947, 947, 947, 947,
+ /* 360 */ 947, 947, 947, 947, 947, 947, 1071, 1069, 1068, 1067,
+ /* 370 */ 947, 1064, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 380 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 390 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 400 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,
+ /* 410 */ 947, 947, 947, 947,
};
/********** End of lemon-generated parsing tables *****************************/
@@ -647,207 +706,236 @@ static const char *const yyTokenName[] = {
/* 16 */ "NK_REM",
/* 17 */ "NK_CONCAT",
/* 18 */ "CREATE",
- /* 19 */ "USER",
- /* 20 */ "PASS",
- /* 21 */ "NK_STRING",
- /* 22 */ "ALTER",
- /* 23 */ "PRIVILEGE",
- /* 24 */ "DROP",
- /* 25 */ "SHOW",
- /* 26 */ "USERS",
- /* 27 */ "DNODE",
- /* 28 */ "PORT",
- /* 29 */ "NK_INTEGER",
- /* 30 */ "DNODES",
- /* 31 */ "NK_ID",
- /* 32 */ "NK_IPTOKEN",
- /* 33 */ "QNODE",
- /* 34 */ "ON",
- /* 35 */ "QNODES",
- /* 36 */ "DATABASE",
- /* 37 */ "DATABASES",
- /* 38 */ "USE",
- /* 39 */ "IF",
- /* 40 */ "NOT",
- /* 41 */ "EXISTS",
- /* 42 */ "BLOCKS",
- /* 43 */ "CACHE",
- /* 44 */ "CACHELAST",
- /* 45 */ "COMP",
- /* 46 */ "DAYS",
- /* 47 */ "FSYNC",
- /* 48 */ "MAXROWS",
- /* 49 */ "MINROWS",
- /* 50 */ "KEEP",
- /* 51 */ "PRECISION",
- /* 52 */ "QUORUM",
- /* 53 */ "REPLICA",
- /* 54 */ "TTL",
- /* 55 */ "WAL",
- /* 56 */ "VGROUPS",
- /* 57 */ "SINGLE_STABLE",
- /* 58 */ "STREAM_MODE",
- /* 59 */ "TABLE",
- /* 60 */ "NK_LP",
- /* 61 */ "NK_RP",
- /* 62 */ "STABLE",
- /* 63 */ "TABLES",
- /* 64 */ "STABLES",
- /* 65 */ "USING",
- /* 66 */ "TAGS",
- /* 67 */ "NK_DOT",
- /* 68 */ "NK_COMMA",
- /* 69 */ "COMMENT",
- /* 70 */ "BOOL",
- /* 71 */ "TINYINT",
- /* 72 */ "SMALLINT",
- /* 73 */ "INT",
- /* 74 */ "INTEGER",
- /* 75 */ "BIGINT",
- /* 76 */ "FLOAT",
- /* 77 */ "DOUBLE",
- /* 78 */ "BINARY",
- /* 79 */ "TIMESTAMP",
- /* 80 */ "NCHAR",
- /* 81 */ "UNSIGNED",
- /* 82 */ "JSON",
- /* 83 */ "VARCHAR",
- /* 84 */ "MEDIUMBLOB",
- /* 85 */ "BLOB",
- /* 86 */ "VARBINARY",
- /* 87 */ "DECIMAL",
- /* 88 */ "SMA",
- /* 89 */ "INDEX",
- /* 90 */ "FULLTEXT",
- /* 91 */ "FUNCTION",
- /* 92 */ "INTERVAL",
- /* 93 */ "TOPIC",
- /* 94 */ "AS",
- /* 95 */ "MNODES",
- /* 96 */ "NK_FLOAT",
- /* 97 */ "NK_BOOL",
- /* 98 */ "NK_VARIABLE",
- /* 99 */ "BETWEEN",
- /* 100 */ "IS",
- /* 101 */ "NULL",
- /* 102 */ "NK_LT",
- /* 103 */ "NK_GT",
- /* 104 */ "NK_LE",
- /* 105 */ "NK_GE",
- /* 106 */ "NK_NE",
- /* 107 */ "NK_EQ",
- /* 108 */ "LIKE",
- /* 109 */ "MATCH",
- /* 110 */ "NMATCH",
- /* 111 */ "IN",
- /* 112 */ "FROM",
- /* 113 */ "JOIN",
- /* 114 */ "INNER",
- /* 115 */ "SELECT",
- /* 116 */ "DISTINCT",
- /* 117 */ "WHERE",
- /* 118 */ "PARTITION",
- /* 119 */ "BY",
- /* 120 */ "SESSION",
- /* 121 */ "STATE_WINDOW",
- /* 122 */ "SLIDING",
- /* 123 */ "FILL",
- /* 124 */ "VALUE",
- /* 125 */ "NONE",
- /* 126 */ "PREV",
- /* 127 */ "LINEAR",
- /* 128 */ "NEXT",
- /* 129 */ "GROUP",
- /* 130 */ "HAVING",
- /* 131 */ "ORDER",
- /* 132 */ "SLIMIT",
- /* 133 */ "SOFFSET",
- /* 134 */ "LIMIT",
- /* 135 */ "OFFSET",
- /* 136 */ "ASC",
- /* 137 */ "DESC",
- /* 138 */ "NULLS",
- /* 139 */ "FIRST",
- /* 140 */ "LAST",
- /* 141 */ "cmd",
- /* 142 */ "user_name",
- /* 143 */ "dnode_endpoint",
- /* 144 */ "dnode_host_name",
- /* 145 */ "not_exists_opt",
- /* 146 */ "db_name",
- /* 147 */ "db_options",
- /* 148 */ "exists_opt",
- /* 149 */ "full_table_name",
- /* 150 */ "column_def_list",
- /* 151 */ "tags_def_opt",
- /* 152 */ "table_options",
- /* 153 */ "multi_create_clause",
- /* 154 */ "tags_def",
- /* 155 */ "multi_drop_clause",
- /* 156 */ "create_subtable_clause",
- /* 157 */ "specific_tags_opt",
- /* 158 */ "literal_list",
- /* 159 */ "drop_table_clause",
- /* 160 */ "col_name_list",
- /* 161 */ "table_name",
- /* 162 */ "column_def",
- /* 163 */ "column_name",
- /* 164 */ "type_name",
- /* 165 */ "col_name",
- /* 166 */ "index_name",
- /* 167 */ "index_options",
- /* 168 */ "func_list",
- /* 169 */ "duration_literal",
- /* 170 */ "sliding_opt",
- /* 171 */ "func",
- /* 172 */ "function_name",
- /* 173 */ "expression_list",
- /* 174 */ "topic_name",
- /* 175 */ "query_expression",
- /* 176 */ "literal",
- /* 177 */ "table_alias",
- /* 178 */ "column_alias",
- /* 179 */ "expression",
- /* 180 */ "column_reference",
- /* 181 */ "subquery",
- /* 182 */ "predicate",
- /* 183 */ "compare_op",
- /* 184 */ "in_op",
- /* 185 */ "in_predicate_value",
- /* 186 */ "boolean_value_expression",
- /* 187 */ "boolean_primary",
- /* 188 */ "common_expression",
- /* 189 */ "from_clause",
- /* 190 */ "table_reference_list",
- /* 191 */ "table_reference",
- /* 192 */ "table_primary",
- /* 193 */ "joined_table",
- /* 194 */ "alias_opt",
- /* 195 */ "parenthesized_joined_table",
- /* 196 */ "join_type",
- /* 197 */ "search_condition",
- /* 198 */ "query_specification",
- /* 199 */ "set_quantifier_opt",
- /* 200 */ "select_list",
- /* 201 */ "where_clause_opt",
- /* 202 */ "partition_by_clause_opt",
- /* 203 */ "twindow_clause_opt",
- /* 204 */ "group_by_clause_opt",
- /* 205 */ "having_clause_opt",
- /* 206 */ "select_sublist",
- /* 207 */ "select_item",
- /* 208 */ "fill_opt",
- /* 209 */ "fill_mode",
- /* 210 */ "group_by_list",
- /* 211 */ "query_expression_body",
- /* 212 */ "order_by_clause_opt",
- /* 213 */ "slimit_clause_opt",
- /* 214 */ "limit_clause_opt",
- /* 215 */ "query_primary",
- /* 216 */ "sort_specification_list",
- /* 217 */ "sort_specification",
- /* 218 */ "ordering_specification_opt",
- /* 219 */ "null_ordering_opt",
+ /* 19 */ "ACCOUNT",
+ /* 20 */ "NK_ID",
+ /* 21 */ "PASS",
+ /* 22 */ "NK_STRING",
+ /* 23 */ "ALTER",
+ /* 24 */ "PPS",
+ /* 25 */ "TSERIES",
+ /* 26 */ "STORAGE",
+ /* 27 */ "STREAMS",
+ /* 28 */ "QTIME",
+ /* 29 */ "DBS",
+ /* 30 */ "USERS",
+ /* 31 */ "CONNS",
+ /* 32 */ "STATE",
+ /* 33 */ "USER",
+ /* 34 */ "PRIVILEGE",
+ /* 35 */ "DROP",
+ /* 36 */ "SHOW",
+ /* 37 */ "DNODE",
+ /* 38 */ "PORT",
+ /* 39 */ "NK_INTEGER",
+ /* 40 */ "DNODES",
+ /* 41 */ "NK_IPTOKEN",
+ /* 42 */ "LOCAL",
+ /* 43 */ "QNODE",
+ /* 44 */ "ON",
+ /* 45 */ "QNODES",
+ /* 46 */ "DATABASE",
+ /* 47 */ "DATABASES",
+ /* 48 */ "USE",
+ /* 49 */ "IF",
+ /* 50 */ "NOT",
+ /* 51 */ "EXISTS",
+ /* 52 */ "BLOCKS",
+ /* 53 */ "CACHE",
+ /* 54 */ "CACHELAST",
+ /* 55 */ "COMP",
+ /* 56 */ "DAYS",
+ /* 57 */ "FSYNC",
+ /* 58 */ "MAXROWS",
+ /* 59 */ "MINROWS",
+ /* 60 */ "KEEP",
+ /* 61 */ "PRECISION",
+ /* 62 */ "QUORUM",
+ /* 63 */ "REPLICA",
+ /* 64 */ "TTL",
+ /* 65 */ "WAL",
+ /* 66 */ "VGROUPS",
+ /* 67 */ "SINGLE_STABLE",
+ /* 68 */ "STREAM_MODE",
+ /* 69 */ "RETENTIONS",
+ /* 70 */ "FILE_FACTOR",
+ /* 71 */ "NK_FLOAT",
+ /* 72 */ "TABLE",
+ /* 73 */ "NK_LP",
+ /* 74 */ "NK_RP",
+ /* 75 */ "STABLE",
+ /* 76 */ "TABLES",
+ /* 77 */ "STABLES",
+ /* 78 */ "ADD",
+ /* 79 */ "COLUMN",
+ /* 80 */ "MODIFY",
+ /* 81 */ "RENAME",
+ /* 82 */ "TAG",
+ /* 83 */ "SET",
+ /* 84 */ "NK_EQ",
+ /* 85 */ "USING",
+ /* 86 */ "TAGS",
+ /* 87 */ "NK_DOT",
+ /* 88 */ "NK_COMMA",
+ /* 89 */ "COMMENT",
+ /* 90 */ "BOOL",
+ /* 91 */ "TINYINT",
+ /* 92 */ "SMALLINT",
+ /* 93 */ "INT",
+ /* 94 */ "INTEGER",
+ /* 95 */ "BIGINT",
+ /* 96 */ "FLOAT",
+ /* 97 */ "DOUBLE",
+ /* 98 */ "BINARY",
+ /* 99 */ "TIMESTAMP",
+ /* 100 */ "NCHAR",
+ /* 101 */ "UNSIGNED",
+ /* 102 */ "JSON",
+ /* 103 */ "VARCHAR",
+ /* 104 */ "MEDIUMBLOB",
+ /* 105 */ "BLOB",
+ /* 106 */ "VARBINARY",
+ /* 107 */ "DECIMAL",
+ /* 108 */ "SMA",
+ /* 109 */ "ROLLUP",
+ /* 110 */ "INDEX",
+ /* 111 */ "FULLTEXT",
+ /* 112 */ "FUNCTION",
+ /* 113 */ "INTERVAL",
+ /* 114 */ "TOPIC",
+ /* 115 */ "AS",
+ /* 116 */ "MNODES",
+ /* 117 */ "NK_BOOL",
+ /* 118 */ "NK_VARIABLE",
+ /* 119 */ "BETWEEN",
+ /* 120 */ "IS",
+ /* 121 */ "NULL",
+ /* 122 */ "NK_LT",
+ /* 123 */ "NK_GT",
+ /* 124 */ "NK_LE",
+ /* 125 */ "NK_GE",
+ /* 126 */ "NK_NE",
+ /* 127 */ "LIKE",
+ /* 128 */ "MATCH",
+ /* 129 */ "NMATCH",
+ /* 130 */ "IN",
+ /* 131 */ "FROM",
+ /* 132 */ "JOIN",
+ /* 133 */ "INNER",
+ /* 134 */ "SELECT",
+ /* 135 */ "DISTINCT",
+ /* 136 */ "WHERE",
+ /* 137 */ "PARTITION",
+ /* 138 */ "BY",
+ /* 139 */ "SESSION",
+ /* 140 */ "STATE_WINDOW",
+ /* 141 */ "SLIDING",
+ /* 142 */ "FILL",
+ /* 143 */ "VALUE",
+ /* 144 */ "NONE",
+ /* 145 */ "PREV",
+ /* 146 */ "LINEAR",
+ /* 147 */ "NEXT",
+ /* 148 */ "GROUP",
+ /* 149 */ "HAVING",
+ /* 150 */ "ORDER",
+ /* 151 */ "SLIMIT",
+ /* 152 */ "SOFFSET",
+ /* 153 */ "LIMIT",
+ /* 154 */ "OFFSET",
+ /* 155 */ "ASC",
+ /* 156 */ "DESC",
+ /* 157 */ "NULLS",
+ /* 158 */ "FIRST",
+ /* 159 */ "LAST",
+ /* 160 */ "cmd",
+ /* 161 */ "account_options",
+ /* 162 */ "alter_account_options",
+ /* 163 */ "literal",
+ /* 164 */ "alter_account_option",
+ /* 165 */ "user_name",
+ /* 166 */ "dnode_endpoint",
+ /* 167 */ "dnode_host_name",
+ /* 168 */ "not_exists_opt",
+ /* 169 */ "db_name",
+ /* 170 */ "db_options",
+ /* 171 */ "exists_opt",
+ /* 172 */ "alter_db_options",
+ /* 173 */ "alter_db_option",
+ /* 174 */ "full_table_name",
+ /* 175 */ "column_def_list",
+ /* 176 */ "tags_def_opt",
+ /* 177 */ "table_options",
+ /* 178 */ "multi_create_clause",
+ /* 179 */ "tags_def",
+ /* 180 */ "multi_drop_clause",
+ /* 181 */ "alter_table_clause",
+ /* 182 */ "alter_table_options",
+ /* 183 */ "column_name",
+ /* 184 */ "type_name",
+ /* 185 */ "create_subtable_clause",
+ /* 186 */ "specific_tags_opt",
+ /* 187 */ "literal_list",
+ /* 188 */ "drop_table_clause",
+ /* 189 */ "col_name_list",
+ /* 190 */ "table_name",
+ /* 191 */ "column_def",
+ /* 192 */ "func_name_list",
+ /* 193 */ "alter_table_option",
+ /* 194 */ "col_name",
+ /* 195 */ "func_name",
+ /* 196 */ "function_name",
+ /* 197 */ "index_name",
+ /* 198 */ "index_options",
+ /* 199 */ "func_list",
+ /* 200 */ "duration_literal",
+ /* 201 */ "sliding_opt",
+ /* 202 */ "func",
+ /* 203 */ "expression_list",
+ /* 204 */ "topic_name",
+ /* 205 */ "query_expression",
+ /* 206 */ "table_alias",
+ /* 207 */ "column_alias",
+ /* 208 */ "expression",
+ /* 209 */ "column_reference",
+ /* 210 */ "subquery",
+ /* 211 */ "predicate",
+ /* 212 */ "compare_op",
+ /* 213 */ "in_op",
+ /* 214 */ "in_predicate_value",
+ /* 215 */ "boolean_value_expression",
+ /* 216 */ "boolean_primary",
+ /* 217 */ "common_expression",
+ /* 218 */ "from_clause",
+ /* 219 */ "table_reference_list",
+ /* 220 */ "table_reference",
+ /* 221 */ "table_primary",
+ /* 222 */ "joined_table",
+ /* 223 */ "alias_opt",
+ /* 224 */ "parenthesized_joined_table",
+ /* 225 */ "join_type",
+ /* 226 */ "search_condition",
+ /* 227 */ "query_specification",
+ /* 228 */ "set_quantifier_opt",
+ /* 229 */ "select_list",
+ /* 230 */ "where_clause_opt",
+ /* 231 */ "partition_by_clause_opt",
+ /* 232 */ "twindow_clause_opt",
+ /* 233 */ "group_by_clause_opt",
+ /* 234 */ "having_clause_opt",
+ /* 235 */ "select_sublist",
+ /* 236 */ "select_item",
+ /* 237 */ "fill_opt",
+ /* 238 */ "fill_mode",
+ /* 239 */ "group_by_list",
+ /* 240 */ "query_expression_body",
+ /* 241 */ "order_by_clause_opt",
+ /* 242 */ "slimit_clause_opt",
+ /* 243 */ "limit_clause_opt",
+ /* 244 */ "query_primary",
+ /* 245 */ "sort_specification_list",
+ /* 246 */ "sort_specification",
+ /* 247 */ "ordering_specification_opt",
+ /* 248 */ "null_ordering_opt",
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
@@ -855,261 +943,322 @@ static const char *const yyTokenName[] = {
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
- /* 0 */ "cmd ::= CREATE USER user_name PASS NK_STRING",
- /* 1 */ "cmd ::= ALTER USER user_name PASS NK_STRING",
- /* 2 */ "cmd ::= ALTER USER user_name PRIVILEGE NK_STRING",
- /* 3 */ "cmd ::= DROP USER user_name",
- /* 4 */ "cmd ::= SHOW USERS",
- /* 5 */ "cmd ::= CREATE DNODE dnode_endpoint",
- /* 6 */ "cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER",
- /* 7 */ "cmd ::= DROP DNODE NK_INTEGER",
- /* 8 */ "cmd ::= DROP DNODE dnode_endpoint",
- /* 9 */ "cmd ::= SHOW DNODES",
- /* 10 */ "dnode_endpoint ::= NK_STRING",
- /* 11 */ "dnode_host_name ::= NK_ID",
- /* 12 */ "dnode_host_name ::= NK_IPTOKEN",
- /* 13 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER",
- /* 14 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER",
- /* 15 */ "cmd ::= SHOW QNODES",
- /* 16 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options",
- /* 17 */ "cmd ::= DROP DATABASE exists_opt db_name",
- /* 18 */ "cmd ::= SHOW DATABASES",
- /* 19 */ "cmd ::= USE db_name",
- /* 20 */ "cmd ::= ALTER DATABASE db_name db_options",
- /* 21 */ "not_exists_opt ::= IF NOT EXISTS",
- /* 22 */ "not_exists_opt ::=",
- /* 23 */ "exists_opt ::= IF EXISTS",
- /* 24 */ "exists_opt ::=",
- /* 25 */ "db_options ::=",
- /* 26 */ "db_options ::= db_options BLOCKS NK_INTEGER",
- /* 27 */ "db_options ::= db_options CACHE NK_INTEGER",
- /* 28 */ "db_options ::= db_options CACHELAST NK_INTEGER",
- /* 29 */ "db_options ::= db_options COMP NK_INTEGER",
- /* 30 */ "db_options ::= db_options DAYS NK_INTEGER",
- /* 31 */ "db_options ::= db_options FSYNC NK_INTEGER",
- /* 32 */ "db_options ::= db_options MAXROWS NK_INTEGER",
- /* 33 */ "db_options ::= db_options MINROWS NK_INTEGER",
- /* 34 */ "db_options ::= db_options KEEP NK_INTEGER",
- /* 35 */ "db_options ::= db_options PRECISION NK_STRING",
- /* 36 */ "db_options ::= db_options QUORUM NK_INTEGER",
- /* 37 */ "db_options ::= db_options REPLICA NK_INTEGER",
- /* 38 */ "db_options ::= db_options TTL NK_INTEGER",
- /* 39 */ "db_options ::= db_options WAL NK_INTEGER",
- /* 40 */ "db_options ::= db_options VGROUPS NK_INTEGER",
- /* 41 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
- /* 42 */ "db_options ::= db_options STREAM_MODE NK_INTEGER",
- /* 43 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
- /* 44 */ "cmd ::= CREATE TABLE multi_create_clause",
- /* 45 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
- /* 46 */ "cmd ::= DROP TABLE multi_drop_clause",
- /* 47 */ "cmd ::= DROP STABLE exists_opt full_table_name",
- /* 48 */ "cmd ::= SHOW TABLES",
- /* 49 */ "cmd ::= SHOW STABLES",
- /* 50 */ "multi_create_clause ::= create_subtable_clause",
- /* 51 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
- /* 52 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP",
- /* 53 */ "multi_drop_clause ::= drop_table_clause",
- /* 54 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause",
- /* 55 */ "drop_table_clause ::= exists_opt full_table_name",
- /* 56 */ "specific_tags_opt ::=",
- /* 57 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP",
- /* 58 */ "full_table_name ::= table_name",
- /* 59 */ "full_table_name ::= db_name NK_DOT table_name",
- /* 60 */ "column_def_list ::= column_def",
- /* 61 */ "column_def_list ::= column_def_list NK_COMMA column_def",
- /* 62 */ "column_def ::= column_name type_name",
- /* 63 */ "column_def ::= column_name type_name COMMENT NK_STRING",
- /* 64 */ "type_name ::= BOOL",
- /* 65 */ "type_name ::= TINYINT",
- /* 66 */ "type_name ::= SMALLINT",
- /* 67 */ "type_name ::= INT",
- /* 68 */ "type_name ::= INTEGER",
- /* 69 */ "type_name ::= BIGINT",
- /* 70 */ "type_name ::= FLOAT",
- /* 71 */ "type_name ::= DOUBLE",
- /* 72 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
- /* 73 */ "type_name ::= TIMESTAMP",
- /* 74 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
- /* 75 */ "type_name ::= TINYINT UNSIGNED",
- /* 76 */ "type_name ::= SMALLINT UNSIGNED",
- /* 77 */ "type_name ::= INT UNSIGNED",
- /* 78 */ "type_name ::= BIGINT UNSIGNED",
- /* 79 */ "type_name ::= JSON",
- /* 80 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
- /* 81 */ "type_name ::= MEDIUMBLOB",
- /* 82 */ "type_name ::= BLOB",
- /* 83 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
- /* 84 */ "type_name ::= DECIMAL",
- /* 85 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
- /* 86 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
- /* 87 */ "tags_def_opt ::=",
- /* 88 */ "tags_def_opt ::= tags_def",
- /* 89 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
- /* 90 */ "table_options ::=",
- /* 91 */ "table_options ::= table_options COMMENT NK_STRING",
- /* 92 */ "table_options ::= table_options KEEP NK_INTEGER",
- /* 93 */ "table_options ::= table_options TTL NK_INTEGER",
- /* 94 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
- /* 95 */ "col_name_list ::= col_name",
- /* 96 */ "col_name_list ::= col_name_list NK_COMMA col_name",
- /* 97 */ "col_name ::= column_name",
- /* 98 */ "cmd ::= CREATE SMA INDEX index_name ON table_name index_options",
- /* 99 */ "cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP",
- /* 100 */ "cmd ::= DROP INDEX index_name ON table_name",
- /* 101 */ "index_options ::=",
- /* 102 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt",
- /* 103 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt",
- /* 104 */ "func_list ::= func",
- /* 105 */ "func_list ::= func_list NK_COMMA func",
- /* 106 */ "func ::= function_name NK_LP expression_list NK_RP",
- /* 107 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression",
- /* 108 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name",
- /* 109 */ "cmd ::= DROP TOPIC exists_opt topic_name",
- /* 110 */ "cmd ::= SHOW VGROUPS",
- /* 111 */ "cmd ::= SHOW db_name NK_DOT VGROUPS",
- /* 112 */ "cmd ::= SHOW MNODES",
- /* 113 */ "cmd ::= query_expression",
- /* 114 */ "literal ::= NK_INTEGER",
- /* 115 */ "literal ::= NK_FLOAT",
- /* 116 */ "literal ::= NK_STRING",
- /* 117 */ "literal ::= NK_BOOL",
- /* 118 */ "literal ::= TIMESTAMP NK_STRING",
- /* 119 */ "literal ::= duration_literal",
- /* 120 */ "duration_literal ::= NK_VARIABLE",
- /* 121 */ "literal_list ::= literal",
- /* 122 */ "literal_list ::= literal_list NK_COMMA literal",
- /* 123 */ "db_name ::= NK_ID",
- /* 124 */ "table_name ::= NK_ID",
- /* 125 */ "column_name ::= NK_ID",
- /* 126 */ "function_name ::= NK_ID",
- /* 127 */ "table_alias ::= NK_ID",
- /* 128 */ "column_alias ::= NK_ID",
- /* 129 */ "user_name ::= NK_ID",
- /* 130 */ "index_name ::= NK_ID",
- /* 131 */ "topic_name ::= NK_ID",
- /* 132 */ "expression ::= literal",
- /* 133 */ "expression ::= column_reference",
- /* 134 */ "expression ::= function_name NK_LP expression_list NK_RP",
- /* 135 */ "expression ::= function_name NK_LP NK_STAR NK_RP",
- /* 136 */ "expression ::= subquery",
- /* 137 */ "expression ::= NK_LP expression NK_RP",
- /* 138 */ "expression ::= NK_PLUS expression",
- /* 139 */ "expression ::= NK_MINUS expression",
- /* 140 */ "expression ::= expression NK_PLUS expression",
- /* 141 */ "expression ::= expression NK_MINUS expression",
- /* 142 */ "expression ::= expression NK_STAR expression",
- /* 143 */ "expression ::= expression NK_SLASH expression",
- /* 144 */ "expression ::= expression NK_REM expression",
- /* 145 */ "expression_list ::= expression",
- /* 146 */ "expression_list ::= expression_list NK_COMMA expression",
- /* 147 */ "column_reference ::= column_name",
- /* 148 */ "column_reference ::= table_name NK_DOT column_name",
- /* 149 */ "predicate ::= expression compare_op expression",
- /* 150 */ "predicate ::= expression BETWEEN expression AND expression",
- /* 151 */ "predicate ::= expression NOT BETWEEN expression AND expression",
- /* 152 */ "predicate ::= expression IS NULL",
- /* 153 */ "predicate ::= expression IS NOT NULL",
- /* 154 */ "predicate ::= expression in_op in_predicate_value",
- /* 155 */ "compare_op ::= NK_LT",
- /* 156 */ "compare_op ::= NK_GT",
- /* 157 */ "compare_op ::= NK_LE",
- /* 158 */ "compare_op ::= NK_GE",
- /* 159 */ "compare_op ::= NK_NE",
- /* 160 */ "compare_op ::= NK_EQ",
- /* 161 */ "compare_op ::= LIKE",
- /* 162 */ "compare_op ::= NOT LIKE",
- /* 163 */ "compare_op ::= MATCH",
- /* 164 */ "compare_op ::= NMATCH",
- /* 165 */ "in_op ::= IN",
- /* 166 */ "in_op ::= NOT IN",
- /* 167 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
- /* 168 */ "boolean_value_expression ::= boolean_primary",
- /* 169 */ "boolean_value_expression ::= NOT boolean_primary",
- /* 170 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
- /* 171 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
- /* 172 */ "boolean_primary ::= predicate",
- /* 173 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
- /* 174 */ "common_expression ::= expression",
- /* 175 */ "common_expression ::= boolean_value_expression",
- /* 176 */ "from_clause ::= FROM table_reference_list",
- /* 177 */ "table_reference_list ::= table_reference",
- /* 178 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
- /* 179 */ "table_reference ::= table_primary",
- /* 180 */ "table_reference ::= joined_table",
- /* 181 */ "table_primary ::= table_name alias_opt",
- /* 182 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
- /* 183 */ "table_primary ::= subquery alias_opt",
- /* 184 */ "table_primary ::= parenthesized_joined_table",
- /* 185 */ "alias_opt ::=",
- /* 186 */ "alias_opt ::= table_alias",
- /* 187 */ "alias_opt ::= AS table_alias",
- /* 188 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
- /* 189 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
- /* 190 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
- /* 191 */ "join_type ::=",
- /* 192 */ "join_type ::= INNER",
- /* 193 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt",
- /* 194 */ "set_quantifier_opt ::=",
- /* 195 */ "set_quantifier_opt ::= DISTINCT",
- /* 196 */ "set_quantifier_opt ::= ALL",
- /* 197 */ "select_list ::= NK_STAR",
- /* 198 */ "select_list ::= select_sublist",
- /* 199 */ "select_sublist ::= select_item",
- /* 200 */ "select_sublist ::= select_sublist NK_COMMA select_item",
- /* 201 */ "select_item ::= common_expression",
- /* 202 */ "select_item ::= common_expression column_alias",
- /* 203 */ "select_item ::= common_expression AS column_alias",
- /* 204 */ "select_item ::= table_name NK_DOT NK_STAR",
- /* 205 */ "where_clause_opt ::=",
- /* 206 */ "where_clause_opt ::= WHERE search_condition",
- /* 207 */ "partition_by_clause_opt ::=",
- /* 208 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
- /* 209 */ "twindow_clause_opt ::=",
- /* 210 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP",
- /* 211 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP",
- /* 212 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
- /* 213 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
- /* 214 */ "sliding_opt ::=",
- /* 215 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
- /* 216 */ "fill_opt ::=",
- /* 217 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
- /* 218 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
- /* 219 */ "fill_mode ::= NONE",
- /* 220 */ "fill_mode ::= PREV",
- /* 221 */ "fill_mode ::= NULL",
- /* 222 */ "fill_mode ::= LINEAR",
- /* 223 */ "fill_mode ::= NEXT",
- /* 224 */ "group_by_clause_opt ::=",
- /* 225 */ "group_by_clause_opt ::= GROUP BY group_by_list",
- /* 226 */ "group_by_list ::= expression",
- /* 227 */ "group_by_list ::= group_by_list NK_COMMA expression",
- /* 228 */ "having_clause_opt ::=",
- /* 229 */ "having_clause_opt ::= HAVING search_condition",
- /* 230 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
- /* 231 */ "query_expression_body ::= query_primary",
- /* 232 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
- /* 233 */ "query_primary ::= query_specification",
- /* 234 */ "order_by_clause_opt ::=",
- /* 235 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
- /* 236 */ "slimit_clause_opt ::=",
- /* 237 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
- /* 238 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
- /* 239 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
- /* 240 */ "limit_clause_opt ::=",
- /* 241 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
- /* 242 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
- /* 243 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
- /* 244 */ "subquery ::= NK_LP query_expression NK_RP",
- /* 245 */ "search_condition ::= common_expression",
- /* 246 */ "sort_specification_list ::= sort_specification",
- /* 247 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
- /* 248 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
- /* 249 */ "ordering_specification_opt ::=",
- /* 250 */ "ordering_specification_opt ::= ASC",
- /* 251 */ "ordering_specification_opt ::= DESC",
- /* 252 */ "null_ordering_opt ::=",
- /* 253 */ "null_ordering_opt ::= NULLS FIRST",
- /* 254 */ "null_ordering_opt ::= NULLS LAST",
+ /* 0 */ "cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options",
+ /* 1 */ "cmd ::= ALTER ACCOUNT NK_ID alter_account_options",
+ /* 2 */ "account_options ::=",
+ /* 3 */ "account_options ::= account_options PPS literal",
+ /* 4 */ "account_options ::= account_options TSERIES literal",
+ /* 5 */ "account_options ::= account_options STORAGE literal",
+ /* 6 */ "account_options ::= account_options STREAMS literal",
+ /* 7 */ "account_options ::= account_options QTIME literal",
+ /* 8 */ "account_options ::= account_options DBS literal",
+ /* 9 */ "account_options ::= account_options USERS literal",
+ /* 10 */ "account_options ::= account_options CONNS literal",
+ /* 11 */ "account_options ::= account_options STATE literal",
+ /* 12 */ "alter_account_options ::= alter_account_option",
+ /* 13 */ "alter_account_options ::= alter_account_options alter_account_option",
+ /* 14 */ "alter_account_option ::= PASS literal",
+ /* 15 */ "alter_account_option ::= PPS literal",
+ /* 16 */ "alter_account_option ::= TSERIES literal",
+ /* 17 */ "alter_account_option ::= STORAGE literal",
+ /* 18 */ "alter_account_option ::= STREAMS literal",
+ /* 19 */ "alter_account_option ::= QTIME literal",
+ /* 20 */ "alter_account_option ::= DBS literal",
+ /* 21 */ "alter_account_option ::= USERS literal",
+ /* 22 */ "alter_account_option ::= CONNS literal",
+ /* 23 */ "alter_account_option ::= STATE literal",
+ /* 24 */ "cmd ::= CREATE USER user_name PASS NK_STRING",
+ /* 25 */ "cmd ::= ALTER USER user_name PASS NK_STRING",
+ /* 26 */ "cmd ::= ALTER USER user_name PRIVILEGE NK_STRING",
+ /* 27 */ "cmd ::= DROP USER user_name",
+ /* 28 */ "cmd ::= SHOW USERS",
+ /* 29 */ "cmd ::= CREATE DNODE dnode_endpoint",
+ /* 30 */ "cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER",
+ /* 31 */ "cmd ::= DROP DNODE NK_INTEGER",
+ /* 32 */ "cmd ::= DROP DNODE dnode_endpoint",
+ /* 33 */ "cmd ::= SHOW DNODES",
+ /* 34 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING",
+ /* 35 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING",
+ /* 36 */ "cmd ::= ALTER ALL DNODES NK_STRING",
+ /* 37 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING",
+ /* 38 */ "dnode_endpoint ::= NK_STRING",
+ /* 39 */ "dnode_host_name ::= NK_ID",
+ /* 40 */ "dnode_host_name ::= NK_IPTOKEN",
+ /* 41 */ "cmd ::= ALTER LOCAL NK_STRING",
+ /* 42 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING",
+ /* 43 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER",
+ /* 44 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER",
+ /* 45 */ "cmd ::= SHOW QNODES",
+ /* 46 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options",
+ /* 47 */ "cmd ::= DROP DATABASE exists_opt db_name",
+ /* 48 */ "cmd ::= SHOW DATABASES",
+ /* 49 */ "cmd ::= USE db_name",
+ /* 50 */ "cmd ::= ALTER DATABASE db_name alter_db_options",
+ /* 51 */ "not_exists_opt ::= IF NOT EXISTS",
+ /* 52 */ "not_exists_opt ::=",
+ /* 53 */ "exists_opt ::= IF EXISTS",
+ /* 54 */ "exists_opt ::=",
+ /* 55 */ "db_options ::=",
+ /* 56 */ "db_options ::= db_options BLOCKS NK_INTEGER",
+ /* 57 */ "db_options ::= db_options CACHE NK_INTEGER",
+ /* 58 */ "db_options ::= db_options CACHELAST NK_INTEGER",
+ /* 59 */ "db_options ::= db_options COMP NK_INTEGER",
+ /* 60 */ "db_options ::= db_options DAYS NK_INTEGER",
+ /* 61 */ "db_options ::= db_options FSYNC NK_INTEGER",
+ /* 62 */ "db_options ::= db_options MAXROWS NK_INTEGER",
+ /* 63 */ "db_options ::= db_options MINROWS NK_INTEGER",
+ /* 64 */ "db_options ::= db_options KEEP NK_INTEGER",
+ /* 65 */ "db_options ::= db_options PRECISION NK_STRING",
+ /* 66 */ "db_options ::= db_options QUORUM NK_INTEGER",
+ /* 67 */ "db_options ::= db_options REPLICA NK_INTEGER",
+ /* 68 */ "db_options ::= db_options TTL NK_INTEGER",
+ /* 69 */ "db_options ::= db_options WAL NK_INTEGER",
+ /* 70 */ "db_options ::= db_options VGROUPS NK_INTEGER",
+ /* 71 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
+ /* 72 */ "db_options ::= db_options STREAM_MODE NK_INTEGER",
+ /* 73 */ "db_options ::= db_options RETENTIONS NK_STRING",
+ /* 74 */ "db_options ::= db_options FILE_FACTOR NK_FLOAT",
+ /* 75 */ "alter_db_options ::= alter_db_option",
+ /* 76 */ "alter_db_options ::= alter_db_options alter_db_option",
+ /* 77 */ "alter_db_option ::= BLOCKS NK_INTEGER",
+ /* 78 */ "alter_db_option ::= FSYNC NK_INTEGER",
+ /* 79 */ "alter_db_option ::= KEEP NK_INTEGER",
+ /* 80 */ "alter_db_option ::= WAL NK_INTEGER",
+ /* 81 */ "alter_db_option ::= QUORUM NK_INTEGER",
+ /* 82 */ "alter_db_option ::= CACHELAST NK_INTEGER",
+ /* 83 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
+ /* 84 */ "cmd ::= CREATE TABLE multi_create_clause",
+ /* 85 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
+ /* 86 */ "cmd ::= DROP TABLE multi_drop_clause",
+ /* 87 */ "cmd ::= DROP STABLE exists_opt full_table_name",
+ /* 88 */ "cmd ::= SHOW TABLES",
+ /* 89 */ "cmd ::= SHOW STABLES",
+ /* 90 */ "cmd ::= ALTER TABLE alter_table_clause",
+ /* 91 */ "cmd ::= ALTER STABLE alter_table_clause",
+ /* 92 */ "alter_table_clause ::= full_table_name alter_table_options",
+ /* 93 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
+ /* 94 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
+ /* 95 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
+ /* 96 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
+ /* 97 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
+ /* 98 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
+ /* 99 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
+ /* 100 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
+ /* 101 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal",
+ /* 102 */ "multi_create_clause ::= create_subtable_clause",
+ /* 103 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
+ /* 104 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP",
+ /* 105 */ "multi_drop_clause ::= drop_table_clause",
+ /* 106 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause",
+ /* 107 */ "drop_table_clause ::= exists_opt full_table_name",
+ /* 108 */ "specific_tags_opt ::=",
+ /* 109 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP",
+ /* 110 */ "full_table_name ::= table_name",
+ /* 111 */ "full_table_name ::= db_name NK_DOT table_name",
+ /* 112 */ "column_def_list ::= column_def",
+ /* 113 */ "column_def_list ::= column_def_list NK_COMMA column_def",
+ /* 114 */ "column_def ::= column_name type_name",
+ /* 115 */ "column_def ::= column_name type_name COMMENT NK_STRING",
+ /* 116 */ "type_name ::= BOOL",
+ /* 117 */ "type_name ::= TINYINT",
+ /* 118 */ "type_name ::= SMALLINT",
+ /* 119 */ "type_name ::= INT",
+ /* 120 */ "type_name ::= INTEGER",
+ /* 121 */ "type_name ::= BIGINT",
+ /* 122 */ "type_name ::= FLOAT",
+ /* 123 */ "type_name ::= DOUBLE",
+ /* 124 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
+ /* 125 */ "type_name ::= TIMESTAMP",
+ /* 126 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
+ /* 127 */ "type_name ::= TINYINT UNSIGNED",
+ /* 128 */ "type_name ::= SMALLINT UNSIGNED",
+ /* 129 */ "type_name ::= INT UNSIGNED",
+ /* 130 */ "type_name ::= BIGINT UNSIGNED",
+ /* 131 */ "type_name ::= JSON",
+ /* 132 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
+ /* 133 */ "type_name ::= MEDIUMBLOB",
+ /* 134 */ "type_name ::= BLOB",
+ /* 135 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
+ /* 136 */ "type_name ::= DECIMAL",
+ /* 137 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
+ /* 138 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
+ /* 139 */ "tags_def_opt ::=",
+ /* 140 */ "tags_def_opt ::= tags_def",
+ /* 141 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
+ /* 142 */ "table_options ::=",
+ /* 143 */ "table_options ::= table_options COMMENT NK_STRING",
+ /* 144 */ "table_options ::= table_options KEEP NK_INTEGER",
+ /* 145 */ "table_options ::= table_options TTL NK_INTEGER",
+ /* 146 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
+ /* 147 */ "table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP",
+ /* 148 */ "alter_table_options ::= alter_table_option",
+ /* 149 */ "alter_table_options ::= alter_table_options alter_table_option",
+ /* 150 */ "alter_table_option ::= COMMENT NK_STRING",
+ /* 151 */ "alter_table_option ::= KEEP NK_INTEGER",
+ /* 152 */ "alter_table_option ::= TTL NK_INTEGER",
+ /* 153 */ "col_name_list ::= col_name",
+ /* 154 */ "col_name_list ::= col_name_list NK_COMMA col_name",
+ /* 155 */ "col_name ::= column_name",
+ /* 156 */ "func_name_list ::= func_name",
+ /* 157 */ "func_name_list ::= func_name_list NK_COMMA col_name",
+ /* 158 */ "func_name ::= function_name",
+ /* 159 */ "cmd ::= CREATE SMA INDEX index_name ON table_name index_options",
+ /* 160 */ "cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP",
+ /* 161 */ "cmd ::= DROP INDEX index_name ON table_name",
+ /* 162 */ "index_options ::=",
+ /* 163 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt",
+ /* 164 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt",
+ /* 165 */ "func_list ::= func",
+ /* 166 */ "func_list ::= func_list NK_COMMA func",
+ /* 167 */ "func ::= function_name NK_LP expression_list NK_RP",
+ /* 168 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression",
+ /* 169 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name",
+ /* 170 */ "cmd ::= DROP TOPIC exists_opt topic_name",
+ /* 171 */ "cmd ::= SHOW VGROUPS",
+ /* 172 */ "cmd ::= SHOW db_name NK_DOT VGROUPS",
+ /* 173 */ "cmd ::= SHOW MNODES",
+ /* 174 */ "cmd ::= query_expression",
+ /* 175 */ "literal ::= NK_INTEGER",
+ /* 176 */ "literal ::= NK_FLOAT",
+ /* 177 */ "literal ::= NK_STRING",
+ /* 178 */ "literal ::= NK_BOOL",
+ /* 179 */ "literal ::= TIMESTAMP NK_STRING",
+ /* 180 */ "literal ::= duration_literal",
+ /* 181 */ "duration_literal ::= NK_VARIABLE",
+ /* 182 */ "literal_list ::= literal",
+ /* 183 */ "literal_list ::= literal_list NK_COMMA literal",
+ /* 184 */ "db_name ::= NK_ID",
+ /* 185 */ "table_name ::= NK_ID",
+ /* 186 */ "column_name ::= NK_ID",
+ /* 187 */ "function_name ::= NK_ID",
+ /* 188 */ "table_alias ::= NK_ID",
+ /* 189 */ "column_alias ::= NK_ID",
+ /* 190 */ "user_name ::= NK_ID",
+ /* 191 */ "index_name ::= NK_ID",
+ /* 192 */ "topic_name ::= NK_ID",
+ /* 193 */ "expression ::= literal",
+ /* 194 */ "expression ::= column_reference",
+ /* 195 */ "expression ::= function_name NK_LP expression_list NK_RP",
+ /* 196 */ "expression ::= function_name NK_LP NK_STAR NK_RP",
+ /* 197 */ "expression ::= subquery",
+ /* 198 */ "expression ::= NK_LP expression NK_RP",
+ /* 199 */ "expression ::= NK_PLUS expression",
+ /* 200 */ "expression ::= NK_MINUS expression",
+ /* 201 */ "expression ::= expression NK_PLUS expression",
+ /* 202 */ "expression ::= expression NK_MINUS expression",
+ /* 203 */ "expression ::= expression NK_STAR expression",
+ /* 204 */ "expression ::= expression NK_SLASH expression",
+ /* 205 */ "expression ::= expression NK_REM expression",
+ /* 206 */ "expression_list ::= expression",
+ /* 207 */ "expression_list ::= expression_list NK_COMMA expression",
+ /* 208 */ "column_reference ::= column_name",
+ /* 209 */ "column_reference ::= table_name NK_DOT column_name",
+ /* 210 */ "predicate ::= expression compare_op expression",
+ /* 211 */ "predicate ::= expression BETWEEN expression AND expression",
+ /* 212 */ "predicate ::= expression NOT BETWEEN expression AND expression",
+ /* 213 */ "predicate ::= expression IS NULL",
+ /* 214 */ "predicate ::= expression IS NOT NULL",
+ /* 215 */ "predicate ::= expression in_op in_predicate_value",
+ /* 216 */ "compare_op ::= NK_LT",
+ /* 217 */ "compare_op ::= NK_GT",
+ /* 218 */ "compare_op ::= NK_LE",
+ /* 219 */ "compare_op ::= NK_GE",
+ /* 220 */ "compare_op ::= NK_NE",
+ /* 221 */ "compare_op ::= NK_EQ",
+ /* 222 */ "compare_op ::= LIKE",
+ /* 223 */ "compare_op ::= NOT LIKE",
+ /* 224 */ "compare_op ::= MATCH",
+ /* 225 */ "compare_op ::= NMATCH",
+ /* 226 */ "in_op ::= IN",
+ /* 227 */ "in_op ::= NOT IN",
+ /* 228 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
+ /* 229 */ "boolean_value_expression ::= boolean_primary",
+ /* 230 */ "boolean_value_expression ::= NOT boolean_primary",
+ /* 231 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
+ /* 232 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
+ /* 233 */ "boolean_primary ::= predicate",
+ /* 234 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
+ /* 235 */ "common_expression ::= expression",
+ /* 236 */ "common_expression ::= boolean_value_expression",
+ /* 237 */ "from_clause ::= FROM table_reference_list",
+ /* 238 */ "table_reference_list ::= table_reference",
+ /* 239 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
+ /* 240 */ "table_reference ::= table_primary",
+ /* 241 */ "table_reference ::= joined_table",
+ /* 242 */ "table_primary ::= table_name alias_opt",
+ /* 243 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
+ /* 244 */ "table_primary ::= subquery alias_opt",
+ /* 245 */ "table_primary ::= parenthesized_joined_table",
+ /* 246 */ "alias_opt ::=",
+ /* 247 */ "alias_opt ::= table_alias",
+ /* 248 */ "alias_opt ::= AS table_alias",
+ /* 249 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
+ /* 250 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
+ /* 251 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
+ /* 252 */ "join_type ::=",
+ /* 253 */ "join_type ::= INNER",
+ /* 254 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt",
+ /* 255 */ "set_quantifier_opt ::=",
+ /* 256 */ "set_quantifier_opt ::= DISTINCT",
+ /* 257 */ "set_quantifier_opt ::= ALL",
+ /* 258 */ "select_list ::= NK_STAR",
+ /* 259 */ "select_list ::= select_sublist",
+ /* 260 */ "select_sublist ::= select_item",
+ /* 261 */ "select_sublist ::= select_sublist NK_COMMA select_item",
+ /* 262 */ "select_item ::= common_expression",
+ /* 263 */ "select_item ::= common_expression column_alias",
+ /* 264 */ "select_item ::= common_expression AS column_alias",
+ /* 265 */ "select_item ::= table_name NK_DOT NK_STAR",
+ /* 266 */ "where_clause_opt ::=",
+ /* 267 */ "where_clause_opt ::= WHERE search_condition",
+ /* 268 */ "partition_by_clause_opt ::=",
+ /* 269 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
+ /* 270 */ "twindow_clause_opt ::=",
+ /* 271 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP",
+ /* 272 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP",
+ /* 273 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
+ /* 274 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
+ /* 275 */ "sliding_opt ::=",
+ /* 276 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
+ /* 277 */ "fill_opt ::=",
+ /* 278 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
+ /* 279 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
+ /* 280 */ "fill_mode ::= NONE",
+ /* 281 */ "fill_mode ::= PREV",
+ /* 282 */ "fill_mode ::= NULL",
+ /* 283 */ "fill_mode ::= LINEAR",
+ /* 284 */ "fill_mode ::= NEXT",
+ /* 285 */ "group_by_clause_opt ::=",
+ /* 286 */ "group_by_clause_opt ::= GROUP BY group_by_list",
+ /* 287 */ "group_by_list ::= expression",
+ /* 288 */ "group_by_list ::= group_by_list NK_COMMA expression",
+ /* 289 */ "having_clause_opt ::=",
+ /* 290 */ "having_clause_opt ::= HAVING search_condition",
+ /* 291 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
+ /* 292 */ "query_expression_body ::= query_primary",
+ /* 293 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
+ /* 294 */ "query_primary ::= query_specification",
+ /* 295 */ "order_by_clause_opt ::=",
+ /* 296 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
+ /* 297 */ "slimit_clause_opt ::=",
+ /* 298 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
+ /* 299 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
+ /* 300 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
+ /* 301 */ "limit_clause_opt ::=",
+ /* 302 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
+ /* 303 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
+ /* 304 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
+ /* 305 */ "subquery ::= NK_LP query_expression NK_RP",
+ /* 306 */ "search_condition ::= common_expression",
+ /* 307 */ "sort_specification_list ::= sort_specification",
+ /* 308 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
+ /* 309 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
+ /* 310 */ "ordering_specification_opt ::=",
+ /* 311 */ "ordering_specification_opt ::= ASC",
+ /* 312 */ "ordering_specification_opt ::= DESC",
+ /* 313 */ "null_ordering_opt ::=",
+ /* 314 */ "null_ordering_opt ::= NULLS FIRST",
+ /* 315 */ "null_ordering_opt ::= NULLS LAST",
};
#endif /* NDEBUG */
@@ -1236,121 +1385,139 @@ static void yy_destructor(
*/
/********* Begin destructor definitions ***************************************/
/* Default NON-TERMINAL Destructor */
- case 141: /* cmd */
- case 147: /* db_options */
- case 149: /* full_table_name */
- case 152: /* table_options */
- case 156: /* create_subtable_clause */
- case 159: /* drop_table_clause */
- case 162: /* column_def */
- case 165: /* col_name */
- case 167: /* index_options */
- case 169: /* duration_literal */
- case 170: /* sliding_opt */
- case 171: /* func */
- case 175: /* query_expression */
- case 176: /* literal */
- case 179: /* expression */
- case 180: /* column_reference */
- case 181: /* subquery */
- case 182: /* predicate */
- case 185: /* in_predicate_value */
- case 186: /* boolean_value_expression */
- case 187: /* boolean_primary */
- case 188: /* common_expression */
- case 189: /* from_clause */
- case 190: /* table_reference_list */
- case 191: /* table_reference */
- case 192: /* table_primary */
- case 193: /* joined_table */
- case 195: /* parenthesized_joined_table */
- case 197: /* search_condition */
- case 198: /* query_specification */
- case 201: /* where_clause_opt */
- case 203: /* twindow_clause_opt */
- case 205: /* having_clause_opt */
- case 207: /* select_item */
- case 208: /* fill_opt */
- case 211: /* query_expression_body */
- case 213: /* slimit_clause_opt */
- case 214: /* limit_clause_opt */
- case 215: /* query_primary */
- case 217: /* sort_specification */
+ case 160: /* cmd */
+ case 163: /* literal */
+ case 170: /* db_options */
+ case 172: /* alter_db_options */
+ case 174: /* full_table_name */
+ case 177: /* table_options */
+ case 181: /* alter_table_clause */
+ case 182: /* alter_table_options */
+ case 185: /* create_subtable_clause */
+ case 188: /* drop_table_clause */
+ case 191: /* column_def */
+ case 194: /* col_name */
+ case 195: /* func_name */
+ case 198: /* index_options */
+ case 200: /* duration_literal */
+ case 201: /* sliding_opt */
+ case 202: /* func */
+ case 205: /* query_expression */
+ case 208: /* expression */
+ case 209: /* column_reference */
+ case 210: /* subquery */
+ case 211: /* predicate */
+ case 214: /* in_predicate_value */
+ case 215: /* boolean_value_expression */
+ case 216: /* boolean_primary */
+ case 217: /* common_expression */
+ case 218: /* from_clause */
+ case 219: /* table_reference_list */
+ case 220: /* table_reference */
+ case 221: /* table_primary */
+ case 222: /* joined_table */
+ case 224: /* parenthesized_joined_table */
+ case 226: /* search_condition */
+ case 227: /* query_specification */
+ case 230: /* where_clause_opt */
+ case 232: /* twindow_clause_opt */
+ case 234: /* having_clause_opt */
+ case 236: /* select_item */
+ case 237: /* fill_opt */
+ case 240: /* query_expression_body */
+ case 242: /* slimit_clause_opt */
+ case 243: /* limit_clause_opt */
+ case 244: /* query_primary */
+ case 246: /* sort_specification */
{
- nodesDestroyNode((yypminor->yy432));
+ nodesDestroyNode((yypminor->yy26));
}
break;
- case 142: /* user_name */
- case 143: /* dnode_endpoint */
- case 144: /* dnode_host_name */
- case 146: /* db_name */
- case 161: /* table_name */
- case 163: /* column_name */
- case 166: /* index_name */
- case 172: /* function_name */
- case 174: /* topic_name */
- case 177: /* table_alias */
- case 178: /* column_alias */
- case 194: /* alias_opt */
+ case 161: /* account_options */
+ case 162: /* alter_account_options */
+ case 164: /* alter_account_option */
{
}
break;
- case 145: /* not_exists_opt */
- case 148: /* exists_opt */
- case 199: /* set_quantifier_opt */
+ case 165: /* user_name */
+ case 166: /* dnode_endpoint */
+ case 167: /* dnode_host_name */
+ case 169: /* db_name */
+ case 183: /* column_name */
+ case 190: /* table_name */
+ case 196: /* function_name */
+ case 197: /* index_name */
+ case 204: /* topic_name */
+ case 206: /* table_alias */
+ case 207: /* column_alias */
+ case 223: /* alias_opt */
{
}
break;
- case 150: /* column_def_list */
- case 151: /* tags_def_opt */
- case 153: /* multi_create_clause */
- case 154: /* tags_def */
- case 155: /* multi_drop_clause */
- case 157: /* specific_tags_opt */
- case 158: /* literal_list */
- case 160: /* col_name_list */
- case 168: /* func_list */
- case 173: /* expression_list */
- case 200: /* select_list */
- case 202: /* partition_by_clause_opt */
- case 204: /* group_by_clause_opt */
- case 206: /* select_sublist */
- case 210: /* group_by_list */
- case 212: /* order_by_clause_opt */
- case 216: /* sort_specification_list */
-{
- nodesDestroyList((yypminor->yy24));
-}
- break;
- case 164: /* type_name */
+ case 168: /* not_exists_opt */
+ case 171: /* exists_opt */
+ case 228: /* set_quantifier_opt */
{
}
break;
- case 183: /* compare_op */
- case 184: /* in_op */
+ case 173: /* alter_db_option */
+ case 193: /* alter_table_option */
{
}
break;
- case 196: /* join_type */
+ case 175: /* column_def_list */
+ case 176: /* tags_def_opt */
+ case 178: /* multi_create_clause */
+ case 179: /* tags_def */
+ case 180: /* multi_drop_clause */
+ case 186: /* specific_tags_opt */
+ case 187: /* literal_list */
+ case 189: /* col_name_list */
+ case 192: /* func_name_list */
+ case 199: /* func_list */
+ case 203: /* expression_list */
+ case 229: /* select_list */
+ case 231: /* partition_by_clause_opt */
+ case 233: /* group_by_clause_opt */
+ case 235: /* select_sublist */
+ case 239: /* group_by_list */
+ case 241: /* order_by_clause_opt */
+ case 245: /* sort_specification_list */
+{
+ nodesDestroyList((yypminor->yy64));
+}
+ break;
+ case 184: /* type_name */
{
}
break;
- case 209: /* fill_mode */
+ case 212: /* compare_op */
+ case 213: /* in_op */
{
}
break;
- case 218: /* ordering_specification_opt */
+ case 225: /* join_type */
{
}
break;
- case 219: /* null_ordering_opt */
+ case 238: /* fill_mode */
+{
+
+}
+ break;
+ case 247: /* ordering_specification_opt */
+{
+
+}
+ break;
+ case 248: /* null_ordering_opt */
{
}
@@ -1649,261 +1816,322 @@ static const struct {
YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
signed char nrhs; /* Negative of the number of RHS symbols in the rule */
} yyRuleInfo[] = {
- { 141, -5 }, /* (0) cmd ::= CREATE USER user_name PASS NK_STRING */
- { 141, -5 }, /* (1) cmd ::= ALTER USER user_name PASS NK_STRING */
- { 141, -5 }, /* (2) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
- { 141, -3 }, /* (3) cmd ::= DROP USER user_name */
- { 141, -2 }, /* (4) cmd ::= SHOW USERS */
- { 141, -3 }, /* (5) cmd ::= CREATE DNODE dnode_endpoint */
- { 141, -5 }, /* (6) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
- { 141, -3 }, /* (7) cmd ::= DROP DNODE NK_INTEGER */
- { 141, -3 }, /* (8) cmd ::= DROP DNODE dnode_endpoint */
- { 141, -2 }, /* (9) cmd ::= SHOW DNODES */
- { 143, -1 }, /* (10) dnode_endpoint ::= NK_STRING */
- { 144, -1 }, /* (11) dnode_host_name ::= NK_ID */
- { 144, -1 }, /* (12) dnode_host_name ::= NK_IPTOKEN */
- { 141, -5 }, /* (13) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
- { 141, -5 }, /* (14) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
- { 141, -2 }, /* (15) cmd ::= SHOW QNODES */
- { 141, -5 }, /* (16) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
- { 141, -4 }, /* (17) cmd ::= DROP DATABASE exists_opt db_name */
- { 141, -2 }, /* (18) cmd ::= SHOW DATABASES */
- { 141, -2 }, /* (19) cmd ::= USE db_name */
- { 141, -4 }, /* (20) cmd ::= ALTER DATABASE db_name db_options */
- { 145, -3 }, /* (21) not_exists_opt ::= IF NOT EXISTS */
- { 145, 0 }, /* (22) not_exists_opt ::= */
- { 148, -2 }, /* (23) exists_opt ::= IF EXISTS */
- { 148, 0 }, /* (24) exists_opt ::= */
- { 147, 0 }, /* (25) db_options ::= */
- { 147, -3 }, /* (26) db_options ::= db_options BLOCKS NK_INTEGER */
- { 147, -3 }, /* (27) db_options ::= db_options CACHE NK_INTEGER */
- { 147, -3 }, /* (28) db_options ::= db_options CACHELAST NK_INTEGER */
- { 147, -3 }, /* (29) db_options ::= db_options COMP NK_INTEGER */
- { 147, -3 }, /* (30) db_options ::= db_options DAYS NK_INTEGER */
- { 147, -3 }, /* (31) db_options ::= db_options FSYNC NK_INTEGER */
- { 147, -3 }, /* (32) db_options ::= db_options MAXROWS NK_INTEGER */
- { 147, -3 }, /* (33) db_options ::= db_options MINROWS NK_INTEGER */
- { 147, -3 }, /* (34) db_options ::= db_options KEEP NK_INTEGER */
- { 147, -3 }, /* (35) db_options ::= db_options PRECISION NK_STRING */
- { 147, -3 }, /* (36) db_options ::= db_options QUORUM NK_INTEGER */
- { 147, -3 }, /* (37) db_options ::= db_options REPLICA NK_INTEGER */
- { 147, -3 }, /* (38) db_options ::= db_options TTL NK_INTEGER */
- { 147, -3 }, /* (39) db_options ::= db_options WAL NK_INTEGER */
- { 147, -3 }, /* (40) db_options ::= db_options VGROUPS NK_INTEGER */
- { 147, -3 }, /* (41) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
- { 147, -3 }, /* (42) db_options ::= db_options STREAM_MODE NK_INTEGER */
- { 141, -9 }, /* (43) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
- { 141, -3 }, /* (44) cmd ::= CREATE TABLE multi_create_clause */
- { 141, -9 }, /* (45) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
- { 141, -3 }, /* (46) cmd ::= DROP TABLE multi_drop_clause */
- { 141, -4 }, /* (47) cmd ::= DROP STABLE exists_opt full_table_name */
- { 141, -2 }, /* (48) cmd ::= SHOW TABLES */
- { 141, -2 }, /* (49) cmd ::= SHOW STABLES */
- { 153, -1 }, /* (50) multi_create_clause ::= create_subtable_clause */
- { 153, -2 }, /* (51) multi_create_clause ::= multi_create_clause create_subtable_clause */
- { 156, -9 }, /* (52) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
- { 155, -1 }, /* (53) multi_drop_clause ::= drop_table_clause */
- { 155, -2 }, /* (54) multi_drop_clause ::= multi_drop_clause drop_table_clause */
- { 159, -2 }, /* (55) drop_table_clause ::= exists_opt full_table_name */
- { 157, 0 }, /* (56) specific_tags_opt ::= */
- { 157, -3 }, /* (57) specific_tags_opt ::= NK_LP col_name_list NK_RP */
- { 149, -1 }, /* (58) full_table_name ::= table_name */
- { 149, -3 }, /* (59) full_table_name ::= db_name NK_DOT table_name */
- { 150, -1 }, /* (60) column_def_list ::= column_def */
- { 150, -3 }, /* (61) column_def_list ::= column_def_list NK_COMMA column_def */
- { 162, -2 }, /* (62) column_def ::= column_name type_name */
- { 162, -4 }, /* (63) column_def ::= column_name type_name COMMENT NK_STRING */
- { 164, -1 }, /* (64) type_name ::= BOOL */
- { 164, -1 }, /* (65) type_name ::= TINYINT */
- { 164, -1 }, /* (66) type_name ::= SMALLINT */
- { 164, -1 }, /* (67) type_name ::= INT */
- { 164, -1 }, /* (68) type_name ::= INTEGER */
- { 164, -1 }, /* (69) type_name ::= BIGINT */
- { 164, -1 }, /* (70) type_name ::= FLOAT */
- { 164, -1 }, /* (71) type_name ::= DOUBLE */
- { 164, -4 }, /* (72) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
- { 164, -1 }, /* (73) type_name ::= TIMESTAMP */
- { 164, -4 }, /* (74) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
- { 164, -2 }, /* (75) type_name ::= TINYINT UNSIGNED */
- { 164, -2 }, /* (76) type_name ::= SMALLINT UNSIGNED */
- { 164, -2 }, /* (77) type_name ::= INT UNSIGNED */
- { 164, -2 }, /* (78) type_name ::= BIGINT UNSIGNED */
- { 164, -1 }, /* (79) type_name ::= JSON */
- { 164, -4 }, /* (80) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
- { 164, -1 }, /* (81) type_name ::= MEDIUMBLOB */
- { 164, -1 }, /* (82) type_name ::= BLOB */
- { 164, -4 }, /* (83) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
- { 164, -1 }, /* (84) type_name ::= DECIMAL */
- { 164, -4 }, /* (85) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
- { 164, -6 }, /* (86) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
- { 151, 0 }, /* (87) tags_def_opt ::= */
- { 151, -1 }, /* (88) tags_def_opt ::= tags_def */
- { 154, -4 }, /* (89) tags_def ::= TAGS NK_LP column_def_list NK_RP */
- { 152, 0 }, /* (90) table_options ::= */
- { 152, -3 }, /* (91) table_options ::= table_options COMMENT NK_STRING */
- { 152, -3 }, /* (92) table_options ::= table_options KEEP NK_INTEGER */
- { 152, -3 }, /* (93) table_options ::= table_options TTL NK_INTEGER */
- { 152, -5 }, /* (94) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
- { 160, -1 }, /* (95) col_name_list ::= col_name */
- { 160, -3 }, /* (96) col_name_list ::= col_name_list NK_COMMA col_name */
- { 165, -1 }, /* (97) col_name ::= column_name */
- { 141, -7 }, /* (98) cmd ::= CREATE SMA INDEX index_name ON table_name index_options */
- { 141, -9 }, /* (99) cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP */
- { 141, -5 }, /* (100) cmd ::= DROP INDEX index_name ON table_name */
- { 167, 0 }, /* (101) index_options ::= */
- { 167, -9 }, /* (102) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
- { 167, -11 }, /* (103) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
- { 168, -1 }, /* (104) func_list ::= func */
- { 168, -3 }, /* (105) func_list ::= func_list NK_COMMA func */
- { 171, -4 }, /* (106) func ::= function_name NK_LP expression_list NK_RP */
- { 141, -6 }, /* (107) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
- { 141, -6 }, /* (108) cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
- { 141, -4 }, /* (109) cmd ::= DROP TOPIC exists_opt topic_name */
- { 141, -2 }, /* (110) cmd ::= SHOW VGROUPS */
- { 141, -4 }, /* (111) cmd ::= SHOW db_name NK_DOT VGROUPS */
- { 141, -2 }, /* (112) cmd ::= SHOW MNODES */
- { 141, -1 }, /* (113) cmd ::= query_expression */
- { 176, -1 }, /* (114) literal ::= NK_INTEGER */
- { 176, -1 }, /* (115) literal ::= NK_FLOAT */
- { 176, -1 }, /* (116) literal ::= NK_STRING */
- { 176, -1 }, /* (117) literal ::= NK_BOOL */
- { 176, -2 }, /* (118) literal ::= TIMESTAMP NK_STRING */
- { 176, -1 }, /* (119) literal ::= duration_literal */
- { 169, -1 }, /* (120) duration_literal ::= NK_VARIABLE */
- { 158, -1 }, /* (121) literal_list ::= literal */
- { 158, -3 }, /* (122) literal_list ::= literal_list NK_COMMA literal */
- { 146, -1 }, /* (123) db_name ::= NK_ID */
- { 161, -1 }, /* (124) table_name ::= NK_ID */
- { 163, -1 }, /* (125) column_name ::= NK_ID */
- { 172, -1 }, /* (126) function_name ::= NK_ID */
- { 177, -1 }, /* (127) table_alias ::= NK_ID */
- { 178, -1 }, /* (128) column_alias ::= NK_ID */
- { 142, -1 }, /* (129) user_name ::= NK_ID */
- { 166, -1 }, /* (130) index_name ::= NK_ID */
- { 174, -1 }, /* (131) topic_name ::= NK_ID */
- { 179, -1 }, /* (132) expression ::= literal */
- { 179, -1 }, /* (133) expression ::= column_reference */
- { 179, -4 }, /* (134) expression ::= function_name NK_LP expression_list NK_RP */
- { 179, -4 }, /* (135) expression ::= function_name NK_LP NK_STAR NK_RP */
- { 179, -1 }, /* (136) expression ::= subquery */
- { 179, -3 }, /* (137) expression ::= NK_LP expression NK_RP */
- { 179, -2 }, /* (138) expression ::= NK_PLUS expression */
- { 179, -2 }, /* (139) expression ::= NK_MINUS expression */
- { 179, -3 }, /* (140) expression ::= expression NK_PLUS expression */
- { 179, -3 }, /* (141) expression ::= expression NK_MINUS expression */
- { 179, -3 }, /* (142) expression ::= expression NK_STAR expression */
- { 179, -3 }, /* (143) expression ::= expression NK_SLASH expression */
- { 179, -3 }, /* (144) expression ::= expression NK_REM expression */
- { 173, -1 }, /* (145) expression_list ::= expression */
- { 173, -3 }, /* (146) expression_list ::= expression_list NK_COMMA expression */
- { 180, -1 }, /* (147) column_reference ::= column_name */
- { 180, -3 }, /* (148) column_reference ::= table_name NK_DOT column_name */
- { 182, -3 }, /* (149) predicate ::= expression compare_op expression */
- { 182, -5 }, /* (150) predicate ::= expression BETWEEN expression AND expression */
- { 182, -6 }, /* (151) predicate ::= expression NOT BETWEEN expression AND expression */
- { 182, -3 }, /* (152) predicate ::= expression IS NULL */
- { 182, -4 }, /* (153) predicate ::= expression IS NOT NULL */
- { 182, -3 }, /* (154) predicate ::= expression in_op in_predicate_value */
- { 183, -1 }, /* (155) compare_op ::= NK_LT */
- { 183, -1 }, /* (156) compare_op ::= NK_GT */
- { 183, -1 }, /* (157) compare_op ::= NK_LE */
- { 183, -1 }, /* (158) compare_op ::= NK_GE */
- { 183, -1 }, /* (159) compare_op ::= NK_NE */
- { 183, -1 }, /* (160) compare_op ::= NK_EQ */
- { 183, -1 }, /* (161) compare_op ::= LIKE */
- { 183, -2 }, /* (162) compare_op ::= NOT LIKE */
- { 183, -1 }, /* (163) compare_op ::= MATCH */
- { 183, -1 }, /* (164) compare_op ::= NMATCH */
- { 184, -1 }, /* (165) in_op ::= IN */
- { 184, -2 }, /* (166) in_op ::= NOT IN */
- { 185, -3 }, /* (167) in_predicate_value ::= NK_LP expression_list NK_RP */
- { 186, -1 }, /* (168) boolean_value_expression ::= boolean_primary */
- { 186, -2 }, /* (169) boolean_value_expression ::= NOT boolean_primary */
- { 186, -3 }, /* (170) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
- { 186, -3 }, /* (171) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
- { 187, -1 }, /* (172) boolean_primary ::= predicate */
- { 187, -3 }, /* (173) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
- { 188, -1 }, /* (174) common_expression ::= expression */
- { 188, -1 }, /* (175) common_expression ::= boolean_value_expression */
- { 189, -2 }, /* (176) from_clause ::= FROM table_reference_list */
- { 190, -1 }, /* (177) table_reference_list ::= table_reference */
- { 190, -3 }, /* (178) table_reference_list ::= table_reference_list NK_COMMA table_reference */
- { 191, -1 }, /* (179) table_reference ::= table_primary */
- { 191, -1 }, /* (180) table_reference ::= joined_table */
- { 192, -2 }, /* (181) table_primary ::= table_name alias_opt */
- { 192, -4 }, /* (182) table_primary ::= db_name NK_DOT table_name alias_opt */
- { 192, -2 }, /* (183) table_primary ::= subquery alias_opt */
- { 192, -1 }, /* (184) table_primary ::= parenthesized_joined_table */
- { 194, 0 }, /* (185) alias_opt ::= */
- { 194, -1 }, /* (186) alias_opt ::= table_alias */
- { 194, -2 }, /* (187) alias_opt ::= AS table_alias */
- { 195, -3 }, /* (188) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
- { 195, -3 }, /* (189) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
- { 193, -6 }, /* (190) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
- { 196, 0 }, /* (191) join_type ::= */
- { 196, -1 }, /* (192) join_type ::= INNER */
- { 198, -9 }, /* (193) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
- { 199, 0 }, /* (194) set_quantifier_opt ::= */
- { 199, -1 }, /* (195) set_quantifier_opt ::= DISTINCT */
- { 199, -1 }, /* (196) set_quantifier_opt ::= ALL */
- { 200, -1 }, /* (197) select_list ::= NK_STAR */
- { 200, -1 }, /* (198) select_list ::= select_sublist */
- { 206, -1 }, /* (199) select_sublist ::= select_item */
- { 206, -3 }, /* (200) select_sublist ::= select_sublist NK_COMMA select_item */
- { 207, -1 }, /* (201) select_item ::= common_expression */
- { 207, -2 }, /* (202) select_item ::= common_expression column_alias */
- { 207, -3 }, /* (203) select_item ::= common_expression AS column_alias */
- { 207, -3 }, /* (204) select_item ::= table_name NK_DOT NK_STAR */
- { 201, 0 }, /* (205) where_clause_opt ::= */
- { 201, -2 }, /* (206) where_clause_opt ::= WHERE search_condition */
- { 202, 0 }, /* (207) partition_by_clause_opt ::= */
- { 202, -3 }, /* (208) partition_by_clause_opt ::= PARTITION BY expression_list */
- { 203, 0 }, /* (209) twindow_clause_opt ::= */
- { 203, -6 }, /* (210) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */
- { 203, -4 }, /* (211) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
- { 203, -6 }, /* (212) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
- { 203, -8 }, /* (213) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
- { 170, 0 }, /* (214) sliding_opt ::= */
- { 170, -4 }, /* (215) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
- { 208, 0 }, /* (216) fill_opt ::= */
- { 208, -4 }, /* (217) fill_opt ::= FILL NK_LP fill_mode NK_RP */
- { 208, -6 }, /* (218) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
- { 209, -1 }, /* (219) fill_mode ::= NONE */
- { 209, -1 }, /* (220) fill_mode ::= PREV */
- { 209, -1 }, /* (221) fill_mode ::= NULL */
- { 209, -1 }, /* (222) fill_mode ::= LINEAR */
- { 209, -1 }, /* (223) fill_mode ::= NEXT */
- { 204, 0 }, /* (224) group_by_clause_opt ::= */
- { 204, -3 }, /* (225) group_by_clause_opt ::= GROUP BY group_by_list */
- { 210, -1 }, /* (226) group_by_list ::= expression */
- { 210, -3 }, /* (227) group_by_list ::= group_by_list NK_COMMA expression */
- { 205, 0 }, /* (228) having_clause_opt ::= */
- { 205, -2 }, /* (229) having_clause_opt ::= HAVING search_condition */
- { 175, -4 }, /* (230) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
- { 211, -1 }, /* (231) query_expression_body ::= query_primary */
- { 211, -4 }, /* (232) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
- { 215, -1 }, /* (233) query_primary ::= query_specification */
- { 212, 0 }, /* (234) order_by_clause_opt ::= */
- { 212, -3 }, /* (235) order_by_clause_opt ::= ORDER BY sort_specification_list */
- { 213, 0 }, /* (236) slimit_clause_opt ::= */
- { 213, -2 }, /* (237) slimit_clause_opt ::= SLIMIT NK_INTEGER */
- { 213, -4 }, /* (238) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
- { 213, -4 }, /* (239) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- { 214, 0 }, /* (240) limit_clause_opt ::= */
- { 214, -2 }, /* (241) limit_clause_opt ::= LIMIT NK_INTEGER */
- { 214, -4 }, /* (242) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
- { 214, -4 }, /* (243) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- { 181, -3 }, /* (244) subquery ::= NK_LP query_expression NK_RP */
- { 197, -1 }, /* (245) search_condition ::= common_expression */
- { 216, -1 }, /* (246) sort_specification_list ::= sort_specification */
- { 216, -3 }, /* (247) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
- { 217, -3 }, /* (248) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
- { 218, 0 }, /* (249) ordering_specification_opt ::= */
- { 218, -1 }, /* (250) ordering_specification_opt ::= ASC */
- { 218, -1 }, /* (251) ordering_specification_opt ::= DESC */
- { 219, 0 }, /* (252) null_ordering_opt ::= */
- { 219, -2 }, /* (253) null_ordering_opt ::= NULLS FIRST */
- { 219, -2 }, /* (254) null_ordering_opt ::= NULLS LAST */
+ { 160, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
+ { 160, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
+ { 161, 0 }, /* (2) account_options ::= */
+ { 161, -3 }, /* (3) account_options ::= account_options PPS literal */
+ { 161, -3 }, /* (4) account_options ::= account_options TSERIES literal */
+ { 161, -3 }, /* (5) account_options ::= account_options STORAGE literal */
+ { 161, -3 }, /* (6) account_options ::= account_options STREAMS literal */
+ { 161, -3 }, /* (7) account_options ::= account_options QTIME literal */
+ { 161, -3 }, /* (8) account_options ::= account_options DBS literal */
+ { 161, -3 }, /* (9) account_options ::= account_options USERS literal */
+ { 161, -3 }, /* (10) account_options ::= account_options CONNS literal */
+ { 161, -3 }, /* (11) account_options ::= account_options STATE literal */
+ { 162, -1 }, /* (12) alter_account_options ::= alter_account_option */
+ { 162, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
+ { 164, -2 }, /* (14) alter_account_option ::= PASS literal */
+ { 164, -2 }, /* (15) alter_account_option ::= PPS literal */
+ { 164, -2 }, /* (16) alter_account_option ::= TSERIES literal */
+ { 164, -2 }, /* (17) alter_account_option ::= STORAGE literal */
+ { 164, -2 }, /* (18) alter_account_option ::= STREAMS literal */
+ { 164, -2 }, /* (19) alter_account_option ::= QTIME literal */
+ { 164, -2 }, /* (20) alter_account_option ::= DBS literal */
+ { 164, -2 }, /* (21) alter_account_option ::= USERS literal */
+ { 164, -2 }, /* (22) alter_account_option ::= CONNS literal */
+ { 164, -2 }, /* (23) alter_account_option ::= STATE literal */
+ { 160, -5 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */
+ { 160, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
+ { 160, -5 }, /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
+ { 160, -3 }, /* (27) cmd ::= DROP USER user_name */
+ { 160, -2 }, /* (28) cmd ::= SHOW USERS */
+ { 160, -3 }, /* (29) cmd ::= CREATE DNODE dnode_endpoint */
+ { 160, -5 }, /* (30) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
+ { 160, -3 }, /* (31) cmd ::= DROP DNODE NK_INTEGER */
+ { 160, -3 }, /* (32) cmd ::= DROP DNODE dnode_endpoint */
+ { 160, -2 }, /* (33) cmd ::= SHOW DNODES */
+ { 160, -4 }, /* (34) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
+ { 160, -5 }, /* (35) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
+ { 160, -4 }, /* (36) cmd ::= ALTER ALL DNODES NK_STRING */
+ { 160, -5 }, /* (37) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
+ { 166, -1 }, /* (38) dnode_endpoint ::= NK_STRING */
+ { 167, -1 }, /* (39) dnode_host_name ::= NK_ID */
+ { 167, -1 }, /* (40) dnode_host_name ::= NK_IPTOKEN */
+ { 160, -3 }, /* (41) cmd ::= ALTER LOCAL NK_STRING */
+ { 160, -4 }, /* (42) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
+ { 160, -5 }, /* (43) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
+ { 160, -5 }, /* (44) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
+ { 160, -2 }, /* (45) cmd ::= SHOW QNODES */
+ { 160, -5 }, /* (46) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
+ { 160, -4 }, /* (47) cmd ::= DROP DATABASE exists_opt db_name */
+ { 160, -2 }, /* (48) cmd ::= SHOW DATABASES */
+ { 160, -2 }, /* (49) cmd ::= USE db_name */
+ { 160, -4 }, /* (50) cmd ::= ALTER DATABASE db_name alter_db_options */
+ { 168, -3 }, /* (51) not_exists_opt ::= IF NOT EXISTS */
+ { 168, 0 }, /* (52) not_exists_opt ::= */
+ { 171, -2 }, /* (53) exists_opt ::= IF EXISTS */
+ { 171, 0 }, /* (54) exists_opt ::= */
+ { 170, 0 }, /* (55) db_options ::= */
+ { 170, -3 }, /* (56) db_options ::= db_options BLOCKS NK_INTEGER */
+ { 170, -3 }, /* (57) db_options ::= db_options CACHE NK_INTEGER */
+ { 170, -3 }, /* (58) db_options ::= db_options CACHELAST NK_INTEGER */
+ { 170, -3 }, /* (59) db_options ::= db_options COMP NK_INTEGER */
+ { 170, -3 }, /* (60) db_options ::= db_options DAYS NK_INTEGER */
+ { 170, -3 }, /* (61) db_options ::= db_options FSYNC NK_INTEGER */
+ { 170, -3 }, /* (62) db_options ::= db_options MAXROWS NK_INTEGER */
+ { 170, -3 }, /* (63) db_options ::= db_options MINROWS NK_INTEGER */
+ { 170, -3 }, /* (64) db_options ::= db_options KEEP NK_INTEGER */
+ { 170, -3 }, /* (65) db_options ::= db_options PRECISION NK_STRING */
+ { 170, -3 }, /* (66) db_options ::= db_options QUORUM NK_INTEGER */
+ { 170, -3 }, /* (67) db_options ::= db_options REPLICA NK_INTEGER */
+ { 170, -3 }, /* (68) db_options ::= db_options TTL NK_INTEGER */
+ { 170, -3 }, /* (69) db_options ::= db_options WAL NK_INTEGER */
+ { 170, -3 }, /* (70) db_options ::= db_options VGROUPS NK_INTEGER */
+ { 170, -3 }, /* (71) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
+ { 170, -3 }, /* (72) db_options ::= db_options STREAM_MODE NK_INTEGER */
+ { 170, -3 }, /* (73) db_options ::= db_options RETENTIONS NK_STRING */
+ { 170, -3 }, /* (74) db_options ::= db_options FILE_FACTOR NK_FLOAT */
+ { 172, -1 }, /* (75) alter_db_options ::= alter_db_option */
+ { 172, -2 }, /* (76) alter_db_options ::= alter_db_options alter_db_option */
+ { 173, -2 }, /* (77) alter_db_option ::= BLOCKS NK_INTEGER */
+ { 173, -2 }, /* (78) alter_db_option ::= FSYNC NK_INTEGER */
+ { 173, -2 }, /* (79) alter_db_option ::= KEEP NK_INTEGER */
+ { 173, -2 }, /* (80) alter_db_option ::= WAL NK_INTEGER */
+ { 173, -2 }, /* (81) alter_db_option ::= QUORUM NK_INTEGER */
+ { 173, -2 }, /* (82) alter_db_option ::= CACHELAST NK_INTEGER */
+ { 160, -9 }, /* (83) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
+ { 160, -3 }, /* (84) cmd ::= CREATE TABLE multi_create_clause */
+ { 160, -9 }, /* (85) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
+ { 160, -3 }, /* (86) cmd ::= DROP TABLE multi_drop_clause */
+ { 160, -4 }, /* (87) cmd ::= DROP STABLE exists_opt full_table_name */
+ { 160, -2 }, /* (88) cmd ::= SHOW TABLES */
+ { 160, -2 }, /* (89) cmd ::= SHOW STABLES */
+ { 160, -3 }, /* (90) cmd ::= ALTER TABLE alter_table_clause */
+ { 160, -3 }, /* (91) cmd ::= ALTER STABLE alter_table_clause */
+ { 181, -2 }, /* (92) alter_table_clause ::= full_table_name alter_table_options */
+ { 181, -5 }, /* (93) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
+ { 181, -4 }, /* (94) alter_table_clause ::= full_table_name DROP COLUMN column_name */
+ { 181, -5 }, /* (95) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
+ { 181, -5 }, /* (96) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
+ { 181, -5 }, /* (97) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
+ { 181, -4 }, /* (98) alter_table_clause ::= full_table_name DROP TAG column_name */
+ { 181, -5 }, /* (99) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
+ { 181, -5 }, /* (100) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
+ { 181, -6 }, /* (101) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
+ { 178, -1 }, /* (102) multi_create_clause ::= create_subtable_clause */
+ { 178, -2 }, /* (103) multi_create_clause ::= multi_create_clause create_subtable_clause */
+ { 185, -9 }, /* (104) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
+ { 180, -1 }, /* (105) multi_drop_clause ::= drop_table_clause */
+ { 180, -2 }, /* (106) multi_drop_clause ::= multi_drop_clause drop_table_clause */
+ { 188, -2 }, /* (107) drop_table_clause ::= exists_opt full_table_name */
+ { 186, 0 }, /* (108) specific_tags_opt ::= */
+ { 186, -3 }, /* (109) specific_tags_opt ::= NK_LP col_name_list NK_RP */
+ { 174, -1 }, /* (110) full_table_name ::= table_name */
+ { 174, -3 }, /* (111) full_table_name ::= db_name NK_DOT table_name */
+ { 175, -1 }, /* (112) column_def_list ::= column_def */
+ { 175, -3 }, /* (113) column_def_list ::= column_def_list NK_COMMA column_def */
+ { 191, -2 }, /* (114) column_def ::= column_name type_name */
+ { 191, -4 }, /* (115) column_def ::= column_name type_name COMMENT NK_STRING */
+ { 184, -1 }, /* (116) type_name ::= BOOL */
+ { 184, -1 }, /* (117) type_name ::= TINYINT */
+ { 184, -1 }, /* (118) type_name ::= SMALLINT */
+ { 184, -1 }, /* (119) type_name ::= INT */
+ { 184, -1 }, /* (120) type_name ::= INTEGER */
+ { 184, -1 }, /* (121) type_name ::= BIGINT */
+ { 184, -1 }, /* (122) type_name ::= FLOAT */
+ { 184, -1 }, /* (123) type_name ::= DOUBLE */
+ { 184, -4 }, /* (124) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
+ { 184, -1 }, /* (125) type_name ::= TIMESTAMP */
+ { 184, -4 }, /* (126) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
+ { 184, -2 }, /* (127) type_name ::= TINYINT UNSIGNED */
+ { 184, -2 }, /* (128) type_name ::= SMALLINT UNSIGNED */
+ { 184, -2 }, /* (129) type_name ::= INT UNSIGNED */
+ { 184, -2 }, /* (130) type_name ::= BIGINT UNSIGNED */
+ { 184, -1 }, /* (131) type_name ::= JSON */
+ { 184, -4 }, /* (132) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
+ { 184, -1 }, /* (133) type_name ::= MEDIUMBLOB */
+ { 184, -1 }, /* (134) type_name ::= BLOB */
+ { 184, -4 }, /* (135) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
+ { 184, -1 }, /* (136) type_name ::= DECIMAL */
+ { 184, -4 }, /* (137) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
+ { 184, -6 }, /* (138) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
+ { 176, 0 }, /* (139) tags_def_opt ::= */
+ { 176, -1 }, /* (140) tags_def_opt ::= tags_def */
+ { 179, -4 }, /* (141) tags_def ::= TAGS NK_LP column_def_list NK_RP */
+ { 177, 0 }, /* (142) table_options ::= */
+ { 177, -3 }, /* (143) table_options ::= table_options COMMENT NK_STRING */
+ { 177, -3 }, /* (144) table_options ::= table_options KEEP NK_INTEGER */
+ { 177, -3 }, /* (145) table_options ::= table_options TTL NK_INTEGER */
+ { 177, -5 }, /* (146) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
+ { 177, -5 }, /* (147) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
+ { 182, -1 }, /* (148) alter_table_options ::= alter_table_option */
+ { 182, -2 }, /* (149) alter_table_options ::= alter_table_options alter_table_option */
+ { 193, -2 }, /* (150) alter_table_option ::= COMMENT NK_STRING */
+ { 193, -2 }, /* (151) alter_table_option ::= KEEP NK_INTEGER */
+ { 193, -2 }, /* (152) alter_table_option ::= TTL NK_INTEGER */
+ { 189, -1 }, /* (153) col_name_list ::= col_name */
+ { 189, -3 }, /* (154) col_name_list ::= col_name_list NK_COMMA col_name */
+ { 194, -1 }, /* (155) col_name ::= column_name */
+ { 192, -1 }, /* (156) func_name_list ::= func_name */
+ { 192, -3 }, /* (157) func_name_list ::= func_name_list NK_COMMA col_name */
+ { 195, -1 }, /* (158) func_name ::= function_name */
+ { 160, -7 }, /* (159) cmd ::= CREATE SMA INDEX index_name ON table_name index_options */
+ { 160, -9 }, /* (160) cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP */
+ { 160, -5 }, /* (161) cmd ::= DROP INDEX index_name ON table_name */
+ { 198, 0 }, /* (162) index_options ::= */
+ { 198, -9 }, /* (163) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
+ { 198, -11 }, /* (164) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
+ { 199, -1 }, /* (165) func_list ::= func */
+ { 199, -3 }, /* (166) func_list ::= func_list NK_COMMA func */
+ { 202, -4 }, /* (167) func ::= function_name NK_LP expression_list NK_RP */
+ { 160, -6 }, /* (168) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
+ { 160, -6 }, /* (169) cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
+ { 160, -4 }, /* (170) cmd ::= DROP TOPIC exists_opt topic_name */
+ { 160, -2 }, /* (171) cmd ::= SHOW VGROUPS */
+ { 160, -4 }, /* (172) cmd ::= SHOW db_name NK_DOT VGROUPS */
+ { 160, -2 }, /* (173) cmd ::= SHOW MNODES */
+ { 160, -1 }, /* (174) cmd ::= query_expression */
+ { 163, -1 }, /* (175) literal ::= NK_INTEGER */
+ { 163, -1 }, /* (176) literal ::= NK_FLOAT */
+ { 163, -1 }, /* (177) literal ::= NK_STRING */
+ { 163, -1 }, /* (178) literal ::= NK_BOOL */
+ { 163, -2 }, /* (179) literal ::= TIMESTAMP NK_STRING */
+ { 163, -1 }, /* (180) literal ::= duration_literal */
+ { 200, -1 }, /* (181) duration_literal ::= NK_VARIABLE */
+ { 187, -1 }, /* (182) literal_list ::= literal */
+ { 187, -3 }, /* (183) literal_list ::= literal_list NK_COMMA literal */
+ { 169, -1 }, /* (184) db_name ::= NK_ID */
+ { 190, -1 }, /* (185) table_name ::= NK_ID */
+ { 183, -1 }, /* (186) column_name ::= NK_ID */
+ { 196, -1 }, /* (187) function_name ::= NK_ID */
+ { 206, -1 }, /* (188) table_alias ::= NK_ID */
+ { 207, -1 }, /* (189) column_alias ::= NK_ID */
+ { 165, -1 }, /* (190) user_name ::= NK_ID */
+ { 197, -1 }, /* (191) index_name ::= NK_ID */
+ { 204, -1 }, /* (192) topic_name ::= NK_ID */
+ { 208, -1 }, /* (193) expression ::= literal */
+ { 208, -1 }, /* (194) expression ::= column_reference */
+ { 208, -4 }, /* (195) expression ::= function_name NK_LP expression_list NK_RP */
+ { 208, -4 }, /* (196) expression ::= function_name NK_LP NK_STAR NK_RP */
+ { 208, -1 }, /* (197) expression ::= subquery */
+ { 208, -3 }, /* (198) expression ::= NK_LP expression NK_RP */
+ { 208, -2 }, /* (199) expression ::= NK_PLUS expression */
+ { 208, -2 }, /* (200) expression ::= NK_MINUS expression */
+ { 208, -3 }, /* (201) expression ::= expression NK_PLUS expression */
+ { 208, -3 }, /* (202) expression ::= expression NK_MINUS expression */
+ { 208, -3 }, /* (203) expression ::= expression NK_STAR expression */
+ { 208, -3 }, /* (204) expression ::= expression NK_SLASH expression */
+ { 208, -3 }, /* (205) expression ::= expression NK_REM expression */
+ { 203, -1 }, /* (206) expression_list ::= expression */
+ { 203, -3 }, /* (207) expression_list ::= expression_list NK_COMMA expression */
+ { 209, -1 }, /* (208) column_reference ::= column_name */
+ { 209, -3 }, /* (209) column_reference ::= table_name NK_DOT column_name */
+ { 211, -3 }, /* (210) predicate ::= expression compare_op expression */
+ { 211, -5 }, /* (211) predicate ::= expression BETWEEN expression AND expression */
+ { 211, -6 }, /* (212) predicate ::= expression NOT BETWEEN expression AND expression */
+ { 211, -3 }, /* (213) predicate ::= expression IS NULL */
+ { 211, -4 }, /* (214) predicate ::= expression IS NOT NULL */
+ { 211, -3 }, /* (215) predicate ::= expression in_op in_predicate_value */
+ { 212, -1 }, /* (216) compare_op ::= NK_LT */
+ { 212, -1 }, /* (217) compare_op ::= NK_GT */
+ { 212, -1 }, /* (218) compare_op ::= NK_LE */
+ { 212, -1 }, /* (219) compare_op ::= NK_GE */
+ { 212, -1 }, /* (220) compare_op ::= NK_NE */
+ { 212, -1 }, /* (221) compare_op ::= NK_EQ */
+ { 212, -1 }, /* (222) compare_op ::= LIKE */
+ { 212, -2 }, /* (223) compare_op ::= NOT LIKE */
+ { 212, -1 }, /* (224) compare_op ::= MATCH */
+ { 212, -1 }, /* (225) compare_op ::= NMATCH */
+ { 213, -1 }, /* (226) in_op ::= IN */
+ { 213, -2 }, /* (227) in_op ::= NOT IN */
+ { 214, -3 }, /* (228) in_predicate_value ::= NK_LP expression_list NK_RP */
+ { 215, -1 }, /* (229) boolean_value_expression ::= boolean_primary */
+ { 215, -2 }, /* (230) boolean_value_expression ::= NOT boolean_primary */
+ { 215, -3 }, /* (231) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
+ { 215, -3 }, /* (232) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
+ { 216, -1 }, /* (233) boolean_primary ::= predicate */
+ { 216, -3 }, /* (234) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
+ { 217, -1 }, /* (235) common_expression ::= expression */
+ { 217, -1 }, /* (236) common_expression ::= boolean_value_expression */
+ { 218, -2 }, /* (237) from_clause ::= FROM table_reference_list */
+ { 219, -1 }, /* (238) table_reference_list ::= table_reference */
+ { 219, -3 }, /* (239) table_reference_list ::= table_reference_list NK_COMMA table_reference */
+ { 220, -1 }, /* (240) table_reference ::= table_primary */
+ { 220, -1 }, /* (241) table_reference ::= joined_table */
+ { 221, -2 }, /* (242) table_primary ::= table_name alias_opt */
+ { 221, -4 }, /* (243) table_primary ::= db_name NK_DOT table_name alias_opt */
+ { 221, -2 }, /* (244) table_primary ::= subquery alias_opt */
+ { 221, -1 }, /* (245) table_primary ::= parenthesized_joined_table */
+ { 223, 0 }, /* (246) alias_opt ::= */
+ { 223, -1 }, /* (247) alias_opt ::= table_alias */
+ { 223, -2 }, /* (248) alias_opt ::= AS table_alias */
+ { 224, -3 }, /* (249) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
+ { 224, -3 }, /* (250) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
+ { 222, -6 }, /* (251) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
+ { 225, 0 }, /* (252) join_type ::= */
+ { 225, -1 }, /* (253) join_type ::= INNER */
+ { 227, -9 }, /* (254) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
+ { 228, 0 }, /* (255) set_quantifier_opt ::= */
+ { 228, -1 }, /* (256) set_quantifier_opt ::= DISTINCT */
+ { 228, -1 }, /* (257) set_quantifier_opt ::= ALL */
+ { 229, -1 }, /* (258) select_list ::= NK_STAR */
+ { 229, -1 }, /* (259) select_list ::= select_sublist */
+ { 235, -1 }, /* (260) select_sublist ::= select_item */
+ { 235, -3 }, /* (261) select_sublist ::= select_sublist NK_COMMA select_item */
+ { 236, -1 }, /* (262) select_item ::= common_expression */
+ { 236, -2 }, /* (263) select_item ::= common_expression column_alias */
+ { 236, -3 }, /* (264) select_item ::= common_expression AS column_alias */
+ { 236, -3 }, /* (265) select_item ::= table_name NK_DOT NK_STAR */
+ { 230, 0 }, /* (266) where_clause_opt ::= */
+ { 230, -2 }, /* (267) where_clause_opt ::= WHERE search_condition */
+ { 231, 0 }, /* (268) partition_by_clause_opt ::= */
+ { 231, -3 }, /* (269) partition_by_clause_opt ::= PARTITION BY expression_list */
+ { 232, 0 }, /* (270) twindow_clause_opt ::= */
+ { 232, -6 }, /* (271) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */
+ { 232, -4 }, /* (272) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
+ { 232, -6 }, /* (273) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
+ { 232, -8 }, /* (274) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
+ { 201, 0 }, /* (275) sliding_opt ::= */
+ { 201, -4 }, /* (276) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
+ { 237, 0 }, /* (277) fill_opt ::= */
+ { 237, -4 }, /* (278) fill_opt ::= FILL NK_LP fill_mode NK_RP */
+ { 237, -6 }, /* (279) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
+ { 238, -1 }, /* (280) fill_mode ::= NONE */
+ { 238, -1 }, /* (281) fill_mode ::= PREV */
+ { 238, -1 }, /* (282) fill_mode ::= NULL */
+ { 238, -1 }, /* (283) fill_mode ::= LINEAR */
+ { 238, -1 }, /* (284) fill_mode ::= NEXT */
+ { 233, 0 }, /* (285) group_by_clause_opt ::= */
+ { 233, -3 }, /* (286) group_by_clause_opt ::= GROUP BY group_by_list */
+ { 239, -1 }, /* (287) group_by_list ::= expression */
+ { 239, -3 }, /* (288) group_by_list ::= group_by_list NK_COMMA expression */
+ { 234, 0 }, /* (289) having_clause_opt ::= */
+ { 234, -2 }, /* (290) having_clause_opt ::= HAVING search_condition */
+ { 205, -4 }, /* (291) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
+ { 240, -1 }, /* (292) query_expression_body ::= query_primary */
+ { 240, -4 }, /* (293) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
+ { 244, -1 }, /* (294) query_primary ::= query_specification */
+ { 241, 0 }, /* (295) order_by_clause_opt ::= */
+ { 241, -3 }, /* (296) order_by_clause_opt ::= ORDER BY sort_specification_list */
+ { 242, 0 }, /* (297) slimit_clause_opt ::= */
+ { 242, -2 }, /* (298) slimit_clause_opt ::= SLIMIT NK_INTEGER */
+ { 242, -4 }, /* (299) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
+ { 242, -4 }, /* (300) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ { 243, 0 }, /* (301) limit_clause_opt ::= */
+ { 243, -2 }, /* (302) limit_clause_opt ::= LIMIT NK_INTEGER */
+ { 243, -4 }, /* (303) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
+ { 243, -4 }, /* (304) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ { 210, -3 }, /* (305) subquery ::= NK_LP query_expression NK_RP */
+ { 226, -1 }, /* (306) search_condition ::= common_expression */
+ { 245, -1 }, /* (307) sort_specification_list ::= sort_specification */
+ { 245, -3 }, /* (308) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
+ { 246, -3 }, /* (309) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
+ { 247, 0 }, /* (310) ordering_specification_opt ::= */
+ { 247, -1 }, /* (311) ordering_specification_opt ::= ASC */
+ { 247, -1 }, /* (312) ordering_specification_opt ::= DESC */
+ { 248, 0 }, /* (313) null_ordering_opt ::= */
+ { 248, -2 }, /* (314) null_ordering_opt ::= NULLS FIRST */
+ { 248, -2 }, /* (315) null_ordering_opt ::= NULLS LAST */
};
static void yy_accept(yyParser*); /* Forward Declaration */
@@ -1990,794 +2218,964 @@ static YYACTIONTYPE yy_reduce(
*/
/********** Begin reduce actions **********************************************/
YYMINORTYPE yylhsminor;
- case 0: /* cmd ::= CREATE USER user_name PASS NK_STRING */
-{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0); }
+ case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
+{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
+ yy_destructor(yypParser,161,&yymsp[0].minor);
break;
- case 1: /* cmd ::= ALTER USER user_name PASS NK_STRING */
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy129, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
+ case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
+{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
+ yy_destructor(yypParser,162,&yymsp[0].minor);
break;
- case 2: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy129, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); }
+ case 2: /* account_options ::= */
+{ }
break;
- case 3: /* cmd ::= DROP USER user_name */
-{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy129); }
+ case 3: /* account_options ::= account_options PPS literal */
+ case 4: /* account_options ::= account_options TSERIES literal */ yytestcase(yyruleno==4);
+ case 5: /* account_options ::= account_options STORAGE literal */ yytestcase(yyruleno==5);
+ case 6: /* account_options ::= account_options STREAMS literal */ yytestcase(yyruleno==6);
+ case 7: /* account_options ::= account_options QTIME literal */ yytestcase(yyruleno==7);
+ case 8: /* account_options ::= account_options DBS literal */ yytestcase(yyruleno==8);
+ case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9);
+ case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10);
+ case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11);
+{ yy_destructor(yypParser,161,&yymsp[-2].minor);
+{ }
+ yy_destructor(yypParser,163,&yymsp[0].minor);
+}
break;
- case 4: /* cmd ::= SHOW USERS */
+ case 12: /* alter_account_options ::= alter_account_option */
+{ yy_destructor(yypParser,164,&yymsp[0].minor);
+{ }
+}
+ break;
+ case 13: /* alter_account_options ::= alter_account_options alter_account_option */
+{ yy_destructor(yypParser,162,&yymsp[-1].minor);
+{ }
+ yy_destructor(yypParser,164,&yymsp[0].minor);
+}
+ break;
+ case 14: /* alter_account_option ::= PASS literal */
+ case 15: /* alter_account_option ::= PPS literal */ yytestcase(yyruleno==15);
+ case 16: /* alter_account_option ::= TSERIES literal */ yytestcase(yyruleno==16);
+ case 17: /* alter_account_option ::= STORAGE literal */ yytestcase(yyruleno==17);
+ case 18: /* alter_account_option ::= STREAMS literal */ yytestcase(yyruleno==18);
+ case 19: /* alter_account_option ::= QTIME literal */ yytestcase(yyruleno==19);
+ case 20: /* alter_account_option ::= DBS literal */ yytestcase(yyruleno==20);
+ case 21: /* alter_account_option ::= USERS literal */ yytestcase(yyruleno==21);
+ case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22);
+ case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23);
+{ }
+ yy_destructor(yypParser,163,&yymsp[0].minor);
+ break;
+ case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING */
+{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy0); }
+ break;
+ case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy353, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
+ break;
+ case 26: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy353, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); }
+ break;
+ case 27: /* cmd ::= DROP USER user_name */
+{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy353); }
+ break;
+ case 28: /* cmd ::= SHOW USERS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL); }
break;
- case 5: /* cmd ::= CREATE DNODE dnode_endpoint */
-{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy129, NULL); }
+ case 29: /* cmd ::= CREATE DNODE dnode_endpoint */
+{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy353, NULL); }
break;
- case 6: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
-{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0); }
+ case 30: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
+{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy0); }
break;
- case 7: /* cmd ::= DROP DNODE NK_INTEGER */
+ case 31: /* cmd ::= DROP DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); }
break;
- case 8: /* cmd ::= DROP DNODE dnode_endpoint */
-{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy129); }
+ case 32: /* cmd ::= DROP DNODE dnode_endpoint */
+{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy353); }
break;
- case 9: /* cmd ::= SHOW DNODES */
+ case 33: /* cmd ::= SHOW DNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL); }
break;
- case 10: /* dnode_endpoint ::= NK_STRING */
- case 11: /* dnode_host_name ::= NK_ID */ yytestcase(yyruleno==11);
- case 12: /* dnode_host_name ::= NK_IPTOKEN */ yytestcase(yyruleno==12);
- case 123: /* db_name ::= NK_ID */ yytestcase(yyruleno==123);
- case 124: /* table_name ::= NK_ID */ yytestcase(yyruleno==124);
- case 125: /* column_name ::= NK_ID */ yytestcase(yyruleno==125);
- case 126: /* function_name ::= NK_ID */ yytestcase(yyruleno==126);
- case 127: /* table_alias ::= NK_ID */ yytestcase(yyruleno==127);
- case 128: /* column_alias ::= NK_ID */ yytestcase(yyruleno==128);
- case 129: /* user_name ::= NK_ID */ yytestcase(yyruleno==129);
- case 130: /* index_name ::= NK_ID */ yytestcase(yyruleno==130);
- case 131: /* topic_name ::= NK_ID */ yytestcase(yyruleno==131);
-{ yylhsminor.yy129 = yymsp[0].minor.yy0; }
- yymsp[0].minor.yy129 = yylhsminor.yy129;
+ case 34: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
+{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
break;
- case 13: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
+ case 35: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
+{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
+ break;
+ case 36: /* cmd ::= ALTER ALL DNODES NK_STRING */
+{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); }
+ break;
+ case 37: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
+{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
+ break;
+ case 38: /* dnode_endpoint ::= NK_STRING */
+ case 39: /* dnode_host_name ::= NK_ID */ yytestcase(yyruleno==39);
+ case 40: /* dnode_host_name ::= NK_IPTOKEN */ yytestcase(yyruleno==40);
+ case 184: /* db_name ::= NK_ID */ yytestcase(yyruleno==184);
+ case 185: /* table_name ::= NK_ID */ yytestcase(yyruleno==185);
+ case 186: /* column_name ::= NK_ID */ yytestcase(yyruleno==186);
+ case 187: /* function_name ::= NK_ID */ yytestcase(yyruleno==187);
+ case 188: /* table_alias ::= NK_ID */ yytestcase(yyruleno==188);
+ case 189: /* column_alias ::= NK_ID */ yytestcase(yyruleno==189);
+ case 190: /* user_name ::= NK_ID */ yytestcase(yyruleno==190);
+ case 191: /* index_name ::= NK_ID */ yytestcase(yyruleno==191);
+ case 192: /* topic_name ::= NK_ID */ yytestcase(yyruleno==192);
+{ yylhsminor.yy353 = yymsp[0].minor.yy0; }
+ yymsp[0].minor.yy353 = yylhsminor.yy353;
+ break;
+ case 41: /* cmd ::= ALTER LOCAL NK_STRING */
+{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
+ break;
+ case 42: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */
+{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
+ break;
+ case 43: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateQnodeStmt(pCxt, &yymsp[0].minor.yy0); }
break;
- case 14: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */
+ case 44: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropQnodeStmt(pCxt, &yymsp[0].minor.yy0); }
break;
- case 15: /* cmd ::= SHOW QNODES */
+ case 45: /* cmd ::= SHOW QNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL); }
break;
- case 16: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
-{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy97, &yymsp[-1].minor.yy129, yymsp[0].minor.yy432); }
+ case 46: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
+{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy107, &yymsp[-1].minor.yy353, yymsp[0].minor.yy26); }
break;
- case 17: /* cmd ::= DROP DATABASE exists_opt db_name */
-{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy97, &yymsp[0].minor.yy129); }
+ case 47: /* cmd ::= DROP DATABASE exists_opt db_name */
+{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy107, &yymsp[0].minor.yy353); }
break;
- case 18: /* cmd ::= SHOW DATABASES */
+ case 48: /* cmd ::= SHOW DATABASES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL); }
break;
- case 19: /* cmd ::= USE db_name */
-{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy129); }
+ case 49: /* cmd ::= USE db_name */
+{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy353); }
break;
- case 20: /* cmd ::= ALTER DATABASE db_name db_options */
-{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy432); }
+ case 50: /* cmd ::= ALTER DATABASE db_name alter_db_options */
+{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy353, yymsp[0].minor.yy26); }
break;
- case 21: /* not_exists_opt ::= IF NOT EXISTS */
-{ yymsp[-2].minor.yy97 = true; }
+ case 51: /* not_exists_opt ::= IF NOT EXISTS */
+{ yymsp[-2].minor.yy107 = true; }
break;
- case 22: /* not_exists_opt ::= */
- case 24: /* exists_opt ::= */ yytestcase(yyruleno==24);
- case 194: /* set_quantifier_opt ::= */ yytestcase(yyruleno==194);
-{ yymsp[1].minor.yy97 = false; }
+ case 52: /* not_exists_opt ::= */
+ case 54: /* exists_opt ::= */ yytestcase(yyruleno==54);
+ case 255: /* set_quantifier_opt ::= */ yytestcase(yyruleno==255);
+{ yymsp[1].minor.yy107 = false; }
break;
- case 23: /* exists_opt ::= IF EXISTS */
-{ yymsp[-1].minor.yy97 = true; }
+ case 53: /* exists_opt ::= IF EXISTS */
+{ yymsp[-1].minor.yy107 = true; }
break;
- case 25: /* db_options ::= */
-{ yymsp[1].minor.yy432 = createDefaultDatabaseOptions(pCxt); }
+ case 55: /* db_options ::= */
+{ yymsp[1].minor.yy26 = createDefaultDatabaseOptions(pCxt); }
break;
- case 26: /* db_options ::= db_options BLOCKS NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_BLOCKS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 56: /* db_options ::= db_options BLOCKS NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_BLOCKS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 27: /* db_options ::= db_options CACHE NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_CACHE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 57: /* db_options ::= db_options CACHE NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_CACHE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 28: /* db_options ::= db_options CACHELAST NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 58: /* db_options ::= db_options CACHELAST NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 29: /* db_options ::= db_options COMP NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 59: /* db_options ::= db_options COMP NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 30: /* db_options ::= db_options DAYS NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 60: /* db_options ::= db_options DAYS NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 31: /* db_options ::= db_options FSYNC NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 61: /* db_options ::= db_options FSYNC NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 32: /* db_options ::= db_options MAXROWS NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 62: /* db_options ::= db_options MAXROWS NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 33: /* db_options ::= db_options MINROWS NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 63: /* db_options ::= db_options MINROWS NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 34: /* db_options ::= db_options KEEP NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_KEEP, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 64: /* db_options ::= db_options KEEP NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_KEEP, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 35: /* db_options ::= db_options PRECISION NK_STRING */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 65: /* db_options ::= db_options PRECISION NK_STRING */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 36: /* db_options ::= db_options QUORUM NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_QUORUM, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 66: /* db_options ::= db_options QUORUM NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_QUORUM, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 37: /* db_options ::= db_options REPLICA NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 67: /* db_options ::= db_options REPLICA NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 38: /* db_options ::= db_options TTL NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_TTL, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 68: /* db_options ::= db_options TTL NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_TTL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 39: /* db_options ::= db_options WAL NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 69: /* db_options ::= db_options WAL NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 40: /* db_options ::= db_options VGROUPS NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 70: /* db_options ::= db_options VGROUPS NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 41: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_SINGLESTABLE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 71: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 42: /* db_options ::= db_options STREAM_MODE NK_INTEGER */
-{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_STREAMMODE, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 72: /* db_options ::= db_options STREAM_MODE NK_INTEGER */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_STREAM_MODE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 43: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
- case 45: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==45);
-{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy97, yymsp[-5].minor.yy432, yymsp[-3].minor.yy24, yymsp[-1].minor.yy24, yymsp[0].minor.yy432);}
+ case 73: /* db_options ::= db_options RETENTIONS NK_STRING */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_RETENTIONS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 44: /* cmd ::= CREATE TABLE multi_create_clause */
-{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy24);}
+ case 74: /* db_options ::= db_options FILE_FACTOR NK_FLOAT */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_FILE_FACTOR, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 46: /* cmd ::= DROP TABLE multi_drop_clause */
-{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy24); }
+ case 75: /* alter_db_options ::= alter_db_option */
+{ yylhsminor.yy26 = createDefaultAlterDatabaseOptions(pCxt); yylhsminor.yy26 = setDatabaseOption(pCxt, yylhsminor.yy26, yymsp[0].minor.yy443.type, &yymsp[0].minor.yy443.val); }
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
break;
- case 47: /* cmd ::= DROP STABLE exists_opt full_table_name */
-{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy97, yymsp[0].minor.yy432); }
+ case 76: /* alter_db_options ::= alter_db_options alter_db_option */
+{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-1].minor.yy26, yymsp[0].minor.yy443.type, &yymsp[0].minor.yy443.val); }
+ yymsp[-1].minor.yy26 = yylhsminor.yy26;
break;
- case 48: /* cmd ::= SHOW TABLES */
+ case 77: /* alter_db_option ::= BLOCKS NK_INTEGER */
+{ yymsp[-1].minor.yy443.type = DB_OPTION_BLOCKS; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; }
+ break;
+ case 78: /* alter_db_option ::= FSYNC NK_INTEGER */
+{ yymsp[-1].minor.yy443.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; }
+ break;
+ case 79: /* alter_db_option ::= KEEP NK_INTEGER */
+{ yymsp[-1].minor.yy443.type = DB_OPTION_KEEP; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; }
+ break;
+ case 80: /* alter_db_option ::= WAL NK_INTEGER */
+{ yymsp[-1].minor.yy443.type = DB_OPTION_WAL; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; }
+ break;
+ case 81: /* alter_db_option ::= QUORUM NK_INTEGER */
+{ yymsp[-1].minor.yy443.type = DB_OPTION_QUORUM; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; }
+ break;
+ case 82: /* alter_db_option ::= CACHELAST NK_INTEGER */
+{ yymsp[-1].minor.yy443.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; }
+ break;
+ case 83: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
+ case 85: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==85);
+{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy107, yymsp[-5].minor.yy26, yymsp[-3].minor.yy64, yymsp[-1].minor.yy64, yymsp[0].minor.yy26); }
+ break;
+ case 84: /* cmd ::= CREATE TABLE multi_create_clause */
+{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy64); }
+ break;
+ case 86: /* cmd ::= DROP TABLE multi_drop_clause */
+{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy64); }
+ break;
+ case 87: /* cmd ::= DROP STABLE exists_opt full_table_name */
+{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy107, yymsp[0].minor.yy26); }
+ break;
+ case 88: /* cmd ::= SHOW TABLES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, NULL); }
break;
- case 49: /* cmd ::= SHOW STABLES */
+ case 89: /* cmd ::= SHOW STABLES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, NULL); }
break;
- case 50: /* multi_create_clause ::= create_subtable_clause */
- case 53: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==53);
- case 60: /* column_def_list ::= column_def */ yytestcase(yyruleno==60);
- case 95: /* col_name_list ::= col_name */ yytestcase(yyruleno==95);
- case 104: /* func_list ::= func */ yytestcase(yyruleno==104);
- case 199: /* select_sublist ::= select_item */ yytestcase(yyruleno==199);
- case 246: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==246);
-{ yylhsminor.yy24 = createNodeList(pCxt, yymsp[0].minor.yy432); }
- yymsp[0].minor.yy24 = yylhsminor.yy24;
+ case 90: /* cmd ::= ALTER TABLE alter_table_clause */
+ case 91: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==91);
+ case 174: /* cmd ::= query_expression */ yytestcase(yyruleno==174);
+{ pCxt->pRootNode = yymsp[0].minor.yy26; }
break;
- case 51: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
- case 54: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==54);
-{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-1].minor.yy24, yymsp[0].minor.yy432); }
- yymsp[-1].minor.yy24 = yylhsminor.yy24;
+ case 92: /* alter_table_clause ::= full_table_name alter_table_options */
+{ yylhsminor.yy26 = createAlterTableOption(pCxt, yymsp[-1].minor.yy26, yymsp[0].minor.yy26); }
+ yymsp[-1].minor.yy26 = yylhsminor.yy26;
break;
- case 52: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
-{ yylhsminor.yy432 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy97, yymsp[-7].minor.yy432, yymsp[-5].minor.yy432, yymsp[-4].minor.yy24, yymsp[-1].minor.yy24); }
- yymsp[-8].minor.yy432 = yylhsminor.yy432;
+ case 93: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
+{ yylhsminor.yy26 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy26, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy353, yymsp[0].minor.yy370); }
+ yymsp[-4].minor.yy26 = yylhsminor.yy26;
break;
- case 55: /* drop_table_clause ::= exists_opt full_table_name */
-{ yylhsminor.yy432 = createDropTableClause(pCxt, yymsp[-1].minor.yy97, yymsp[0].minor.yy432); }
- yymsp[-1].minor.yy432 = yylhsminor.yy432;
+ case 94: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
+{ yylhsminor.yy26 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy26, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy353); }
+ yymsp[-3].minor.yy26 = yylhsminor.yy26;
break;
- case 56: /* specific_tags_opt ::= */
- case 87: /* tags_def_opt ::= */ yytestcase(yyruleno==87);
- case 207: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==207);
- case 224: /* group_by_clause_opt ::= */ yytestcase(yyruleno==224);
- case 234: /* order_by_clause_opt ::= */ yytestcase(yyruleno==234);
-{ yymsp[1].minor.yy24 = NULL; }
+ case 95: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
+{ yylhsminor.yy26 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy26, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy353, yymsp[0].minor.yy370); }
+ yymsp[-4].minor.yy26 = yylhsminor.yy26;
break;
- case 57: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */
-{ yymsp[-2].minor.yy24 = yymsp[-1].minor.yy24; }
+ case 96: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
+{ yylhsminor.yy26 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy26, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy353, &yymsp[0].minor.yy353); }
+ yymsp[-4].minor.yy26 = yylhsminor.yy26;
break;
- case 58: /* full_table_name ::= table_name */
-{ yylhsminor.yy432 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy129, NULL); }
- yymsp[0].minor.yy432 = yylhsminor.yy432;
+ case 97: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
+{ yylhsminor.yy26 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy26, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy353, yymsp[0].minor.yy370); }
+ yymsp[-4].minor.yy26 = yylhsminor.yy26;
break;
- case 59: /* full_table_name ::= db_name NK_DOT table_name */
-{ yylhsminor.yy432 = createRealTableNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129, NULL); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 98: /* alter_table_clause ::= full_table_name DROP TAG column_name */
+{ yylhsminor.yy26 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy26, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy353); }
+ yymsp[-3].minor.yy26 = yylhsminor.yy26;
break;
- case 61: /* column_def_list ::= column_def_list NK_COMMA column_def */
- case 96: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==96);
- case 105: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==105);
- case 200: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==200);
- case 247: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==247);
-{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-2].minor.yy24, yymsp[0].minor.yy432); }
- yymsp[-2].minor.yy24 = yylhsminor.yy24;
+ case 99: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
+{ yylhsminor.yy26 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy26, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy353, yymsp[0].minor.yy370); }
+ yymsp[-4].minor.yy26 = yylhsminor.yy26;
break;
- case 62: /* column_def ::= column_name type_name */
-{ yylhsminor.yy432 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy224, NULL); }
- yymsp[-1].minor.yy432 = yylhsminor.yy432;
+ case 100: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
+{ yylhsminor.yy26 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy26, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy353, &yymsp[0].minor.yy353); }
+ yymsp[-4].minor.yy26 = yylhsminor.yy26;
break;
- case 63: /* column_def ::= column_name type_name COMMENT NK_STRING */
-{ yylhsminor.yy432 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-2].minor.yy224, &yymsp[0].minor.yy0); }
- yymsp[-3].minor.yy432 = yylhsminor.yy432;
+ case 101: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
+{ yylhsminor.yy26 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy26, &yymsp[-2].minor.yy353, yymsp[0].minor.yy26); }
+ yymsp[-5].minor.yy26 = yylhsminor.yy26;
break;
- case 64: /* type_name ::= BOOL */
-{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BOOL); }
+ case 102: /* multi_create_clause ::= create_subtable_clause */
+ case 105: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==105);
+ case 112: /* column_def_list ::= column_def */ yytestcase(yyruleno==112);
+ case 153: /* col_name_list ::= col_name */ yytestcase(yyruleno==153);
+ case 156: /* func_name_list ::= func_name */ yytestcase(yyruleno==156);
+ case 165: /* func_list ::= func */ yytestcase(yyruleno==165);
+ case 260: /* select_sublist ::= select_item */ yytestcase(yyruleno==260);
+ case 307: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==307);
+{ yylhsminor.yy64 = createNodeList(pCxt, yymsp[0].minor.yy26); }
+ yymsp[0].minor.yy64 = yylhsminor.yy64;
break;
- case 65: /* type_name ::= TINYINT */
-{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_TINYINT); }
+ case 103: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
+ case 106: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==106);
+{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-1].minor.yy64, yymsp[0].minor.yy26); }
+ yymsp[-1].minor.yy64 = yylhsminor.yy64;
break;
- case 66: /* type_name ::= SMALLINT */
-{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
+ case 104: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
+{ yylhsminor.yy26 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy107, yymsp[-7].minor.yy26, yymsp[-5].minor.yy26, yymsp[-4].minor.yy64, yymsp[-1].minor.yy64); }
+ yymsp[-8].minor.yy26 = yylhsminor.yy26;
break;
- case 67: /* type_name ::= INT */
- case 68: /* type_name ::= INTEGER */ yytestcase(yyruleno==68);
-{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_INT); }
+ case 107: /* drop_table_clause ::= exists_opt full_table_name */
+{ yylhsminor.yy26 = createDropTableClause(pCxt, yymsp[-1].minor.yy107, yymsp[0].minor.yy26); }
+ yymsp[-1].minor.yy26 = yylhsminor.yy26;
break;
- case 69: /* type_name ::= BIGINT */
-{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BIGINT); }
+ case 108: /* specific_tags_opt ::= */
+ case 139: /* tags_def_opt ::= */ yytestcase(yyruleno==139);
+ case 268: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==268);
+ case 285: /* group_by_clause_opt ::= */ yytestcase(yyruleno==285);
+ case 295: /* order_by_clause_opt ::= */ yytestcase(yyruleno==295);
+{ yymsp[1].minor.yy64 = NULL; }
break;
- case 70: /* type_name ::= FLOAT */
-{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_FLOAT); }
+ case 109: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */
+{ yymsp[-2].minor.yy64 = yymsp[-1].minor.yy64; }
break;
- case 71: /* type_name ::= DOUBLE */
-{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
+ case 110: /* full_table_name ::= table_name */
+{ yylhsminor.yy26 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy353, NULL); }
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
break;
- case 72: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
+ case 111: /* full_table_name ::= db_name NK_DOT table_name */
+{ yylhsminor.yy26 = createRealTableNode(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy353, NULL); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 73: /* type_name ::= TIMESTAMP */
-{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
+ case 113: /* column_def_list ::= column_def_list NK_COMMA column_def */
+ case 154: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==154);
+ case 157: /* func_name_list ::= func_name_list NK_COMMA col_name */ yytestcase(yyruleno==157);
+ case 166: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==166);
+ case 261: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==261);
+ case 308: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==308);
+{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, yymsp[0].minor.yy26); }
+ yymsp[-2].minor.yy64 = yylhsminor.yy64;
break;
- case 74: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
+ case 114: /* column_def ::= column_name type_name */
+{ yylhsminor.yy26 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy353, yymsp[0].minor.yy370, NULL); }
+ yymsp[-1].minor.yy26 = yylhsminor.yy26;
break;
- case 75: /* type_name ::= TINYINT UNSIGNED */
-{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
+ case 115: /* column_def ::= column_name type_name COMMENT NK_STRING */
+{ yylhsminor.yy26 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy353, yymsp[-2].minor.yy370, &yymsp[0].minor.yy0); }
+ yymsp[-3].minor.yy26 = yylhsminor.yy26;
break;
- case 76: /* type_name ::= SMALLINT UNSIGNED */
-{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
+ case 116: /* type_name ::= BOOL */
+{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_BOOL); }
break;
- case 77: /* type_name ::= INT UNSIGNED */
-{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UINT); }
+ case 117: /* type_name ::= TINYINT */
+{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_TINYINT); }
break;
- case 78: /* type_name ::= BIGINT UNSIGNED */
-{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
+ case 118: /* type_name ::= SMALLINT */
+{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
break;
- case 79: /* type_name ::= JSON */
-{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_JSON); }
+ case 119: /* type_name ::= INT */
+ case 120: /* type_name ::= INTEGER */ yytestcase(yyruleno==120);
+{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_INT); }
break;
- case 80: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
+ case 121: /* type_name ::= BIGINT */
+{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_BIGINT); }
break;
- case 81: /* type_name ::= MEDIUMBLOB */
-{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
+ case 122: /* type_name ::= FLOAT */
+{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_FLOAT); }
break;
- case 82: /* type_name ::= BLOB */
-{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BLOB); }
+ case 123: /* type_name ::= DOUBLE */
+{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
break;
- case 83: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
+ case 124: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy370 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
break;
- case 84: /* type_name ::= DECIMAL */
-{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+ case 125: /* type_name ::= TIMESTAMP */
+{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
break;
- case 85: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
-{ yymsp[-3].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+ case 126: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy370 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
break;
- case 86: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
-{ yymsp[-5].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+ case 127: /* type_name ::= TINYINT UNSIGNED */
+{ yymsp[-1].minor.yy370 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
break;
- case 88: /* tags_def_opt ::= tags_def */
- case 198: /* select_list ::= select_sublist */ yytestcase(yyruleno==198);
-{ yylhsminor.yy24 = yymsp[0].minor.yy24; }
- yymsp[0].minor.yy24 = yylhsminor.yy24;
+ case 128: /* type_name ::= SMALLINT UNSIGNED */
+{ yymsp[-1].minor.yy370 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
break;
- case 89: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
-{ yymsp[-3].minor.yy24 = yymsp[-1].minor.yy24; }
+ case 129: /* type_name ::= INT UNSIGNED */
+{ yymsp[-1].minor.yy370 = createDataType(TSDB_DATA_TYPE_UINT); }
break;
- case 90: /* table_options ::= */
-{ yymsp[1].minor.yy432 = createDefaultTableOptions(pCxt);}
+ case 130: /* type_name ::= BIGINT UNSIGNED */
+{ yymsp[-1].minor.yy370 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
break;
- case 91: /* table_options ::= table_options COMMENT NK_STRING */
-{ yylhsminor.yy432 = setTableOption(pCxt, yymsp[-2].minor.yy432, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 131: /* type_name ::= JSON */
+{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_JSON); }
break;
- case 92: /* table_options ::= table_options KEEP NK_INTEGER */
-{ yylhsminor.yy432 = setTableOption(pCxt, yymsp[-2].minor.yy432, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 132: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy370 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
break;
- case 93: /* table_options ::= table_options TTL NK_INTEGER */
-{ yylhsminor.yy432 = setTableOption(pCxt, yymsp[-2].minor.yy432, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 133: /* type_name ::= MEDIUMBLOB */
+{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
break;
- case 94: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
-{ yylhsminor.yy432 = setTableSmaOption(pCxt, yymsp[-4].minor.yy432, yymsp[-1].minor.yy24); }
- yymsp[-4].minor.yy432 = yylhsminor.yy432;
+ case 134: /* type_name ::= BLOB */
+{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_BLOB); }
break;
- case 97: /* col_name ::= column_name */
-{ yylhsminor.yy432 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy129); }
- yymsp[0].minor.yy432 = yylhsminor.yy432;
+ case 135: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy370 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
break;
- case 98: /* cmd ::= CREATE SMA INDEX index_name ON table_name index_options */
-{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, &yymsp[-3].minor.yy129, &yymsp[-1].minor.yy129, NULL, yymsp[0].minor.yy432); }
+ case 136: /* type_name ::= DECIMAL */
+{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
- case 99: /* cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP */
-{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, &yymsp[-5].minor.yy129, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy24, NULL); }
+ case 137: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy370 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
- case 100: /* cmd ::= DROP INDEX index_name ON table_name */
-{ pCxt->pRootNode = createDropIndexStmt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129); }
+ case 138: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
+{ yymsp[-5].minor.yy370 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
- case 101: /* index_options ::= */
- case 205: /* where_clause_opt ::= */ yytestcase(yyruleno==205);
- case 209: /* twindow_clause_opt ::= */ yytestcase(yyruleno==209);
- case 214: /* sliding_opt ::= */ yytestcase(yyruleno==214);
- case 216: /* fill_opt ::= */ yytestcase(yyruleno==216);
- case 228: /* having_clause_opt ::= */ yytestcase(yyruleno==228);
- case 236: /* slimit_clause_opt ::= */ yytestcase(yyruleno==236);
- case 240: /* limit_clause_opt ::= */ yytestcase(yyruleno==240);
-{ yymsp[1].minor.yy432 = NULL; }
+ case 140: /* tags_def_opt ::= tags_def */
+ case 259: /* select_list ::= select_sublist */ yytestcase(yyruleno==259);
+{ yylhsminor.yy64 = yymsp[0].minor.yy64; }
+ yymsp[0].minor.yy64 = yylhsminor.yy64;
break;
- case 102: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
-{ yymsp[-8].minor.yy432 = createIndexOption(pCxt, yymsp[-6].minor.yy24, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), NULL, yymsp[0].minor.yy432); }
+ case 141: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
+{ yymsp[-3].minor.yy64 = yymsp[-1].minor.yy64; }
break;
- case 103: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
-{ yymsp[-10].minor.yy432 = createIndexOption(pCxt, yymsp[-8].minor.yy24, releaseRawExprNode(pCxt, yymsp[-4].minor.yy432), releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), yymsp[0].minor.yy432); }
+ case 142: /* table_options ::= */
+{ yymsp[1].minor.yy26 = createDefaultTableOptions(pCxt); }
break;
- case 106: /* func ::= function_name NK_LP expression_list NK_RP */
-{ yylhsminor.yy432 = createFunctionNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy24); }
- yymsp[-3].minor.yy432 = yylhsminor.yy432;
+ case 143: /* table_options ::= table_options COMMENT NK_STRING */
+{ yylhsminor.yy26 = setTableOption(pCxt, yymsp[-2].minor.yy26, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 107: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
-{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy97, &yymsp[-2].minor.yy129, yymsp[0].minor.yy432, NULL); }
+ case 144: /* table_options ::= table_options KEEP NK_INTEGER */
+{ yylhsminor.yy26 = setTableOption(pCxt, yymsp[-2].minor.yy26, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 108: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
-{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy97, &yymsp[-2].minor.yy129, NULL, &yymsp[0].minor.yy129); }
+ case 145: /* table_options ::= table_options TTL NK_INTEGER */
+{ yylhsminor.yy26 = setTableOption(pCxt, yymsp[-2].minor.yy26, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 109: /* cmd ::= DROP TOPIC exists_opt topic_name */
-{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy97, &yymsp[0].minor.yy129); }
+ case 146: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
+{ yylhsminor.yy26 = setTableSmaOption(pCxt, yymsp[-4].minor.yy26, yymsp[-1].minor.yy64); }
+ yymsp[-4].minor.yy26 = yylhsminor.yy26;
break;
- case 110: /* cmd ::= SHOW VGROUPS */
+ case 147: /* table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
+{ yylhsminor.yy26 = setTableRollupOption(pCxt, yymsp[-4].minor.yy26, yymsp[-1].minor.yy64); }
+ yymsp[-4].minor.yy26 = yylhsminor.yy26;
+ break;
+ case 148: /* alter_table_options ::= alter_table_option */
+{ yylhsminor.yy26 = createDefaultAlterTableOptions(pCxt); yylhsminor.yy26 = setTableOption(pCxt, yylhsminor.yy26, yymsp[0].minor.yy443.type, &yymsp[0].minor.yy443.val); }
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
+ break;
+ case 149: /* alter_table_options ::= alter_table_options alter_table_option */
+{ yylhsminor.yy26 = setTableOption(pCxt, yymsp[-1].minor.yy26, yymsp[0].minor.yy443.type, &yymsp[0].minor.yy443.val); }
+ yymsp[-1].minor.yy26 = yylhsminor.yy26;
+ break;
+ case 150: /* alter_table_option ::= COMMENT NK_STRING */
+{ yymsp[-1].minor.yy443.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; }
+ break;
+ case 151: /* alter_table_option ::= KEEP NK_INTEGER */
+{ yymsp[-1].minor.yy443.type = TABLE_OPTION_KEEP; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; }
+ break;
+ case 152: /* alter_table_option ::= TTL NK_INTEGER */
+{ yymsp[-1].minor.yy443.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; }
+ break;
+ case 155: /* col_name ::= column_name */
+{ yylhsminor.yy26 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy353); }
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
+ break;
+ case 158: /* func_name ::= function_name */
+{ yylhsminor.yy26 = createFunctionNode(pCxt, &yymsp[0].minor.yy353, NULL); }
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
+ break;
+ case 159: /* cmd ::= CREATE SMA INDEX index_name ON table_name index_options */
+{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, &yymsp[-3].minor.yy353, &yymsp[-1].minor.yy353, NULL, yymsp[0].minor.yy26); }
+ break;
+ case 160: /* cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP */
+{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, &yymsp[-5].minor.yy353, &yymsp[-3].minor.yy353, yymsp[-1].minor.yy64, NULL); }
+ break;
+ case 161: /* cmd ::= DROP INDEX index_name ON table_name */
+{ pCxt->pRootNode = createDropIndexStmt(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy353); }
+ break;
+ case 162: /* index_options ::= */
+ case 266: /* where_clause_opt ::= */ yytestcase(yyruleno==266);
+ case 270: /* twindow_clause_opt ::= */ yytestcase(yyruleno==270);
+ case 275: /* sliding_opt ::= */ yytestcase(yyruleno==275);
+ case 277: /* fill_opt ::= */ yytestcase(yyruleno==277);
+ case 289: /* having_clause_opt ::= */ yytestcase(yyruleno==289);
+ case 297: /* slimit_clause_opt ::= */ yytestcase(yyruleno==297);
+ case 301: /* limit_clause_opt ::= */ yytestcase(yyruleno==301);
+{ yymsp[1].minor.yy26 = NULL; }
+ break;
+ case 163: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
+{ yymsp[-8].minor.yy26 = createIndexOption(pCxt, yymsp[-6].minor.yy64, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), NULL, yymsp[0].minor.yy26); }
+ break;
+ case 164: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
+{ yymsp[-10].minor.yy26 = createIndexOption(pCxt, yymsp[-8].minor.yy64, releaseRawExprNode(pCxt, yymsp[-4].minor.yy26), releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), yymsp[0].minor.yy26); }
+ break;
+ case 167: /* func ::= function_name NK_LP expression_list NK_RP */
+{ yylhsminor.yy26 = createFunctionNode(pCxt, &yymsp[-3].minor.yy353, yymsp[-1].minor.yy64); }
+ yymsp[-3].minor.yy26 = yylhsminor.yy26;
+ break;
+ case 168: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
+{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy107, &yymsp[-2].minor.yy353, yymsp[0].minor.yy26, NULL); }
+ break;
+ case 169: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
+{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy107, &yymsp[-2].minor.yy353, NULL, &yymsp[0].minor.yy353); }
+ break;
+ case 170: /* cmd ::= DROP TOPIC exists_opt topic_name */
+{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy107, &yymsp[0].minor.yy353); }
+ break;
+ case 171: /* cmd ::= SHOW VGROUPS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, NULL); }
break;
- case 111: /* cmd ::= SHOW db_name NK_DOT VGROUPS */
-{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &yymsp[-2].minor.yy129); }
+ case 172: /* cmd ::= SHOW db_name NK_DOT VGROUPS */
+{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &yymsp[-2].minor.yy353); }
break;
- case 112: /* cmd ::= SHOW MNODES */
+ case 173: /* cmd ::= SHOW MNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL); }
break;
- case 113: /* cmd ::= query_expression */
-{ pCxt->pRootNode = yymsp[0].minor.yy432; }
+ case 175: /* literal ::= NK_INTEGER */
+{ yylhsminor.yy26 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
break;
- case 114: /* literal ::= NK_INTEGER */
-{ yylhsminor.yy432 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy432 = yylhsminor.yy432;
+ case 176: /* literal ::= NK_FLOAT */
+{ yylhsminor.yy26 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
break;
- case 115: /* literal ::= NK_FLOAT */
-{ yylhsminor.yy432 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy432 = yylhsminor.yy432;
+ case 177: /* literal ::= NK_STRING */
+{ yylhsminor.yy26 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
break;
- case 116: /* literal ::= NK_STRING */
-{ yylhsminor.yy432 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy432 = yylhsminor.yy432;
+ case 178: /* literal ::= NK_BOOL */
+{ yylhsminor.yy26 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
break;
- case 117: /* literal ::= NK_BOOL */
-{ yylhsminor.yy432 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy432 = yylhsminor.yy432;
+ case 179: /* literal ::= TIMESTAMP NK_STRING */
+{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
+ yymsp[-1].minor.yy26 = yylhsminor.yy26;
break;
- case 118: /* literal ::= TIMESTAMP NK_STRING */
-{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
- yymsp[-1].minor.yy432 = yylhsminor.yy432;
+ case 180: /* literal ::= duration_literal */
+ case 193: /* expression ::= literal */ yytestcase(yyruleno==193);
+ case 194: /* expression ::= column_reference */ yytestcase(yyruleno==194);
+ case 197: /* expression ::= subquery */ yytestcase(yyruleno==197);
+ case 229: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==229);
+ case 233: /* boolean_primary ::= predicate */ yytestcase(yyruleno==233);
+ case 235: /* common_expression ::= expression */ yytestcase(yyruleno==235);
+ case 236: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==236);
+ case 238: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==238);
+ case 240: /* table_reference ::= table_primary */ yytestcase(yyruleno==240);
+ case 241: /* table_reference ::= joined_table */ yytestcase(yyruleno==241);
+ case 245: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==245);
+ case 292: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==292);
+ case 294: /* query_primary ::= query_specification */ yytestcase(yyruleno==294);
+{ yylhsminor.yy26 = yymsp[0].minor.yy26; }
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
break;
- case 119: /* literal ::= duration_literal */
- case 132: /* expression ::= literal */ yytestcase(yyruleno==132);
- case 133: /* expression ::= column_reference */ yytestcase(yyruleno==133);
- case 136: /* expression ::= subquery */ yytestcase(yyruleno==136);
- case 168: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==168);
- case 172: /* boolean_primary ::= predicate */ yytestcase(yyruleno==172);
- case 174: /* common_expression ::= expression */ yytestcase(yyruleno==174);
- case 175: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==175);
- case 177: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==177);
- case 179: /* table_reference ::= table_primary */ yytestcase(yyruleno==179);
- case 180: /* table_reference ::= joined_table */ yytestcase(yyruleno==180);
- case 184: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==184);
- case 231: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==231);
- case 233: /* query_primary ::= query_specification */ yytestcase(yyruleno==233);
-{ yylhsminor.yy432 = yymsp[0].minor.yy432; }
- yymsp[0].minor.yy432 = yylhsminor.yy432;
+ case 181: /* duration_literal ::= NK_VARIABLE */
+{ yylhsminor.yy26 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
break;
- case 120: /* duration_literal ::= NK_VARIABLE */
-{ yylhsminor.yy432 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
- yymsp[0].minor.yy432 = yylhsminor.yy432;
+ case 182: /* literal_list ::= literal */
+ case 206: /* expression_list ::= expression */ yytestcase(yyruleno==206);
+{ yylhsminor.yy64 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy26)); }
+ yymsp[0].minor.yy64 = yylhsminor.yy64;
break;
- case 121: /* literal_list ::= literal */
- case 145: /* expression_list ::= expression */ yytestcase(yyruleno==145);
-{ yylhsminor.yy24 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy432)); }
- yymsp[0].minor.yy24 = yylhsminor.yy24;
+ case 183: /* literal_list ::= literal_list NK_COMMA literal */
+ case 207: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==207);
+{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, releaseRawExprNode(pCxt, yymsp[0].minor.yy26)); }
+ yymsp[-2].minor.yy64 = yylhsminor.yy64;
break;
- case 122: /* literal_list ::= literal_list NK_COMMA literal */
- case 146: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==146);
-{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-2].minor.yy24, releaseRawExprNode(pCxt, yymsp[0].minor.yy432)); }
- yymsp[-2].minor.yy24 = yylhsminor.yy24;
+ case 195: /* expression ::= function_name NK_LP expression_list NK_RP */
+{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy353, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy353, yymsp[-1].minor.yy64)); }
+ yymsp[-3].minor.yy26 = yylhsminor.yy26;
break;
- case 134: /* expression ::= function_name NK_LP expression_list NK_RP */
-{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy24)); }
- yymsp[-3].minor.yy432 = yylhsminor.yy432;
+ case 196: /* expression ::= function_name NK_LP NK_STAR NK_RP */
+{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy353, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy353, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); }
+ yymsp[-3].minor.yy26 = yylhsminor.yy26;
break;
- case 135: /* expression ::= function_name NK_LP NK_STAR NK_RP */
-{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy129, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); }
- yymsp[-3].minor.yy432 = yylhsminor.yy432;
+ case 198: /* expression ::= NK_LP expression NK_RP */
+ case 234: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==234);
+{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy26)); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 137: /* expression ::= NK_LP expression NK_RP */
- case 173: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==173);
-{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy432)); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
- break;
- case 138: /* expression ::= NK_PLUS expression */
+ case 199: /* expression ::= NK_PLUS expression */
{
- SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy432));
+ SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy26));
}
- yymsp[-1].minor.yy432 = yylhsminor.yy432;
+ yymsp[-1].minor.yy26 = yylhsminor.yy26;
break;
- case 139: /* expression ::= NK_MINUS expression */
+ case 200: /* expression ::= NK_MINUS expression */
{
- SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy432), NULL));
+ SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy26), NULL));
}
- yymsp[-1].minor.yy432 = yylhsminor.yy432;
+ yymsp[-1].minor.yy26 = yylhsminor.yy26;
break;
- case 140: /* expression ::= expression NK_PLUS expression */
+ case 201: /* expression ::= expression NK_PLUS expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26)));
}
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 141: /* expression ::= expression NK_MINUS expression */
+ case 202: /* expression ::= expression NK_MINUS expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26)));
}
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 142: /* expression ::= expression NK_STAR expression */
+ case 203: /* expression ::= expression NK_STAR expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26)));
}
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 143: /* expression ::= expression NK_SLASH expression */
+ case 204: /* expression ::= expression NK_SLASH expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26)));
}
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 144: /* expression ::= expression NK_REM expression */
+ case 205: /* expression ::= expression NK_REM expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26)));
}
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 147: /* column_reference ::= column_name */
-{ yylhsminor.yy432 = createRawExprNode(pCxt, &yymsp[0].minor.yy129, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy129)); }
- yymsp[0].minor.yy432 = yylhsminor.yy432;
+ case 208: /* column_reference ::= column_name */
+{ yylhsminor.yy26 = createRawExprNode(pCxt, &yymsp[0].minor.yy353, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy353)); }
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
break;
- case 148: /* column_reference ::= table_name NK_DOT column_name */
-{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129, createColumnNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129)); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 209: /* column_reference ::= table_name NK_DOT column_name */
+{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy353, createColumnNode(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy353)); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 149: /* predicate ::= expression compare_op expression */
- case 154: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==154);
+ case 210: /* predicate ::= expression compare_op expression */
+ case 215: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==215);
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy260, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy80, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26)));
}
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 150: /* predicate ::= expression BETWEEN expression AND expression */
+ case 211: /* predicate ::= expression BETWEEN expression AND expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy432);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy432), releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy26);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy26), releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26)));
}
- yymsp[-4].minor.yy432 = yylhsminor.yy432;
+ yymsp[-4].minor.yy26 = yylhsminor.yy26;
break;
- case 151: /* predicate ::= expression NOT BETWEEN expression AND expression */
+ case 212: /* predicate ::= expression NOT BETWEEN expression AND expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy432);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[-5].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy26);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[-5].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26)));
}
- yymsp[-5].minor.yy432 = yylhsminor.yy432;
+ yymsp[-5].minor.yy26 = yylhsminor.yy26;
break;
- case 152: /* predicate ::= expression IS NULL */
+ case 213: /* predicate ::= expression IS NULL */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), NULL));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), NULL));
}
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 153: /* predicate ::= expression IS NOT NULL */
+ case 214: /* predicate ::= expression IS NOT NULL */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy432), NULL));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy26), NULL));
}
- yymsp[-3].minor.yy432 = yylhsminor.yy432;
+ yymsp[-3].minor.yy26 = yylhsminor.yy26;
break;
- case 155: /* compare_op ::= NK_LT */
-{ yymsp[0].minor.yy260 = OP_TYPE_LOWER_THAN; }
+ case 216: /* compare_op ::= NK_LT */
+{ yymsp[0].minor.yy80 = OP_TYPE_LOWER_THAN; }
break;
- case 156: /* compare_op ::= NK_GT */
-{ yymsp[0].minor.yy260 = OP_TYPE_GREATER_THAN; }
+ case 217: /* compare_op ::= NK_GT */
+{ yymsp[0].minor.yy80 = OP_TYPE_GREATER_THAN; }
break;
- case 157: /* compare_op ::= NK_LE */
-{ yymsp[0].minor.yy260 = OP_TYPE_LOWER_EQUAL; }
+ case 218: /* compare_op ::= NK_LE */
+{ yymsp[0].minor.yy80 = OP_TYPE_LOWER_EQUAL; }
break;
- case 158: /* compare_op ::= NK_GE */
-{ yymsp[0].minor.yy260 = OP_TYPE_GREATER_EQUAL; }
+ case 219: /* compare_op ::= NK_GE */
+{ yymsp[0].minor.yy80 = OP_TYPE_GREATER_EQUAL; }
break;
- case 159: /* compare_op ::= NK_NE */
-{ yymsp[0].minor.yy260 = OP_TYPE_NOT_EQUAL; }
+ case 220: /* compare_op ::= NK_NE */
+{ yymsp[0].minor.yy80 = OP_TYPE_NOT_EQUAL; }
break;
- case 160: /* compare_op ::= NK_EQ */
-{ yymsp[0].minor.yy260 = OP_TYPE_EQUAL; }
+ case 221: /* compare_op ::= NK_EQ */
+{ yymsp[0].minor.yy80 = OP_TYPE_EQUAL; }
break;
- case 161: /* compare_op ::= LIKE */
-{ yymsp[0].minor.yy260 = OP_TYPE_LIKE; }
+ case 222: /* compare_op ::= LIKE */
+{ yymsp[0].minor.yy80 = OP_TYPE_LIKE; }
break;
- case 162: /* compare_op ::= NOT LIKE */
-{ yymsp[-1].minor.yy260 = OP_TYPE_NOT_LIKE; }
+ case 223: /* compare_op ::= NOT LIKE */
+{ yymsp[-1].minor.yy80 = OP_TYPE_NOT_LIKE; }
break;
- case 163: /* compare_op ::= MATCH */
-{ yymsp[0].minor.yy260 = OP_TYPE_MATCH; }
+ case 224: /* compare_op ::= MATCH */
+{ yymsp[0].minor.yy80 = OP_TYPE_MATCH; }
break;
- case 164: /* compare_op ::= NMATCH */
-{ yymsp[0].minor.yy260 = OP_TYPE_NMATCH; }
+ case 225: /* compare_op ::= NMATCH */
+{ yymsp[0].minor.yy80 = OP_TYPE_NMATCH; }
break;
- case 165: /* in_op ::= IN */
-{ yymsp[0].minor.yy260 = OP_TYPE_IN; }
+ case 226: /* in_op ::= IN */
+{ yymsp[0].minor.yy80 = OP_TYPE_IN; }
break;
- case 166: /* in_op ::= NOT IN */
-{ yymsp[-1].minor.yy260 = OP_TYPE_NOT_IN; }
+ case 227: /* in_op ::= NOT IN */
+{ yymsp[-1].minor.yy80 = OP_TYPE_NOT_IN; }
break;
- case 167: /* in_predicate_value ::= NK_LP expression_list NK_RP */
-{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy24)); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 228: /* in_predicate_value ::= NK_LP expression_list NK_RP */
+{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy64)); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 169: /* boolean_value_expression ::= NOT boolean_primary */
+ case 230: /* boolean_value_expression ::= NOT boolean_primary */
{
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy432), NULL));
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy26), NULL));
}
- yymsp[-1].minor.yy432 = yylhsminor.yy432;
+ yymsp[-1].minor.yy26 = yylhsminor.yy26;
break;
- case 170: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
+ case 231: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26)));
}
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 171: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
+ case 232: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26)));
}
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 176: /* from_clause ::= FROM table_reference_list */
- case 206: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==206);
- case 229: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==229);
-{ yymsp[-1].minor.yy432 = yymsp[0].minor.yy432; }
+ case 237: /* from_clause ::= FROM table_reference_list */
+ case 267: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==267);
+ case 290: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==290);
+{ yymsp[-1].minor.yy26 = yymsp[0].minor.yy26; }
break;
- case 178: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
-{ yylhsminor.yy432 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy432, yymsp[0].minor.yy432, NULL); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 239: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
+{ yylhsminor.yy26 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy26, yymsp[0].minor.yy26, NULL); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 181: /* table_primary ::= table_name alias_opt */
-{ yylhsminor.yy432 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); }
- yymsp[-1].minor.yy432 = yylhsminor.yy432;
+ case 242: /* table_primary ::= table_name alias_opt */
+{ yylhsminor.yy26 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy353, &yymsp[0].minor.yy353); }
+ yymsp[-1].minor.yy26 = yylhsminor.yy26;
break;
- case 182: /* table_primary ::= db_name NK_DOT table_name alias_opt */
-{ yylhsminor.yy432 = createRealTableNode(pCxt, &yymsp[-3].minor.yy129, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); }
- yymsp[-3].minor.yy432 = yylhsminor.yy432;
+ case 243: /* table_primary ::= db_name NK_DOT table_name alias_opt */
+{ yylhsminor.yy26 = createRealTableNode(pCxt, &yymsp[-3].minor.yy353, &yymsp[-1].minor.yy353, &yymsp[0].minor.yy353); }
+ yymsp[-3].minor.yy26 = yylhsminor.yy26;
break;
- case 183: /* table_primary ::= subquery alias_opt */
-{ yylhsminor.yy432 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy432), &yymsp[0].minor.yy129); }
- yymsp[-1].minor.yy432 = yylhsminor.yy432;
+ case 244: /* table_primary ::= subquery alias_opt */
+{ yylhsminor.yy26 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy26), &yymsp[0].minor.yy353); }
+ yymsp[-1].minor.yy26 = yylhsminor.yy26;
break;
- case 185: /* alias_opt ::= */
-{ yymsp[1].minor.yy129 = nil_token; }
+ case 246: /* alias_opt ::= */
+{ yymsp[1].minor.yy353 = nil_token; }
break;
- case 186: /* alias_opt ::= table_alias */
-{ yylhsminor.yy129 = yymsp[0].minor.yy129; }
- yymsp[0].minor.yy129 = yylhsminor.yy129;
+ case 247: /* alias_opt ::= table_alias */
+{ yylhsminor.yy353 = yymsp[0].minor.yy353; }
+ yymsp[0].minor.yy353 = yylhsminor.yy353;
break;
- case 187: /* alias_opt ::= AS table_alias */
-{ yymsp[-1].minor.yy129 = yymsp[0].minor.yy129; }
+ case 248: /* alias_opt ::= AS table_alias */
+{ yymsp[-1].minor.yy353 = yymsp[0].minor.yy353; }
break;
- case 188: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
- case 189: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==189);
-{ yymsp[-2].minor.yy432 = yymsp[-1].minor.yy432; }
+ case 249: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
+ case 250: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==250);
+{ yymsp[-2].minor.yy26 = yymsp[-1].minor.yy26; }
break;
- case 190: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
-{ yylhsminor.yy432 = createJoinTableNode(pCxt, yymsp[-4].minor.yy332, yymsp[-5].minor.yy432, yymsp[-2].minor.yy432, yymsp[0].minor.yy432); }
- yymsp[-5].minor.yy432 = yylhsminor.yy432;
+ case 251: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
+{ yylhsminor.yy26 = createJoinTableNode(pCxt, yymsp[-4].minor.yy372, yymsp[-5].minor.yy26, yymsp[-2].minor.yy26, yymsp[0].minor.yy26); }
+ yymsp[-5].minor.yy26 = yylhsminor.yy26;
break;
- case 191: /* join_type ::= */
-{ yymsp[1].minor.yy332 = JOIN_TYPE_INNER; }
+ case 252: /* join_type ::= */
+{ yymsp[1].minor.yy372 = JOIN_TYPE_INNER; }
break;
- case 192: /* join_type ::= INNER */
-{ yymsp[0].minor.yy332 = JOIN_TYPE_INNER; }
+ case 253: /* join_type ::= INNER */
+{ yymsp[0].minor.yy372 = JOIN_TYPE_INNER; }
break;
- case 193: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
+ case 254: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
{
- yymsp[-8].minor.yy432 = createSelectStmt(pCxt, yymsp[-7].minor.yy97, yymsp[-6].minor.yy24, yymsp[-5].minor.yy432);
- yymsp[-8].minor.yy432 = addWhereClause(pCxt, yymsp[-8].minor.yy432, yymsp[-4].minor.yy432);
- yymsp[-8].minor.yy432 = addPartitionByClause(pCxt, yymsp[-8].minor.yy432, yymsp[-3].minor.yy24);
- yymsp[-8].minor.yy432 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy432, yymsp[-2].minor.yy432);
- yymsp[-8].minor.yy432 = addGroupByClause(pCxt, yymsp[-8].minor.yy432, yymsp[-1].minor.yy24);
- yymsp[-8].minor.yy432 = addHavingClause(pCxt, yymsp[-8].minor.yy432, yymsp[0].minor.yy432);
+ yymsp[-8].minor.yy26 = createSelectStmt(pCxt, yymsp[-7].minor.yy107, yymsp[-6].minor.yy64, yymsp[-5].minor.yy26);
+ yymsp[-8].minor.yy26 = addWhereClause(pCxt, yymsp[-8].minor.yy26, yymsp[-4].minor.yy26);
+ yymsp[-8].minor.yy26 = addPartitionByClause(pCxt, yymsp[-8].minor.yy26, yymsp[-3].minor.yy64);
+ yymsp[-8].minor.yy26 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy26, yymsp[-2].minor.yy26);
+ yymsp[-8].minor.yy26 = addGroupByClause(pCxt, yymsp[-8].minor.yy26, yymsp[-1].minor.yy64);
+ yymsp[-8].minor.yy26 = addHavingClause(pCxt, yymsp[-8].minor.yy26, yymsp[0].minor.yy26);
}
break;
- case 195: /* set_quantifier_opt ::= DISTINCT */
-{ yymsp[0].minor.yy97 = true; }
+ case 256: /* set_quantifier_opt ::= DISTINCT */
+{ yymsp[0].minor.yy107 = true; }
break;
- case 196: /* set_quantifier_opt ::= ALL */
-{ yymsp[0].minor.yy97 = false; }
+ case 257: /* set_quantifier_opt ::= ALL */
+{ yymsp[0].minor.yy107 = false; }
break;
- case 197: /* select_list ::= NK_STAR */
-{ yymsp[0].minor.yy24 = NULL; }
+ case 258: /* select_list ::= NK_STAR */
+{ yymsp[0].minor.yy64 = NULL; }
break;
- case 201: /* select_item ::= common_expression */
+ case 262: /* select_item ::= common_expression */
{
- SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432);
- yylhsminor.yy432 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy432), &t);
+ SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26);
+ yylhsminor.yy26 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy26), &t);
}
- yymsp[0].minor.yy432 = yylhsminor.yy432;
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
break;
- case 202: /* select_item ::= common_expression column_alias */
-{ yylhsminor.yy432 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy432), &yymsp[0].minor.yy129); }
- yymsp[-1].minor.yy432 = yylhsminor.yy432;
+ case 263: /* select_item ::= common_expression column_alias */
+{ yylhsminor.yy26 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy26), &yymsp[0].minor.yy353); }
+ yymsp[-1].minor.yy26 = yylhsminor.yy26;
break;
- case 203: /* select_item ::= common_expression AS column_alias */
-{ yylhsminor.yy432 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), &yymsp[0].minor.yy129); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 264: /* select_item ::= common_expression AS column_alias */
+{ yylhsminor.yy26 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), &yymsp[0].minor.yy353); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 204: /* select_item ::= table_name NK_DOT NK_STAR */
-{ yylhsminor.yy432 = createColumnNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 265: /* select_item ::= table_name NK_DOT NK_STAR */
+{ yylhsminor.yy26 = createColumnNode(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 208: /* partition_by_clause_opt ::= PARTITION BY expression_list */
- case 225: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==225);
- case 235: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==235);
-{ yymsp[-2].minor.yy24 = yymsp[0].minor.yy24; }
+ case 269: /* partition_by_clause_opt ::= PARTITION BY expression_list */
+ case 286: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==286);
+ case 296: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==296);
+{ yymsp[-2].minor.yy64 = yymsp[0].minor.yy64; }
break;
- case 210: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */
-{ yymsp[-5].minor.yy432 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy432), &yymsp[-1].minor.yy0); }
+ case 271: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */
+{ yymsp[-5].minor.yy26 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy26), &yymsp[-1].minor.yy0); }
break;
- case 211: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
-{ yymsp[-3].minor.yy432 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy432)); }
+ case 272: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
+{ yymsp[-3].minor.yy26 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy26)); }
break;
- case 212: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
-{ yymsp[-5].minor.yy432 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy432), NULL, yymsp[-1].minor.yy432, yymsp[0].minor.yy432); }
+ case 273: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
+{ yymsp[-5].minor.yy26 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy26), NULL, yymsp[-1].minor.yy26, yymsp[0].minor.yy26); }
break;
- case 213: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
-{ yymsp[-7].minor.yy432 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy432), releaseRawExprNode(pCxt, yymsp[-3].minor.yy432), yymsp[-1].minor.yy432, yymsp[0].minor.yy432); }
+ case 274: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
+{ yymsp[-7].minor.yy26 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy26), releaseRawExprNode(pCxt, yymsp[-3].minor.yy26), yymsp[-1].minor.yy26, yymsp[0].minor.yy26); }
break;
- case 215: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
-{ yymsp[-3].minor.yy432 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy432); }
+ case 276: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
+{ yymsp[-3].minor.yy26 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy26); }
break;
- case 217: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
-{ yymsp[-3].minor.yy432 = createFillNode(pCxt, yymsp[-1].minor.yy294, NULL); }
+ case 278: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
+{ yymsp[-3].minor.yy26 = createFillNode(pCxt, yymsp[-1].minor.yy192, NULL); }
break;
- case 218: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
-{ yymsp[-5].minor.yy432 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy24)); }
+ case 279: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
+{ yymsp[-5].minor.yy26 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy64)); }
break;
- case 219: /* fill_mode ::= NONE */
-{ yymsp[0].minor.yy294 = FILL_MODE_NONE; }
+ case 280: /* fill_mode ::= NONE */
+{ yymsp[0].minor.yy192 = FILL_MODE_NONE; }
break;
- case 220: /* fill_mode ::= PREV */
-{ yymsp[0].minor.yy294 = FILL_MODE_PREV; }
+ case 281: /* fill_mode ::= PREV */
+{ yymsp[0].minor.yy192 = FILL_MODE_PREV; }
break;
- case 221: /* fill_mode ::= NULL */
-{ yymsp[0].minor.yy294 = FILL_MODE_NULL; }
+ case 282: /* fill_mode ::= NULL */
+{ yymsp[0].minor.yy192 = FILL_MODE_NULL; }
break;
- case 222: /* fill_mode ::= LINEAR */
-{ yymsp[0].minor.yy294 = FILL_MODE_LINEAR; }
+ case 283: /* fill_mode ::= LINEAR */
+{ yymsp[0].minor.yy192 = FILL_MODE_LINEAR; }
break;
- case 223: /* fill_mode ::= NEXT */
-{ yymsp[0].minor.yy294 = FILL_MODE_NEXT; }
+ case 284: /* fill_mode ::= NEXT */
+{ yymsp[0].minor.yy192 = FILL_MODE_NEXT; }
break;
- case 226: /* group_by_list ::= expression */
-{ yylhsminor.yy24 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); }
- yymsp[0].minor.yy24 = yylhsminor.yy24;
+ case 287: /* group_by_list ::= expression */
+{ yylhsminor.yy64 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); }
+ yymsp[0].minor.yy64 = yylhsminor.yy64;
break;
- case 227: /* group_by_list ::= group_by_list NK_COMMA expression */
-{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-2].minor.yy24, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); }
- yymsp[-2].minor.yy24 = yylhsminor.yy24;
+ case 288: /* group_by_list ::= group_by_list NK_COMMA expression */
+{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); }
+ yymsp[-2].minor.yy64 = yylhsminor.yy64;
break;
- case 230: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
+ case 291: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
{
- yylhsminor.yy432 = addOrderByClause(pCxt, yymsp[-3].minor.yy432, yymsp[-2].minor.yy24);
- yylhsminor.yy432 = addSlimitClause(pCxt, yylhsminor.yy432, yymsp[-1].minor.yy432);
- yylhsminor.yy432 = addLimitClause(pCxt, yylhsminor.yy432, yymsp[0].minor.yy432);
+ yylhsminor.yy26 = addOrderByClause(pCxt, yymsp[-3].minor.yy26, yymsp[-2].minor.yy64);
+ yylhsminor.yy26 = addSlimitClause(pCxt, yylhsminor.yy26, yymsp[-1].minor.yy26);
+ yylhsminor.yy26 = addLimitClause(pCxt, yylhsminor.yy26, yymsp[0].minor.yy26);
}
- yymsp[-3].minor.yy432 = yylhsminor.yy432;
+ yymsp[-3].minor.yy26 = yylhsminor.yy26;
break;
- case 232: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
-{ yylhsminor.yy432 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy432, yymsp[0].minor.yy432); }
- yymsp[-3].minor.yy432 = yylhsminor.yy432;
+ case 293: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
+{ yylhsminor.yy26 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy26, yymsp[0].minor.yy26); }
+ yymsp[-3].minor.yy26 = yylhsminor.yy26;
break;
- case 237: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
- case 241: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==241);
-{ yymsp[-1].minor.yy432 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
+ case 298: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
+ case 302: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==302);
+{ yymsp[-1].minor.yy26 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
break;
- case 238: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
- case 242: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==242);
-{ yymsp[-3].minor.yy432 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
+ case 299: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
+ case 303: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==303);
+{ yymsp[-3].minor.yy26 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
break;
- case 239: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- case 243: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==243);
-{ yymsp[-3].minor.yy432 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
+ case 300: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ case 304: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==304);
+{ yymsp[-3].minor.yy26 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
break;
- case 244: /* subquery ::= NK_LP query_expression NK_RP */
-{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy432); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 305: /* subquery ::= NK_LP query_expression NK_RP */
+{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy26); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 245: /* search_condition ::= common_expression */
-{ yylhsminor.yy432 = releaseRawExprNode(pCxt, yymsp[0].minor.yy432); }
- yymsp[0].minor.yy432 = yylhsminor.yy432;
+ case 306: /* search_condition ::= common_expression */
+{ yylhsminor.yy26 = releaseRawExprNode(pCxt, yymsp[0].minor.yy26); }
+ yymsp[0].minor.yy26 = yylhsminor.yy26;
break;
- case 248: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
-{ yylhsminor.yy432 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), yymsp[-1].minor.yy378, yymsp[0].minor.yy257); }
- yymsp[-2].minor.yy432 = yylhsminor.yy432;
+ case 309: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
+{ yylhsminor.yy26 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), yymsp[-1].minor.yy32, yymsp[0].minor.yy391); }
+ yymsp[-2].minor.yy26 = yylhsminor.yy26;
break;
- case 249: /* ordering_specification_opt ::= */
-{ yymsp[1].minor.yy378 = ORDER_ASC; }
+ case 310: /* ordering_specification_opt ::= */
+{ yymsp[1].minor.yy32 = ORDER_ASC; }
break;
- case 250: /* ordering_specification_opt ::= ASC */
-{ yymsp[0].minor.yy378 = ORDER_ASC; }
+ case 311: /* ordering_specification_opt ::= ASC */
+{ yymsp[0].minor.yy32 = ORDER_ASC; }
break;
- case 251: /* ordering_specification_opt ::= DESC */
-{ yymsp[0].minor.yy378 = ORDER_DESC; }
+ case 312: /* ordering_specification_opt ::= DESC */
+{ yymsp[0].minor.yy32 = ORDER_DESC; }
break;
- case 252: /* null_ordering_opt ::= */
-{ yymsp[1].minor.yy257 = NULL_ORDER_DEFAULT; }
+ case 313: /* null_ordering_opt ::= */
+{ yymsp[1].minor.yy391 = NULL_ORDER_DEFAULT; }
break;
- case 253: /* null_ordering_opt ::= NULLS FIRST */
-{ yymsp[-1].minor.yy257 = NULL_ORDER_FIRST; }
+ case 314: /* null_ordering_opt ::= NULLS FIRST */
+{ yymsp[-1].minor.yy391 = NULL_ORDER_FIRST; }
break;
- case 254: /* null_ordering_opt ::= NULLS LAST */
-{ yymsp[-1].minor.yy257 = NULL_ORDER_LAST; }
+ case 315: /* null_ordering_opt ::= NULLS LAST */
+{ yymsp[-1].minor.yy391 = NULL_ORDER_LAST; }
break;
default:
break;
@@ -2839,13 +3237,15 @@ static void yy_syntax_error(
ParseCTX_FETCH
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
-
- if(TOKEN.z) {
- generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z);
- } else {
- generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL);
+
+ if (pCxt->valid) {
+ if(TOKEN.z) {
+ generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z);
+ } else {
+ generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL);
+ }
+ pCxt->valid = false;
}
- pCxt->valid = false;
/************ End %syntax_error code ******************************************/
ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
diff --git a/source/libs/parser/test/mockCatalogService.cpp b/source/libs/parser/test/mockCatalogService.cpp
index 65d3f51dde..1f333e49e7 100644
--- a/source/libs/parser/test/mockCatalogService.cpp
+++ b/source/libs/parser/test/mockCatalogService.cpp
@@ -13,12 +13,11 @@
* along with this program. If not, see .
*/
-#include "mockCatalogService.h"
-
#include
#include
#include