2022-01-23 12:34:16 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can use, redistribute, and/or modify
|
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3
|
|
|
|
|
* or later ("AGPL"), as published by the Free Software Foundation.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2022-03-03 12:25:16 +00:00
|
|
|
#ifndef _TD_CMD_NODES_H_
|
|
|
|
|
#define _TD_CMD_NODES_H_
|
2022-01-23 12:34:16 +00:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-03-31 06:19:11 +00:00
|
|
|
#include "query.h"
|
2022-03-02 02:50:51 +00:00
|
|
|
#include "querynodes.h"
|
2022-01-23 12:34:16 +00:00
|
|
|
|
2024-03-13 07:17:43 +00:00
|
|
|
#define DESCRIBE_RESULT_COLS 4
|
|
|
|
|
#define DESCRIBE_RESULT_COLS_COMPRESS 7
|
2024-03-12 08:46:41 +00:00
|
|
|
#define DESCRIBE_RESULT_FIELD_LEN (TSDB_COL_NAME_LEN - 1 + VARSTR_HEADER_SIZE)
|
|
|
|
|
#define DESCRIBE_RESULT_TYPE_LEN (20 + VARSTR_HEADER_SIZE)
|
|
|
|
|
#define DESCRIBE_RESULT_NOTE_LEN (16 + VARSTR_HEADER_SIZE)
|
|
|
|
|
#define DESCRIBE_RESULT_COPRESS_OPTION_LEN (TSDB_CL_COMPRESS_OPTION_LEN + VARSTR_HEADER_SIZE)
|
2022-03-31 06:19:11 +00:00
|
|
|
|
2022-06-23 10:03:15 +00:00
|
|
|
#define SHOW_CREATE_DB_RESULT_COLS 2
|
2022-06-18 11:50:53 +00:00
|
|
|
#define SHOW_CREATE_DB_RESULT_FIELD1_LEN (TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE)
|
|
|
|
|
#define SHOW_CREATE_DB_RESULT_FIELD2_LEN (TSDB_MAX_BINARY_LEN + VARSTR_HEADER_SIZE)
|
|
|
|
|
|
2022-06-23 10:03:15 +00:00
|
|
|
#define SHOW_CREATE_TB_RESULT_COLS 2
|
2022-06-20 12:58:36 +00:00
|
|
|
#define SHOW_CREATE_TB_RESULT_FIELD1_LEN (TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE)
|
2022-10-21 09:24:06 +00:00
|
|
|
#define SHOW_CREATE_TB_RESULT_FIELD2_LEN (TSDB_MAX_ALLOWED_SQL_LEN * 3)
|
2022-06-20 12:58:36 +00:00
|
|
|
|
2023-10-11 02:38:22 +00:00
|
|
|
#define SHOW_CREATE_VIEW_RESULT_COLS 2
|
|
|
|
|
#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)
|
|
|
|
|
|
2023-07-14 06:38:35 +00:00
|
|
|
#define SHOW_LOCAL_VARIABLES_RESULT_COLS 3
|
2022-06-22 09:17:18 +00:00
|
|
|
#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)
|
2023-07-14 06:38:35 +00:00
|
|
|
#define SHOW_LOCAL_VARIABLES_RESULT_FIELD3_LEN (TSDB_CONFIG_SCOPE_LEN + VARSTR_HEADER_SIZE)
|
2022-06-22 09:17:18 +00:00
|
|
|
|
2024-03-29 03:02:33 +00:00
|
|
|
#define COMPACT_DB_RESULT_COLS 3
|
2023-11-16 06:40:54 +00:00
|
|
|
#define COMPACT_DB_RESULT_FIELD1_LEN 32
|
|
|
|
|
#define COMPACT_DB_RESULT_FIELD3_LEN 128
|
|
|
|
|
|
2022-12-29 10:07:57 +00:00
|
|
|
#define SHOW_ALIVE_RESULT_COLS 1
|
2022-06-07 03:53:32 +00:00
|
|
|
|
2023-03-03 08:57:13 +00:00
|
|
|
#define BIT_FLAG_MASK(n) (1 << n)
|
|
|
|
|
#define BIT_FLAG_SET_MASK(val, mask) ((val) |= (mask))
|
|
|
|
|
#define BIT_FLAG_TEST_MASK(val, mask) (((val) & (mask)) != 0)
|
2022-06-07 03:53:32 +00:00
|
|
|
|
2023-03-03 08:57:13 +00:00
|
|
|
#define PRIVILEGE_TYPE_ALL BIT_FLAG_MASK(0)
|
|
|
|
|
#define PRIVILEGE_TYPE_READ BIT_FLAG_MASK(1)
|
|
|
|
|
#define PRIVILEGE_TYPE_WRITE BIT_FLAG_MASK(2)
|
|
|
|
|
#define PRIVILEGE_TYPE_SUBSCRIBE BIT_FLAG_MASK(3)
|
2023-10-16 11:53:08 +00:00
|
|
|
#define PRIVILEGE_TYPE_ALTER BIT_FLAG_MASK(4)
|
2022-06-07 03:53:32 +00:00
|
|
|
|
2022-03-01 02:13:22 +00:00
|
|
|
typedef struct SDatabaseOptions {
|
2022-04-27 10:18:37 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
int32_t buffer;
|
2022-07-16 03:47:26 +00:00
|
|
|
char cacheModelStr[TSDB_CACHE_MODEL_STR_LEN];
|
|
|
|
|
int8_t cacheModel;
|
2022-07-06 10:47:33 +00:00
|
|
|
int32_t cacheLastSize;
|
2022-04-27 10:18:37 +00:00
|
|
|
int8_t compressionLevel;
|
2024-03-26 11:56:15 +00:00
|
|
|
int8_t encryptAlgorithm;
|
2022-04-27 10:18:37 +00:00
|
|
|
int32_t daysPerFile;
|
2024-03-26 11:56:15 +00:00
|
|
|
char encryptAlgorithmStr[TSDB_ENCRYPT_ALGO_STR_LEN];
|
2022-04-07 10:19:20 +00:00
|
|
|
SValueNode* pDaysPerFile;
|
2022-04-27 10:18:37 +00:00
|
|
|
int32_t fsyncPeriod;
|
|
|
|
|
int32_t maxRowsPerBlock;
|
|
|
|
|
int32_t minRowsPerBlock;
|
|
|
|
|
SNodeList* pKeep;
|
2022-06-11 07:44:49 +00:00
|
|
|
int64_t keep[3];
|
2023-09-19 10:44:27 +00:00
|
|
|
int32_t keepTimeOffset;
|
2022-04-27 10:18:37 +00:00
|
|
|
int32_t pages;
|
|
|
|
|
int32_t pagesize;
|
2022-09-13 06:19:50 +00:00
|
|
|
int32_t tsdbPageSize;
|
2022-04-27 10:18:37 +00:00
|
|
|
char precisionStr[3];
|
|
|
|
|
int8_t precision;
|
|
|
|
|
int8_t replica;
|
2022-07-16 03:47:26 +00:00
|
|
|
char strictStr[TSDB_DB_STRICT_STR_LEN];
|
2022-04-27 10:18:37 +00:00
|
|
|
int8_t strict;
|
|
|
|
|
int8_t walLevel;
|
|
|
|
|
int32_t numOfVgroups;
|
|
|
|
|
int8_t singleStable;
|
|
|
|
|
SNodeList* pRetentions;
|
2022-05-25 13:20:11 +00:00
|
|
|
int8_t schemaless;
|
2022-07-25 13:09:06 +00:00
|
|
|
int32_t walRetentionPeriod;
|
|
|
|
|
int32_t walRetentionSize;
|
|
|
|
|
int32_t walRollPeriod;
|
|
|
|
|
int32_t walSegmentSize;
|
2022-09-01 07:52:03 +00:00
|
|
|
bool walRetentionPeriodIsSet;
|
|
|
|
|
bool walRetentionSizeIsSet;
|
|
|
|
|
bool walRollPeriodIsSet;
|
2022-09-01 11:01:37 +00:00
|
|
|
int32_t sstTrigger;
|
2022-09-03 03:22:36 +00:00
|
|
|
int32_t tablePrefix;
|
|
|
|
|
int32_t tableSuffix;
|
2024-04-08 02:33:02 +00:00
|
|
|
int32_t s3ChunkSize;
|
|
|
|
|
int32_t s3KeepLocal;
|
|
|
|
|
SValueNode* s3KeepLocalStr;
|
|
|
|
|
int8_t s3Compact;
|
2024-03-15 01:14:54 +00:00
|
|
|
int8_t withArbitrator;
|
2022-03-01 02:13:22 +00:00
|
|
|
} SDatabaseOptions;
|
2022-01-23 12:34:16 +00:00
|
|
|
|
2022-03-01 02:13:22 +00:00
|
|
|
typedef struct SCreateDatabaseStmt {
|
2022-04-27 10:18:37 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
bool ignoreExists;
|
2022-03-15 08:00:09 +00:00
|
|
|
SDatabaseOptions* pOptions;
|
2022-03-01 02:13:22 +00:00
|
|
|
} SCreateDatabaseStmt;
|
2022-01-23 12:34:16 +00:00
|
|
|
|
2022-03-03 12:25:16 +00:00
|
|
|
typedef struct SUseDatabaseStmt {
|
|
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
2022-03-03 12:25:16 +00:00
|
|
|
} SUseDatabaseStmt;
|
|
|
|
|
|
2022-03-07 12:18:05 +00:00
|
|
|
typedef struct SDropDatabaseStmt {
|
|
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
bool ignoreNotExists;
|
2022-03-07 12:18:05 +00:00
|
|
|
} SDropDatabaseStmt;
|
|
|
|
|
|
2022-03-16 06:08:59 +00:00
|
|
|
typedef struct SAlterDatabaseStmt {
|
2022-04-27 10:18:37 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
2022-03-16 06:08:59 +00:00
|
|
|
SDatabaseOptions* pOptions;
|
|
|
|
|
} SAlterDatabaseStmt;
|
|
|
|
|
|
2022-06-29 10:20:27 +00:00
|
|
|
typedef struct SFlushDatabaseStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
} SFlushDatabaseStmt;
|
|
|
|
|
|
2022-07-11 02:53:06 +00:00
|
|
|
typedef struct STrimDatabaseStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
2022-09-26 10:39:47 +00:00
|
|
|
int32_t maxSpeed;
|
2022-07-11 02:53:06 +00:00
|
|
|
} STrimDatabaseStmt;
|
|
|
|
|
|
2024-04-08 02:33:02 +00:00
|
|
|
typedef struct SS3MigrateDatabaseStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
} SS3MigrateDatabaseStmt;
|
|
|
|
|
|
2022-12-27 03:11:02 +00:00
|
|
|
typedef struct SCompactDatabaseStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
2023-03-07 07:24:04 +00:00
|
|
|
SNode* pStart;
|
|
|
|
|
SNode* pEnd;
|
2022-12-27 03:11:02 +00:00
|
|
|
} SCompactDatabaseStmt;
|
|
|
|
|
|
2022-03-02 02:50:51 +00:00
|
|
|
typedef struct STableOptions {
|
2022-04-27 10:18:37 +00:00
|
|
|
ENodeType type;
|
2022-06-16 12:45:00 +00:00
|
|
|
bool commentNull;
|
2022-05-19 06:26:10 +00:00
|
|
|
char comment[TSDB_TB_COMMENT_LEN];
|
2022-06-17 09:27:42 +00:00
|
|
|
SNodeList* pMaxDelay;
|
|
|
|
|
int64_t maxDelay1;
|
|
|
|
|
int64_t maxDelay2;
|
|
|
|
|
SNodeList* pWatermark;
|
|
|
|
|
int64_t watermark1;
|
|
|
|
|
int64_t watermark2;
|
2022-12-06 08:07:11 +00:00
|
|
|
SNodeList* pDeleteMark;
|
|
|
|
|
int64_t deleteMark1;
|
|
|
|
|
int64_t deleteMark2;
|
2022-04-27 10:18:37 +00:00
|
|
|
SNodeList* pRollupFuncs;
|
|
|
|
|
int32_t ttl;
|
2022-03-05 23:12:08 +00:00
|
|
|
SNodeList* pSma;
|
2022-03-02 02:50:51 +00:00
|
|
|
} STableOptions;
|
|
|
|
|
|
2024-03-07 10:06:15 +00:00
|
|
|
typedef struct SColumnOptions {
|
2024-03-29 03:02:33 +00:00
|
|
|
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;
|
2024-03-07 10:06:15 +00:00
|
|
|
} SColumnOptions;
|
2022-03-02 02:50:51 +00:00
|
|
|
typedef struct SColumnDefNode {
|
|
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
char colName[TSDB_COL_NAME_LEN];
|
2022-03-02 02:50:51 +00:00
|
|
|
SDataType dataType;
|
2024-04-15 07:07:45 +00:00
|
|
|
SNode* pOptions;
|
2022-04-27 10:18:37 +00:00
|
|
|
bool sma;
|
2022-03-02 02:50:51 +00:00
|
|
|
} SColumnDefNode;
|
|
|
|
|
|
|
|
|
|
typedef struct SCreateTableStmt {
|
2022-04-27 10:18:37 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char tableName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
bool ignoreExists;
|
|
|
|
|
SNodeList* pCols;
|
|
|
|
|
SNodeList* pTags;
|
2022-03-15 08:00:09 +00:00
|
|
|
STableOptions* pOptions;
|
2022-03-02 02:50:51 +00:00
|
|
|
} SCreateTableStmt;
|
|
|
|
|
|
2022-03-06 13:52:12 +00:00
|
|
|
typedef struct SCreateSubTableClause {
|
2022-06-20 12:36:15 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char tableName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
char useDbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char useTableName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
bool ignoreExists;
|
|
|
|
|
SNodeList* pSpecificTags;
|
|
|
|
|
SNodeList* pValsOfTags;
|
2022-06-14 11:06:14 +00:00
|
|
|
STableOptions* pOptions;
|
2022-03-06 13:52:12 +00:00
|
|
|
} SCreateSubTableClause;
|
2022-03-05 23:12:08 +00:00
|
|
|
|
2024-06-24 14:13:03 +00:00
|
|
|
typedef struct SCreateSubTableFromFileClause {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char useDbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char useTableName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
bool ignoreExists;
|
|
|
|
|
SNodeList* pSpecificTags;
|
|
|
|
|
char filePath[PATH_MAX];
|
|
|
|
|
} SCreateSubTableFromFileClause;
|
|
|
|
|
|
2022-12-21 05:51:06 +00:00
|
|
|
typedef struct SCreateMultiTablesStmt {
|
2022-04-27 10:18:37 +00:00
|
|
|
ENodeType type;
|
2022-03-05 23:12:08 +00:00
|
|
|
SNodeList* pSubTables;
|
2022-12-21 05:51:06 +00:00
|
|
|
} SCreateMultiTablesStmt;
|
2022-03-02 02:50:51 +00:00
|
|
|
|
2022-03-07 12:18:05 +00:00
|
|
|
typedef struct SDropTableClause {
|
|
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char tableName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
bool ignoreNotExists;
|
2024-03-12 09:36:45 +00:00
|
|
|
SArray* pTsmas;
|
2022-03-07 12:18:05 +00:00
|
|
|
} SDropTableClause;
|
|
|
|
|
|
|
|
|
|
typedef struct SDropTableStmt {
|
2022-04-27 10:18:37 +00:00
|
|
|
ENodeType type;
|
2022-03-07 12:18:05 +00:00
|
|
|
SNodeList* pTables;
|
2024-03-12 09:36:45 +00:00
|
|
|
bool withTsma;
|
2022-03-07 12:18:05 +00:00
|
|
|
} SDropTableStmt;
|
|
|
|
|
|
2022-03-08 09:25:26 +00:00
|
|
|
typedef struct SDropSuperTableStmt {
|
|
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char tableName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
bool ignoreNotExists;
|
2022-03-08 09:25:26 +00:00
|
|
|
} SDropSuperTableStmt;
|
|
|
|
|
|
2022-03-16 11:28:40 +00:00
|
|
|
typedef struct SAlterTableStmt {
|
2024-03-07 10:06:15 +00:00
|
|
|
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;
|
|
|
|
|
SColumnOptions* pColOptions;
|
2022-03-16 11:28:40 +00:00
|
|
|
} SAlterTableStmt;
|
|
|
|
|
|
2022-03-07 12:18:05 +00:00
|
|
|
typedef struct SCreateUserStmt {
|
2024-03-29 03:02:33 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
char userName[TSDB_USER_LEN];
|
|
|
|
|
char password[TSDB_USET_PASSWORD_LEN];
|
|
|
|
|
int8_t sysinfo;
|
2024-06-17 06:31:39 +00:00
|
|
|
int8_t createDb;
|
|
|
|
|
int8_t isImport;
|
2024-03-29 03:02:33 +00:00
|
|
|
int32_t numIpRanges;
|
2023-08-29 09:35:03 +00:00
|
|
|
SIpV4Range* pIpRanges;
|
2023-08-30 09:12:12 +00:00
|
|
|
|
|
|
|
|
SNodeList* pNodeListIpRanges;
|
2022-03-07 12:18:05 +00:00
|
|
|
} SCreateUserStmt;
|
|
|
|
|
|
|
|
|
|
typedef struct SAlterUserStmt {
|
2024-03-29 03:02:33 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
char userName[TSDB_USER_LEN];
|
|
|
|
|
int8_t alterType;
|
|
|
|
|
char password[TSDB_USET_PASSWORD_LEN];
|
|
|
|
|
int8_t enable;
|
|
|
|
|
int8_t sysinfo;
|
2024-05-22 11:00:47 +00:00
|
|
|
int8_t createdb;
|
2024-03-29 03:02:33 +00:00
|
|
|
int32_t numIpRanges;
|
2023-08-29 09:35:03 +00:00
|
|
|
SIpV4Range* pIpRanges;
|
2023-08-30 09:12:12 +00:00
|
|
|
|
|
|
|
|
SNodeList* pNodeListIpRanges;
|
2022-03-07 12:18:05 +00:00
|
|
|
} SAlterUserStmt;
|
|
|
|
|
|
|
|
|
|
typedef struct SDropUserStmt {
|
|
|
|
|
ENodeType type;
|
2022-12-20 08:53:08 +00:00
|
|
|
char userName[TSDB_USER_LEN];
|
2022-03-07 12:18:05 +00:00
|
|
|
} SDropUserStmt;
|
|
|
|
|
|
|
|
|
|
typedef struct SCreateDnodeStmt {
|
|
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
char fqdn[TSDB_FQDN_LEN];
|
|
|
|
|
int32_t port;
|
2022-03-07 12:18:05 +00:00
|
|
|
} SCreateDnodeStmt;
|
|
|
|
|
|
|
|
|
|
typedef struct SDropDnodeStmt {
|
|
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
int32_t dnodeId;
|
|
|
|
|
char fqdn[TSDB_FQDN_LEN];
|
|
|
|
|
int32_t port;
|
2022-10-31 02:30:54 +00:00
|
|
|
bool force;
|
2023-05-16 01:50:10 +00:00
|
|
|
bool unsafe;
|
2022-03-07 12:18:05 +00:00
|
|
|
} SDropDnodeStmt;
|
|
|
|
|
|
2022-03-16 11:28:40 +00:00
|
|
|
typedef struct SAlterDnodeStmt {
|
|
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
int32_t dnodeId;
|
|
|
|
|
char config[TSDB_DNODE_CONFIG_LEN];
|
|
|
|
|
char value[TSDB_DNODE_VALUE_LEN];
|
2022-03-16 11:28:40 +00:00
|
|
|
} SAlterDnodeStmt;
|
|
|
|
|
|
2022-03-08 09:25:26 +00:00
|
|
|
typedef struct SShowStmt {
|
2022-06-18 10:37:18 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
SNode* pDbName; // SValueNode
|
|
|
|
|
SNode* pTbName; // SValueNode
|
|
|
|
|
EOperatorType tableCondType;
|
2024-03-29 03:02:33 +00:00
|
|
|
EShowKind showKind; // show databases: user/system, show tables: normal/child, others NULL
|
2024-06-17 06:31:39 +00:00
|
|
|
bool withFull; // for show users full;
|
2022-03-08 09:25:26 +00:00
|
|
|
} SShowStmt;
|
|
|
|
|
|
2022-06-17 13:16:13 +00:00
|
|
|
typedef struct SShowCreateDatabaseStmt {
|
2022-04-01 08:31:24 +00:00
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
2023-03-02 03:33:29 +00:00
|
|
|
char dbFName[TSDB_DB_FNAME_LEN];
|
2022-06-17 13:16:13 +00:00
|
|
|
void* pCfg; // SDbCfgInfo
|
|
|
|
|
} SShowCreateDatabaseStmt;
|
|
|
|
|
|
2022-12-29 10:07:57 +00:00
|
|
|
typedef struct SShowAliveStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
} SShowAliveStmt;
|
|
|
|
|
|
2022-06-17 13:16:13 +00:00
|
|
|
typedef struct SShowCreateTableStmt {
|
2022-06-23 10:03:15 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char tableName[TSDB_TABLE_NAME_LEN];
|
2022-08-02 12:20:44 +00:00
|
|
|
void* pDbCfg; // SDbCfgInfo
|
|
|
|
|
void* pTableCfg; // STableCfg
|
2022-06-17 13:16:13 +00:00
|
|
|
} SShowCreateTableStmt;
|
2022-04-01 08:31:24 +00:00
|
|
|
|
2023-10-11 02:38:22 +00:00
|
|
|
typedef struct SShowCreateViewStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char viewName[TSDB_VIEW_NAME_LEN];
|
|
|
|
|
void* pViewMeta;
|
|
|
|
|
} SShowCreateViewStmt;
|
|
|
|
|
|
2022-06-18 10:37:18 +00:00
|
|
|
typedef struct SShowTableDistributedStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char tableName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
} SShowTableDistributedStmt;
|
|
|
|
|
|
2022-06-20 12:36:15 +00:00
|
|
|
typedef struct SShowDnodeVariablesStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
SNode* pDnodeId;
|
2022-10-24 08:34:10 +00:00
|
|
|
SNode* pLikePattern;
|
2022-06-20 12:36:15 +00:00
|
|
|
} SShowDnodeVariablesStmt;
|
|
|
|
|
|
2022-09-01 11:01:37 +00:00
|
|
|
typedef struct SShowVnodesStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
SNode* pDnodeId;
|
|
|
|
|
SNode* pDnodeEndpoint;
|
|
|
|
|
} SShowVnodesStmt;
|
|
|
|
|
|
2022-11-10 09:22:13 +00:00
|
|
|
typedef struct SShowTableTagsStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
SNode* pDbName; // SValueNode
|
|
|
|
|
SNode* pTbName; // SValueNode
|
|
|
|
|
SNodeList* pTags;
|
|
|
|
|
} SShowTableTagsStmt;
|
|
|
|
|
|
2023-11-16 03:41:02 +00:00
|
|
|
typedef struct SShowCompactsStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
} SShowCompactsStmt;
|
|
|
|
|
|
2023-11-23 07:26:21 +00:00
|
|
|
typedef struct SShowCompactDetailsStmt {
|
|
|
|
|
ENodeType type;
|
2024-03-29 03:02:33 +00:00
|
|
|
SNode* pCompactId;
|
2023-11-23 07:26:21 +00:00
|
|
|
} SShowCompactDetailsStmt;
|
|
|
|
|
|
2022-12-28 02:31:34 +00:00
|
|
|
typedef enum EIndexType { INDEX_TYPE_SMA = 1, INDEX_TYPE_FULLTEXT, INDEX_TYPE_NORMAL } EIndexType;
|
2022-03-15 08:00:09 +00:00
|
|
|
|
|
|
|
|
typedef struct SIndexOptions {
|
2022-04-27 10:18:37 +00:00
|
|
|
ENodeType type;
|
2022-03-15 08:00:09 +00:00
|
|
|
SNodeList* pFuncs;
|
2022-04-27 10:18:37 +00:00
|
|
|
SNode* pInterval;
|
|
|
|
|
SNode* pOffset;
|
|
|
|
|
SNode* pSliding;
|
2023-07-06 02:33:01 +00:00
|
|
|
int8_t tsPrecision;
|
2022-06-23 10:03:15 +00:00
|
|
|
SNode* pStreamOptions;
|
2022-03-15 08:00:09 +00:00
|
|
|
} SIndexOptions;
|
|
|
|
|
|
|
|
|
|
typedef struct SCreateIndexStmt {
|
2023-07-06 02:33:01 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
EIndexType indexType;
|
|
|
|
|
bool ignoreExists;
|
|
|
|
|
char indexDbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char indexName[TSDB_INDEX_NAME_LEN];
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char tableName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
SNodeList* pCols;
|
|
|
|
|
SIndexOptions* pOptions;
|
|
|
|
|
SNode* pPrevQuery;
|
|
|
|
|
SMCreateSmaReq* pReq;
|
2022-03-15 08:00:09 +00:00
|
|
|
} SCreateIndexStmt;
|
|
|
|
|
|
2022-03-16 06:08:59 +00:00
|
|
|
typedef struct SDropIndexStmt {
|
|
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
bool ignoreNotExists;
|
2022-08-02 12:20:44 +00:00
|
|
|
char indexDbName[TSDB_DB_NAME_LEN];
|
2022-04-27 10:18:37 +00:00
|
|
|
char indexName[TSDB_INDEX_NAME_LEN];
|
2022-03-16 06:08:59 +00:00
|
|
|
} SDropIndexStmt;
|
|
|
|
|
|
2022-04-09 06:57:28 +00:00
|
|
|
typedef struct SCreateComponentNodeStmt {
|
2022-03-15 12:04:52 +00:00
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
int32_t dnodeId;
|
2022-04-09 06:57:28 +00:00
|
|
|
} SCreateComponentNodeStmt;
|
2022-03-15 12:04:52 +00:00
|
|
|
|
2022-04-09 06:57:28 +00:00
|
|
|
typedef struct SDropComponentNodeStmt {
|
2022-03-16 06:08:59 +00:00
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
int32_t dnodeId;
|
2022-04-09 06:57:28 +00:00
|
|
|
} SDropComponentNodeStmt;
|
2022-03-16 06:08:59 +00:00
|
|
|
|
2023-05-09 11:19:14 +00:00
|
|
|
typedef struct SRestoreComponentNodeStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
int32_t dnodeId;
|
|
|
|
|
} SRestoreComponentNodeStmt;
|
|
|
|
|
|
2022-03-16 06:08:59 +00:00
|
|
|
typedef struct SCreateTopicStmt {
|
2022-05-30 03:59:23 +00:00
|
|
|
ENodeType type;
|
2023-07-17 11:52:07 +00:00
|
|
|
char topicName[TSDB_TOPIC_NAME_LEN];
|
2022-05-30 03:59:23 +00:00
|
|
|
char subDbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char subSTbName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
bool ignoreExists;
|
2023-06-30 03:42:40 +00:00
|
|
|
int8_t withMeta;
|
2022-05-30 03:59:23 +00:00
|
|
|
SNode* pQuery;
|
2023-05-25 11:01:58 +00:00
|
|
|
SNode* pWhere;
|
2022-03-16 06:08:59 +00:00
|
|
|
} SCreateTopicStmt;
|
|
|
|
|
|
|
|
|
|
typedef struct SDropTopicStmt {
|
|
|
|
|
ENodeType type;
|
2023-07-17 11:52:07 +00:00
|
|
|
char topicName[TSDB_TOPIC_NAME_LEN];
|
2022-04-27 10:18:37 +00:00
|
|
|
bool ignoreNotExists;
|
2022-03-16 06:08:59 +00:00
|
|
|
} SDropTopicStmt;
|
|
|
|
|
|
2022-05-25 13:20:11 +00:00
|
|
|
typedef struct SDropCGroupStmt {
|
|
|
|
|
ENodeType type;
|
2023-07-17 11:52:07 +00:00
|
|
|
char topicName[TSDB_TOPIC_NAME_LEN];
|
2022-05-25 13:20:11 +00:00
|
|
|
char cgroup[TSDB_CGROUP_LEN];
|
|
|
|
|
bool ignoreNotExists;
|
|
|
|
|
} SDropCGroupStmt;
|
|
|
|
|
|
2023-12-18 06:18:52 +00:00
|
|
|
typedef struct SAlterClusterStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char config[TSDB_DNODE_CONFIG_LEN];
|
2024-01-18 09:49:11 +00:00
|
|
|
char value[TSDB_CLUSTER_VALUE_LEN];
|
2023-12-18 06:18:52 +00:00
|
|
|
} SAlterClusterStmt;
|
|
|
|
|
|
2022-03-16 11:28:40 +00:00
|
|
|
typedef struct SAlterLocalStmt {
|
|
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
char config[TSDB_DNODE_CONFIG_LEN];
|
|
|
|
|
char value[TSDB_DNODE_VALUE_LEN];
|
2022-03-16 11:28:40 +00:00
|
|
|
} SAlterLocalStmt;
|
|
|
|
|
|
2022-03-31 06:19:11 +00:00
|
|
|
typedef struct SDescribeStmt {
|
2022-04-27 10:18:37 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char tableName[TSDB_TABLE_NAME_LEN];
|
2022-03-31 06:19:11 +00:00
|
|
|
STableMeta* pMeta;
|
|
|
|
|
} SDescribeStmt;
|
|
|
|
|
|
2022-04-14 12:35:44 +00:00
|
|
|
typedef struct SKillStmt {
|
|
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
int32_t targetId;
|
2022-04-14 12:35:44 +00:00
|
|
|
} SKillStmt;
|
|
|
|
|
|
2022-06-15 05:49:29 +00:00
|
|
|
typedef struct SKillQueryStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char queryId[TSDB_QUERY_ID_LEN];
|
|
|
|
|
} SKillQueryStmt;
|
|
|
|
|
|
2023-03-03 08:57:13 +00:00
|
|
|
typedef enum EStreamOptionsSetFlag {
|
|
|
|
|
SOPT_TRIGGER_TYPE_SET = BIT_FLAG_MASK(0),
|
|
|
|
|
SOPT_WATERMARK_SET = BIT_FLAG_MASK(1),
|
|
|
|
|
SOPT_DELETE_MARK_SET = BIT_FLAG_MASK(2),
|
|
|
|
|
SOPT_FILL_HISTORY_SET = BIT_FLAG_MASK(3),
|
|
|
|
|
SOPT_IGNORE_EXPIRED_SET = BIT_FLAG_MASK(4),
|
|
|
|
|
SOPT_IGNORE_UPDATE_SET = BIT_FLAG_MASK(5),
|
|
|
|
|
} EStreamOptionsSetFlag;
|
|
|
|
|
|
2022-04-15 10:30:01 +00:00
|
|
|
typedef struct SStreamOptions {
|
|
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
int8_t triggerType;
|
2022-06-13 06:54:38 +00:00
|
|
|
SNode* pDelay;
|
2022-04-27 10:18:37 +00:00
|
|
|
SNode* pWatermark;
|
2022-12-06 08:07:11 +00:00
|
|
|
SNode* pDeleteMark;
|
2022-10-26 09:01:55 +00:00
|
|
|
int8_t fillHistory;
|
2022-08-12 07:04:04 +00:00
|
|
|
int8_t ignoreExpired;
|
2023-02-07 11:31:08 +00:00
|
|
|
int8_t ignoreUpdate;
|
2023-03-03 08:57:13 +00:00
|
|
|
int64_t setFlag;
|
2022-04-15 10:30:01 +00:00
|
|
|
} SStreamOptions;
|
|
|
|
|
|
|
|
|
|
typedef struct SCreateStreamStmt {
|
2023-06-12 08:10:54 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
char streamName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
char targetDbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char targetTabName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
bool ignoreExists;
|
|
|
|
|
SStreamOptions* pOptions;
|
|
|
|
|
SNode* pQuery;
|
|
|
|
|
SNode* pPrevQuery;
|
|
|
|
|
SNodeList* pTags;
|
|
|
|
|
SNode* pSubtable;
|
|
|
|
|
SNodeList* pCols;
|
|
|
|
|
SCMCreateStreamReq* pReq;
|
2022-04-15 10:30:01 +00:00
|
|
|
} SCreateStreamStmt;
|
|
|
|
|
|
|
|
|
|
typedef struct SDropStreamStmt {
|
|
|
|
|
ENodeType type;
|
2022-04-27 10:18:37 +00:00
|
|
|
char streamName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
bool ignoreNotExists;
|
2022-04-15 10:30:01 +00:00
|
|
|
} SDropStreamStmt;
|
|
|
|
|
|
2023-04-24 06:48:33 +00:00
|
|
|
typedef struct SPauseStreamStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char streamName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
bool ignoreNotExists;
|
|
|
|
|
} SPauseStreamStmt;
|
|
|
|
|
|
|
|
|
|
typedef struct SResumeStreamStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char streamName[TSDB_TABLE_NAME_LEN];
|
|
|
|
|
bool ignoreNotExists;
|
|
|
|
|
bool ignoreUntreated;
|
|
|
|
|
} SResumeStreamStmt;
|
|
|
|
|
|
2022-04-20 09:43:02 +00:00
|
|
|
typedef struct SCreateFunctionStmt {
|
|
|
|
|
ENodeType type;
|
2023-04-04 09:45:18 +00:00
|
|
|
bool orReplace;
|
2022-04-27 10:18:37 +00:00
|
|
|
bool ignoreExists;
|
|
|
|
|
char funcName[TSDB_FUNC_NAME_LEN];
|
|
|
|
|
bool isAgg;
|
|
|
|
|
char libraryPath[PATH_MAX];
|
2022-04-20 09:43:02 +00:00
|
|
|
SDataType outputDt;
|
2022-04-27 10:18:37 +00:00
|
|
|
int32_t bufSize;
|
2023-03-04 03:08:50 +00:00
|
|
|
int8_t language;
|
2022-04-20 09:43:02 +00:00
|
|
|
} SCreateFunctionStmt;
|
|
|
|
|
|
2022-05-07 09:37:17 +00:00
|
|
|
typedef struct SDropFunctionStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char funcName[TSDB_FUNC_NAME_LEN];
|
|
|
|
|
bool ignoreNotExists;
|
|
|
|
|
} SDropFunctionStmt;
|
|
|
|
|
|
2023-09-19 06:19:54 +00:00
|
|
|
typedef struct SCreateViewStmt {
|
2024-03-29 03:02:33 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char viewName[TSDB_VIEW_NAME_LEN];
|
|
|
|
|
char* pQuerySql;
|
|
|
|
|
bool orReplace;
|
|
|
|
|
SNode* pQuery;
|
|
|
|
|
SCMCreateViewReq createReq;
|
2023-09-19 06:19:54 +00:00
|
|
|
} SCreateViewStmt;
|
|
|
|
|
|
|
|
|
|
typedef struct SDropViewStmt {
|
2024-03-29 03:02:33 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
|
|
|
|
char viewName[TSDB_VIEW_NAME_LEN];
|
|
|
|
|
bool ignoreNotExists;
|
2023-09-19 06:19:54 +00:00
|
|
|
} SDropViewStmt;
|
|
|
|
|
|
2022-05-07 09:37:17 +00:00
|
|
|
typedef struct SGrantStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
char userName[TSDB_USER_LEN];
|
2022-11-30 11:24:15 +00:00
|
|
|
char objName[TSDB_DB_NAME_LEN]; // db or topic
|
2023-03-28 10:43:58 +00:00
|
|
|
char tabName[TSDB_TABLE_NAME_LEN];
|
2022-05-07 09:37:17 +00:00
|
|
|
int64_t privileges;
|
2023-03-28 10:43:58 +00:00
|
|
|
SNode* pTagCond;
|
2022-05-07 09:37:17 +00:00
|
|
|
} SGrantStmt;
|
|
|
|
|
|
|
|
|
|
typedef SGrantStmt SRevokeStmt;
|
|
|
|
|
|
2022-06-07 03:53:32 +00:00
|
|
|
typedef struct SBalanceVgroupStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
} SBalanceVgroupStmt;
|
|
|
|
|
|
2023-03-22 01:36:59 +00:00
|
|
|
typedef struct SBalanceVgroupLeaderStmt {
|
|
|
|
|
ENodeType type;
|
2023-10-09 07:46:41 +00:00
|
|
|
int32_t vgId;
|
2024-05-13 08:20:27 +00:00
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
2023-03-22 01:36:59 +00:00
|
|
|
} SBalanceVgroupLeaderStmt;
|
|
|
|
|
|
2022-06-07 03:53:32 +00:00
|
|
|
typedef struct SMergeVgroupStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
int32_t vgId1;
|
|
|
|
|
int32_t vgId2;
|
|
|
|
|
} SMergeVgroupStmt;
|
|
|
|
|
|
|
|
|
|
typedef struct SRedistributeVgroupStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
int32_t vgId;
|
|
|
|
|
int32_t dnodeId1;
|
|
|
|
|
int32_t dnodeId2;
|
|
|
|
|
int32_t dnodeId3;
|
|
|
|
|
SNodeList* pDnodes;
|
|
|
|
|
} SRedistributeVgroupStmt;
|
|
|
|
|
|
|
|
|
|
typedef struct SSplitVgroupStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
int32_t vgId;
|
|
|
|
|
} SSplitVgroupStmt;
|
|
|
|
|
|
2023-11-20 08:36:13 +00:00
|
|
|
typedef struct STSMAOptions {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
SNodeList* pFuncs;
|
|
|
|
|
SNodeList* pCols;
|
|
|
|
|
SNode* pInterval;
|
2024-01-03 05:51:25 +00:00
|
|
|
uint8_t tsPrecision;
|
2024-01-31 06:20:49 +00:00
|
|
|
bool recursiveTsma; // true if create recursive tsma
|
2023-11-20 08:36:13 +00:00
|
|
|
} STSMAOptions;
|
|
|
|
|
|
|
|
|
|
typedef struct SCreateTSMAStmt {
|
|
|
|
|
ENodeType type;
|
|
|
|
|
bool ignoreExists;
|
2024-03-20 02:51:02 +00:00
|
|
|
char tsmaName[TSDB_TABLE_NAME_LEN];
|
2023-11-20 08:36:13 +00:00
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
2024-01-31 06:20:49 +00:00
|
|
|
char tableName[TSDB_TABLE_NAME_LEN]; // base tb name or base tsma name
|
2024-02-20 09:09:48 +00:00
|
|
|
char originalTbName[TSDB_TABLE_NAME_LEN];
|
2023-11-20 08:36:13 +00:00
|
|
|
STSMAOptions* pOptions;
|
2024-02-20 09:09:48 +00:00
|
|
|
SNode* pPrevQuery;
|
|
|
|
|
SMCreateSmaReq* pReq;
|
2024-07-05 10:21:48 +00:00
|
|
|
uint8_t precision;
|
2023-11-20 08:36:13 +00:00
|
|
|
} SCreateTSMAStmt;
|
|
|
|
|
|
|
|
|
|
typedef struct SDropTSMAStmt {
|
2023-11-24 01:47:35 +00:00
|
|
|
ENodeType type;
|
|
|
|
|
bool ignoreNotExists;
|
|
|
|
|
char dbName[TSDB_DB_NAME_LEN];
|
2024-03-20 02:51:02 +00:00
|
|
|
char tsmaName[TSDB_TABLE_NAME_LEN];
|
2023-11-20 08:36:13 +00:00
|
|
|
} SDropTSMAStmt;
|
|
|
|
|
|
2022-01-23 12:34:16 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-03-03 12:25:16 +00:00
|
|
|
#endif /*_TD_CMD_NODES_H_*/
|