diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 3a6622c145..c3d45cc7be 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -42,13 +42,12 @@ extern "C" { #define SHOW_CREATE_VIEW_RESULT_FIELD1_LEN (TSDB_VIEW_FNAME_LEN + 4 + VARSTR_HEADER_SIZE) #define SHOW_CREATE_VIEW_RESULT_FIELD2_LEN (TSDB_MAX_ALLOWED_SQL_LEN + VARSTR_HEADER_SIZE) - #define SHOW_LOCAL_VARIABLES_RESULT_COLS 3 #define SHOW_LOCAL_VARIABLES_RESULT_FIELD1_LEN (TSDB_CONFIG_OPTION_LEN + VARSTR_HEADER_SIZE) #define SHOW_LOCAL_VARIABLES_RESULT_FIELD2_LEN (TSDB_CONFIG_VALUE_LEN + VARSTR_HEADER_SIZE) #define SHOW_LOCAL_VARIABLES_RESULT_FIELD3_LEN (TSDB_CONFIG_SCOPE_LEN + VARSTR_HEADER_SIZE) -#define COMPACT_DB_RESULT_COLS 3 +#define COMPACT_DB_RESULT_COLS 3 #define COMPACT_DB_RESULT_FIELD1_LEN 32 #define COMPACT_DB_RESULT_FIELD3_LEN 128 @@ -166,13 +165,13 @@ typedef struct STableOptions { } STableOptions; typedef struct SColumnOptions { - ENodeType type; - bool commentNull; - char comment[TSDB_CL_COMMENT_LEN]; - char encode[TSDB_CL_COMPRESS_OPTION_LEN]; - char compress[TSDB_CL_COMPRESS_OPTION_LEN]; - char compressLevel[TSDB_CL_COMPRESS_OPTION_LEN]; - bool bPrimaryKey; + ENodeType type; + bool commentNull; + char comment[TSDB_CL_COMMENT_LEN]; + char encode[TSDB_CL_COMPRESS_OPTION_LEN]; + char compress[TSDB_CL_COMPRESS_OPTION_LEN]; + char compressLevel[TSDB_CL_COMPRESS_OPTION_LEN]; + bool bPrimaryKey; } SColumnOptions; typedef struct SColumnDefNode { ENodeType type; @@ -180,6 +179,7 @@ typedef struct SColumnDefNode { SDataType dataType; SColumnOptions* pOptions; bool sma; + bool is_pk; } SColumnDefNode; typedef struct SCreateTableStmt { @@ -242,24 +242,24 @@ typedef struct SAlterTableStmt { } SAlterTableStmt; typedef struct SCreateUserStmt { - ENodeType type; - char userName[TSDB_USER_LEN]; - char password[TSDB_USET_PASSWORD_LEN]; - int8_t sysinfo; - int32_t numIpRanges; + ENodeType type; + char userName[TSDB_USER_LEN]; + char password[TSDB_USET_PASSWORD_LEN]; + int8_t sysinfo; + int32_t numIpRanges; SIpV4Range* pIpRanges; SNodeList* pNodeListIpRanges; } SCreateUserStmt; typedef struct SAlterUserStmt { - ENodeType type; - char userName[TSDB_USER_LEN]; - int8_t alterType; - char password[TSDB_USET_PASSWORD_LEN]; - int8_t enable; - int8_t sysinfo; - int32_t numIpRanges; + ENodeType type; + char userName[TSDB_USER_LEN]; + int8_t alterType; + char password[TSDB_USET_PASSWORD_LEN]; + int8_t enable; + int8_t sysinfo; + int32_t numIpRanges; SIpV4Range* pIpRanges; SNodeList* pNodeListIpRanges; @@ -297,7 +297,7 @@ typedef struct SShowStmt { SNode* pDbName; // SValueNode SNode* pTbName; // SValueNode EOperatorType tableCondType; - EShowKind showKind; // show databases: user/system, show tables: normal/child, others NULL + EShowKind showKind; // show databases: user/system, show tables: normal/child, others NULL } SShowStmt; typedef struct SShowCreateDatabaseStmt { @@ -358,7 +358,7 @@ typedef struct SShowCompactsStmt { typedef struct SShowCompactDetailsStmt { ENodeType type; - SNode* pCompactId; + SNode* pCompactId; } SShowCompactDetailsStmt; typedef enum EIndexType { INDEX_TYPE_SMA = 1, INDEX_TYPE_FULLTEXT, INDEX_TYPE_NORMAL } EIndexType; @@ -536,20 +536,20 @@ typedef struct SDropFunctionStmt { } SDropFunctionStmt; typedef struct SCreateViewStmt { - ENodeType type; - char dbName[TSDB_DB_NAME_LEN]; - char viewName[TSDB_VIEW_NAME_LEN]; - char* pQuerySql; - bool orReplace; - SNode* pQuery; - SCMCreateViewReq createReq; + ENodeType type; + char dbName[TSDB_DB_NAME_LEN]; + char viewName[TSDB_VIEW_NAME_LEN]; + char* pQuerySql; + bool orReplace; + SNode* pQuery; + SCMCreateViewReq createReq; } SCreateViewStmt; typedef struct SDropViewStmt { - ENodeType type; - char dbName[TSDB_DB_NAME_LEN]; - char viewName[TSDB_VIEW_NAME_LEN]; - bool ignoreNotExists; + ENodeType type; + char dbName[TSDB_DB_NAME_LEN]; + char viewName[TSDB_VIEW_NAME_LEN]; + bool ignoreNotExists; } SDropViewStmt; typedef struct SGrantStmt {