提交 6184d330 编写于 作者: wmmhello's avatar wmmhello

fix: comment & ttl

上级 8ace8dfd
...@@ -108,7 +108,7 @@ extern float tsStreamComputDelayRatio; // the delayed computing ration of the ...@@ -108,7 +108,7 @@ extern float tsStreamComputDelayRatio; // the delayed computing ration of the
extern int64_t tsMaxRetentWindow; extern int64_t tsMaxRetentWindow;
// build info // build info
extern char td_version[]; extern char version[];
extern char compatible_version[]; extern char compatible_version[];
extern char gitinfo[]; extern char gitinfo[];
extern char buildinfo[]; extern char buildinfo[];
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
extern "C" { extern "C" {
#endif #endif
extern char td_version[]; extern char version[];
extern char compatible_version[]; extern char compatible_version[];
extern char gitinfo[]; extern char gitinfo[];
extern char buildinfo[]; extern char buildinfo[];
......
...@@ -397,7 +397,7 @@ const char *taos_data_type(int type) { ...@@ -397,7 +397,7 @@ const char *taos_data_type(int type) {
} }
} }
const char *taos_get_client_info() { return td_version; } const char *taos_get_client_info() { return version; }
int taos_affected_rows(TAOS_RES *res) { int taos_affected_rows(TAOS_RES *res) {
if (res == NULL || TD_RES_TMQ(res)) { if (res == NULL || TD_RES_TMQ(res)) {
......
...@@ -362,7 +362,7 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) { ...@@ -362,7 +362,7 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) {
if (cfgAddString(pCfg, "os version", info.version, 1) != 0) return -1; if (cfgAddString(pCfg, "os version", info.version, 1) != 0) return -1;
if (cfgAddString(pCfg, "os machine", info.machine, 1) != 0) return -1; if (cfgAddString(pCfg, "os machine", info.machine, 1) != 0) return -1;
if (cfgAddString(pCfg, "version", td_version, 1) != 0) return -1; if (cfgAddString(pCfg, "version", version, 1) != 0) return -1;
if (cfgAddString(pCfg, "compatible_version", compatible_version, 1) != 0) return -1; if (cfgAddString(pCfg, "compatible_version", compatible_version, 1) != 0) return -1;
if (cfgAddString(pCfg, "gitinfo", gitinfo, 1) != 0) return -1; if (cfgAddString(pCfg, "gitinfo", gitinfo, 1) != 0) return -1;
if (cfgAddString(pCfg, "buildinfo", buildinfo, 1) != 0) return -1; if (cfgAddString(pCfg, "buildinfo", buildinfo, 1) != 0) return -1;
......
...@@ -114,7 +114,7 @@ static void dmPrintVersion() { ...@@ -114,7 +114,7 @@ static void dmPrintVersion() {
#else #else
char *releaseName = "community"; char *releaseName = "community";
#endif #endif
printf("%s version: %s compatible_version: %s\n", releaseName, td_version, compatible_version); printf("%s version: %s compatible_version: %s\n", releaseName, version, compatible_version);
printf("gitinfo: %s\n", gitinfo); printf("gitinfo: %s\n", gitinfo);
printf("buildInfo: %s\n", buildinfo); printf("buildInfo: %s\n", buildinfo);
} }
......
...@@ -642,7 +642,7 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr ...@@ -642,7 +642,7 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr
} }
// cluster info // cluster info
tstrncpy(pClusterInfo->version, td_version, sizeof(pClusterInfo->version)); tstrncpy(pClusterInfo->version, version, sizeof(pClusterInfo->version));
pClusterInfo->monitor_interval = tsMonitorInterval; pClusterInfo->monitor_interval = tsMonitorInterval;
pClusterInfo->connections_total = mndGetNumOfConnections(pMnode); pClusterInfo->connections_total = mndGetNumOfConnections(pMnode);
......
...@@ -232,7 +232,7 @@ static int32_t mndProcessConnectReq(SRpcMsg *pReq) { ...@@ -232,7 +232,7 @@ static int32_t mndProcessConnectReq(SRpcMsg *pReq) {
connectRsp.connType = connReq.connType; connectRsp.connType = connReq.connType;
connectRsp.dnodeNum = mndGetDnodeSize(pMnode); connectRsp.dnodeNum = mndGetDnodeSize(pMnode);
snprintf(connectRsp.sVersion, sizeof(connectRsp.sVersion), "ver:%s\nbuild:%s\ngitinfo:%s", td_version, buildinfo, snprintf(connectRsp.sVersion, sizeof(connectRsp.sVersion), "ver:%s\nbuild:%s\ngitinfo:%s", version, buildinfo,
gitinfo); gitinfo);
mndGetMnodeEpSet(pMnode, &connectRsp.epSet); mndGetMnodeEpSet(pMnode, &connectRsp.epSet);
......
...@@ -110,7 +110,7 @@ static char* mndBuildTelemetryReport(SMnode* pMnode) { ...@@ -110,7 +110,7 @@ static char* mndBuildTelemetryReport(SMnode* pMnode) {
snprintf(tmp, sizeof(tmp), "%" PRId64 " kB", tsTotalMemoryKB); snprintf(tmp, sizeof(tmp), "%" PRId64 " kB", tsTotalMemoryKB);
tjsonAddStringToObject(pJson, "memory", tmp); tjsonAddStringToObject(pJson, "memory", tmp);
tjsonAddStringToObject(pJson, "version", td_version); tjsonAddStringToObject(pJson, "version", version);
tjsonAddStringToObject(pJson, "buildInfo", buildinfo); tjsonAddStringToObject(pJson, "buildInfo", buildinfo);
tjsonAddStringToObject(pJson, "gitInfo", gitinfo); tjsonAddStringToObject(pJson, "gitInfo", gitinfo);
tjsonAddStringToObject(pJson, "email", pMgmt->email); tjsonAddStringToObject(pJson, "email", pMgmt->email);
......
...@@ -785,7 +785,7 @@ static void udfdPrintVersion() { ...@@ -785,7 +785,7 @@ static void udfdPrintVersion() {
#else #else
char *releaseName = "community"; char *releaseName = "community";
#endif #endif
printf("%s version: %s compatible_version: %s\n", releaseName, td_version, compatible_version); printf("%s version: %s compatible_version: %s\n", releaseName, version, compatible_version);
printf("gitinfo: %s\n", gitinfo); printf("gitinfo: %s\n", gitinfo);
printf("buildInfo: %s\n", buildinfo); printf("buildInfo: %s\n", buildinfo);
} }
......
...@@ -803,6 +803,7 @@ static void buildCreateTbReq(SVCreateTbReq* pTbReq, const char* tname, STag* pTa ...@@ -803,6 +803,7 @@ static void buildCreateTbReq(SVCreateTbReq* pTbReq, const char* tname, STag* pTa
pTbReq->name = strdup(tname); pTbReq->name = strdup(tname);
pTbReq->ctb.suid = suid; pTbReq->ctb.suid = suid;
pTbReq->ctb.pTag = (uint8_t*)pTag; pTbReq->ctb.pTag = (uint8_t*)pTag;
pTbReq->commentLen = -1;
return; return;
} }
......
char td_version[12] = "${TD_VER_NUMBER}"; char version[12] = "${TD_VER_NUMBER}";
char compatible_version[12] = "${TD_VER_COMPATIBLE}"; char compatible_version[12] = "${TD_VER_COMPATIBLE}";
char gitinfo[48] = "${TD_VER_GIT}"; char gitinfo[48] = "${TD_VER_GIT}";
char buildinfo[64] = "Built at ${TD_VER_DATE}"; char buildinfo[64] = "Built at ${TD_VER_DATE}";
......
...@@ -132,17 +132,21 @@ class TDTestCase: ...@@ -132,17 +132,21 @@ class TDTestCase:
print("============== STEP 3 ===== test child table") print("============== STEP 3 ===== test child table")
tdSql.execute("create table child_table1 using super_table1 tags(1)") tdSql.execute("create table child_table1 using super_table1 tags(1) ttl 10")
tdSql.execute("create table child_table2 using super_table1 tags(1) comment ''") tdSql.execute("create table child_table2 using super_table1 tags(1) comment ''")
tdSql.execute("create table child_table3 using super_table1 tags(1) comment 'child'") tdSql.execute("create table child_table3 using super_table1 tags(1) comment 'child'")
tdSql.execute("insert into child_table4 using super_table1 tags(1) values(now, 1)")
tdSql.query("show tables like 'child_table1'") tdSql.query("show tables like 'child_table1'")
tdSql.checkData(0, 0, 'child_table1') tdSql.checkData(0, 0, 'child_table1')
tdSql.checkData(0, 7, 10)
tdSql.checkData(0, 8, None) tdSql.checkData(0, 8, None)
tdSql.query("show tables like 'child_table2'") tdSql.query("show tables like 'child_table2'")
tdSql.checkData(0, 0, 'child_table2') tdSql.checkData(0, 0, 'child_table2')
tdSql.checkData(0, 7, 0)
tdSql.checkData(0, 8, '') tdSql.checkData(0, 8, '')
...@@ -150,6 +154,11 @@ class TDTestCase: ...@@ -150,6 +154,11 @@ class TDTestCase:
tdSql.checkData(0, 0, 'child_table3') tdSql.checkData(0, 0, 'child_table3')
tdSql.checkData(0, 8, 'child') tdSql.checkData(0, 8, 'child')
tdSql.query("show tables like 'child_table4'")
tdSql.checkData(0, 0, 'child_table4')
tdSql.checkData(0, 7, 0)
tdSql.checkData(0, 8, None)
tdSql.execute("alter table child_table1 comment 'nihao'") tdSql.execute("alter table child_table1 comment 'nihao'")
tdSql.query("show tables like 'child_table1'") tdSql.query("show tables like 'child_table1'")
...@@ -171,6 +180,22 @@ class TDTestCase: ...@@ -171,6 +180,22 @@ class TDTestCase:
tdSql.checkData(0, 0, 'child_table3') tdSql.checkData(0, 0, 'child_table3')
tdSql.checkData(0, 8, 'tdengine') tdSql.checkData(0, 8, 'tdengine')
tdSql.execute("alter table child_table4 comment 'tdengine'")
tdSql.query("show tables like 'child_table4'")
tdSql.checkData(0, 0, 'child_table4')
tdSql.checkData(0, 8, 'tdengine')
tdSql.execute("alter table child_table4 ttl 9")
tdSql.query("show tables like 'child_table4'")
tdSql.checkData(0, 0, 'child_table4')
tdSql.checkData(0, 7, 9)
tdSql.execute("alter table child_table3 ttl 9")
tdSql.query("show tables like 'child_table3'")
tdSql.checkData(0, 0, 'child_table3')
tdSql.checkData(0, 7, 9)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)
......
...@@ -67,7 +67,7 @@ void shellPrintHelp() { ...@@ -67,7 +67,7 @@ void shellPrintHelp() {
#include <argp.h> #include <argp.h>
#include <termio.h> #include <termio.h>
const char *argp_program_version = td_version; const char *argp_program_version = version;
const char *argp_program_bug_address = SHELL_EMAIL; const char *argp_program_bug_address = SHELL_EMAIL;
static struct argp_option shellOptions[] = { static struct argp_option shellOptions[] = {
...@@ -342,7 +342,7 @@ int32_t shellParseArgs(int32_t argc, char *argv[]) { ...@@ -342,7 +342,7 @@ int32_t shellParseArgs(int32_t argc, char *argv[]) {
shell.info.promptHeader = "taos> "; shell.info.promptHeader = "taos> ";
shell.info.promptContinue = " -> "; shell.info.promptContinue = " -> ";
shell.info.promptSize = 6; shell.info.promptSize = 6;
snprintf(shell.info.programVersion, sizeof(shell.info.programVersion), "version: %s", td_version); snprintf(shell.info.programVersion, sizeof(shell.info.programVersion), "version: %s", version);
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32) #if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
shell.info.osname = "Windows"; shell.info.osname = "Windows";
......
...@@ -68,7 +68,7 @@ int32_t shellCheckIntSize() { ...@@ -68,7 +68,7 @@ int32_t shellCheckIntSize() {
return 0; return 0;
} }
void shellPrintVersion() { printf("version: %s\n", td_version); } void shellPrintVersion() { printf("version: %s\n", version); }
void shellGenerateAuth() { void shellGenerateAuth() {
char secretEncrypt[TSDB_PASSWORD_LEN + 1] = {0}; char secretEncrypt[TSDB_PASSWORD_LEN + 1] = {0};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册