Merge branch 'develop' of https://github.com/taosdata/TDengine into develop

This commit is contained in:
Shuduo Sang 2020-05-26 09:57:45 +08:00
commit 53e5f84d64
70 changed files with 3254 additions and 2664 deletions

View File

@ -210,7 +210,7 @@ typedef struct SQueryInfo {
int16_t numOfTables;
STableMetaInfo **pTableMetaInfo;
struct STSBuf * tsBuf;
int64_t * defaultVal; // default value for interpolation
int64_t * fillVal; // default value for interpolation
char * msg; // pointer to the pCmd->payload to keep error message temporarily
int64_t clauseLimit; // limit for current sub clause

View File

@ -390,7 +390,11 @@ static void function_finalizer(SQLFunctionCtx *pCtx) {
if (pResInfo->hasResult != DATA_SET_FLAG) {
tscTrace("no result generated, result is set to NULL");
setNull(pCtx->aOutputBuf, pCtx->outputType, pCtx->outputBytes);
if (pCtx->outputType == TSDB_DATA_TYPE_BINARY || pCtx->outputType == TSDB_DATA_TYPE_NCHAR) {
setVardataNull(pCtx->aOutputBuf, pCtx->outputType);
} else {
setNull(pCtx->aOutputBuf, pCtx->outputType, pCtx->outputBytes);
}
}
doFinalizer(pCtx);
@ -1864,12 +1868,22 @@ static void last_row_finalizer(SQLFunctionCtx *pCtx) {
SResultInfo *pResInfo = GET_RES_INFO(pCtx);
if (pCtx->currentStage == SECONDARY_STAGE_MERGE) {
if (pResInfo->hasResult != DATA_SET_FLAG) {
setNull(pCtx->aOutputBuf, pCtx->outputType, pCtx->outputBytes);
if (pCtx->outputType == TSDB_DATA_TYPE_BINARY || pCtx->outputType == TSDB_DATA_TYPE_NCHAR) {
setVardataNull(pCtx->aOutputBuf, pCtx->outputType);
} else {
setNull(pCtx->aOutputBuf, pCtx->outputType, pCtx->outputBytes);
}
return;
}
} else {
if (pResInfo->hasResult != DATA_SET_FLAG) {
setNull(pCtx->aOutputBuf, pCtx->outputType, pCtx->outputBytes);
if (pCtx->outputType == TSDB_DATA_TYPE_BINARY || pCtx->outputType == TSDB_DATA_TYPE_NCHAR) {
setVardataNull(pCtx->aOutputBuf, pCtx->outputType);
} else {
setNull(pCtx->aOutputBuf, pCtx->outputType, pCtx->outputBytes);
}
return;
}
}
@ -2885,7 +2899,12 @@ static void leastsquares_finalizer(SQLFunctionCtx *pCtx) {
SLeastsquareInfo *pInfo = pResInfo->interResultBuf;
if (pInfo->num == 0) {
setNull(pCtx->aOutputBuf, pCtx->outputType, pCtx->outputBytes);
if (pCtx->outputType == TSDB_DATA_TYPE_BINARY || pCtx->outputType == TSDB_DATA_TYPE_NCHAR) {
setVardataNull(pCtx->aOutputBuf, pCtx->outputType);
} else {
setNull(pCtx->aOutputBuf, pCtx->outputType, pCtx->outputBytes);
}
return;
}
@ -3139,7 +3158,7 @@ static void diff_function(SQLFunctionCtx *pCtx) {
pOutput += 1;
pTimestamp += 1;
} else {
*pOutput = pData[i] - pCtx->param[1].i64Key;
*pOutput = pData[i] - pCtx->param[1].dKey;
*pTimestamp = pCtx->ptsList[i];
pOutput += 1;
pTimestamp += 1;
@ -3170,7 +3189,7 @@ static void diff_function(SQLFunctionCtx *pCtx) {
pOutput += 1;
pTimestamp += 1;
} else {
*pOutput = pData[i] - pCtx->param[1].i64Key;
*pOutput = pData[i] - pCtx->param[1].dKey;
*pTimestamp = pCtx->ptsList[i];
pOutput += 1;
@ -3862,7 +3881,11 @@ static void interp_function(SQLFunctionCtx *pCtx) {
*(TSKEY *)pCtx->aOutputBuf = pInfoDetail->ts;
} else {
if (pInfoDetail->type == TSDB_FILL_NULL) {
setNull(pCtx->aOutputBuf, pCtx->outputType, pCtx->outputBytes);
if (pCtx->outputType == TSDB_DATA_TYPE_BINARY || pCtx->outputType == TSDB_DATA_TYPE_NCHAR) {
setVardataNull(pCtx->aOutputBuf, pCtx->outputType);
} else {
setNull(pCtx->aOutputBuf, pCtx->outputType, pCtx->outputBytes);
}
} else if (pInfoDetail->type == TSDB_FILL_SET_VALUE) {
tVariantDump(&pCtx->param[1], pCtx->aOutputBuf, pCtx->inputType);
} else if (pInfoDetail->type == TSDB_FILL_PREV) {
@ -3914,7 +3937,11 @@ static void interp_function(SQLFunctionCtx *pCtx) {
}
} else {
setNull(pCtx->aOutputBuf, srcType, pCtx->inputBytes);
if (srcType == TSDB_DATA_TYPE_BINARY || srcType == TSDB_DATA_TYPE_NCHAR) {
setVardataNull(pCtx->aOutputBuf, pCtx->inputBytes);
} else {
setNull(pCtx->aOutputBuf, srcType, pCtx->inputBytes);
}
}
}
}

View File

@ -312,8 +312,7 @@ int32_t tsParseOneColumnData(SSchema *pSchema, SSQLToken *pToken, char *payload,
case TSDB_DATA_TYPE_BINARY:
// binary data cannot be null-terminated char string, otherwise the last char of the string is lost
if (pToken->type == TK_NULL) {
varDataSetLen(payload, sizeof(int8_t));
*(uint8_t*) varDataVal(payload) = TSDB_DATA_BINARY_NULL;
setVardataNull(payload, TSDB_DATA_TYPE_BINARY);
} else { // too long values will return invalid sql, not be truncated automatically
if (pToken->n + VARSTR_HEADER_SIZE > pSchema->bytes) { //todo refactor
return tscInvalidSQLErrMsg(msg, "string data overflow", pToken->z);
@ -326,8 +325,7 @@ int32_t tsParseOneColumnData(SSchema *pSchema, SSQLToken *pToken, char *payload,
case TSDB_DATA_TYPE_NCHAR:
if (pToken->type == TK_NULL) {
varDataSetLen(payload, sizeof(int32_t));
*(uint32_t*) varDataVal(payload) = TSDB_DATA_NCHAR_NULL;
setVardataNull(payload, TSDB_DATA_TYPE_NCHAR);
} else {
// if the converted output len is over than pColumnModel->bytes, return error: 'Argument list too long'
size_t output = 0;

View File

@ -13,7 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _XOPEN_SOURCE
#define _BSD_SOURCE
#define _XOPEN_SOURCE 500
#define _DEFAULT_SOURCE
#include "os.h"
@ -4015,9 +4016,9 @@ int32_t parseFillClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySQL) {
size_t size = tscSqlExprNumOfExprs(pQueryInfo);
if (pQueryInfo->defaultVal == NULL) {
pQueryInfo->defaultVal = calloc(size, sizeof(int64_t));
if (pQueryInfo->defaultVal == NULL) {
if (pQueryInfo->fillVal == NULL) {
pQueryInfo->fillVal = calloc(size, sizeof(int64_t));
if (pQueryInfo->fillVal == NULL) {
return TSDB_CODE_CLI_OUT_OF_MEMORY;
}
}
@ -4028,7 +4029,11 @@ int32_t parseFillClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySQL) {
pQueryInfo->fillType = TSDB_FILL_NULL;
for (int32_t i = START_INTERPO_COL_IDX; i < size; ++i) {
TAOS_FIELD* pFields = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, i);
setNull((char*)&pQueryInfo->defaultVal[i], pFields->type, pFields->bytes);
if (pFields->type == TSDB_DATA_TYPE_BINARY || pFields->type == TSDB_DATA_TYPE_NCHAR) {
setVardataNull((char*) &pQueryInfo->fillVal[i], pFields->type);
} else {
setNull((char*)&pQueryInfo->fillVal[i], pFields->type, pFields->bytes);
};
}
} else if (strncasecmp(pItem->pVar.pz, "prev", 4) == 0 && pItem->pVar.nLen == 4) {
pQueryInfo->fillType = TSDB_FILL_PREV;
@ -4061,11 +4066,11 @@ int32_t parseFillClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySQL) {
TAOS_FIELD* pFields = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, i);
if (pFields->type == TSDB_DATA_TYPE_BINARY || pFields->type == TSDB_DATA_TYPE_NCHAR) {
setNull((char*)(&pQueryInfo->defaultVal[i]), pFields->type, pFields->bytes);
setVardataNull((char*) &pQueryInfo->fillVal[i], pFields->type);
continue;
}
int32_t ret = tVariantDump(&pFillToken->a[j].pVar, (char*)&pQueryInfo->defaultVal[i], pFields->type);
int32_t ret = tVariantDump(&pFillToken->a[j].pVar, (char*)&pQueryInfo->fillVal[i], pFields->type);
if (ret != TSDB_CODE_SUCCESS) {
return invalidSqlErrMsg(pQueryInfo->msg, msg);
}
@ -4079,9 +4084,9 @@ int32_t parseFillClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySQL) {
TAOS_FIELD* pFields = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, i);
if (pFields->type == TSDB_DATA_TYPE_BINARY || pFields->type == TSDB_DATA_TYPE_NCHAR) {
setNull((char*)(&pQueryInfo->defaultVal[i]), pFields->type, pFields->bytes);
setVardataNull((char*) &pQueryInfo->fillVal[i], pFields->type);
} else {
tVariantDump(&lastItem->pVar, (char*)&pQueryInfo->defaultVal[i], pFields->type);
tVariantDump(&lastItem->pVar, (char*)&pQueryInfo->fillVal[i], pFields->type);
}
}
}

View File

@ -145,7 +145,7 @@ static SFillColInfo* createFillColInfo(SQueryInfo* pQueryInfo) {
pFillCol[i].flag = pExpr->colInfo.flag;
pFillCol[i].col.offset = offset;
pFillCol[i].functionId = pExpr->functionId;
pFillCol[i].defaultVal.i = pQueryInfo->defaultVal[i];
pFillCol[i].fillVal.i = pQueryInfo->fillVal[i];
offset += pExpr->resBytes;
}
@ -946,8 +946,7 @@ static void doInterpolateResult(SSqlObj *pSql, SLocalReducer *pLocalReducer, boo
}
while (1) {
int64_t newRows = -1;
taosGenerateDataBlock(pFillInfo, pResPages, &newRows, pLocalReducer->resColModel->capacity);
int64_t newRows = taosGenerateDataBlock(pFillInfo, pResPages, pLocalReducer->resColModel->capacity);
if (pQueryInfo->limit.offset < newRows) {
newRows -= pQueryInfo->limit.offset;

View File

@ -781,8 +781,8 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
if (pQueryInfo->fillType != TSDB_FILL_NONE) {
for (int32_t i = 0; i < pQueryInfo->fieldsInfo.numOfOutput; ++i) {
*((int64_t *)pMsg) = htobe64(pQueryInfo->defaultVal[i]);
pMsg += sizeof(pQueryInfo->defaultVal[0]);
*((int64_t *)pMsg) = htobe64(pQueryInfo->fillVal[i]);
pMsg += sizeof(pQueryInfo->fillVal[0]);
}
}

View File

@ -223,7 +223,7 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf
int16_t offset = tscFieldInfoGetOffset(pQueryInfo, i);
TAOS_FIELD *pField = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, i);
assignVal(pSql->res.data + offset, (char *)(&pQueryInfo->defaultVal[i]), pField->bytes, pField->type);
assignVal(pSql->res.data + offset, (char *)(&pQueryInfo->fillVal[i]), pField->bytes, pField->type);
row[i] = pSql->res.data + offset;
}

View File

@ -281,7 +281,7 @@ void tscClearInterpInfo(SQueryInfo* pQueryInfo) {
}
pQueryInfo->fillType = TSDB_FILL_NONE;
tfree(pQueryInfo->defaultVal);
tfree(pQueryInfo->fillVal);
}
int32_t tscCreateResPointerInfo(SSqlRes* pRes, SQueryInfo* pQueryInfo) {
@ -1616,7 +1616,7 @@ static void freeQueryInfoImpl(SQueryInfo* pQueryInfo) {
pQueryInfo->tsBuf = tsBufDestory(pQueryInfo->tsBuf);
tfree(pQueryInfo->defaultVal);
tfree(pQueryInfo->fillVal);
}
void tscClearSubqueryInfo(SSqlCmd* pCmd) {
@ -1768,7 +1768,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
pNewQueryInfo->order = pQueryInfo->order;
pNewQueryInfo->clauseLimit = pQueryInfo->clauseLimit;
pNewQueryInfo->pTableMetaInfo = NULL;
pNewQueryInfo->defaultVal = NULL;
pNewQueryInfo->fillVal = NULL;
pNewQueryInfo->numOfTables = 0;
pNewQueryInfo->tsBuf = NULL;
@ -1780,8 +1780,8 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
tscTagCondCopy(&pNewQueryInfo->tagCond, &pQueryInfo->tagCond);
if (pQueryInfo->fillType != TSDB_FILL_NONE) {
pNewQueryInfo->defaultVal = malloc(pQueryInfo->fieldsInfo.numOfOutput * sizeof(int64_t));
memcpy(pNewQueryInfo->defaultVal, pQueryInfo->defaultVal, pQueryInfo->fieldsInfo.numOfOutput * sizeof(int64_t));
pNewQueryInfo->fillVal = malloc(pQueryInfo->fieldsInfo.numOfOutput * sizeof(int64_t));
memcpy(pNewQueryInfo->fillVal, pQueryInfo->fillVal, pQueryInfo->fieldsInfo.numOfOutput * sizeof(int64_t));
}
if (tscAllocPayload(pnCmd, TSDB_DEFAULT_PAYLOAD_SIZE) != TSDB_CODE_SUCCESS) {

View File

@ -202,6 +202,8 @@ char tsTimezone[64] = {0};
char tsLocale[TSDB_LOCALE_LEN] = {0};
char tsCharset[TSDB_LOCALE_LEN] = {0}; // default encode string
int32_t tsMaxBinaryDisplayWidth = 30;
static pthread_once_t tsInitGlobalCfgOnce = PTHREAD_ONCE_INIT;
void taosSetAllDebugFlag() {
@ -1227,6 +1229,16 @@ static void doInitGlobalConfig() {
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosInitConfigOption(cfg);
cfg.option = "maxBinaryDisplayWidth";
cfg.ptr = &tsMaxBinaryDisplayWidth;
cfg.valType = TAOS_CFG_VTYPE_INT32;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT;
cfg.minValue = 1;
cfg.maxValue = 0x7fffffff;
cfg.ptrLength = 0;
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosInitConfigOption(cfg);
}
void taosInitGlobalCfg() {

View File

@ -381,6 +381,18 @@ bool isNull(const char *val, int32_t type) {
};
}
void setVardataNull(char* val, int32_t type) {
if (type == TSDB_DATA_TYPE_BINARY) {
varDataSetLen(val, sizeof(int8_t));
*(uint8_t*) varDataVal(val) = TSDB_DATA_BINARY_NULL;
} else if (type == TSDB_DATA_TYPE_NCHAR) {
varDataSetLen(val, sizeof(int32_t));
*(uint32_t*) varDataVal(val) = TSDB_DATA_NCHAR_NULL;
} else {
assert(0);
}
}
void setNull(char *val, int32_t type, int32_t bytes) { setNullN(val, type, bytes, 1); }
void setNullN(char *val, int32_t type, int32_t bytes, int32_t numOfElems) {
@ -483,7 +495,7 @@ void assignVal(char *val, const char *src, int32_t len, int32_t type) {
break;
};
case TSDB_DATA_TYPE_NCHAR: {
wcsncpy((wchar_t*)val, (wchar_t*)src, len / TSDB_NCHAR_SIZE);
varDataCopy(val, src);
break;
};
default: {

View File

@ -188,7 +188,7 @@ public class TSDBDriver implements java.sql.Driver {
}
public boolean acceptsURL(String url) throws SQLException {
return true;
return StringUtils.isNotBlank(url) && url.startsWith(URL_PREFIX);
}
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
@ -355,4 +355,4 @@ public class TSDBDriver implements java.sql.Driver {
public String database(Properties props) {
return props.getProperty(PROPERTY_KEY_DBNAME);
}
}
}

View File

@ -157,6 +157,7 @@ extern tDataTypeDescriptor tDataTypeDesc[11];
bool isValidDataType(int32_t type, int32_t length);
bool isNull(const char *val, int32_t type);
void setVardataNull(char* val, int32_t type);
void setNull(char *val, int32_t type, int32_t bytes);
void setNullN(char *val, int32_t type, int32_t bytes, int32_t numOfElems);

View File

@ -443,7 +443,7 @@ typedef struct {
int16_t numOfOutput; // final output columns numbers
int16_t tagNameRelType; // relation of tag criteria and tbname criteria
int16_t fillType; // interpolate type
uint64_t defaultVal; // default value array list
uint64_t fillVal; // default value array list
int32_t tsOffset; // offset value in current msg body, NOTE: ts list is compressed
int32_t tsLen; // total length of ts comp block
int32_t tsNumOfBlocks; // ts comp block numbers

View File

@ -29,18 +29,6 @@
#define MAX_COMMAND_SIZE 65536
#define HISTORY_FILE ".taos_history"
#define BOOL_OUTPUT_LENGTH 6
#define TINYINT_OUTPUT_LENGTH 6
#define SMALLINT_OUTPUT_LENGTH 7
#define INT_OUTPUT_LENGTH 11
#define BIGINT_OUTPUT_LENGTH 21
#define FLOAT_OUTPUT_LENGTH 20
#define DOUBLE_OUTPUT_LENGTH 25
#define BINARY_OUTPUT_LENGTH 20
// dynamic config timestamp width according to maximum time precision
extern int32_t TIMESTAMP_OUTPUT_LENGTH;
typedef struct SShellHistory {
char* hist[MAX_HISTORY_SIZE];
int hstart;
@ -80,7 +68,7 @@ void get_history_path(char* history);
void cleanup_handler(void* arg);
void exitShell();
int shellDumpResult(TAOS* con, char* fname, int* error_no, bool printMode);
void shellPrintNChar(char* str, int width, bool printMode);
void shellPrintNChar(const char* str, int length, int width);
void shellGetGrantInfo(void *con);
int isCommentLine(char *line);

View File

@ -352,37 +352,31 @@ void *shellLoopQuery(void *arg) {
return NULL;
}
void shellPrintNChar(char *str, int width, bool printMode) {
int col_left = width;
wchar_t wc;
while (col_left > 0) {
if (*str == '\0') break;
char *tstr = str;
int byte_width = mbtowc(&wc, tstr, MB_CUR_MAX);
if (byte_width <= 0) break;
int col_width = wcwidth(wc);
if (col_width <= 0) {
str += byte_width;
continue;
void shellPrintNChar(const char *str, int length, int width) {
int pos = 0, cols = 0;
while (pos < length) {
wchar_t wc;
pos += mbtowc(&wc, str + pos, MB_CUR_MAX);
if (pos > length) {
break;
}
int w = wcwidth(wc);
if (w > 0) {
if (width > 0 && cols + w > width) {
break;
}
printf("%lc", wc);
cols += w;
}
if (col_left < col_width) break;
printf("%lc", wc);
str += byte_width;
col_left -= col_width;
}
while (col_left > 0) {
printf(" ");
col_left--;
}
if (!printMode) {
printf("|");
} else {
printf("\n");
for (; cols < width; cols++) {
putchar(' ');
}
}
int get_old_terminal_mode(struct termios *tio) {
/* Make sure stdin is a terminal. */
if (!isatty(STDIN_FILENO)) {

View File

@ -13,6 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _BSD_SOURCE
#define _GNU_SOURCE
#define _XOPEN_SOURCE
#define _DEFAULT_SOURCE
@ -35,6 +37,9 @@ int prompt_size = 6;
TAOS_RES *result = NULL;
SShellHistory history;
#define DEFAULT_MAX_BINARY_DISPLAY_WIDTH 30
extern int32_t tsMaxBinaryDisplayWidth;
/*
* FUNCTION: Initialize the shell.
*/
@ -195,7 +200,15 @@ int32_t shellRunCommand(TAOS *con, char *command) {
} else if (regex_match(command, "^[\t ]*clear[ \t;]*$", REG_EXTENDED | REG_ICASE)) {
// If clear the screen.
system("clear");
return 0;
} else if (regex_match(command, "^[\t ]*set[ \t]+max_binary_display_width[ \t]+(default|[1-9][0-9]*)[ \t;]*$", REG_EXTENDED | REG_ICASE)) {
strtok(command, " \t");
strtok(NULL, " \t");
char* p = strtok(NULL, " \t");
if (strcasecmp(p, "default") == 0) {
tsMaxBinaryDisplayWidth = DEFAULT_MAX_BINARY_DISPLAY_WIDTH;
} else {
tsMaxBinaryDisplayWidth = atoi(p);
}
} else if (regex_match(command, "^[ \t]*source[\t ]+[^ ]+[ \t;]*$", REG_EXTENDED | REG_ICASE)) {
/* If source file. */
char *c_ptr = strtok(command, " ;");
@ -310,360 +323,347 @@ int regex_match(const char *s, const char *reg, int cflags) {
return 0;
}
int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
TAOS_ROW row = NULL;
int numOfRows = 0;
time_t tt;
char buf[25] = "\0";
struct tm *ptm;
int output_bytes = 0;
FILE * fp = NULL;
int num_fields = taos_field_count(con);
wordexp_t full_path;
assert(num_fields != 0);
static char* formatTimestamp(char* buf, int64_t val, int precision) {
if (args.is_raw_time) {
sprintf(buf, "%" PRId64, val);
return buf;
}
result = taos_use_result(con);
time_t tt;
if (precision == TSDB_TIME_PRECISION_MICRO) {
tt = (time_t)(val / 1000000);
} else {
tt = (time_t)(val / 1000);
}
struct tm* ptm = localtime(&tt);
size_t pos = strftime(buf, 32, "%Y-%m-%d %H:%M:%S", ptm);
if (precision == TSDB_TIME_PRECISION_MICRO) {
sprintf(buf + pos, ".%06d", (int)(val % 1000000));
} else {
sprintf(buf + pos, ".%03d", (int)(val % 1000));
}
return buf;
}
static void dumpFieldToFile(FILE* fp, const char* val, TAOS_FIELD* field, int32_t length, int precision) {
if (val == NULL) {
fprintf(fp, "%s", TSDB_DATA_NULL_STR);
return;
}
char buf[TSDB_MAX_BYTES_PER_ROW];
switch (field->type) {
case TSDB_DATA_TYPE_BOOL:
fprintf(fp, "%d", ((((int)(*((char *)val))) == 1) ? 1 : 0));
break;
case TSDB_DATA_TYPE_TINYINT:
fprintf(fp, "%d", (int)(*((char *)val)));
break;
case TSDB_DATA_TYPE_SMALLINT:
fprintf(fp, "%d", (int)(*((short *)val)));
break;
case TSDB_DATA_TYPE_INT:
fprintf(fp, "%d", *((int *)val));
break;
case TSDB_DATA_TYPE_BIGINT:
fprintf(fp, "%" PRId64, *((int64_t *)val));
break;
case TSDB_DATA_TYPE_FLOAT:
fprintf(fp, "%.5f", GET_FLOAT_VAL(val));
break;
case TSDB_DATA_TYPE_DOUBLE:
fprintf(fp, "%.9f", GET_DOUBLE_VAL(val));
break;
case TSDB_DATA_TYPE_BINARY:
case TSDB_DATA_TYPE_NCHAR:
memcpy(buf, val, length);
buf[length] = 0;
fprintf(fp, "\'%s\'", buf);
break;
case TSDB_DATA_TYPE_TIMESTAMP:
formatTimestamp(buf, *(int64_t*)val, precision);
fprintf(fp, "'%s'", buf);
break;
default:
break;
}
}
static int dumpResultToFile(const char* fname, TAOS_RES* result) {
TAOS_ROW row = taos_fetch_row(result);
if (row == NULL) {
return 0;
}
wordexp_t full_path;
if (wordexp(fname, &full_path, 0) != 0) {
fprintf(stderr, "ERROR: invalid file name: %s\n", fname);
return -1;
}
FILE* fp = fopen(full_path.we_wordv[0], "w");
if (fp == NULL) {
fprintf(stderr, "ERROR: failed to open file: %s\n", full_path.we_wordv[0]);
wordfree(&full_path);
return -1;
}
wordfree(&full_path);
int num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
int32_t* length = taos_fetch_lengths(result);
int precision = taos_result_precision(result);
for (int col = 0; col < num_fields; col++) {
if (col > 0) {
fprintf(fp, ",");
}
fprintf(fp, "%s", fields[col].name);
}
fputc('\n', fp);
int numOfRows = 0;
do {
for (int i = 0; i < num_fields; i++) {
if (i > 0) {
fputc(',', fp);
}
dumpFieldToFile(fp, row[i], fields +i, length[i], precision);
}
fputc('\n', fp);
numOfRows++;
row = taos_fetch_row(result);
} while( row != NULL);
fclose(fp);
return numOfRows;
}
static void printField(const char* val, TAOS_FIELD* field, int width, int32_t length, int precision) {
if (val == NULL) {
int w = width;
if (field->type < TSDB_DATA_TYPE_TINYINT || field->type > TSDB_DATA_TYPE_DOUBLE) {
w = 0;
}
w = printf("%*s", w, TSDB_DATA_NULL_STR);
for (; w < width; w++) {
putchar(' ');
}
return;
}
char buf[TSDB_MAX_BYTES_PER_ROW];
switch (field->type) {
case TSDB_DATA_TYPE_BOOL:
printf("%*s", width, ((((int)(*((char *)val))) == 1) ? "true" : "false"));
break;
case TSDB_DATA_TYPE_TINYINT:
printf("%*d", width, (int)(*((char *)val)));
break;
case TSDB_DATA_TYPE_SMALLINT:
printf("%*d", width, (int)(*((short *)val)));
break;
case TSDB_DATA_TYPE_INT:
printf("%*d", width, *((int *)val));
break;
case TSDB_DATA_TYPE_BIGINT:
printf("%*" PRId64, width, *((int64_t *)val));
break;
case TSDB_DATA_TYPE_FLOAT:
printf("%*.5f", width, GET_FLOAT_VAL(val));
break;
case TSDB_DATA_TYPE_DOUBLE:
printf("%*.9f", width, GET_DOUBLE_VAL(val));
break;
case TSDB_DATA_TYPE_BINARY:
case TSDB_DATA_TYPE_NCHAR:
shellPrintNChar(val, length, width);
break;
case TSDB_DATA_TYPE_TIMESTAMP:
formatTimestamp(buf, *(int64_t*)val, precision);
printf("%s", buf);
break;
default:
break;
}
}
static int verticalPrintResult(TAOS_RES* result) {
TAOS_ROW row = taos_fetch_row(result);
if (row == NULL) {
return 0;
}
int num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
int32_t* length = taos_fetch_lengths(result);
int precision = taos_result_precision(result);
int maxColNameLen = 0;
for (int col = 0; col < num_fields; col++) {
int len = strlen(fields[col].name);
if (len > maxColNameLen) {
maxColNameLen = len;
}
}
int numOfRows = 0;
do {
printf("*************************** %d.row ***************************\n", numOfRows + 1);
for (int i = 0; i < num_fields; i++) {
TAOS_FIELD* field = fields + i;
int padding = (int)(maxColNameLen - strlen(field->name));
printf("%*.s%s: ", padding, " ", field->name);
printField(row[i], field, 0, length[i], precision);
putchar('\n');
}
numOfRows++;
row = taos_fetch_row(result);
} while(row != NULL);
return numOfRows;
}
static int calcColWidth(TAOS_FIELD* field, int precision) {
int width = strlen(field->name);
switch (field->type) {
case TSDB_DATA_TYPE_BOOL:
return MAX(5, width); // 'false'
case TSDB_DATA_TYPE_TINYINT:
return MAX(4, width); // '-127'
case TSDB_DATA_TYPE_SMALLINT:
return MAX(6, width); // '-32767'
case TSDB_DATA_TYPE_INT:
return MAX(11, width); // '-2147483648'
case TSDB_DATA_TYPE_BIGINT:
return MAX(21, width); // '-9223372036854775807'
case TSDB_DATA_TYPE_FLOAT:
return MAX(20, width);
case TSDB_DATA_TYPE_DOUBLE:
return MAX(25, width);
case TSDB_DATA_TYPE_BINARY:
case TSDB_DATA_TYPE_NCHAR:
if (field->bytes > tsMaxBinaryDisplayWidth) {
return MAX(tsMaxBinaryDisplayWidth, width);
} else {
return MAX(field->bytes, width);
}
case TSDB_DATA_TYPE_TIMESTAMP:
if (args.is_raw_time) {
return MAX(14, width);
} else if (precision == TSDB_TIME_PRECISION_MICRO) {
return MAX(26, width); // '2020-01-01 00:00:00.000000'
} else {
return MAX(23, width); // '2020-01-01 00:00:00.000'
}
default:
assert(false);
}
return 0;
}
static void printHeader(TAOS_FIELD* fields, int* width, int num_fields) {
int rowWidth = 0;
for (int col = 0; col < num_fields; col++) {
TAOS_FIELD* field = fields + col;
int padding = (int)(width[col] - strlen(field->name));
int left = padding / 2;
printf(" %*.s%s%*.s |", left, " ", field->name, padding - left, " ");
rowWidth += width[col] + 3;
}
putchar('\n');
for (int i = 0; i < rowWidth; i++) {
putchar('=');
}
putchar('\n');
}
static int horizontalPrintResult(TAOS_RES* result) {
TAOS_ROW row = taos_fetch_row(result);
if (row == NULL) {
return 0;
}
int num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
int32_t* length = taos_fetch_lengths(result);
int precision = taos_result_precision(result);
int width[TSDB_MAX_COLUMNS];
for (int col = 0; col < num_fields; col++) {
width[col] = calcColWidth(fields + col, precision);
}
printHeader(fields, width, num_fields);
int numOfRows = 0;
do {
for (int i = 0; i < num_fields; i++) {
putchar(' ');
printField(row[i], fields + i, width[i], length[i], precision);
putchar(' ');
putchar('|');
}
putchar('\n');
numOfRows++;
row = taos_fetch_row(result);
} while(row != NULL);
return numOfRows;
}
int shellDumpResult(TAOS *con, char *fname, int *error_no, bool vertical) {
int numOfRows = 0;
TAOS_RES* result = taos_use_result(con);
if (result == NULL) {
taos_error(con);
return -1;
}
if (fname != NULL) {
if (wordexp(fname, &full_path, 0) != 0) {
fprintf(stderr, "ERROR: invalid file name: %s\n", fname);
return -1;
}
fp = fopen(full_path.we_wordv[0], "w");
if (fp == NULL) {
fprintf(stderr, "ERROR: failed to open file: %s\n", full_path.we_wordv[0]);
wordfree(&full_path);
return -1;
}
wordfree(&full_path);
}
TAOS_FIELD *fields = taos_fetch_fields(result);
row = taos_fetch_row(result);
int32_t* length = taos_fetch_lengths(result);
char t_str[TSDB_MAX_BYTES_PER_ROW] = "\0";
int l[TSDB_MAX_COLUMNS] = {0};
int maxLenColumnName = 0;
if (row) {
// Print the header indicator
if (fname == NULL) { // print to standard output
if (!printMode) {
for (int col = 0; col < num_fields; col++) {
switch (fields[col].type) {
case TSDB_DATA_TYPE_BOOL:
l[col] = MAX(BOOL_OUTPUT_LENGTH, strlen(fields[col].name));
break;
case TSDB_DATA_TYPE_TINYINT:
l[col] = MAX(TINYINT_OUTPUT_LENGTH, strlen(fields[col].name));
break;
case TSDB_DATA_TYPE_SMALLINT:
l[col] = MAX(SMALLINT_OUTPUT_LENGTH, strlen(fields[col].name));
break;
case TSDB_DATA_TYPE_INT:
l[col] = MAX(INT_OUTPUT_LENGTH, strlen(fields[col].name));
break;
case TSDB_DATA_TYPE_BIGINT:
l[col] = MAX(BIGINT_OUTPUT_LENGTH, strlen(fields[col].name));
break;
case TSDB_DATA_TYPE_FLOAT:
l[col] = MAX(FLOAT_OUTPUT_LENGTH, strlen(fields[col].name));
break;
case TSDB_DATA_TYPE_DOUBLE:
l[col] = MAX(DOUBLE_OUTPUT_LENGTH, strlen(fields[col].name));
break;
case TSDB_DATA_TYPE_BINARY:
case TSDB_DATA_TYPE_NCHAR:
l[col] = MAX(fields[col].bytes, strlen(fields[col].name));
/* l[col] = max(BINARY_OUTPUT_LENGTH, strlen(fields[col].name)); */
break;
case TSDB_DATA_TYPE_TIMESTAMP: {
int32_t defaultWidth = TIMESTAMP_OUTPUT_LENGTH;
if (args.is_raw_time) {
defaultWidth = 14;
}
if (taos_result_precision(result) == TSDB_TIME_PRECISION_MICRO) {
defaultWidth += 3;
}
l[col] = MAX(defaultWidth, strlen(fields[col].name));
break;
}
default:
break;
}
int spaces = (int)(l[col] - strlen(fields[col].name));
int left_space = spaces / 2;
int right_space = (spaces % 2 ? left_space + 1 : left_space);
printf("%*.s%s%*.s|", left_space, " ", fields[col].name, right_space, " ");
output_bytes += (l[col] + 1);
}
printf("\n");
for (int k = 0; k < output_bytes; k++) printf("=");
printf("\n");
} else {
for (int col = 0; col < num_fields; col++) {
if (strlen(fields[col].name) > maxLenColumnName) maxLenColumnName = strlen(fields[col].name);
}
}
// print the elements
do {
if (!printMode) {
for (int i = 0; i < num_fields; i++) {
if (row[i] == NULL) {
printf("%*s|", l[i], TSDB_DATA_NULL_STR);
continue;
}
switch (fields[i].type) {
case TSDB_DATA_TYPE_BOOL:
printf("%*s|", l[i], ((((int)(*((char *)row[i]))) == 1) ? "true" : "false"));
break;
case TSDB_DATA_TYPE_TINYINT:
printf("%*d|", l[i], (int)(*((char *)row[i])));
break;
case TSDB_DATA_TYPE_SMALLINT:
printf("%*d|", l[i], (int)(*((short *)row[i])));
break;
case TSDB_DATA_TYPE_INT:
printf("%*d|", l[i], *((int *)row[i]));
break;
case TSDB_DATA_TYPE_BIGINT:
printf("%*" PRId64 "|", l[i], *((int64_t *)row[i]));
break;
case TSDB_DATA_TYPE_FLOAT: {
float fv = 0;
fv = GET_FLOAT_VAL(row[i]);
printf("%*.5f|", l[i], fv);
}
break;
case TSDB_DATA_TYPE_DOUBLE: {
double dv = 0;
dv = GET_DOUBLE_VAL(row[i]);
printf("%*.9f|", l[i], dv);
}
break;
case TSDB_DATA_TYPE_BINARY:
case TSDB_DATA_TYPE_NCHAR:
memset(t_str, 0, TSDB_MAX_BYTES_PER_ROW);
memcpy(t_str, row[i], length[i]);
/* printf("%-*s|",max(fields[i].bytes, strlen(fields[i].name)),
* t_str); */
/* printf("%-*s|", l[i], t_str); */
shellPrintNChar(t_str, l[i], printMode);
break;
case TSDB_DATA_TYPE_TIMESTAMP:
if (args.is_raw_time) {
printf(" %" PRId64 "|", *(int64_t *)row[i]);
} else {
if (taos_result_precision(result) == TSDB_TIME_PRECISION_MICRO) {
tt = (time_t)((*(int64_t *)row[i]) / 1000000);
} else {
tt = (time_t)((*(int64_t *)row[i]) / 1000);
}
ptm = localtime(&tt);
strftime(buf, 64, "%y-%m-%d %H:%M:%S", ptm);
if (taos_result_precision(result) == TSDB_TIME_PRECISION_MICRO) {
printf(" %s.%06d|", buf, (int)(*(int64_t *)row[i] % 1000000));
} else {
printf(" %s.%03d|", buf, (int)(*(int64_t *)row[i] % 1000));
}
}
break;
default:
break;
}
}
printf("\n");
} else {
printf("*************************** %d.row ***************************\n", numOfRows + 1);
for (int i = 0; i < num_fields; i++) {
// 1. print column name
int left_space = (int)(maxLenColumnName - strlen(fields[i].name));
printf("%*.s%s: ", left_space, " ", fields[i].name);
// 2. print column value
if (row[i] == NULL) {
printf("%s\n", TSDB_DATA_NULL_STR);
continue;
}
switch (fields[i].type) {
case TSDB_DATA_TYPE_BOOL:
printf("%s\n", ((((int)(*((char *)row[i]))) == 1) ? "true" : "false"));
break;
case TSDB_DATA_TYPE_TINYINT:
printf("%d\n", (int)(*((char *)row[i])));
break;
case TSDB_DATA_TYPE_SMALLINT:
printf("%d\n", (int)(*((short *)row[i])));
break;
case TSDB_DATA_TYPE_INT:
printf("%d\n", *((int *)row[i]));
break;
case TSDB_DATA_TYPE_BIGINT:
printf("%" PRId64 "\n", *((int64_t *)row[i]));
break;
case TSDB_DATA_TYPE_FLOAT: {
float fv = 0;
fv = GET_FLOAT_VAL(row[i]);
printf("%.5f\n", fv);
}
break;
case TSDB_DATA_TYPE_DOUBLE: {
double dv = 0;
dv = GET_DOUBLE_VAL(row[i]);
printf("%.9f\n", dv);
}
break;
case TSDB_DATA_TYPE_BINARY:
case TSDB_DATA_TYPE_NCHAR:
memset(t_str, 0, TSDB_MAX_BYTES_PER_ROW);
memcpy(t_str, row[i], length[i]);
l[i] = MAX(fields[i].bytes, strlen(fields[i].name));
shellPrintNChar(t_str, l[i], printMode);
break;
case TSDB_DATA_TYPE_TIMESTAMP:
if (args.is_raw_time) {
printf("%" PRId64 "\n", *(int64_t *)row[i]);
} else {
if (taos_result_precision(result) == TSDB_TIME_PRECISION_MICRO) {
tt = (time_t)((*(int64_t *)row[i]) / 1000000);
} else {
tt = (time_t)((*(int64_t *)row[i]) / 1000);
}
ptm = localtime(&tt);
strftime(buf, 64, "%y-%m-%d %H:%M:%S", ptm);
if (taos_result_precision(result) == TSDB_TIME_PRECISION_MICRO) {
printf("%s.%06d\n", buf, (int)(*(int64_t *)row[i] % 1000000));
} else {
printf("%s.%03d\n", buf, (int)(*(int64_t *)row[i] % 1000));
}
}
break;
default:
break;
}
}
}
numOfRows++;
} while ((row = taos_fetch_row(result)));
} else { // dump to file
// first write column
for (int col = 0; col < num_fields; col++) {
fprintf(fp, "%s", fields[col].name);
if (col < num_fields - 1) {
fprintf(fp, ",");
} else {
fprintf(fp, "\n");
}
}
do {
for (int i = 0; i < num_fields; i++) {
if (row[i]) {
switch (fields[i].type) {
case TSDB_DATA_TYPE_BOOL:
fprintf(fp, "%d", ((((int)(*((char *)row[i]))) == 1) ? 1 : 0));
break;
case TSDB_DATA_TYPE_TINYINT:
fprintf(fp, "%d", (int)(*((char *)row[i])));
break;
case TSDB_DATA_TYPE_SMALLINT:
fprintf(fp, "%d", (int)(*((short *)row[i])));
break;
case TSDB_DATA_TYPE_INT:
fprintf(fp, "%d", *((int *)row[i]));
break;
case TSDB_DATA_TYPE_BIGINT:
fprintf(fp, "%" PRId64, *((int64_t *)row[i]));
break;
case TSDB_DATA_TYPE_FLOAT: {
float fv = 0;
fv = GET_FLOAT_VAL(row[i]);
fprintf(fp, "%.5f", fv);
}
break;
case TSDB_DATA_TYPE_DOUBLE: {
double dv = 0;
dv = GET_DOUBLE_VAL(row[i]);
fprintf(fp, "%.9f", dv);
}
break;
case TSDB_DATA_TYPE_BINARY:
case TSDB_DATA_TYPE_NCHAR:
memset(t_str, 0, TSDB_MAX_BYTES_PER_ROW);
memcpy(t_str, row[i], length[i]);
fprintf(fp, "\'%s\'", t_str);
break;
case TSDB_DATA_TYPE_TIMESTAMP:
if (args.is_raw_time) {
fprintf(fp, "%" PRId64, *(int64_t *)row[i]);
} else {
if (taos_result_precision(result) == TSDB_TIME_PRECISION_MICRO) {
tt = (time_t)((*(int64_t *)row[i]) / 1000000);
} else {
tt = (time_t)((*(int64_t *)row[i]) / 1000);
}
ptm = localtime(&tt);
strftime(buf, 64, "%Y-%m-%d %H:%M:%S", ptm);
if (taos_result_precision(result) == TSDB_TIME_PRECISION_MICRO) {
fprintf(fp, "\'%s.%06d\'", buf, (int)(*(int64_t *)row[i] % 1000000));
} else {
fprintf(fp, "\'%s.%03d\'", buf, (int)(*(int64_t *)row[i] % 1000));
}
}
break;
default:
break;
}
} else {
fprintf(fp, "%s", TSDB_DATA_NULL_STR);
}
if (i < num_fields - 1) {
fprintf(fp, ",");
} else {
fprintf(fp, "\n");
}
}
numOfRows++;
} while ((row = taos_fetch_row(result)));
}
numOfRows = dumpResultToFile(fname, result);
} else if(vertical) {
numOfRows = verticalPrintResult(result);
} else {
numOfRows = horizontalPrintResult(result);
}
*error_no = taos_errno(con);
taos_free_result(result);
result = NULL;
if (fname != NULL) {
fclose(fp);
}
return numOfRows;
}
void read_history() {
// Initialize history
memset(history.hist, 0, sizeof(char *) * MAX_HISTORY_SIZE);

View File

@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _GNU_SOURCE
#define _XOPEN_SOURCE
#define _DEFAULT_SOURCE

View File

@ -329,34 +329,27 @@ void *shellLoopQuery(void *arg) {
return NULL;
}
void shellPrintNChar(char *str, int width, bool printMode) {
int col_left = width;
wchar_t wc;
while (col_left > 0) {
if (*str == '\0') break;
char *tstr = str;
int byte_width = mbtowc(&wc, tstr, MB_CUR_MAX);
if (byte_width <= 0) break;
int col_width = wcwidth(wc);
if (col_width <= 0) {
str += byte_width;
continue;
void shellPrintNChar(const char *str, int length, int width) {
int pos = 0, cols = 0;
while (pos < length) {
wchar_t wc;
pos += mbtowc(&wc, str + pos, MB_CUR_MAX);
if (pos > length) {
break;
}
int w = wcwidth(wc);
if (w > 0) {
if (width > 0 && cols + w > width) {
break;
}
printf("%lc", wc);
cols += w;
}
if (col_left < col_width) break;
printf("%lc", wc);
str += byte_width;
col_left -= col_width;
}
while (col_left > 0) {
printf(" ");
col_left--;
}
if (!printMode) {
printf("|");
} else {
printf("\n");
for (; cols < width; cols++) {
putchar(' ');
}
}

View File

@ -20,7 +20,6 @@
TAOS* con;
pthread_t pid;
int32_t TIMESTAMP_OUTPUT_LENGTH = 22;
// TODO: IMPLEMENT INTERRUPT HANDLER.
void interruptHandler(int signum) {

View File

@ -217,32 +217,32 @@ void *shellLoopQuery(void *arg) {
return NULL;
}
void shellPrintNChar(char *str, int width, bool printMode) {
int col_left = width;
wchar_t wc;
while (col_left > 0) {
if (*str == '\0') break;
char *tstr = str;
int byte_width = mbtowc(&wc, tstr, MB_CUR_MAX);
int col_width = byte_width;
if (col_left < col_width) break;
printf("%lc", wc);
str += byte_width;
col_left -= col_width;
void shellPrintNChar(const char *str, int length, int width) {
int pos = 0, cols = 0;
while (pos < length) {
wchar_t wc;
int bytes = mbtowc(&wc, str + pos, MB_CUR_MAX);
pos += bytes;
if (pos > length) {
break;
}
int w = bytes;
if (w > 0) {
if (width > 0 && cols + w > width) {
break;
}
printf("%lc", wc);
cols += w;
}
}
while (col_left > 0) {
printf(" ");
col_left--;
}
if (!printMode) {
printf("|");
} else {
printf("\n");
for (; cols < width; cols++) {
putchar(' ');
}
}
void get_history_path(char *history) { sprintf(history, "%s/%s", ".", HISTORY_FILE); }
void exitShell() { exit(EXIT_SUCCESS); }

View File

@ -138,7 +138,7 @@ typedef struct SQuery {
SColumnInfo* colList;
SColumnInfo* tagColList;
int32_t numOfFilterCols;
int64_t* defaultVal;
int64_t* fillVal;
uint32_t status; // query status
SResultRec rec;
int32_t pos;

View File

@ -28,7 +28,7 @@ typedef struct {
STColumn col; // column info
int16_t functionId; // sql function id
int16_t flag; // column flag: TAG COLUMN|NORMAL COLUMN
union {int64_t i; double d;} defaultVal;
union {int64_t i; double d;} fillVal;
} SFillColInfo;
typedef struct SFillInfo {
@ -75,15 +75,13 @@ void taosFillCopyInputDataFromOneFilePage(SFillInfo* pFillInfo, tFilePage* pInpu
TSKEY taosGetRevisedEndKey(TSKEY ekey, int32_t order, int64_t timeInterval, int8_t slidingTimeUnit, int8_t precision);
int32_t taosGetNumOfResultWithFill(SFillInfo* pFillInfo, int32_t numOfRows, int64_t ekey, int32_t maxNumOfRows);
int64_t taosGetNumOfResultWithFill(SFillInfo* pFillInfo, int32_t numOfRows, int64_t ekey, int32_t maxNumOfRows);
int32_t taosNumOfRemainRows(SFillInfo *pFillInfo);
int32_t taosDoInterpoResult(SFillInfo* pFillInfo, tFilePage** data, int32_t numOfRows, int32_t outputRows, char** srcData);
int taosDoLinearInterpolation(int32_t type, SPoint *point1, SPoint *point2, SPoint *point);
void taosGenerateDataBlock(SFillInfo* pFillInfo, tFilePage** output, int64_t* outputRows, int32_t capacity);
int64_t taosGenerateDataBlock(SFillInfo* pFillInfo, tFilePage** output, int32_t capacity);
#ifdef __cplusplus
}

View File

@ -376,11 +376,16 @@ bool isSelectivityWithTagsQuery(SQuery *pQuery) {
bool isTSCompQuery(SQuery *pQuery) { return pQuery->pSelectExpr[0].base.functionId == TSDB_FUNC_TS_COMP; }
static bool limitResults(SQuery *pQuery) {
static bool limitResults(SQueryRuntimeEnv* pRuntimeEnv) {
SQInfo* pQInfo = GET_QINFO_ADDR(pRuntimeEnv);
SQuery* pQuery = pRuntimeEnv->pQuery;
if ((pQuery->limit.limit > 0) && (pQuery->rec.total + pQuery->rec.rows > pQuery->limit.limit)) {
pQuery->rec.rows = pQuery->limit.limit - pQuery->rec.total;
assert(pQuery->rec.rows > 0);
qTrace("QInfo:%p discard remain data due to result limitation, limit:%"PRId64", current return:%d, total:%"PRId64,
pQInfo, pQuery->limit.limit, pQuery->rec.rows, pQuery->rec.total + pQuery->rec.rows);
assert(pQuery->rec.rows >= 0);
setQueryStatus(pQuery, QUERY_COMPLETED);
return true;
}
@ -624,15 +629,17 @@ static int32_t getForwardStepsInBlock(int32_t numOfRows, __block_search_fn_t sea
/**
* NOTE: the query status only set for the first scan of master scan.
*/
static void doCheckQueryCompleted(SQueryRuntimeEnv *pRuntimeEnv, TSKEY lastKey, SWindowResInfo *pWindowResInfo) {
static int32_t doCheckQueryCompleted(SQueryRuntimeEnv *pRuntimeEnv, TSKEY lastKey, SWindowResInfo *pWindowResInfo) {
SQuery *pQuery = pRuntimeEnv->pQuery;
if (pRuntimeEnv->scanFlag != MASTER_SCAN || (!isIntervalQuery(pQuery))) {
return;
return pWindowResInfo->size;
}
// no qualified results exist, abort check
int32_t numOfClosed = 0;
if (pWindowResInfo->size == 0) {
return;
return pWindowResInfo->size;
}
// query completed
@ -646,10 +653,10 @@ static void doCheckQueryCompleted(SQueryRuntimeEnv *pRuntimeEnv, TSKEY lastKey,
int32_t i = 0;
int64_t skey = TSKEY_INITIAL_VAL;
// TODO opt performance: get the closed time window here
for (i = 0; i < pWindowResInfo->size; ++i) {
SWindowResult *pResult = &pWindowResInfo->pResult[i];
if (pResult->status.closed) {
numOfClosed += 1;
continue;
}
@ -672,16 +679,26 @@ static void doCheckQueryCompleted(SQueryRuntimeEnv *pRuntimeEnv, TSKEY lastKey,
pWindowResInfo->prevSKey = pWindowResInfo->pResult[pWindowResInfo->curIndex].window.skey;
// the number of completed slots are larger than the threshold, dump to client immediately.
int32_t n = numOfClosedTimeWindow(pWindowResInfo);
if (n > pWindowResInfo->threshold) {
// the number of completed slots are larger than the threshold, return current generated results to client.
if (numOfClosed > pWindowResInfo->threshold) {
qTrace("QInfo:%p total result window:%d closed:%d, reached the output threshold %d, return",
GET_QINFO_ADDR(pRuntimeEnv), pWindowResInfo->size, numOfClosed, pQuery->rec.threshold);
setQueryStatus(pQuery, QUERY_RESBUF_FULL);
} else {
qTrace("QInfo:%p total result window:%d already closed:%d", GET_QINFO_ADDR(pRuntimeEnv), pWindowResInfo->size,
numOfClosed);
}
qTrace("QInfo:%p total window:%d, closed:%d", GET_QINFO_ADDR(pRuntimeEnv), pWindowResInfo->size, n);
}
// output has reached the limitation, set query completed
if (pQuery->limit.limit > 0 && (pQuery->limit.limit + pQuery->limit.offset) <= numOfClosed &&
pRuntimeEnv->scanFlag == MASTER_SCAN) {
setQueryStatus(pQuery, QUERY_COMPLETED);
}
assert(pWindowResInfo->prevSKey != TSKEY_INITIAL_VAL);
return numOfClosed;
}
static int32_t getNumOfRowsInTimeWindow(SQuery *pQuery, SDataBlockInfo *pDataBlockInfo, TSKEY *pPrimaryColumn,
@ -1309,28 +1326,27 @@ static int32_t tableApplyFunctionsOnBlock(SQueryRuntimeEnv *pRuntimeEnv, SDataBl
TSKEY lastKey = QUERY_IS_ASC_QUERY(pQuery) ? pDataBlockInfo->window.ekey : pDataBlockInfo->window.skey;
pTableQInfo->lastKey = lastKey + GET_FORWARD_DIRECTION_FACTOR(pQuery->order.order);
doCheckQueryCompleted(pRuntimeEnv, lastKey, pWindowResInfo);
// interval query with limit applied
if (isIntervalQuery(pQuery) && pQuery->limit.limit > 0 &&
(pQuery->limit.limit + pQuery->limit.offset) <= numOfClosedTimeWindow(pWindowResInfo) &&
pRuntimeEnv->scanFlag == MASTER_SCAN) {
setQueryStatus(pQuery, QUERY_COMPLETED);
}
int32_t numOfRes = 0;
if (isIntervalQuery(pQuery)) {
numOfRes = doCheckQueryCompleted(pRuntimeEnv, lastKey, pWindowResInfo);
} else {
numOfRes = getNumOfResult(pRuntimeEnv);
int32_t numOfRes = getNumOfResult(pRuntimeEnv);
// update the number of output result
if (numOfRes > 0 && pQuery->checkBuffer == 1) {
assert(numOfRes >= pQuery->rec.rows);
pQuery->rec.rows = numOfRes;
// update the number of output result
if (numOfRes > 0 && pQuery->checkBuffer == 1) {
assert(numOfRes >= pQuery->rec.rows);
pQuery->rec.rows = numOfRes;
if (numOfRes >= pQuery->rec.threshold) {
setQueryStatus(pQuery, QUERY_RESBUF_FULL);
}
if (numOfRes >= pQuery->rec.threshold) {
setQueryStatus(pQuery, QUERY_RESBUF_FULL);
}
if ((pQuery->limit.limit >= 0) && numOfRes >= (pQuery->limit.limit + pQuery->limit.offset)) {
setQueryStatus(pQuery, QUERY_COMPLETED);
if ((pQuery->limit.limit >= 0) && (pQuery->limit.limit + pQuery->limit.offset) <= numOfRes) {
setQueryStatus(pQuery, QUERY_COMPLETED);
}
}
}
@ -2026,10 +2042,10 @@ void pointInterpSupporterSetData(SQInfo *pQInfo, SPointInterpoSupporter *pPointI
tVariantCreateFromBinary(&pCtx->param[3], (char *)&count, sizeof(count), TSDB_DATA_TYPE_INT);
if (isNull((char *)&pQuery->defaultVal[i], pCtx->inputType)) {
if (isNull((char *)&pQuery->fillVal[i], pCtx->inputType)) {
pCtx->param[1].nType = TSDB_DATA_TYPE_NULL;
} else {
tVariantCreateFromBinary(&pCtx->param[1], (char *)&pQuery->defaultVal[i], pCtx->inputBytes, pCtx->inputType);
tVariantCreateFromBinary(&pCtx->param[1], (char *)&pQuery->fillVal[i], pCtx->inputBytes, pCtx->inputType);
}
pInterpDetail->ts = pQuery->window.skey;
@ -2471,8 +2487,8 @@ static int64_t doScanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) {
SArray *pDataBlock = loadDataBlockOnDemand(pRuntimeEnv, pQueryHandle, &blockInfo, &pStatis);
int32_t numOfRes = tableApplyFunctionsOnBlock(pRuntimeEnv, &blockInfo, pStatis, binarySearchForKey, pDataBlock);
qTrace("QInfo:%p check data block, brange:%" PRId64 "-%" PRId64 ", rows:%d, numOfRes:%d", GET_QINFO_ADDR(pRuntimeEnv),
blockInfo.window.skey, blockInfo.window.ekey, blockInfo.rows, numOfRes);
qTrace("QInfo:%p check data block, brange:%" PRId64 "-%" PRId64 ", numOfRows:%d, numOfRes:%d, lastKey:%"PRId64, GET_QINFO_ADDR(pRuntimeEnv),
blockInfo.window.skey, blockInfo.window.ekey, blockInfo.rows, numOfRes, pQuery->current->lastKey);
// while the output buffer is full or limit/offset is applied, query may be paused here
if (Q_STATUS_EQUAL(pQuery->status, QUERY_RESBUF_FULL | QUERY_COMPLETED)) {
@ -3374,7 +3390,9 @@ static void clearEnvAfterReverseScan(SQueryRuntimeEnv *pRuntimeEnv, SQueryStatus
// during reverse scan
pTableQueryInfo->lastKey = pStatus->lastKey;
pQuery->status = pStatus->status;
pTableQueryInfo->win = pStatus->w;
pQuery->window = pTableQueryInfo->win;
}
void scanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv, TSKEY start) {
@ -3396,6 +3414,7 @@ void scanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv, TSKEY start) {
if (pRuntimeEnv->scanFlag == MASTER_SCAN) {
qstatus.status = pQuery->status;
qstatus.curWindow.ekey = pTableQueryInfo->lastKey - step;
qstatus.lastKey = pTableQueryInfo->lastKey;
}
if (!needScanDataBlocksAgain(pRuntimeEnv)) {
@ -3423,6 +3442,9 @@ void scanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv, TSKEY start) {
setQueryStatus(pQuery, QUERY_NOT_COMPLETED);
pRuntimeEnv->scanFlag = REPEAT_SCAN;
qTrace("QInfo:%p start to repeat scan data blocks due to query func required, qrange:%"PRId64"-%"PRId64, pQInfo,
cond.twindow.skey, cond.twindow.ekey);
// check if query is killed or not
if (isQueryKilled(pQInfo)) {
@ -3707,7 +3729,7 @@ static int32_t doCopyToSData(SQInfo *pQInfo, SWindowResult *result, int32_t orde
int32_t startIdx = 0;
int32_t step = -1;
qTrace("QInfo:%p start to copy data from windowResInfo to query buf", GET_QINFO_ADDR(pQuery));
qTrace("QInfo:%p start to copy data from windowResInfo to query buf", pQInfo);
int32_t totalSubset = getNumOfSubset(pQInfo);
if (orderType == TSDB_ORDER_ASC) {
@ -3836,7 +3858,7 @@ bool queryHasRemainResults(SQueryRuntimeEnv* pRuntimeEnv) {
}
/*
* There are no results returned to client now.
* While the code reaches here, there are no results returned to client now.
* If query is not completed yet, the gaps between two results blocks need to be handled after next data block
* is retrieved from TSDB.
*
@ -3890,18 +3912,24 @@ static void doCopyQueryResultToMsg(SQInfo *pQInfo, int32_t numOfRows, char *data
}
int32_t doFillGapsInResults(SQueryRuntimeEnv* pRuntimeEnv, tFilePage **pDst, int32_t numOfRows, int32_t *numOfInterpo) {
SQInfo* pQInfo = GET_QINFO_ADDR(pRuntimeEnv);
SQuery *pQuery = pRuntimeEnv->pQuery;
SFillInfo* pFillInfo = pRuntimeEnv->pFillInfo;
while (1) {
taosGenerateDataBlock(pRuntimeEnv->pFillInfo, (tFilePage**) pQuery->sdata, &pQuery->rec.rows, pQuery->rec.capacity);
int32_t ret = pQuery->rec.rows;
int32_t ret = taosGenerateDataBlock(pFillInfo, (tFilePage**) pQuery->sdata, pQuery->rec.capacity);
// todo apply limit output function
/* reached the start position of according to offset value, return immediately */
if (pQuery->limit.offset == 0) {
qTrace("QInfo:%p initial numOfRows:%d, generate filled result:%d rows", pQInfo, pFillInfo->numOfRows, ret);
return ret;
}
if (pQuery->limit.offset < ret) {
qTrace("QInfo:%p initial numOfRows:%d, generate filled result:%d rows, offset:%d. Discard due to offset, remain:%d, new offset:%d",
pQInfo, pFillInfo->numOfRows, ret, pQuery->limit.offset, ret - pQuery->limit.offset, 0);
ret -= pQuery->limit.offset;
// todo !!!!there exactly number of interpo is not valid.
// todo refactor move to the beginning of buffer
@ -3909,10 +3937,16 @@ int32_t doFillGapsInResults(SQueryRuntimeEnv* pRuntimeEnv, tFilePage **pDst, int
memmove(pDst[i]->data, pDst[i]->data + pQuery->pSelectExpr[i].bytes * pQuery->limit.offset,
ret * pQuery->pSelectExpr[i].bytes);
}
pQuery->limit.offset = 0;
return ret;
} else {
qTrace("QInfo:%p initial numOfRows:%d, generate filled result:%d rows, offset:%d. Discard due to offset, "
"remain:%d, new offset:%d", pQInfo, pFillInfo->numOfRows, ret, pQuery->limit.offset, 0,
pQuery->limit.offset - ret);
pQuery->limit.offset -= ret;
pQuery->rec.rows = 0;
ret = 0;
}
@ -3920,8 +3954,6 @@ int32_t doFillGapsInResults(SQueryRuntimeEnv* pRuntimeEnv, tFilePage **pDst, int
return ret;
}
}
return 0;
}
void vnodePrintQueryStatistics(SQInfo *pQInfo) {
@ -4002,8 +4034,8 @@ static void updateOffsetVal(SQueryRuntimeEnv *pRuntimeEnv, SDataBlockInfo *pBloc
int32_t numOfRes = tableApplyFunctionsOnBlock(pRuntimeEnv, pBlockInfo, NULL, binarySearchForKey, pDataBlock);
qTrace("QInfo:%p check data block, brange:%" PRId64 "-%" PRId64 ", rows:%d, numOfRes:%d", GET_QINFO_ADDR(pRuntimeEnv),
pBlockInfo->window.skey, pBlockInfo->window.ekey, pBlockInfo->rows, numOfRes);
qTrace("QInfo:%p check data block, brange:%" PRId64 "-%" PRId64 ", numOfRows:%d, numOfRes:%d, lastKey:%"PRId64, GET_QINFO_ADDR(pRuntimeEnv),
pBlockInfo->window.skey, pBlockInfo->window.ekey, pBlockInfo->rows, numOfRes, pQuery->current->lastKey);
}
void skipBlocks(SQueryRuntimeEnv *pRuntimeEnv) {
@ -4120,8 +4152,9 @@ static bool skipTimeInterval(SQueryRuntimeEnv *pRuntimeEnv, TSKEY* start) {
int32_t numOfRes = tableApplyFunctionsOnBlock(pRuntimeEnv, &blockInfo, NULL, binarySearchForKey, pDataBlock);
pRuntimeEnv->windowResInfo.curIndex = index; // restore the window index
qTrace("QInfo:%p check data block, brange:%" PRId64 "-%" PRId64 ", rows:%d, numOfRes:%d",
GET_QINFO_ADDR(pRuntimeEnv), blockInfo.window.skey, blockInfo.window.ekey, blockInfo.rows, numOfRes);
qTrace("QInfo:%p check data block, brange:%" PRId64 "-%" PRId64 ", numOfRows:%d, numOfRes:%d, lastKey:%"PRId64,
GET_QINFO_ADDR(pRuntimeEnv), blockInfo.window.skey, blockInfo.window.ekey, blockInfo.rows, numOfRes, pQuery->current->lastKey);
return true;
} else { // do nothing
*start = tw.skey;
@ -4215,7 +4248,7 @@ static SFillColInfo* taosCreateFillColInfo(SQuery* pQuery) {
pFillCol[i].col.offset = offset;
pFillCol[i].flag = TSDB_COL_NORMAL; // always be ta normal column for table query
pFillCol[i].functionId = pExprInfo->base.functionId;
pFillCol[i].defaultVal.i = pQuery->defaultVal[i];
pFillCol[i].fillVal.i = pQuery->fillVal[i];
offset += pExprInfo->bytes;
}
@ -4591,7 +4624,7 @@ static void sequentialTableProcess(SQInfo *pQInfo) {
skipResults(pRuntimeEnv);
// the limitation of output result is reached, set the query completed
if (limitResults(pQuery)) {
if (limitResults(pRuntimeEnv)) {
pQInfo->tableIndex = pQInfo->groupInfo.numOfTables;
break;
}
@ -4846,7 +4879,7 @@ static void tableFixedOutputProcess(SQInfo *pQInfo, STableQueryInfo* pTableInfo)
pQuery->rec.rows = getNumOfResult(pRuntimeEnv);
skipResults(pRuntimeEnv);
limitResults(pQuery);
limitResults(pRuntimeEnv);
}
static void tableMultiOutputProcess(SQInfo *pQInfo, STableQueryInfo* pTableInfo) {
@ -4894,7 +4927,7 @@ static void tableMultiOutputProcess(SQInfo *pQInfo, STableQueryInfo* pTableInfo)
resetCtxOutputBuf(pRuntimeEnv);
}
limitResults(pQuery);
limitResults(pRuntimeEnv);
if (Q_STATUS_EQUAL(pQuery->status, QUERY_RESBUF_FULL)) {
qTrace("QInfo:%p query paused due to output limitation, next qrange:%" PRId64 "-%" PRId64, pQInfo,
pQuery->current->lastKey, pQuery->window.ekey);
@ -4972,7 +5005,7 @@ static void tableIntervalProcess(SQInfo *pQInfo, STableQueryInfo* pTableInfo) {
// the offset is handled at prepare stage if no interpolation involved
if (pQuery->fillType == TSDB_FILL_NONE || pQuery->rec.rows == 0) {
limitResults(pQuery);
limitResults(pRuntimeEnv);
break;
} else {
TSKEY ekey = taosGetRevisedEndKey(pQuery->window.ekey, pQuery->order.order, pQuery->slidingTime,
@ -4980,11 +5013,10 @@ static void tableIntervalProcess(SQInfo *pQInfo, STableQueryInfo* pTableInfo) {
taosFillSetStartInfo(pRuntimeEnv->pFillInfo, pQuery->rec.rows, ekey);
taosFillCopyInputDataFromFilePage(pRuntimeEnv->pFillInfo, (tFilePage**) pQuery->sdata);
numOfInterpo = 0;
pQuery->rec.rows = doFillGapsInResults(pRuntimeEnv, (tFilePage **)pQuery->sdata, pQuery->rec.rows, &numOfInterpo);
qTrace("QInfo: %p fill results completed, final:%d", pQInfo, pQuery->rec.rows);
if (pQuery->rec.rows > 0 || Q_STATUS_EQUAL(pQuery->status, QUERY_COMPLETED)) {
limitResults(pQuery);
limitResults(pRuntimeEnv);
break;
}
@ -5017,9 +5049,8 @@ static void tableQueryImpl(SQInfo *pQInfo) {
int32_t remain = taosNumOfRemainRows(pRuntimeEnv->pFillInfo);
pQuery->rec.rows = doFillGapsInResults(pRuntimeEnv, (tFilePage **)pQuery->sdata, remain, &numOfInterpo);
qTrace("QInfo: %p fill results completed, final:%d", pQInfo, pQuery->rec.rows);
if (pQuery->rec.rows > 0) {
limitResults(pQuery);
limitResults(pRuntimeEnv);
}
qTrace("QInfo:%p current:%d returned, total:%d", pQInfo, pQuery->rec.rows, pQuery->rec.total);
@ -5351,7 +5382,7 @@ static int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SArray **pTableIdList,
pQueryMsg->fillType = htons(pQueryMsg->fillType);
if (pQueryMsg->fillType != TSDB_FILL_NONE) {
pQueryMsg->defaultVal = (uint64_t)(pMsg);
pQueryMsg->fillVal = (uint64_t)(pMsg);
int64_t *v = (int64_t *)pMsg;
for (int32_t i = 0; i < pQueryMsg->numOfOutput; ++i) {
@ -5722,13 +5753,13 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SArray* pTableIdList,
}
if (pQuery->fillType != TSDB_FILL_NONE) {
pQuery->defaultVal = malloc(sizeof(int64_t) * pQuery->numOfOutput);
if (pQuery->defaultVal == NULL) {
pQuery->fillVal = malloc(sizeof(int64_t) * pQuery->numOfOutput);
if (pQuery->fillVal == NULL) {
goto _cleanup;
}
// the first column is the timestamp
memcpy(pQuery->defaultVal, (char *)pQueryMsg->defaultVal, pQuery->numOfOutput * sizeof(int64_t));
memcpy(pQuery->fillVal, (char *)pQueryMsg->fillVal, pQuery->numOfOutput * sizeof(int64_t));
}
// to make sure third party won't overwrite this structure
@ -5785,7 +5816,7 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SArray* pTableIdList,
return pQInfo;
_cleanup:
tfree(pQuery->defaultVal);
tfree(pQuery->fillVal);
if (pQuery->sdata != NULL) {
for (int16_t col = 0; col < pQuery->numOfOutput; ++col) {
@ -5893,8 +5924,8 @@ static void freeQInfo(SQInfo *pQInfo) {
tfree(pQuery->pSelectExpr);
}
if (pQuery->defaultVal != NULL) {
tfree(pQuery->defaultVal);
if (pQuery->fillVal != NULL) {
tfree(pQuery->fillVal);
}
// todo refactor, extract method to destroytableDataInfo
@ -5997,8 +6028,13 @@ static int32_t doDumpQueryResult(SQInfo *pQInfo, char *data) {
}
pQuery->rec.total += pQuery->rec.rows;
qTrace("QInfo:%p current:%d, total:%d", pQInfo, pQuery->rec.rows, pQuery->rec.total);
qTrace("QInfo:%p current numOfRes rows:%d, total:%d", pQInfo, pQuery->rec.rows, pQuery->rec.total);
if (pQuery->limit.limit > 0 && pQuery->limit.limit == pQuery->rec.total) {
qTrace("QInfo:%p results limitation reached, limitation:%"PRId64, pQInfo, pQuery->limit.limit);
setQueryStatus(pQuery, QUERY_OVER);
}
return TSDB_CODE_SUCCESS;
// todo if interpolation exists, the result may be dump to client by several rounds

View File

@ -34,7 +34,7 @@ int64_t taosGetIntervalStartTimestamp(int64_t startTime, int64_t slidingTime, ch
* here we revised the start time of day according to the local time zone,
* but in case of DST, the start time of one day need to be dynamically decided.
*
* TODO dynamically decide the start time of a day
* TODO dynamically decide the start time of a day, move to common module
*/
// todo refactor to extract function that is available for Linux/Windows/Mac platform
@ -116,10 +116,9 @@ void taosFillSetStartInfo(SFillInfo* pFillInfo, int32_t numOfRows, TSKEY endKey)
return;
}
pFillInfo->rowIdx = 0;
pFillInfo->rowIdx = 0;
pFillInfo->endKey = endKey;
pFillInfo->numOfRows = numOfRows;
pFillInfo->endKey = endKey;
}
void taosFillCopyInputDataFromFilePage(SFillInfo* pFillInfo, tFilePage** pInput) {
@ -131,6 +130,8 @@ void taosFillCopyInputDataFromFilePage(SFillInfo* pFillInfo, tFilePage** pInput)
void taosFillCopyInputDataFromOneFilePage(SFillInfo* pFillInfo, tFilePage* pInput) {
assert(pFillInfo->numOfRows == pInput->num);
int32_t t = 0;
for(int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
@ -138,7 +139,7 @@ void taosFillCopyInputDataFromOneFilePage(SFillInfo* pFillInfo, tFilePage* pInpu
memcpy(pFillInfo->pData[i], s, pInput->num * pCol->col.bytes);
if (pCol->flag == TSDB_COL_TAG) { // copy the tag value
memcpy(pFillInfo->pTags[i], pFillInfo->pData[i], pCol->col.bytes);
memcpy(pFillInfo->pTags[t++], pFillInfo->pData[i], pCol->col.bytes);
}
}
}
@ -170,7 +171,7 @@ static int32_t taosGetTotalNumOfFilledRes(SFillInfo* pFillInfo, const TSKEY* tsA
}
}
int32_t taosGetNumOfResultWithFill(SFillInfo* pFillInfo, int32_t numOfRows, int64_t ekey, int32_t maxNumOfRows) {
int64_t taosGetNumOfResultWithFill(SFillInfo* pFillInfo, int32_t numOfRows, int64_t ekey, int32_t maxNumOfRows) {
int32_t numOfRes = taosGetTotalNumOfFilledRes(pFillInfo, (int64_t*) pFillInfo->pData[0], numOfRows,
pFillInfo->slidingTime, ekey);
return (numOfRes > maxNumOfRows) ? maxNumOfRows : numOfRes;
@ -193,7 +194,7 @@ static double linearInterpolationImpl(double v1, double v2, double k1, double k2
int taosDoLinearInterpolation(int32_t type, SPoint* point1, SPoint* point2, SPoint* point) {
switch (type) {
case TSDB_DATA_TYPE_INT: {
*(int32_t*)point->val = linearInterpolationImpl(*(int32_t*)point1->val, *(int32_t*)point2->val, point1->key,
*(int32_t*)point->val = (int32_t) linearInterpolationImpl(*(int32_t*)point1->val, *(int32_t*)point2->val, point1->key,
point2->key, point->key);
break;
}
@ -209,17 +210,17 @@ int taosDoLinearInterpolation(int32_t type, SPoint* point1, SPoint* point2, SPoi
};
case TSDB_DATA_TYPE_TIMESTAMP:
case TSDB_DATA_TYPE_BIGINT: {
*(int64_t*)point->val = linearInterpolationImpl(*(int64_t*)point1->val, *(int64_t*)point2->val, point1->key,
*(int64_t*)point->val = (int64_t) linearInterpolationImpl(*(int64_t*)point1->val, *(int64_t*)point2->val, point1->key,
point2->key, point->key);
break;
};
case TSDB_DATA_TYPE_SMALLINT: {
*(int16_t*)point->val = linearInterpolationImpl(*(int16_t*)point1->val, *(int16_t*)point2->val, point1->key,
*(int16_t*)point->val = (int16_t) linearInterpolationImpl(*(int16_t*)point1->val, *(int16_t*)point2->val, point1->key,
point2->key, point->key);
break;
};
case TSDB_DATA_TYPE_TINYINT: {
*(int8_t*)point->val =
*(int8_t*) point->val = (int8_t)
linearInterpolationImpl(*(int8_t*)point1->val, *(int8_t*)point2->val, point1->key, point2->key, point->key);
break;
};
@ -243,8 +244,8 @@ static void setTagsValue(SFillInfo* pColInfo, tFilePage** data, char** pTags, in
static void doInterpoResultImpl(SFillInfo* pFillInfo, tFilePage** data, int32_t* num, char** srcData,
int64_t ts, char** pTags, bool outOfBound) {
char** prevValues = &pFillInfo->prevValues;
char** nextValues = &pFillInfo->nextValues;
char* prevValues = pFillInfo->prevValues;
char* nextValues = pFillInfo->nextValues;
SPoint point1, point2, point;
@ -257,16 +258,21 @@ static void doInterpoResultImpl(SFillInfo* pFillInfo, tFilePage** data, int32_t*
// set the other values
if (pFillInfo->fillType == TSDB_FILL_PREV) {
char* pInterpolationData = FILL_IS_ASC_FILL(pFillInfo) ? *prevValues : *nextValues;
if (pInterpolationData != NULL) {
char* p = FILL_IS_ASC_FILL(pFillInfo) ? prevValues : nextValues;
if (p != NULL) {
for (int32_t i = 1; i < numOfValCols; ++i) {
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
char* val1 = elePtrAt(data[i]->data, pCol->col.bytes, *num);
if (isNull(pInterpolationData + pCol->col.offset, pCol->col.type)) {
setNull(val1, pCol->col.type, pCol->col.bytes);
if (isNull(p + pCol->col.offset, pCol->col.type)) {
if (pCol->col.type == TSDB_DATA_TYPE_BINARY || pCol->col.type == TSDB_DATA_TYPE_NCHAR) {
setVardataNull(val1, pCol->col.type);
} else {
setNull(val1, pCol->col.type, pCol->col.bytes);
}
} else {
assignVal(val1, pInterpolationData + pCol->col.offset, pCol->col.bytes, pCol->col.type);
assignVal(val1, p + pCol->col.offset, pCol->col.bytes, pCol->col.type);
}
}
} else { // no prev value yet, set the value for NULL
@ -274,14 +280,18 @@ static void doInterpoResultImpl(SFillInfo* pFillInfo, tFilePage** data, int32_t*
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
char* val1 = elePtrAt(data[i]->data, pCol->col.bytes, *num);
setNull(val1, pCol->col.type, pCol->col.bytes);
if (pCol->col.type == TSDB_DATA_TYPE_BINARY||pCol->col.type == TSDB_DATA_TYPE_NCHAR) {
setVardataNull(val1, pCol->col.type);
} else {
setNull(val1, pCol->col.type, pCol->col.bytes);
}
}
}
setTagsValue(pFillInfo, data, pTags, numOfValCols, *num);
} else if (pFillInfo->fillType == TSDB_FILL_LINEAR) {
// TODO : linear interpolation supports NULL value
if (*prevValues != NULL && !outOfBound) {
if (prevValues != NULL && !outOfBound) {
for (int32_t i = 1; i < numOfValCols; ++i) {
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
@ -289,14 +299,17 @@ static void doInterpoResultImpl(SFillInfo* pFillInfo, tFilePage** data, int32_t*
int16_t bytes = pCol->col.bytes;
char *val1 = elePtrAt(data[i]->data, pCol->col.bytes, *num);
if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_NCHAR || type == TSDB_DATA_TYPE_BOOL) {
if (type == TSDB_DATA_TYPE_BINARY|| type == TSDB_DATA_TYPE_NCHAR) {
setVardataNull(val1, pCol->col.type);
continue;
} else if (type == TSDB_DATA_TYPE_BOOL) {
setNull(val1, pCol->col.type, bytes);
continue;
}
point1 = (SPoint){.key = *(TSKEY*)(*prevValues), .val = *prevValues + pCol->col.offset};
point1 = (SPoint){.key = *(TSKEY*)(prevValues), .val = prevValues + pCol->col.offset};
point2 = (SPoint){.key = ts, .val = srcData[i] + pFillInfo->rowIdx * bytes};
point = (SPoint){.key = pFillInfo->start, .val = val1};
point = (SPoint){.key = pFillInfo->start, .val = val1};
taosDoLinearInterpolation(type, &point1, &point2, &point);
}
@ -307,7 +320,12 @@ static void doInterpoResultImpl(SFillInfo* pFillInfo, tFilePage** data, int32_t*
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
char* val1 = elePtrAt(data[i]->data, pCol->col.bytes, *num);
setNull(val1, pCol->col.type, pCol->col.bytes);
if (pCol->col.type == TSDB_DATA_TYPE_BINARY || pCol->col.type == TSDB_DATA_TYPE_NCHAR) {
setVardataNull(val1, pCol->col.type);
} else {
setNull(val1, pCol->col.type, pCol->col.bytes);
}
}
setTagsValue(pFillInfo, data, pTags, numOfValCols, *num);
@ -318,7 +336,7 @@ static void doInterpoResultImpl(SFillInfo* pFillInfo, tFilePage** data, int32_t*
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
char* val1 = elePtrAt(data[i]->data, pCol->col.bytes, *num);
assignVal(val1, (char*)&pCol->defaultVal.i, pCol->col.bytes, pCol->col.type);
assignVal(val1, (char*)&pCol->fillVal.i, pCol->col.bytes, pCol->col.type);
}
setTagsValue(pFillInfo, data, pTags, numOfValCols, *num);
@ -338,11 +356,16 @@ static void initBeforeAfterDataBuf(SFillInfo* pFillInfo, char** nextValues) {
*nextValues = calloc(1, pFillInfo->rowSize);
for (int i = 1; i < pFillInfo->numOfCols; i++) {
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
setNull(*nextValues + pCol->col.offset, pCol->col.type, pCol->col.bytes);
if (pCol->col.type == TSDB_DATA_TYPE_BINARY||pCol->col.type == TSDB_DATA_TYPE_NCHAR) {
setVardataNull(*nextValues + pCol->col.offset, pCol->col.type);
} else {
setNull(*nextValues + pCol->col.offset, pCol->col.type, pCol->col.bytes);
}
}
}
int32_t taosDoInterpoResult(SFillInfo* pFillInfo, tFilePage** data, int32_t numOfRows, int32_t outputRows, char** srcData) {
int32_t generateDataBlockImpl(SFillInfo* pFillInfo, tFilePage** data, int32_t numOfRows, int32_t outputRows, char** srcData) {
int32_t num = 0;
pFillInfo->numOfCurrent = 0;
@ -356,8 +379,8 @@ int32_t taosDoInterpoResult(SFillInfo* pFillInfo, tFilePage** data, int32_t numO
if (numOfRows == 0) {
/*
* we need to rebuild whole result set
* NOTE:we need to keep the last saved data, to generated the filled data
* These data are generated according to fill strategy, since the current timestamp is out of time window of
* real result set. Note that we need to keep the direct previous result rows, to generated the filled data.
*/
while (num < outputRows) {
doInterpoResultImpl(pFillInfo, data, &num, srcData, pFillInfo->start, pTags, true);
@ -387,7 +410,7 @@ int32_t taosDoInterpoResult(SFillInfo* pFillInfo, tFilePage** data, int32_t numO
while (((pFillInfo->start < ts && FILL_IS_ASC_FILL(pFillInfo)) ||
(pFillInfo->start > ts && !FILL_IS_ASC_FILL(pFillInfo))) && num < outputRows) {
doInterpoResultImpl(pFillInfo, data, &num, srcData, pFillInfo->start, pTags, false);
doInterpoResultImpl(pFillInfo, data, &num, srcData, ts, pTags, false);
}
/* output buffer is full, abort */
@ -420,7 +443,7 @@ int32_t taosDoInterpoResult(SFillInfo* pFillInfo, tFilePage** data, int32_t numO
assignVal(val1, src, pCol->col.bytes, pCol->col.type);
memcpy(*prevValues + pCol->col.offset, src, pCol->col.bytes);
} else {
assignVal(val1, (char*) &pCol->defaultVal.i, pCol->col.bytes, pCol->col.type);
assignVal(val1, (char*) &pCol->fillVal.i, pCol->col.bytes, pCol->col.type);
}
}
}
@ -450,21 +473,12 @@ int32_t taosDoInterpoResult(SFillInfo* pFillInfo, tFilePage** data, int32_t numO
}
}
void taosGenerateDataBlock(SFillInfo* pFillInfo, tFilePage** output, int64_t* outputRows, int32_t capacity) {
int64_t taosGenerateDataBlock(SFillInfo* pFillInfo, tFilePage** output, int32_t capacity) {
int32_t remain = taosNumOfRemainRows(pFillInfo); // todo use iterator?
// TSKEY ekey = taosGetRevisedEndKey(pQuery->window.ekey, pQuery->order.order, pQuery->slidingTime,
// pQuery->slidingTimeUnit, pQuery->precision);
// if (QUERY_IS_ASC_QUERY(pQuery)) {
// assert(ekey >= pQuery->window.ekey);
// } else {
// assert(ekey <= pQuery->window.ekey);
// }
int32_t rows = taosGetNumOfResultWithFill(pFillInfo, remain, pFillInfo->endKey, capacity);
int32_t rows = taosGetNumOfResultWithFill(pFillInfo, remain, pFillInfo->endKey, capacity);
int32_t numOfRes = taosDoInterpoResult(pFillInfo, output, remain, rows, pFillInfo->pData);
*outputRows = rows;
int32_t numOfRes = generateDataBlockImpl(pFillInfo, output, remain, rows, pFillInfo->pData);
assert(numOfRes == rows);
return numOfRes;
}

View File

@ -101,11 +101,12 @@ void tVariantCreateFromBinary(tVariant *pVar, const char *pz, size_t len, uint32
break;
}
case TSDB_DATA_TYPE_NCHAR: { // here we get the nchar length from raw binary bits length
pVar->nLen = len / TSDB_NCHAR_SIZE;
pVar->wpz = calloc(1, (pVar->nLen + 1) * TSDB_NCHAR_SIZE);
int32_t lenInwchar = len / TSDB_NCHAR_SIZE;
pVar->wpz = calloc(1, (lenInwchar + 1) * TSDB_NCHAR_SIZE);
wcsncpy(pVar->wpz, (wchar_t *)pz, pVar->nLen);
pVar->wpz[pVar->nLen] = 0;
wcsncpy(pVar->wpz, (wchar_t *)pz, lenInwchar);
pVar->wpz[lenInwchar] = 0;
pVar->nLen = len;
break;
}

View File

@ -1539,14 +1539,21 @@ int32_t tsdbRetrieveDataBlockStatisInfo(TsdbQueryHandleT* pQueryHandle, SDataSta
tsdbLoadCompData(&pHandle->rhelper, pBlockInfo->compBlock, NULL);
size_t numOfCols = QH_GET_NUM_OF_COLS(pHandle);
memset(pHandle->statis, 0, sizeof(SDataStatis) * numOfCols);
for(int32_t i = 0; i < numOfCols; ++i) {
SDataStatis* st = &pHandle->statis[i];
int32_t colId = st->colId;
memset(st, 0, sizeof(SDataStatis));
st->colId = colId;
}
tsdbGetDataStatis(&pHandle->rhelper, pHandle->statis, numOfCols);
*pBlockStatis = pHandle->statis;
//update the number of NULL data rows
for(int32_t i = 0; i < numOfCols; ++i) {
if (pHandle->statis[i].numOfNull == -1) {
if (pHandle->statis[i].numOfNull == -1) { // set the column data are all NULL
pHandle->statis[i].numOfNull = pBlockInfo->compBlock->numOfRows;
}
}

View File

@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _BSD_SOURCE
#define _XOPEN_SOURCE
#define _DEFAULT_SOURCE

View File

@ -129,4 +129,6 @@ python3 ./test.py -f user/pass_len.py
#query
python3 ./test.py -f query/filter.py
python3 ./test.py $1 -f query/filterCombo.py
python3 ./test.py $1 -f query/queryNormal.py
python3 ./test.py $1 -f query/queryError.py

View File

@ -29,7 +29,8 @@ class TDTestCase:
tdSql.prepare()
tdLog.info("=============== step1")
tdSql.execute('create table tb (ts timestamp, speed int, temp float, note binary(5), flag bool)')
tdSql.execute(
'create table tb (ts timestamp, speed int, temp float, note binary(5), flag bool)')
numOfRecords = 0
randomList = [10, 50, 100, 500, 1000, 5000]
@ -38,23 +39,24 @@ class TDTestCase:
tdLog.info("will insert %d records" % num)
for x in range(0, num):
tdLog.info(
'insert into tb values (now + %da, NULL, NULL, NULL, TRUE)' % x)
'insert into tb values (now + %da, NULL, NULL, NULL, TRUE)' %
x)
tdSql.execute(
'insert into tb values (now + %da, NULL, NULL, NULL, TRUE)' % x)
'insert into tb values (now + %da, NULL, NULL, NULL, TRUE)' %
x)
numOfRecords = numOfRecords + num
tdSql.query("select * from tb")
tdSql.checkRows(numOfRecords)
tdSql.checkData(numOfRecords-num, 1, None)
tdSql.checkData(numOfRecords-1, 2, None)
tdSql.checkData(numOfRecords - num, 1, None)
tdSql.checkData(numOfRecords - 1, 2, None)
tdLog.info("stop dnode to commit data to disk")
tdDnodes.stop(1)
tdDnodes.start(1)
tdLog.sleep(5)
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)

View File

@ -0,0 +1,67 @@
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
from util.log import *
from util.cases import *
from util.sql import *
from util.dnodes import *
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self):
tdSql.prepare()
tdLog.info("=============== step1")
tdSql.execute(
'create table tb (ts timestamp, speed int, temp float, note binary(4000), flag bool)')
numOfRecords = 1000000
dividend = 1000
tdLog.info("will insert %d records" % numOfRecords)
ts = 1500000000000
for i in range(0, numOfRecords):
if (i % dividend):
print(".", end="")
tdSql.execute(
'insert into tb values (%d + %da, NULL, NULL, NULL, TRUE)' %
(ts, i))
else:
print("a", end="")
tdSql.execute(
'insert into tb values (%d + %da, NULL, NULL, "a", FALSE)' %
(ts, i))
tdSql.query("select * from tb")
tdSql.checkRows(numOfRecords)
tdSql.checkData(numOfRecords - dividend, 3, 'a')
tdSql.checkData(numOfRecords - dividend - 1, 3, None)
tdLog.info("stop dnode to commit data to disk")
tdDnodes.stop(1)
tdLog.info("dnodes:%d size is %d" % (1, tdDnodes.getDataSize(1)))
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())

View File

@ -0,0 +1,60 @@
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import taos
from util.log import *
from util.cases import *
from util.sql import *
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self):
tdSql.prepare()
print("==============step1")
tdSql.execute(
"create table if not exists st (ts timestamp, tagtype int, name nchar(16)) tags(dev nchar(50))")
tdSql.execute(
'CREATE TABLE if not exists dev_001 using st tags("dev_01")')
tdSql.execute(
'CREATE TABLE if not exists dev_002 using st tags("dev_02")')
print("==============step2")
tdSql.execute(
"""INSERT INTO dev_001(ts, tagtype, name) VALUES('2020-05-13 10:00:00.000', 1, 'first'),('2020-05-13 10:00:00.001', 2, 'second'),
('2020-05-13 10:00:00.002', 3, 'third') dev_002 VALUES('2020-05-13 10:00:00.003', 1, 'first'), ('2020-05-13 10:00:00.004', 2, 'second'),
('2020-05-13 10:00:00.005', 3, 'third')""")
# query with filter condition A OR condition B
tdSql.query("select * from db.st where ts > '2020-05-13 10:00:00.002' AND tagtype < 2")
tdSql.checkRows(1)
# query with filter condition A OR condition B, error expected
tdSql.error("select * from db.st where ts > '2020-05-13 10:00:00.002' OR tagtype < 2")
# illegal condition
tdSql.error("select * from db.st where ts != '2020-05-13 10:00:00.002' OR tagtype < 2")
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())

View File

@ -0,0 +1,67 @@
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import taos
from util.log import *
from util.cases import *
from util.sql import *
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self):
tdSql.prepare()
print("==============step1")
tdSql.execute(
"create table if not exists st (ts timestamp, tagtype int, name nchar(16)) tags(dev nchar(50))")
tdSql.execute(
'CREATE TABLE if not exists dev_001 using st tags("dev_01")')
tdSql.execute(
'CREATE TABLE if not exists dev_002 using st tags("dev_02")')
print("==============step2")
tdSql.execute(
"""INSERT INTO dev_001(ts, tagtype, name) VALUES('2020-05-13 10:00:00.000', 1, 'first'),('2020-05-13 10:00:00.001', 2, 'second'),
('2020-05-13 10:00:00.002', 3, 'third') dev_002 VALUES('2020-05-13 10:00:00.003', 1, 'first'), ('2020-05-13 10:00:00.004', 2, 'second'),
('2020-05-13 10:00:00.005', 3, 'third')""")
"""Error expected here, but no errors
# query first .. as ..
tdSql.error("select first(*) as one from st")
# query last .. as ..
tdSql.error("select last(*) as latest from st")
"""
# query last row .. as ..
tdSql.error("select last_row as latest from st")
# query distinct on normal colnum
tdSql.error("select distinct tagtype from st")
# query .. order by non-time field
tdSql.error("select * from st order by name")
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())

View File

@ -0,0 +1,84 @@
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import taos
from util.log import *
from util.cases import *
from util.sql import *
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self):
tdSql.prepare()
print("==============step1")
tdSql.execute("create table stb1 (ts timestamp, c1 int, c2 float) tags(t1 int, t2 binary(10), t3 nchar(10))")
tdSql.execute("insert into tb1 using stb1 tags(1,'tb1', '表1') values ('2020-04-18 15:00:00.000', 1, 0.1), ('2020-04-18 15:00:01.000', 2, 0.1)")
tdSql.execute("insert into tb2 using stb1 tags(2,'tb2', '表2') values ('2020-04-18 15:00:02.000', 3, 2.1), ('2020-04-18 15:00:03.000', 4, 2.2)")
# join 2 tables -- bug exists
# tdSql.query("select * from tb1 a, tb2 b where a.ts = b.ts")
# tdSql.checkRows(1)
# join 3 tables -- bug exists
# tdSql.query("select stb_t.ts, stb_t.dscrption, stb_t.temperature, stb_p.id, stb_p.dscrption, stb_p.pressure,stb_v.velocity from stb_p, stb_t, stb_v where stb_p.ts=stb_t.ts and stb_p.ts=stb_v.ts and stb_p.id = stb_t.id")
# query count
tdSql.query("select count(*) from stb1")
tdSql.checkData(0, 0, 4)
# query first
tdSql.query("select first(*) from stb1")
tdSql.checkData(0, 1, 1)
# query last
tdSql.query("select last(*) from stb1")
tdSql.checkData(0, 1, 4)
# query as
tdSql.query("select t2 as number from stb1")
tdSql.checkRows(2)
# query first ... as
tdSql.query("select first(*) as begin from stb1")
tdSql.checkData(0, 1, 1)
# query last ... as
tdSql.query("select last(*) as end from stb1")
tdSql.checkData(0, 1, 4)
# query group .. by
tdSql.query("select sum(c1), t2 from stb1 group by t2")
tdSql.checkRows(2)
# query ... limit
tdSql.query("select * from stb1 limit 2")
tdSql.checkRows(2)
# query ... limit offset
tdSql.query("select * from stb1 limit 2 offset 3")
tdSql.checkRows(1)
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())

View File

@ -121,6 +121,7 @@ class Test:
tdDnodes.start(1)
tdSql.prepare()
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)

View File

@ -56,4 +56,10 @@ python3 ./test.py $1 -s && sleep 1
#query
python3 ./test.py $1 -f query/filter.py
python3 ./test.py $1 -s && sleep 1
python3 ./test.py $1 -f query/filterCombo.py
python3 ./test.py $1 -s && sleep 1
python3 ./test.py $1 -f query/queryNormal.py
python3 ./test.py $1 -s && sleep 1
python3 ./test.py $1 -f query/queryError.py
python3 ./test.py $1 -s && sleep 1

View File

@ -98,12 +98,16 @@ class TDTestCase:
# create a super table with name exceed max length
sname = self.generateString(maxTableNameLen + 1)
tdLog.info("create a super table with length %d" % len(sname))
tdSql.error("create table %s (ts timestamp, value int) tags(id int)" % sname)
tdSql.error(
"create table %s (ts timestamp, value int) tags(id int)" %
sname)
# create a super table with name of max length
sname = self.generateString(maxTableNameLen)
tdLog.info("create a super table with length %d" % len(sname))
tdSql.execute("create table %s (ts timestamp, value int) tags(id int)" % sname)
tdSql.execute(
"create table %s (ts timestamp, value int) tags(id int)" %
sname)
tdLog.info("check table count, should be one")
tdSql.query('show stables')
tdSql.checkRows(1)

View File

@ -69,9 +69,9 @@ class TDTestCase:
"insert into %s values (now + %s, %d)" %
(tb, ms, x))
x = x + 1
#TSIM: endw
# TSIM: endw
i = i + 1
#TSIM: endw
# TSIM: endw
while (i < 10):
tb = "%s%d" % (tbPrefix, i)
# TSIM: sql create table $tb using %s tags( 1, 1, 1 )
@ -89,9 +89,9 @@ class TDTestCase:
"insert into %s values (now + %s, %d)" %
(tb, ms, x))
x = x + 1
#TSIM: endw
# TSIM: endw
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -102,7 +102,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(%d)' % totalNum)
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from %s where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % mt)
@ -111,7 +111,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % mt)
tdSql.query('select * from %s where ts > now + 4m' % mt)
@ -119,7 +119,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % mt)
tdSql.query('select * from %s where ts = now + 4m' % mt)
@ -127,7 +127,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -138,7 +138,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -149,14 +149,14 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where tgcol1 <> 0
tdLog.info('select * from %s where tgcol1 <> 0' % mt)
tdSql.query('select * from %s where tgcol1 <> 0' % mt)
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where tgcol1 = 1
tdLog.info('select * from %s where tgcol1 = 1' % mt)
tdSql.query('select * from %s where tgcol1 = 1' % mt)
@ -164,35 +164,35 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where tgcol1 <> 1
tdLog.info('select * from %s where tgcol1 <> 1' % mt)
tdSql.query('select * from %s where tgcol1 <> 1' % mt)
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where tgcol1 = true
tdLog.info('select * from %s where tgcol1 = true' % mt)
tdSql.query('select * from %s where tgcol1 = true' % mt)
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where tgcol1 <> true
tdLog.info('select * from %s where tgcol1 <> true' % mt)
tdSql.query('select * from %s where tgcol1 <> true' % mt)
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where tgcol1 = false
tdLog.info('select * from %s where tgcol1 = false' % mt)
tdSql.query('select * from %s where tgcol1 = false' % mt)
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where tgcol1 <> false
tdLog.info('select * from %s where tgcol1 <> false' % mt)
tdSql.query('select * from %s where tgcol1 <> false' % mt)
@ -200,7 +200,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -210,28 +210,28 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where tgcol2 <> 0
tdLog.info('select * from %s where tgcol2 <> 0' % mt)
tdSql.query('select * from %s where tgcol2 <> 0' % mt)
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where tgcol2 = 1
tdLog.info('select * from %s where tgcol2 = 1' % mt)
tdSql.query('select * from %s where tgcol2 = 1' % mt)
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where tgcol2 <> 1
tdLog.info('select * from %s where tgcol2 <> 1' % mt)
tdSql.query('select * from %s where tgcol2 <> 1' % mt)
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -242,28 +242,28 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where tgcol3 <> 0
tdLog.info('select * from %s where tgcol3 <> 0' % mt)
tdSql.query('select * from %s where tgcol3 <> 0' % mt)
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where tgcol3 = 1
tdLog.info('select * from %s where tgcol3 = 1' % mt)
tdSql.query('select * from %s where tgcol3 = 1' % mt)
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where tgcol3 <> 1
tdLog.info('select * from %s where tgcol3 <> 1' % mt)
tdSql.query('select * from %s where tgcol3 <> 1' % mt)
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -277,7 +277,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> true
tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> true' %
@ -288,7 +288,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol1 = false
tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 = false' %
@ -299,7 +299,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol1 <> false
tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 <> false' %
@ -310,7 +310,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol1 = false
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 = false' %
@ -321,7 +321,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol1 <> false
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 <> false' %
@ -332,7 +332,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and
# tgcol1 <> false
tdLog.info(
@ -344,7 +344,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> false
# and ts < now + 5m
tdLog.info(
@ -357,7 +357,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -368,7 +368,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 1
tdLog.info('select * from %s where ts > now + 4m and tgcol2 <> 1' % mt)
tdSql.query(
@ -378,7 +378,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol2 = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol2 = 0' % mt)
tdSql.query('select * from %s where ts < now + 4m and tgcol2 = 0' % mt)
@ -386,7 +386,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol2 <> 0
tdLog.info('select * from %s where ts < now + 4m and tgcol2 <> 0' % mt)
tdSql.query(
@ -396,7 +396,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol2 = 0
tdLog.info('select * from %s where ts <= now + 4m and tgcol2 = 0' % mt)
tdSql.query(
@ -406,7 +406,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol2 <> 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' %
@ -418,7 +418,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and
# tgcol2 <> 0
tdLog.info(
@ -431,7 +431,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 0 and ts
# < now + 5m
tdLog.info(
@ -444,7 +444,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -455,7 +455,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1
tdLog.info('select * from %s where ts > now + 4m and tgcol3 <> 1' % mt)
tdSql.query(
@ -465,7 +465,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol3 = 0' % mt)
tdSql.query('select * from %s where ts < now + 4m and tgcol3 = 0' % mt)
@ -473,7 +473,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0
tdLog.info('select * from %s where ts < now + 4m and tgcol3 <> 0' % mt)
tdSql.query(
@ -483,7 +483,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0
tdLog.info('select * from %s where ts <= now + 4m and tgcol3 = 0' % mt)
tdSql.query(
@ -493,7 +493,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0' %
@ -505,7 +505,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and
# tgcol3 <> 0
tdLog.info(
@ -518,7 +518,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts
# < now + 5m
tdLog.info(
@ -531,7 +531,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -547,7 +547,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 1 and
# tgcol1 <> true
tdLog.info(
@ -560,7 +560,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol2 = 0 and
# tgcol1 = false
tdLog.info(
@ -573,7 +573,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol2 <> 0 and
# tgcol1 <> false
tdLog.info(
@ -586,7 +586,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol2 = 0 and
# tgcol1 = false
tdLog.info(
@ -599,7 +599,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol2 <> 0 and
# tgcol1 <> false
tdLog.info(
@ -612,7 +612,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and
# tgcol2 <> 0 and tgcol1 <> false
tdLog.info(
@ -625,7 +625,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol1 <> false
tdLog.info(
@ -638,7 +638,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -654,7 +654,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 and
# tgcol1 <> true
tdLog.info(
@ -667,7 +667,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 and
# tgcol1 = false
tdLog.info(
@ -680,7 +680,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 and
# tgcol1 <> false
tdLog.info(
@ -693,7 +693,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 and
# tgcol1 = false
tdLog.info(
@ -706,7 +706,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 and
# tgcol1 <> false
tdLog.info(
@ -719,7 +719,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and
# tgcol3 <> 0 and tgcol1 <> false
tdLog.info(
@ -732,7 +732,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol1 <> false
tdLog.info(
@ -745,7 +745,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -761,7 +761,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 and
# tgcol2 <> 1
tdLog.info(
@ -774,7 +774,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 and
# tgcol2 = 0
tdLog.info(
@ -787,7 +787,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 and
# tgcol2 <> 0
tdLog.info(
@ -800,7 +800,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 and
# tgcol2 = 0
tdLog.info(
@ -813,7 +813,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 and
# tgcol2 <> 0
tdLog.info(
@ -826,7 +826,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and
# tgcol3 <> 0 and tgcol2 <> 0
tdLog.info(
@ -839,7 +839,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol2 <> 0
tdLog.info(
@ -852,7 +852,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step12
tdLog.info('=============== step12')
@ -868,7 +868,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1
tdLog.info(
@ -881,7 +881,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol1 = 0 and
# tgcol2 = 0 and tgcol3 = 0
tdLog.info(
@ -894,7 +894,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol1 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0
tdLog.info(
@ -907,7 +907,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol1 = 0 and
# tgcol2 = 0 and tgcol3 = 0
tdLog.info(
@ -920,7 +920,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol1 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0
tdLog.info(
@ -933,7 +933,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and
# tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info(
@ -946,7 +946,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info(
@ -959,7 +959,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step13
tdLog.info('=============== step13')
@ -977,7 +977,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step14
tdLog.info('=============== step14')
@ -995,7 +995,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where tgcol1 = true and
@ -1012,7 +1012,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where tgcol1 = true and
@ -1029,7 +1029,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step15
tdLog.info('=============== step15')
@ -1047,7 +1047,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and
@ -1064,7 +1064,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and
@ -1081,7 +1081,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and
@ -1096,7 +1096,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step16
tdLog.info('=============== step16')
@ -1114,7 +1114,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s group by tgcol2
@ -1130,7 +1130,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s group by tgcol3
@ -1146,7 +1146,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step17
tdLog.info('=============== step17')
@ -1165,7 +1165,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where tgcol1 = true and
@ -1182,7 +1182,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where tgcol1 = true and
@ -1199,7 +1199,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step18
tdLog.info('=============== step18')
@ -1218,7 +1218,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and
@ -1235,7 +1235,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and
@ -1250,7 +1250,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and
@ -1263,7 +1263,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step19
tdLog.info('=============== step19')
@ -1278,7 +1278,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where tgcol1 = true and
@ -1291,7 +1291,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where tgcol1 = true and
@ -1304,7 +1304,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -1318,7 +1318,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -77,22 +77,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol2
tdLog.info('alter table %s drop tag tgcol2' % (mt))
@ -119,22 +119,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4 then
tdLog.info('tdSql.checkData(0, 3, 4)')
tdSql.checkData(0, 3, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step2
tdLog.info('select * from %s where tgcol2 = 1 -x step2' % (mt))
@ -171,22 +171,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol2
tdLog.info('alter table %s drop tag tgcol2' % (mt))
@ -213,22 +213,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4 then
tdLog.info('tdSql.checkData(0, 3, 4)')
tdSql.checkData(0, 3, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step3
tdLog.info('select * from %s where tgcol2 = 1 -x step3' % (mt))
@ -265,22 +265,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2.00000 then
tdLog.info('tdSql.checkData(0, 3, 2.00000)')
tdSql.checkData(0, 3, 2.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql describe $tb
tdLog.info('describe %s' % (tb))
@ -289,22 +289,22 @@ class TDTestCase:
tdLog.info('tdSql.checkDataType(2, 1, "BIGINT")')
tdSql.checkDataType(2, 1, "BIGINT")
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data31 != FLOAT then
tdLog.info('tdSql.checkDataType(3, 1, "FLOAT")')
tdSql.checkDataType(3, 1, "FLOAT")
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data23 != 1 then
tdLog.info('tdSql.checkData(2, 3, 1)')
tdSql.checkData(2, 3, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data33 != 2.000000 then
tdLog.info('tdSql.checkData(3, 3, 2.000000)')
tdSql.checkData(3, 3, 2.000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol2
tdLog.info('alter table %s drop tag tgcol2' % (mt))
@ -331,22 +331,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4.00000 then
tdLog.info('tdSql.checkData(0, 3, 4.00000)')
tdSql.checkData(0, 3, 4.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step4
tdLog.info('select * from %s where tgcol2 = 1 -x step4' % (mt))
@ -383,22 +383,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1.000000000 then
tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
tdSql.checkData(0, 2, 1.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol2
tdLog.info('alter table %s drop tag tgcol2' % (mt))
@ -425,22 +425,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1.000000000 then
tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
tdSql.checkData(0, 2, 1.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4 then
tdLog.info('tdSql.checkData(0, 3, 4)')
tdSql.checkData(0, 3, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol3 = '1' -x step5
tdLog.info('select * from %s where tgcol3 = "1" -x step5' % (mt))
@ -477,27 +477,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt change tag tgcol1 tgcol4
tdLog.info('alter table %s change tag tgcol1 tgcol4' % (mt))
@ -540,27 +540,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 0 then
tdLog.info('tdSql.checkData(0, 2, 0)')
tdSql.checkData(0, 2, 0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 5 then
tdLog.info('tdSql.checkData(0, 3, 5)')
tdSql.checkData(0, 3, 5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 6 then
tdLog.info('tdSql.checkData(0, 4, 6)')
tdSql.checkData(0, 4, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol6 = '6'
tdLog.info('select * from %s where tgcol6 = "6"' % (mt))
@ -571,27 +571,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 0 then
tdLog.info('tdSql.checkData(0, 2, 0)')
tdSql.checkData(0, 2, 0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 5 then
tdLog.info('tdSql.checkData(0, 3, 5)')
tdSql.checkData(0, 3, 5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 6 then
tdLog.info('tdSql.checkData(0, 4, 6)')
tdSql.checkData(0, 4, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol4 = 1
tdLog.info('select * from %s where tgcol4 = 1' % (mt))
@ -600,7 +600,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol3 = 1 -x step52
tdLog.info('select * from %s where tgcol3 = 1 -x step52' % (mt))
tdSql.error('select * from %s where tgcol3 = 12' % (mt))
@ -636,27 +636,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt change tag tgcol1 tgcol4
tdLog.info('alter table %s change tag tgcol1 tgcol4' % (mt))
@ -699,27 +699,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 4 then
tdLog.info('tdSql.checkData(0, 2, 4)')
tdSql.checkData(0, 2, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 5 then
tdLog.info('tdSql.checkData(0, 3, 5)')
tdSql.checkData(0, 3, 5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 6 then
tdLog.info('tdSql.checkData(0, 4, 6)')
tdSql.checkData(0, 4, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step71
tdLog.info('select * from %s where tgcol2 = 1 -x step71' % (mt))
@ -761,27 +761,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2.00000 then
tdLog.info('tdSql.checkData(0, 3, 2.00000)')
tdSql.checkData(0, 3, 2.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt change tag tgcol1 tgcol4
tdLog.info('alter table %s change tag tgcol1 tgcol4' % (mt))
@ -825,27 +825,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 4 then
tdLog.info('tdSql.checkData(0, 2, 4)')
tdSql.checkData(0, 2, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 5 then
tdLog.info('tdSql.checkData(0, 3, 5)')
tdSql.checkData(0, 3, 5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 1 then
tdLog.info('tdSql.checkData(0, 4, 1)')
tdSql.checkData(0, 4, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step81
tdLog.info('select * from %s where tgcol2 = 1 -x step81' % (mt))
@ -887,27 +887,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1.000000000 then
tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
tdSql.checkData(0, 2, 1.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt change tag tgcol1 tgcol4
tdLog.info('alter table %s change tag tgcol1 tgcol4' % (mt))
@ -950,27 +950,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 4.000000000 then
tdLog.info('tdSql.checkData(0, 2, 4.000000000)')
tdSql.checkData(0, 2, 4.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 1 then
tdLog.info('tdSql.checkData(0, 3, 1)')
tdSql.checkData(0, 3, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 6.00000 then
tdLog.info('tdSql.checkData(0, 4, 6.00000)')
tdSql.checkData(0, 4, 6.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol3 = 1 -x step91
tdLog.info('select * from %s where tgcol3 = 1 -x step91' % (mt))
@ -1016,32 +1016,32 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 4 then
tdLog.info('tdSql.checkData(0, 5, 4)')
tdSql.checkData(0, 5, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt change tag tgcol1 tgcol4 -x step103
tdLog.info('alter table %s change tag tgcol1 tgcol4 -x step103' % (mt))
@ -1090,32 +1090,32 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4 then
tdLog.info('tdSql.checkData(0, 3, 4)')
tdSql.checkData(0, 3, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 0 then
tdLog.info('tdSql.checkData(0, 4, 0)')
tdSql.checkData(0, 4, 0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != NULL then
tdLog.info('tdSql.checkData(0, 5, NULL)')
tdSql.checkData(0, 5, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step101
tdLog.info('select * from %s where tgcol2 = 1 -x step101' % (mt))
@ -1161,37 +1161,37 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 4.00000 then
tdLog.info('tdSql.checkData(0, 5, 4.00000)')
tdSql.checkData(0, 5, 4.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 5 then
tdLog.info('tdSql.checkData(0, 6, 5)')
tdSql.checkData(0, 6, 5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt change tag tgcol1 tgcol4 -x step114
tdLog.info('alter table %s change tag tgcol1 tgcol4 -x step114' % (mt))
@ -1261,42 +1261,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4 then
tdLog.info('tdSql.checkData(0, 3, 4)')
tdSql.checkData(0, 3, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 5 then
tdLog.info('tdSql.checkData(0, 4, 5)')
tdSql.checkData(0, 4, 5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 6 then
tdLog.info('tdSql.checkData(0, 5, 6)')
tdSql.checkData(0, 5, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 7 then
tdLog.info('tdSql.checkData(0, 6, 7)')
tdSql.checkData(0, 6, 7)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != 8 then
tdLog.info('tdSql.checkData(0, 7, 8)')
tdSql.checkData(0, 7, 8)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step111
tdLog.info('select * from %s where tgcol2 = 1 -x step111' % (mt))
@ -1348,42 +1348,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3.00000 then
tdLog.info('tdSql.checkData(0, 4, 3.00000)')
tdSql.checkData(0, 4, 3.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 4.000000000 then
tdLog.info('tdSql.checkData(0, 5, 4.000000000)')
tdSql.checkData(0, 5, 4.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 5 then
tdLog.info('tdSql.checkData(0, 6, 5)')
tdSql.checkData(0, 6, 5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != 6 then
tdLog.info('tdSql.checkData(0, 7, 6)')
tdSql.checkData(0, 7, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol2
tdLog.info('alter table %s drop tag tgcol2' % (mt))
@ -1447,42 +1447,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 0 then
tdLog.info('tdSql.checkData(0, 2, 0)')
tdSql.checkData(0, 2, 0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 1 then
tdLog.info('tdSql.checkData(0, 3, 1)')
tdSql.checkData(0, 3, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 5 then
tdLog.info('tdSql.checkData(0, 4, 5)')
tdSql.checkData(0, 4, 5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 4 then
tdLog.info('tdSql.checkData(0, 5, 4)')
tdSql.checkData(0, 5, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 3 then
tdLog.info('tdSql.checkData(0, 6, 3)')
tdSql.checkData(0, 6, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != 2 then
tdLog.info('tdSql.checkData(0, 7, 2)')
tdSql.checkData(0, 7, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = '5'
tdLog.info('select * from %s where tgcol2 = "5"' % (mt))
@ -1491,7 +1491,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol3 = 4
tdLog.info('select * from %s where tgcol3 = 4' % (mt))
@ -1500,7 +1500,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol5 = 2
tdLog.info('select * from %s where tgcol5 = 2' % (mt))
@ -1509,7 +1509,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol6 = '1'
tdLog.info('select * from %s where tgcol6 = "1"' % (mt))
@ -1518,7 +1518,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step13
tdLog.info('=============== step13')
@ -1554,42 +1554,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 4 then
tdLog.info('tdSql.checkData(0, 5, 4)')
tdSql.checkData(0, 5, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 5.000000000 then
tdLog.info('tdSql.checkData(0, 6, 5.000000000)')
tdSql.checkData(0, 6, 5.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != 6 then
tdLog.info('tdSql.checkData(0, 7, 6)')
tdSql.checkData(0, 7, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol2
tdLog.info('alter table %s drop tag tgcol2' % (mt))
@ -1647,42 +1647,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 7 then
tdLog.info('tdSql.checkData(0, 2, 7)')
tdSql.checkData(0, 2, 7)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 9 then
tdLog.info('tdSql.checkData(0, 3, 9)')
tdSql.checkData(0, 3, 9)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 11.000000000 then
tdLog.info('tdSql.checkData(0, 4, 11.000000000)')
tdSql.checkData(0, 4, 11.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 8 then
tdLog.info('tdSql.checkData(0, 5, 8)')
tdSql.checkData(0, 5, 8)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 10 then
tdLog.info('tdSql.checkData(0, 6, 10)')
tdSql.checkData(0, 6, 10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != 12 then
tdLog.info('tdSql.checkData(0, 7, 12)')
tdSql.checkData(0, 7, 12)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step14
tdLog.info('=============== step14')
@ -1753,7 +1753,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -82,10 +82,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM: while $i < 10
while (i < 10):
# TSIM: $tb = $tbPrefix . $i
@ -108,10 +108,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -123,7 +123,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($rowNum)')
tdSql.checkRows(rowNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
@ -131,7 +131,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
@ -139,7 +139,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
@ -147,7 +147,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
@ -155,7 +155,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -167,7 +167,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m
tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' %
@ -179,7 +179,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > 100000 and ts < 100000
tdLog.info('select * from %s where ts > 100000 and ts < 100000' % (tb))
tdSql.query(
@ -189,7 +189,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' %
@ -201,7 +201,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
tdLog.info(
@ -214,7 +214,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -225,7 +225,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($totalNum)')
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
@ -234,7 +234,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
@ -242,7 +242,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
@ -250,7 +250,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -262,7 +262,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -273,7 +273,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -281,7 +281,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -289,7 +289,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -297,7 +297,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -305,7 +305,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -313,7 +313,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -321,7 +321,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -329,7 +329,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -342,7 +342,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1
tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' %
@ -354,7 +354,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
tdSql.query(
@ -364,7 +364,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' %
@ -376,7 +376,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' %
@ -388,7 +388,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
@ -400,7 +400,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol <> 0
tdLog.info(
@ -413,7 +413,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
tdLog.info(
@ -426,7 +426,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -444,7 +444,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -462,7 +462,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -480,7 +480,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -498,7 +498,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -517,7 +517,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -536,7 +536,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step12
@ -556,7 +556,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -570,7 +570,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -82,10 +82,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM: while $i < 10
while (i < 10):
# TSIM: $tb = $tbPrefix . $i
@ -108,10 +108,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -123,7 +123,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($rowNum)')
tdSql.checkRows(rowNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
@ -131,7 +131,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
@ -139,7 +139,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
@ -147,7 +147,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
@ -155,7 +155,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -167,7 +167,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m
tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' %
@ -179,7 +179,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > 100000 and ts < 100000
tdLog.info('select * from %s where ts > 100000 and ts < 100000' % (tb))
tdSql.query(
@ -189,7 +189,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' %
@ -201,7 +201,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
tdLog.info(
@ -214,7 +214,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -225,7 +225,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($totalNum)')
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
@ -234,7 +234,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
@ -242,7 +242,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
@ -250,7 +250,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -262,7 +262,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -273,7 +273,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> '0'
tdLog.info('select * from %s where tgcol <> "0"' % (mt))
tdSql.query('select * from %s where tgcol <> "0"' % (mt))
@ -281,7 +281,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = '1'
tdLog.info('select * from %s where tgcol = "1"' % (mt))
tdSql.query('select * from %s where tgcol = "1"' % (mt))
@ -289,7 +289,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> '1'
tdLog.info('select * from %s where tgcol <> "1"' % (mt))
tdSql.query('select * from %s where tgcol <> "1"' % (mt))
@ -297,7 +297,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = '1'
tdLog.info('select * from %s where tgcol = "1"' % (mt))
tdSql.query('select * from %s where tgcol = "1"' % (mt))
@ -305,7 +305,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> '1'
tdLog.info('select * from %s where tgcol <> "1"' % (mt))
tdSql.query('select * from %s where tgcol <> "1"' % (mt))
@ -313,7 +313,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = '0'
tdLog.info('select * from %s where tgcol = "0"' % (mt))
tdSql.query('select * from %s where tgcol = "0"' % (mt))
@ -321,7 +321,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> '0'
tdLog.info('select * from %s where tgcol <> "0"' % (mt))
tdSql.query('select * from %s where tgcol <> "0"' % (mt))
@ -329,7 +329,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -344,7 +344,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> '1'
tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> "1"' %
@ -356,7 +356,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = '0'
tdLog.info(
'select * from %s where ts < now + 4m and tgcol = "0"' %
@ -368,7 +368,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> '0'
tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> "0"' %
@ -380,7 +380,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = '0'
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = "0"' %
@ -392,7 +392,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> '0'
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> "0"' %
@ -404,7 +404,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol <> '0'
tdLog.info(
@ -417,7 +417,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> '0' and
# ts < now + 5m
tdLog.info(
@ -430,7 +430,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -448,7 +448,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -466,7 +466,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -484,7 +484,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -502,7 +502,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -521,7 +521,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -540,7 +540,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step12
@ -560,7 +560,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -574,7 +574,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -84,10 +84,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM: while $i < 10
while (i < 10):
# TSIM: $tb = $tbPrefix . $i
@ -112,10 +112,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -126,7 +126,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($totalNum)')
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
@ -135,7 +135,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
@ -143,7 +143,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
@ -151,7 +151,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -163,7 +163,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -174,7 +174,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> '0'
tdLog.info('select * from %s where tgcol <> "0"' % (mt))
tdSql.query('select * from %s where tgcol <> "0"' % (mt))
@ -182,7 +182,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = '1'
tdLog.info('select * from %s where tgcol = "1"' % (mt))
tdSql.query('select * from %s where tgcol = "1"' % (mt))
@ -190,7 +190,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> '1'
tdLog.info('select * from %s where tgcol <> "1"' % (mt))
tdSql.query('select * from %s where tgcol <> "1"' % (mt))
@ -198,7 +198,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = '1'
tdLog.info('select * from %s where tgcol = "1"' % (mt))
tdSql.query('select * from %s where tgcol = "1"' % (mt))
@ -206,7 +206,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> '1'
tdLog.info('select * from %s where tgcol <> "1"' % (mt))
tdSql.query('select * from %s where tgcol <> "1"' % (mt))
@ -214,7 +214,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = '0'
tdLog.info('select * from %s where tgcol = "0"' % (mt))
tdSql.query('select * from %s where tgcol = "0"' % (mt))
@ -222,7 +222,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> '0'
tdLog.info('select * from %s where tgcol <> "0"' % (mt))
tdSql.query('select * from %s where tgcol <> "0"' % (mt))
@ -230,7 +230,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -241,7 +241,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 <> '0'
tdLog.info('select * from %s where tgcol2 <> "0"' % (mt))
tdSql.query('select * from %s where tgcol2 <> "0"' % (mt))
@ -249,7 +249,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = '1'
tdLog.info('select * from %s where tgcol2 = "1"' % (mt))
tdSql.query('select * from %s where tgcol2 = "1"' % (mt))
@ -257,7 +257,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 <> '1'
tdLog.info('select * from %s where tgcol2 <> "1"' % (mt))
tdSql.query('select * from %s where tgcol2 <> "1"' % (mt))
@ -265,7 +265,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -280,7 +280,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> '1'
tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> "1"' %
@ -292,7 +292,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = '0'
tdLog.info(
'select * from %s where ts < now + 4m and tgcol = "0"' %
@ -304,7 +304,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> '0'
tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> "0"' %
@ -316,7 +316,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = '0'
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = "0"' %
@ -328,7 +328,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> '0'
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> "0"' %
@ -340,7 +340,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol <> '0'
tdLog.info(
@ -353,7 +353,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> '0' and
# ts < now + 5m
tdLog.info(
@ -366,7 +366,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -381,7 +381,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '1'
tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' %
@ -393,7 +393,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = '0'
tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = "0"' %
@ -405,7 +405,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> '0'
tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' %
@ -417,7 +417,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = '0'
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' %
@ -429,7 +429,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> '0'
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' %
@ -441,7 +441,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol2 <> '0'
tdLog.info(
@ -454,7 +454,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and
# ts < now + 5m
tdLog.info(
@ -467,7 +467,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -483,7 +483,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '1' and
# tgcol <> '1'
tdLog.info(
@ -496,7 +496,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = '0' and
# tgcol = '0'
tdLog.info(
@ -509,7 +509,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> '0' and
# tgcol <> '0'
tdLog.info(
@ -522,7 +522,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = '0' and
# tgcol = '0'
tdLog.info(
@ -535,7 +535,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> '0'
# and tgcol <> '0'
tdLog.info(
@ -548,7 +548,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol2 <> '0' and tgcol <> '0'
tdLog.info(
@ -561,7 +561,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and
# ts < now + 5m and ts < now + 5m and tgcol <> '0'
tdLog.info(
@ -574,7 +574,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -592,7 +592,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -610,7 +610,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = '1'
@ -626,7 +626,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' and
@ -643,7 +643,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -661,7 +661,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -679,7 +679,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step12
tdLog.info('=============== step12')
@ -698,7 +698,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = '1'
@ -715,7 +715,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' and
@ -732,7 +732,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step13
@ -752,7 +752,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step14
tdLog.info('=============== step14')
@ -771,7 +771,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -785,7 +785,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -81,10 +81,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM: while $i < 10
while (i < 10):
# TSIM: $tb = $tbPrefix . $i
@ -107,10 +107,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -122,7 +122,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($rowNum)')
tdSql.checkRows(rowNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
@ -130,7 +130,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
@ -138,7 +138,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
@ -146,7 +146,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
@ -154,7 +154,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -166,7 +166,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m
tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' %
@ -178,7 +178,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' %
@ -190,7 +190,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
tdLog.info(
@ -203,7 +203,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -214,7 +214,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($totalNum)')
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
@ -223,7 +223,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
@ -231,7 +231,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
@ -239,7 +239,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -251,7 +251,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -262,7 +262,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -270,7 +270,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -280,7 +280,7 @@ class TDTestCase:
# TSIM: print expect 100, actual:$rows
tdLog.info('expect 100, actual:$rows')
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -288,7 +288,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = true
tdLog.info('select * from %s where tgcol = true' % (mt))
tdSql.query('select * from %s where tgcol = true' % (mt))
@ -296,7 +296,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> true
tdLog.info('select * from %s where tgcol <> true' % (mt))
tdSql.query('select * from %s where tgcol <> true' % (mt))
@ -304,7 +304,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = false
tdLog.info('select * from %s where tgcol = false' % (mt))
tdSql.query('select * from %s where tgcol = false' % (mt))
@ -312,7 +312,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> false
tdLog.info('select * from %s where tgcol <> false' % (mt))
tdSql.query('select * from %s where tgcol <> false' % (mt))
@ -320,7 +320,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -335,7 +335,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> true
tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> true' %
@ -347,7 +347,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = false
tdLog.info(
'select * from %s where ts < now + 4m and tgcol = false' %
@ -359,7 +359,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> false
tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> false' %
@ -371,7 +371,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = false
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = false' %
@ -383,7 +383,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> false
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> false' %
@ -395,7 +395,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol <> false
tdLog.info(
@ -408,7 +408,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> false
# and ts < now + 5m
tdLog.info(
@ -421,7 +421,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -439,7 +439,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -457,7 +457,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -475,7 +475,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -493,7 +493,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -512,7 +512,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -531,7 +531,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step12
@ -555,7 +555,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -569,7 +569,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -81,10 +81,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM: while $i < 10
while (i < 10):
tb = "%s%d" % (tbPrefix, i)
@ -106,10 +106,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -120,7 +120,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($totalNum)')
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
@ -129,7 +129,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
@ -137,7 +137,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
@ -145,7 +145,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -157,7 +157,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -168,7 +168,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -176,7 +176,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -184,7 +184,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -192,7 +192,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = true
tdLog.info('select * from %s where tgcol = true' % (mt))
tdSql.query('select * from %s where tgcol = true' % (mt))
@ -200,7 +200,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> true
tdLog.info('select * from %s where tgcol <> true' % (mt))
tdSql.query('select * from %s where tgcol <> true' % (mt))
@ -208,7 +208,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = false
tdLog.info('select * from %s where tgcol = false' % (mt))
tdSql.query('select * from %s where tgcol = false' % (mt))
@ -216,7 +216,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> false
tdLog.info('select * from %s where tgcol <> false' % (mt))
tdSql.query('select * from %s where tgcol <> false' % (mt))
@ -224,7 +224,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -235,7 +235,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 <> '0'
tdLog.info('select * from %s where tgcol2 <> "0"' % (mt))
tdSql.query('select * from %s where tgcol2 <> "0"' % (mt))
@ -243,7 +243,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = '1'
tdLog.info('select * from %s where tgcol2 = "1"' % (mt))
tdSql.query('select * from %s where tgcol2 = "1"' % (mt))
@ -251,7 +251,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 <> "1"
tdLog.info('select * from %s where tgcol2 <> "1"' % (mt))
tdSql.query('select * from %s where tgcol2 <> "1"' % (mt))
@ -259,7 +259,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -274,7 +274,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> true
tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> true' %
@ -286,7 +286,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = false
tdLog.info(
'select * from %s where ts < now + 4m and tgcol = false' %
@ -298,7 +298,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> false
tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> false' %
@ -310,7 +310,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = false
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = false' %
@ -322,7 +322,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> false
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> false' %
@ -334,7 +334,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol <> false
tdLog.info(
@ -347,7 +347,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> false
# and ts < now + 5m
tdLog.info(
@ -360,7 +360,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -375,7 +375,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '1'
tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' %
@ -387,7 +387,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = '0'
tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = "0"' %
@ -399,7 +399,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> '0'
tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' %
@ -411,7 +411,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = '0'
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' %
@ -423,7 +423,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> '0'
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' %
@ -435,7 +435,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol2 <> '0'
tdLog.info(
@ -448,7 +448,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and
# ts < now + 5m
tdLog.info(
@ -461,7 +461,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -477,7 +477,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '1' and
# tgcol <> true
tdLog.info(
@ -490,7 +490,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = '0' and
# tgcol = false
tdLog.info(
@ -503,7 +503,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> '0' and
# tgcol <> false
tdLog.info(
@ -516,7 +516,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = '0' and
# tgcol = false
tdLog.info(
@ -529,7 +529,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> '0'
# and tgcol <> false
tdLog.info(
@ -542,7 +542,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol2 <> '0' and tgcol <> false
tdLog.info(
@ -555,7 +555,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and
# ts < now + 5m and ts < now + 5m and tgcol <> false
tdLog.info(
@ -568,7 +568,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -586,7 +586,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -604,7 +604,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = '1'
@ -620,7 +620,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true and
@ -637,7 +637,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -655,7 +655,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -673,7 +673,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step12
tdLog.info('=============== step12')
@ -692,7 +692,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = '1'
@ -709,7 +709,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true and
@ -726,7 +726,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step13
@ -746,7 +746,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step14
tdLog.info('=============== step14')
@ -765,7 +765,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -779,7 +779,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -81,10 +81,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM: while $i < 10
while (i < 10):
tb = "%s%d" % (tbPrefix, i)
@ -106,10 +106,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -120,7 +120,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($totalNum)')
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
@ -129,7 +129,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
@ -137,7 +137,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
@ -145,7 +145,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -157,7 +157,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -168,7 +168,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -176,7 +176,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -184,7 +184,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -192,7 +192,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = true
tdLog.info('select * from %s where tgcol = true' % (mt))
tdSql.query('select * from %s where tgcol = true' % (mt))
@ -200,7 +200,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> true
tdLog.info('select * from %s where tgcol <> true' % (mt))
tdSql.query('select * from %s where tgcol <> true' % (mt))
@ -208,7 +208,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = false
tdLog.info('select * from %s where tgcol = false' % (mt))
tdSql.query('select * from %s where tgcol = false' % (mt))
@ -216,7 +216,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> false
tdLog.info('select * from %s where tgcol <> false' % (mt))
tdSql.query('select * from %s where tgcol <> false' % (mt))
@ -224,7 +224,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -235,7 +235,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 <> 0
tdLog.info('select * from %s where tgcol2 <> 0' % (mt))
tdSql.query('select * from %s where tgcol2 <> 0' % (mt))
@ -243,7 +243,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 1
tdLog.info('select * from %s where tgcol2 = 1' % (mt))
tdSql.query('select * from %s where tgcol2 = 1' % (mt))
@ -251,7 +251,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 <> 1
tdLog.info('select * from %s where tgcol2 <> 1' % (mt))
tdSql.query('select * from %s where tgcol2 <> 1' % (mt))
@ -259,7 +259,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = true
tdLog.info('select * from %s where tgcol2 = true' % (mt))
tdSql.query('select * from %s where tgcol2 = true' % (mt))
@ -267,7 +267,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 <> true
tdLog.info('select * from %s where tgcol2 <> true' % (mt))
tdSql.query('select * from %s where tgcol2 <> true' % (mt))
@ -275,7 +275,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = false
tdLog.info('select * from %s where tgcol2 = false' % (mt))
tdSql.query('select * from %s where tgcol2 = false' % (mt))
@ -283,7 +283,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 <> false
tdLog.info('select * from %s where tgcol2 <> false' % (mt))
tdSql.query('select * from %s where tgcol2 <> false' % (mt))
@ -291,7 +291,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -306,7 +306,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> true
tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> true' %
@ -318,7 +318,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = false
tdLog.info(
'select * from %s where ts < now + 4m and tgcol = false' %
@ -330,7 +330,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> false
tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> false' %
@ -342,7 +342,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = false
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = false' %
@ -354,7 +354,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> false
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> false' %
@ -366,7 +366,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol <> false
tdLog.info(
@ -379,7 +379,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> false
# and ts < now + 5m
tdLog.info(
@ -392,7 +392,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -407,7 +407,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 1
tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 1' %
@ -419,7 +419,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = 0
tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = 0' %
@ -431,7 +431,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> 0
tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> 0' %
@ -443,7 +443,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = 0' %
@ -455,7 +455,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' %
@ -467,7 +467,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol2 <> 0
tdLog.info(
@ -480,7 +480,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and
# ts < now + 5m
tdLog.info(
@ -493,7 +493,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -509,7 +509,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and
# tgcol <> true
tdLog.info(
@ -522,7 +522,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = 0 and
# tgcol = false
tdLog.info(
@ -535,7 +535,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and
# tgcol <> false
tdLog.info(
@ -548,7 +548,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and
# tgcol = false
tdLog.info(
@ -561,7 +561,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and
# tgcol <> false
tdLog.info(
@ -574,7 +574,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol2 <> 0 and tgcol <> false
tdLog.info(
@ -587,7 +587,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol <> false
tdLog.info(
@ -600,7 +600,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -618,7 +618,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -636,7 +636,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = 1
@ -652,7 +652,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true and
@ -669,7 +669,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -687,7 +687,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -705,7 +705,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step12
tdLog.info('=============== step12')
@ -724,7 +724,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = 1 group
@ -741,7 +741,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true and
@ -758,7 +758,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step13
@ -778,7 +778,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step14
tdLog.info('=============== step14')
@ -797,7 +797,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -811,7 +811,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -66,22 +66,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt change tag tagcx tgcol3 -x step21
# TSIM: return -1
@ -123,22 +123,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt change tag tgcol1 tgcol3
# TSIM: sql alter table $mt change tag tgcol2 tgcol4
@ -167,22 +167,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2.00000 then
tdLog.info('tdSql.checkData(0, 3, 2.00000)')
tdSql.checkData(0, 3, 2.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt change tag tgcol1 tgcol3
# TSIM: sql alter table $mt change tag tgcol2 tgcol4
@ -211,22 +211,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1.000000000 then
tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
tdSql.checkData(0, 2, 1.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt change tag tgcol1 tgcol3
# TSIM: sql alter table $mt change tag tgcol2 tgcol4
@ -255,42 +255,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 4 then
tdLog.info('tdSql.checkData(0, 5, 4)')
tdSql.checkData(0, 5, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 5.000000000 then
tdLog.info('tdSql.checkData(0, 6, 5.000000000)')
tdSql.checkData(0, 6, 5.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != 6 then
tdLog.info('tdSql.checkData(0, 7, 6)')
tdSql.checkData(0, 7, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol3
# TSIM: sql reset query cache
@ -331,22 +331,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol4 = 2
tdLog.info('select * from $mt where tgcol4 = 2')
@ -357,22 +357,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -400,22 +400,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol4 = 2
tdLog.info('select * from $mt where tgcol4 = 2')
@ -426,22 +426,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -469,22 +469,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2.00000 then
tdLog.info('tdSql.checkData(0, 3, 2.00000)')
tdSql.checkData(0, 3, 2.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol4 = 2
tdLog.info('select * from $mt where tgcol4 = 2')
@ -495,22 +495,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2.00000 then
tdLog.info('tdSql.checkData(0, 3, 2.00000)')
tdSql.checkData(0, 3, 2.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -538,22 +538,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1.000000000 then
tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
tdSql.checkData(0, 2, 1.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol4 = '2'
tdLog.info('select * from $mt where tgcol4 = '2'')
@ -564,22 +564,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1.000000000 then
tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
tdSql.checkData(0, 2, 1.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -627,42 +627,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 4 then
tdLog.info('tdSql.checkData(0, 4, 4)')
tdSql.checkData(0, 4, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 5.000000000 then
tdLog.info('tdSql.checkData(0, 5, 5.000000000)')
tdSql.checkData(0, 5, 5.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 6 then
tdLog.info('tdSql.checkData(0, 6, 6)')
tdSql.checkData(0, 6, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != NULL then
tdLog.info('tdSql.checkData(0, 7, NULL)')
tdSql.checkData(0, 7, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol8 = 2
tdLog.info('select * from $mt where tgcol8 = 2')
@ -673,42 +673,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 4 then
tdLog.info('tdSql.checkData(0, 4, 4)')
tdSql.checkData(0, 4, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 5.000000000 then
tdLog.info('tdSql.checkData(0, 5, 5.000000000)')
tdSql.checkData(0, 5, 5.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 6 then
tdLog.info('tdSql.checkData(0, 6, 6)')
tdSql.checkData(0, 6, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != NULL then
tdLog.info('tdSql.checkData(0, 7, NULL)')
tdSql.checkData(0, 7, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol9 = '4'
tdLog.info('select * from $mt where tgcol9 = '4'')
@ -719,42 +719,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 4 then
tdLog.info('tdSql.checkData(0, 4, 4)')
tdSql.checkData(0, 4, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 5.000000000 then
tdLog.info('tdSql.checkData(0, 5, 5.000000000)')
tdSql.checkData(0, 5, 5.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 6 then
tdLog.info('tdSql.checkData(0, 6, 6)')
tdSql.checkData(0, 6, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != NULL then
tdLog.info('tdSql.checkData(0, 7, NULL)')
tdSql.checkData(0, 7, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol10 = 5
tdLog.info('select * from $mt where tgcol10 = 5')
@ -765,42 +765,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 4 then
tdLog.info('tdSql.checkData(0, 4, 4)')
tdSql.checkData(0, 4, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 5.000000000 then
tdLog.info('tdSql.checkData(0, 5, 5.000000000)')
tdSql.checkData(0, 5, 5.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 6 then
tdLog.info('tdSql.checkData(0, 6, 6)')
tdSql.checkData(0, 6, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != NULL then
tdLog.info('tdSql.checkData(0, 7, NULL)')
tdSql.checkData(0, 7, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol11 = '6'
tdLog.info('select * from $mt where tgcol11 = '6'')
@ -811,42 +811,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 4 then
tdLog.info('tdSql.checkData(0, 4, 4)')
tdSql.checkData(0, 4, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 5.000000000 then
tdLog.info('tdSql.checkData(0, 5, 5.000000000)')
tdSql.checkData(0, 5, 5.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 6 then
tdLog.info('tdSql.checkData(0, 6, 6)')
tdSql.checkData(0, 6, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != NULL then
tdLog.info('tdSql.checkData(0, 7, NULL)')
tdSql.checkData(0, 7, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -860,7 +860,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -103,7 +103,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(4)')
tdSql.checkRows(4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -149,7 +149,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -160,7 +160,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(4)')
tdSql.checkRows(4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
@ -169,7 +169,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -183,7 +183,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

File diff suppressed because it is too large Load Diff

View File

@ -76,12 +76,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -89,7 +89,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -120,12 +120,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -133,7 +133,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -164,12 +164,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -177,7 +177,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -207,12 +207,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -220,7 +220,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -251,12 +251,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -264,7 +264,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -295,12 +295,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -310,7 +310,7 @@ class TDTestCase:
# TSIM: print expect 0, actual: $rows
tdLog.info('expect 0, actual: $rows')
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -341,12 +341,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -354,7 +354,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -385,12 +385,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = '0'
tdLog.info('select * from %s where tgcol = "0"' % (mt))
tdSql.query('select * from %s where tgcol = "0"' % (mt))
@ -398,7 +398,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -431,12 +431,12 @@ class TDTestCase:
# TSIM: print expect 1, actual: $rows
tdLog.info('expect 1, actual: $rows')
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -444,7 +444,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -475,12 +475,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -488,7 +488,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step12
tdLog.info('=============== step12')
@ -519,12 +519,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -532,7 +532,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step13
tdLog.info('=============== step13')
@ -563,12 +563,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -576,7 +576,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step14
tdLog.info('=============== step14')
@ -607,12 +607,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
@ -621,7 +621,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: print =============== step15
tdLog.info('=============== step15')
# TSIM: $i = 15
@ -651,12 +651,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -664,7 +664,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step16
tdLog.info('=============== step16')
@ -695,12 +695,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -708,7 +708,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step17
tdLog.info('=============== step17')
@ -739,12 +739,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -752,7 +752,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step18
tdLog.info('=============== step18')
@ -783,12 +783,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -796,7 +796,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step19
tdLog.info('=============== step19')
@ -827,12 +827,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -840,7 +840,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step20
tdLog.info('=============== step20')
@ -871,12 +871,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -884,7 +884,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step21
tdLog.info('=============== step21')
@ -915,12 +915,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -928,7 +928,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step22
tdLog.info('=============== step22')
@ -959,12 +959,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -972,7 +972,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step23
tdLog.info('=============== step23')
@ -1003,12 +1003,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -1016,7 +1016,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step24
tdLog.info('=============== step24')
@ -1052,12 +1052,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 2
tdLog.info('select * from %s where tgcol2 = 2' % (mt))
tdSql.query('select * from %s where tgcol2 = 2' % (mt))
@ -1065,12 +1065,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol3 = 3
tdLog.info('select * from %s where tgcol3 = 3' % (mt))
tdSql.query('select * from %s where tgcol3 = 3' % (mt))
@ -1078,12 +1078,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol4 = 4
tdLog.info('select * from %s where tgcol4 = 4' % (mt))
tdSql.query('select * from %s where tgcol4 = 4' % (mt))
@ -1091,12 +1091,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol5 = 5
tdLog.info('select * from %s where tgcol5 = 5' % (mt))
tdSql.query('select * from %s where tgcol5 = 5' % (mt))
@ -1104,12 +1104,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol6 = '6'
tdLog.info('select * from %s where tgcol6 = "6"' % (mt))
tdSql.query('select * from %s where tgcol6 = "6"' % (mt))
@ -1117,12 +1117,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol6 = '0'
tdLog.info('select * from %s where tgcol6 = "0"' % (mt))
tdSql.query('select * from %s where tgcol6 = "0"' % (mt))
@ -1130,7 +1130,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step25
tdLog.info('=============== step25')
@ -1166,12 +1166,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol6 = '0'
tdLog.info('select * from %s where tgcol6 = "0"' % (mt))
tdSql.query('select * from %s where tgcol6 = "0"' % (mt))
@ -1179,7 +1179,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step26
tdLog.info('=============== step26')
@ -1216,12 +1216,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol3 = '0'
tdLog.info('select * from %s where tgcol3 = "0"' % (mt))
tdSql.query('select * from %s where tgcol3 = "0"' % (mt))
@ -1229,7 +1229,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step27
tdLog.info('=============== step27')
@ -1280,12 +1280,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step29
tdLog.info('=============== step29')
@ -1316,12 +1316,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step30
tdLog.info('=============== step30')
@ -1376,7 +1376,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print $data00 $data01 $data02
tdLog.info('$data00 $data01 $data02')
@ -1384,7 +1384,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 2, "12345")')
tdSql.checkData(0, 2, "12345")
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -77,22 +77,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol2
tdLog.info('alter table %s drop tag tgcol2' % (mt))
@ -127,22 +127,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol2
tdLog.info('alter table %s drop tag tgcol2' % (mt))
@ -177,22 +177,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2.00000 then
tdLog.info('tdSql.checkData(0, 3, 2.00000)')
tdSql.checkData(0, 3, 2.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql describe $tb
tdLog.info('describe %s' % (tb))
@ -201,17 +201,17 @@ class TDTestCase:
tdLog.info('tdSql.checkDataType(2, 1, "BIGINT")')
tdSql.checkDataType(2, 1, "BIGINT")
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data31 != FLOAT then
tdLog.info('tdSql.checkDataType(3, 1, "FLOAT")')
tdSql.checkDataType(3, 1, "FLOAT")
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data23 != 1 then
tdLog.info('tdSql.checkData(2, 3, 1)')
tdSql.checkData(2, 3, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol1 -x step40
tdLog.info('alter table %s drop tag tgcol1 -x step40' % (mt))
@ -251,22 +251,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1.000000000 then
tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
tdSql.checkData(0, 2, 1.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol1 -x step50
tdLog.info('alter table %s drop tag tgcol1 -x step50' % (mt))
@ -306,27 +306,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol2
tdLog.info('alter table %s drop tag tgcol2' % (mt))
@ -364,27 +364,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql describe $tb
tdLog.info('describe %s' % (tb))
@ -393,47 +393,47 @@ class TDTestCase:
tdLog.info('tdSql.checkDataType(2, 1, "SMALLINT")')
tdSql.checkDataType(2, 1, "SMALLINT")
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data31 != TINYINT then
tdLog.info('tdSql.checkDataType(3, 1, "TINYINT")')
tdSql.checkDataType(3, 1, "TINYINT")
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data41 != BINARY then
tdLog.info('tdSql.checkDataType(4, 1, "BINARY")')
tdSql.checkDataType(4, 1, "BINARY")
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data22 != 2 then
tdLog.info('tdSql.checkData(2, 2, 2)')
tdSql.checkData(2, 2, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data32 != 1 then
tdLog.info('tdSql.checkData(3, 2, 1)')
tdSql.checkData(3, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data42 != 10 then
tdLog.info('tdSql.checkData(4, 2, 10)')
tdSql.checkData(4, 2, 10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data23 != 1 then
tdLog.info('tdSql.checkData(2, 3, 1)')
tdSql.checkData(2, 3, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data33 != 2 then
tdLog.info('tdSql.checkData(3, 3, 2)')
tdSql.checkData(3, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data43 != 3 then
tdLog.info('tdSql.checkData(4, 3, 3)')
tdSql.checkData(4, 3, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol2
tdLog.info('alter table %s drop tag tgcol2' % (mt))
@ -471,27 +471,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2.00000 then
tdLog.info('tdSql.checkData(0, 3, 2.00000)')
tdSql.checkData(0, 3, 2.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol2
tdLog.info('alter table %s drop tag tgcol2' % (mt))
@ -531,27 +531,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1.000000000 then
tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
tdSql.checkData(0, 2, 1.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol3
tdLog.info('alter table %s drop tag tgcol3' % (mt))
@ -593,32 +593,32 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 4 then
tdLog.info('tdSql.checkData(0, 5, 4)')
tdSql.checkData(0, 5, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol3
tdLog.info('alter table %s drop tag tgcol3' % (mt))
@ -663,37 +663,37 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 4.00000 then
tdLog.info('tdSql.checkData(0, 5, 4.00000)')
tdSql.checkData(0, 5, 4.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 5 then
tdLog.info('tdSql.checkData(0, 6, 5)')
tdSql.checkData(0, 6, 5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol2
tdLog.info('alter table %s drop tag tgcol2' % (mt))
@ -739,42 +739,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3.00000 then
tdLog.info('tdSql.checkData(0, 4, 3.00000)')
tdSql.checkData(0, 4, 3.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 4.000000000 then
tdLog.info('tdSql.checkData(0, 5, 4.000000000)')
tdSql.checkData(0, 5, 4.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 5 then
tdLog.info('tdSql.checkData(0, 6, 5)')
tdSql.checkData(0, 6, 5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != 6 then
tdLog.info('tdSql.checkData(0, 7, 6)')
tdSql.checkData(0, 7, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol2
tdLog.info('alter table %s drop tag tgcol2' % (mt))
@ -823,42 +823,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 4 then
tdLog.info('tdSql.checkData(0, 5, 4)')
tdSql.checkData(0, 5, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 5.000000000 then
tdLog.info('tdSql.checkData(0, 6, 5.000000000)')
tdSql.checkData(0, 6, 5.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != 6 then
tdLog.info('tdSql.checkData(0, 7, 6)')
tdSql.checkData(0, 7, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol3
tdLog.info('alter table %s drop tag tgcol3' % (mt))
@ -890,22 +890,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != NULL then
tdLog.info('tdSql.checkData(0, 3, NULL)')
tdSql.checkData(0, 3, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step2
tdLog.info('select * from %s where tgcol2 = 1 -x step2' % (mt))
@ -931,22 +931,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != NULL then
tdLog.info('tdSql.checkData(0, 3, NULL)')
tdSql.checkData(0, 3, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step3
tdLog.info('select * from %s where tgcol2 = 1 -x step3' % (mt))
@ -972,22 +972,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != NULL then
tdLog.info('tdSql.checkData(0, 3, NULL)')
tdSql.checkData(0, 3, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step4
tdLog.info('select * from %s where tgcol2 = 1 -x step4' % (mt))
@ -1013,22 +1013,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1.000000000 then
tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
tdSql.checkData(0, 2, 1.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != NULL then
tdLog.info('tdSql.checkData(0, 3, NULL)')
tdSql.checkData(0, 3, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = '1' -x step5
tdLog.info('select * from %s where tgcol2 = "1" -x step5' % (mt))
@ -1054,27 +1054,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != NULL then
tdLog.info('tdSql.checkData(0, 3, NULL)')
tdSql.checkData(0, 3, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != NULL then
tdLog.info('tdSql.checkData(0, 4, NULL)')
tdSql.checkData(0, 4, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step51
tdLog.info('select * from %s where tgcol2 = 1 -x step51' % (mt))
@ -1105,27 +1105,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != NULL then
tdLog.info('tdSql.checkData(0, 3, NULL)')
tdSql.checkData(0, 3, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != NULL then
tdLog.info('tdSql.checkData(0, 4, NULL)')
tdSql.checkData(0, 4, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step71
tdLog.info('select * from %s where tgcol2 = 1 -x step71' % (mt))
@ -1156,27 +1156,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != NULL then
tdLog.info('tdSql.checkData(0, 3, NULL)')
tdSql.checkData(0, 3, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != NULL then
tdLog.info('tdSql.checkData(0, 4, NULL)')
tdSql.checkData(0, 4, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step81
tdLog.info('select * from %s where tgcol2 = 1 -x step81' % (mt))
@ -1207,27 +1207,27 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1.000000000 then
tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
tdSql.checkData(0, 2, 1.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != NULL then
tdLog.info('tdSql.checkData(0, 3, NULL)')
tdSql.checkData(0, 3, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != NULL then
tdLog.info('tdSql.checkData(0, 4, NULL)')
tdSql.checkData(0, 4, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol3 = 1 -x step91
tdLog.info('select * from %s where tgcol3 = 1 -x step91' % (mt))
@ -1258,32 +1258,32 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != NULL then
tdLog.info('tdSql.checkData(0, 3, NULL)')
tdSql.checkData(0, 3, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != NULL then
tdLog.info('tdSql.checkData(0, 4, NULL)')
tdSql.checkData(0, 4, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != NULL then
tdLog.info('tdSql.checkData(0, 5, NULL)')
tdSql.checkData(0, 5, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step101
tdLog.info('select * from %s where tgcol2 = 1 -x step101' % (mt))
@ -1319,37 +1319,37 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4.00000 then
tdLog.info('tdSql.checkData(0, 3, 4.00000)')
tdSql.checkData(0, 3, 4.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != NULL then
tdLog.info('tdSql.checkData(0, 4, NULL)')
tdSql.checkData(0, 4, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != NULL then
tdLog.info('tdSql.checkData(0, 5, NULL)')
tdSql.checkData(0, 5, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != NULL then
tdLog.info('tdSql.checkData(0, 6, NULL)')
tdSql.checkData(0, 6, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step111
tdLog.info('select * from %s where tgcol2 = 1 -x step111' % (mt))
@ -1385,42 +1385,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4.000000000 then
tdLog.info('tdSql.checkData(0, 3, 4.000000000)')
tdSql.checkData(0, 3, 4.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != NULL then
tdLog.info('tdSql.checkData(0, 4, NULL)')
tdSql.checkData(0, 4, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != NULL then
tdLog.info('tdSql.checkData(0, 5, NULL)')
tdSql.checkData(0, 5, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != NULL then
tdLog.info('tdSql.checkData(0, 6, NULL)')
tdSql.checkData(0, 6, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != NULL then
tdLog.info('tdSql.checkData(0, 7, NULL)')
tdSql.checkData(0, 7, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 1 -x step120
tdLog.info('select * from %s where tgcol2 = 1 -x step120' % (mt))
@ -1464,42 +1464,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 5.000000000 then
tdLog.info('tdSql.checkData(0, 4, 5.000000000)')
tdSql.checkData(0, 4, 5.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != NULL then
tdLog.info('tdSql.checkData(0, 5, NULL)')
tdSql.checkData(0, 5, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != NULL then
tdLog.info('tdSql.checkData(0, 6, NULL)')
tdSql.checkData(0, 6, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != NULL then
tdLog.info('tdSql.checkData(0, 7, NULL)')
tdSql.checkData(0, 7, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol3 = 1 -x step130
tdLog.info('select * from %s where tgcol3 = 1 -x step130' % (mt))
@ -1583,7 +1583,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -82,10 +82,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM: while $i < 10
while (i < 10):
# TSIM: $tb = $tbPrefix . $i
@ -108,10 +108,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -123,7 +123,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($rowNum)')
tdSql.checkRows(rowNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
@ -131,7 +131,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
@ -139,7 +139,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
@ -147,7 +147,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
@ -155,7 +155,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -167,7 +167,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m
tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' %
@ -179,7 +179,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > 100000 and ts < 100000
tdLog.info('select * from %s where ts > 100000 and ts < 100000' % (tb))
tdSql.query(
@ -189,7 +189,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' %
@ -201,7 +201,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
tdLog.info(
@ -214,7 +214,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -225,7 +225,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($totalNum)')
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
@ -234,7 +234,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
@ -242,7 +242,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
@ -250,7 +250,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -262,7 +262,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -273,7 +273,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -281,7 +281,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -289,7 +289,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -297,7 +297,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -305,7 +305,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -313,7 +313,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -321,7 +321,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -329,7 +329,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -342,7 +342,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1
tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' %
@ -354,7 +354,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
tdSql.query(
@ -364,7 +364,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' %
@ -376,7 +376,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' %
@ -388,7 +388,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
@ -400,7 +400,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol <> 0
tdLog.info(
@ -413,7 +413,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
tdLog.info(
@ -426,7 +426,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -444,7 +444,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -462,7 +462,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -480,7 +480,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -498,7 +498,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -517,7 +517,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -536,7 +536,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step12
@ -556,7 +556,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -570,7 +570,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -120,7 +120,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tg = '1' -x
@ -162,12 +162,12 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data00 != 10 then
tdLog.info('tdSql.checkData(0, 0, 10)')
tdSql.checkData(0, 0, 10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -194,7 +194,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -263,7 +263,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -293,7 +293,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step14
tdLog.info('=============== step14')
@ -313,7 +313,7 @@ class TDTestCase:
# TSIM: print expect 100, actual $data00
tdLog.info('expect 100, actual $data00')
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step15
tdLog.info('=============== step15')
@ -344,7 +344,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -358,7 +358,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -82,10 +82,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM: while $i < 10
while (i < 10):
# TSIM: $tb = $tbPrefix . $i
@ -108,10 +108,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -123,7 +123,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($rowNum)')
tdSql.checkRows(rowNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
@ -131,7 +131,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
@ -139,7 +139,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
@ -147,7 +147,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
@ -155,7 +155,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -167,7 +167,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m
tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' %
@ -179,7 +179,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > 100000 and ts < 100000
tdLog.info('select * from %s where ts > 100000 and ts < 100000' % (tb))
tdSql.query(
@ -189,7 +189,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' %
@ -201,7 +201,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
tdLog.info(
@ -214,7 +214,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -225,7 +225,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($totalNum)')
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
@ -234,7 +234,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
@ -242,7 +242,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
@ -250,7 +250,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -262,7 +262,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -273,7 +273,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -281,7 +281,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -289,7 +289,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -297,7 +297,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -305,7 +305,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -313,7 +313,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -321,7 +321,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -329,7 +329,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -342,7 +342,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1
tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' %
@ -354,7 +354,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
tdSql.query(
@ -364,7 +364,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' %
@ -376,7 +376,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' %
@ -388,7 +388,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
@ -400,7 +400,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol <> 0
tdLog.info(
@ -413,7 +413,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
tdLog.info(
@ -426,7 +426,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -444,7 +444,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -462,7 +462,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -480,7 +480,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -498,7 +498,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -517,7 +517,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -536,7 +536,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step12
@ -556,7 +556,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -570,7 +570,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -81,10 +81,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM: while $i < 10
while (i < 10):
# TSIM: $tb = $tbPrefix . $i
@ -107,10 +107,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -122,7 +122,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($rowNum)')
tdSql.checkRows(rowNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
@ -130,7 +130,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
@ -138,7 +138,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
@ -146,7 +146,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
@ -154,7 +154,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -166,7 +166,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m
tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' %
@ -178,7 +178,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > 100000 and ts < 100000
tdLog.info('select * from %s where ts > 100000 and ts < 100000' % (tb))
tdSql.query(
@ -188,7 +188,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' %
@ -200,7 +200,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
tdLog.info(
@ -213,7 +213,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -224,7 +224,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($totalNum)')
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
@ -233,7 +233,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
@ -241,7 +241,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
@ -249,7 +249,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -261,7 +261,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -272,7 +272,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -280,7 +280,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -288,7 +288,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -296,7 +296,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -304,7 +304,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -312,7 +312,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -320,7 +320,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -328,7 +328,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -341,7 +341,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1
tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' %
@ -353,7 +353,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
tdSql.query(
@ -363,7 +363,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' %
@ -375,7 +375,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' %
@ -387,7 +387,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
@ -399,7 +399,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol <> 0
tdLog.info(
@ -412,7 +412,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
tdLog.info(
@ -425,7 +425,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -443,7 +443,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -461,7 +461,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -479,7 +479,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -497,7 +497,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -516,7 +516,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -535,7 +535,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step12
@ -555,7 +555,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -569,7 +569,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -82,10 +82,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM: while $i < 10
while (i < 10):
# TSIM: $tb = $tbPrefix . $i
@ -108,10 +108,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -122,7 +122,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($totalNum)')
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
@ -131,7 +131,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
@ -139,7 +139,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
@ -147,7 +147,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -159,7 +159,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -170,7 +170,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -178,7 +178,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -186,7 +186,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -194,7 +194,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -202,7 +202,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -210,7 +210,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -218,7 +218,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -226,7 +226,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -237,7 +237,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 <> '0'
tdLog.info('select * from %s where tgcol2 <> "0"' % (mt))
tdSql.query('select * from %s where tgcol2 <> "0"' % (mt))
@ -245,7 +245,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = '1'
tdLog.info('select * from %s where tgcol2 = "1"' % (mt))
tdSql.query('select * from %s where tgcol2 = "1"' % (mt))
@ -253,7 +253,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 <> '1'
tdLog.info('select * from %s where tgcol2 <> "1"' % (mt))
tdSql.query('select * from %s where tgcol2 <> "1"' % (mt))
@ -261,7 +261,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -274,7 +274,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1
tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' %
@ -286,7 +286,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
tdSql.query(
@ -296,7 +296,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' %
@ -308,7 +308,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' %
@ -320,7 +320,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
@ -332,7 +332,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol <> 0
tdLog.info(
@ -345,7 +345,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
tdLog.info(
@ -358,7 +358,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -373,7 +373,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '1'
tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' %
@ -385,7 +385,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = '0'
tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = "0"' %
@ -397,7 +397,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> '0'
tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' %
@ -409,7 +409,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = '0'
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' %
@ -421,7 +421,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> '0'
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' %
@ -433,7 +433,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol2 <> '0'
tdLog.info(
@ -446,7 +446,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and
# ts < now + 5m
tdLog.info(
@ -459,7 +459,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -475,7 +475,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '1' and
# tgcol <> 1
tdLog.info(
@ -488,7 +488,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = '0' and
# tgcol = 0
tdLog.info(
@ -501,7 +501,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> '0' and
# tgcol <> 0
tdLog.info(
@ -514,7 +514,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = '0' and
# tgcol = 0
tdLog.info(
@ -527,7 +527,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> '0'
# and tgcol <> 0
tdLog.info(
@ -540,7 +540,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol2 <> '0' and tgcol <> 0
tdLog.info(
@ -553,7 +553,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and
# ts < now + 5m and ts < now + 5m and tgcol <> 0
tdLog.info(
@ -566,7 +566,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -584,7 +584,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -602,7 +602,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = '1'
@ -618,7 +618,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 and
@ -635,7 +635,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -653,7 +653,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -671,7 +671,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step12
tdLog.info('=============== step12')
@ -690,7 +690,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = '1'
@ -707,7 +707,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 and
@ -724,7 +724,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step13
@ -744,7 +744,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step14
tdLog.info('=============== step14')
@ -763,7 +763,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -777,7 +777,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -82,10 +82,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM: while $i < 10
while (i < 10):
# TSIM: $tb = $tbPrefix . $i
@ -108,10 +108,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -122,7 +122,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($totalNum)')
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
@ -131,7 +131,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
@ -139,7 +139,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
@ -147,7 +147,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -159,7 +159,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -170,7 +170,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -178,7 +178,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -186,7 +186,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -194,7 +194,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -202,7 +202,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -210,7 +210,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -218,7 +218,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -226,7 +226,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -237,7 +237,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 < 0.5
tdLog.info('select * from %s where tgcol2 < 0.5' % (mt))
tdSql.query('select * from %s where tgcol2 < 0.5' % (mt))
@ -245,7 +245,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 > 0.5 and tgcol2 < 1.5
tdLog.info(
'select * from %s where tgcol2 > 0.5 and tgcol2 < 1.5' %
@ -257,7 +257,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 <> 1
tdLog.info('select * from %s where tgcol2 <> 1' % (mt))
tdSql.query('select * from %s where tgcol2 <> 1' % (mt))
@ -265,7 +265,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 1
tdLog.info('select * from %s where tgcol2 = 1' % (mt))
tdSql.query('select * from %s where tgcol2 = 1' % (mt))
@ -273,7 +273,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 <> 1
tdLog.info('select * from %s where tgcol2 <> 1' % (mt))
tdSql.query('select * from %s where tgcol2 <> 1' % (mt))
@ -281,7 +281,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 = 0
tdLog.info('select * from %s where tgcol2 = 0' % (mt))
tdSql.query('select * from %s where tgcol2 = 0' % (mt))
@ -289,7 +289,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol2 <> 0
tdLog.info('select * from %s where tgcol2 <> 0' % (mt))
tdSql.query('select * from %s where tgcol2 <> 0' % (mt))
@ -297,7 +297,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -310,7 +310,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1
tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' %
@ -322,7 +322,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
tdSql.query(
@ -332,7 +332,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' %
@ -344,7 +344,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' %
@ -356,7 +356,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
@ -368,7 +368,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol <> 0
tdLog.info(
@ -381,7 +381,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
tdLog.info(
@ -394,7 +394,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -409,7 +409,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 1
tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 1' %
@ -421,7 +421,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = 0
tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = 0' %
@ -433,7 +433,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> 0
tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> 0' %
@ -445,7 +445,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = 0' %
@ -457,7 +457,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' %
@ -469,7 +469,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol2 <> 0
tdLog.info(
@ -482,7 +482,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and
# ts < now + 5m
tdLog.info(
@ -495,7 +495,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -511,7 +511,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and
# tgcol <> 1
tdLog.info(
@ -524,7 +524,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = 0 and
# tgcol = 0
tdLog.info(
@ -537,7 +537,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and
# tgcol <> 0
tdLog.info(
@ -550,7 +550,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and
# tgcol = 0
tdLog.info(
@ -563,7 +563,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and
# tgcol <> 0
tdLog.info(
@ -576,7 +576,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol2 <> 0 and tgcol <> 0
tdLog.info(
@ -589,7 +589,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol <> 0
tdLog.info(
@ -602,7 +602,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -620,7 +620,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -638,7 +638,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = 1
@ -654,7 +654,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 and
@ -671,7 +671,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -689,7 +689,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -707,7 +707,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step12
tdLog.info('=============== step12')
@ -726,7 +726,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = 1 group
@ -743,7 +743,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 and
@ -760,7 +760,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step13
@ -780,7 +780,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step14
tdLog.info('=============== step14')
@ -799,7 +799,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -813,7 +813,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -77,22 +77,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $tb set tag tagcx 1 -x step21
tdLog.info('alter table %s set tag tagcx 1 -x step21' % (tb))
@ -119,22 +119,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 0 then
tdLog.info('tdSql.checkData(0, 2, 0)')
tdSql.checkData(0, 2, 0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4 then
tdLog.info('tdSql.checkData(0, 3, 4)')
tdSql.checkData(0, 3, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 4
tdLog.info('select * from %s where tgcol2 = 4' % (mt))
@ -145,22 +145,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 0 then
tdLog.info('tdSql.checkData(0, 2, 0)')
tdSql.checkData(0, 2, 0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4 then
tdLog.info('tdSql.checkData(0, 3, 4)')
tdSql.checkData(0, 3, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql describe $tb
tdLog.info('describe %s' % (tb))
@ -171,22 +171,22 @@ class TDTestCase:
tdLog.info('tdSql.checkDataType(2, 1, "BOOL")')
tdSql.checkDataType(2, 1, "BOOL")
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data31 != INT then
tdLog.info('tdSql.checkDataType(3, 1, "INT")')
tdSql.checkDataType(3, 1, "INT")
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data23 != false then
tdLog.info('tdSql.checkData(2, 3, false)')
tdSql.checkData(2, 3, false)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data33 != 4 then
tdLog.info('tdSql.checkData(3, 3, 4)')
tdSql.checkData(3, 3, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -217,22 +217,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $tb set tag tgcol1=3
tdLog.info('alter table %s set tag tgcol1=3' % (tb))
@ -254,22 +254,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 3 then
tdLog.info('tdSql.checkData(0, 2, 3)')
tdSql.checkData(0, 2, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4 then
tdLog.info('tdSql.checkData(0, 3, 4)')
tdSql.checkData(0, 3, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 4
tdLog.info('select * from %s where tgcol2 = 4' % (mt))
@ -280,22 +280,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 3 then
tdLog.info('tdSql.checkData(0, 2, 3)')
tdSql.checkData(0, 2, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4 then
tdLog.info('tdSql.checkData(0, 3, 4)')
tdSql.checkData(0, 3, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 2
tdLog.info('select * from %s where tgcol2 = 2' % (mt))
@ -304,7 +304,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step4
@ -336,22 +336,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2.00000 then
tdLog.info('tdSql.checkData(0, 3, 2.00000)')
tdSql.checkData(0, 3, 2.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $tb set tag tgcol1=3
tdLog.info('alter table %s set tag tgcol1=3' % (tb))
@ -373,22 +373,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 3 then
tdLog.info('tdSql.checkData(0, 2, 3)')
tdSql.checkData(0, 2, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4.00000 then
tdLog.info('tdSql.checkData(0, 3, 4.00000)')
tdSql.checkData(0, 3, 4.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 4
tdLog.info('select * from %s where tgcol2 = 4' % (mt))
@ -399,22 +399,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 3 then
tdLog.info('tdSql.checkData(0, 2, 3)')
tdSql.checkData(0, 2, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4.00000 then
tdLog.info('tdSql.checkData(0, 3, 4.00000)')
tdSql.checkData(0, 3, 4.00000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step5
@ -446,22 +446,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1.000000000 then
tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
tdSql.checkData(0, 2, 1.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $tb set tag tgcol1=3
tdLog.info('alter table %s set tag tgcol1=3' % (tb))
@ -483,22 +483,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 3.000000000 then
tdLog.info('tdSql.checkData(0, 2, 3.000000000)')
tdSql.checkData(0, 2, 3.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4 then
tdLog.info('tdSql.checkData(0, 3, 4)')
tdSql.checkData(0, 3, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = '4'
tdLog.info('select * from %s where tgcol2 = "4"' % (mt))
@ -509,22 +509,22 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 3.000000000 then
tdLog.info('tdSql.checkData(0, 2, 3.000000000)')
tdSql.checkData(0, 2, 3.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 4 then
tdLog.info('tdSql.checkData(0, 3, 4)')
tdSql.checkData(0, 3, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -560,42 +560,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 1 then
tdLog.info('tdSql.checkData(0, 2, 1)')
tdSql.checkData(0, 2, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 2 then
tdLog.info('tdSql.checkData(0, 3, 2)')
tdSql.checkData(0, 3, 2)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 3 then
tdLog.info('tdSql.checkData(0, 4, 3)')
tdSql.checkData(0, 4, 3)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 4 then
tdLog.info('tdSql.checkData(0, 5, 4)')
tdSql.checkData(0, 5, 4)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 5.000000000 then
tdLog.info('tdSql.checkData(0, 6, 5.000000000)')
tdSql.checkData(0, 6, 5.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != 6 then
tdLog.info('tdSql.checkData(0, 7, 6)')
tdSql.checkData(0, 7, 6)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql alter table $mt drop tag tgcol3
tdLog.info('alter table %s drop tag tgcol3' % (mt))
@ -629,42 +629,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 7 then
tdLog.info('tdSql.checkData(0, 2, 7)')
tdSql.checkData(0, 2, 7)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 8 then
tdLog.info('tdSql.checkData(0, 3, 8)')
tdSql.checkData(0, 3, 8)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 9 then
tdLog.info('tdSql.checkData(0, 4, 9)')
tdSql.checkData(0, 4, 9)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 10.000000000 then
tdLog.info('tdSql.checkData(0, 5, 10.000000000)')
tdSql.checkData(0, 5, 10.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 11 then
tdLog.info('tdSql.checkData(0, 6, 11)')
tdSql.checkData(0, 6, 11)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != NULL then
tdLog.info('tdSql.checkData(0, 7, NULL)')
tdSql.checkData(0, 7, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol2 = 8
tdLog.info('select * from %s where tgcol2 = 8' % (mt))
@ -675,42 +675,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 7 then
tdLog.info('tdSql.checkData(0, 2, 7)')
tdSql.checkData(0, 2, 7)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 8 then
tdLog.info('tdSql.checkData(0, 3, 8)')
tdSql.checkData(0, 3, 8)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 9 then
tdLog.info('tdSql.checkData(0, 4, 9)')
tdSql.checkData(0, 4, 9)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 10.000000000 then
tdLog.info('tdSql.checkData(0, 5, 10.000000000)')
tdSql.checkData(0, 5, 10.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 11 then
tdLog.info('tdSql.checkData(0, 6, 11)')
tdSql.checkData(0, 6, 11)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != NULL then
tdLog.info('tdSql.checkData(0, 7, NULL)')
tdSql.checkData(0, 7, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol4 = '9'
tdLog.info('select * from %s where tgcol4 = "9"' % (mt))
@ -721,42 +721,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 7 then
tdLog.info('tdSql.checkData(0, 2, 7)')
tdSql.checkData(0, 2, 7)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 8 then
tdLog.info('tdSql.checkData(0, 3, 8)')
tdSql.checkData(0, 3, 8)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 9 then
tdLog.info('tdSql.checkData(0, 4, 9)')
tdSql.checkData(0, 4, 9)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 10.000000000 then
tdLog.info('tdSql.checkData(0, 5, 10.000000000)')
tdSql.checkData(0, 5, 10.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 11 then
tdLog.info('tdSql.checkData(0, 6, 11)')
tdSql.checkData(0, 6, 11)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != NULL then
tdLog.info('tdSql.checkData(0, 7, NULL)')
tdSql.checkData(0, 7, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol5 = 10
tdLog.info('select * from %s where tgcol5 = 10' % (mt))
@ -767,42 +767,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 7 then
tdLog.info('tdSql.checkData(0, 2, 7)')
tdSql.checkData(0, 2, 7)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 8 then
tdLog.info('tdSql.checkData(0, 3, 8)')
tdSql.checkData(0, 3, 8)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 9 then
tdLog.info('tdSql.checkData(0, 4, 9)')
tdSql.checkData(0, 4, 9)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 10.000000000 then
tdLog.info('tdSql.checkData(0, 5, 10.000000000)')
tdSql.checkData(0, 5, 10.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 11 then
tdLog.info('tdSql.checkData(0, 6, 11)')
tdSql.checkData(0, 6, 11)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != NULL then
tdLog.info('tdSql.checkData(0, 7, NULL)')
tdSql.checkData(0, 7, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where tgcol6 = '11'
tdLog.info('select * from %s where tgcol6 = "11"' % (mt))
@ -813,42 +813,42 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data01 != 1 then
tdLog.info('tdSql.checkData(0, 1, 1)')
tdSql.checkData(0, 1, 1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data02 != 7 then
tdLog.info('tdSql.checkData(0, 2, 7)')
tdSql.checkData(0, 2, 7)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data03 != 8 then
tdLog.info('tdSql.checkData(0, 3, 8)')
tdSql.checkData(0, 3, 8)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data04 != 9 then
tdLog.info('tdSql.checkData(0, 4, 9)')
tdSql.checkData(0, 4, 9)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data05 != 10.000000000 then
tdLog.info('tdSql.checkData(0, 5, 10.000000000)')
tdSql.checkData(0, 5, 10.000000000)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data06 != 11 then
tdLog.info('tdSql.checkData(0, 6, 11)')
tdSql.checkData(0, 6, 11)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: if $data07 != NULL then
tdLog.info('tdSql.checkData(0, 7, NULL)')
tdSql.checkData(0, 7, None)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -862,7 +862,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -82,10 +82,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM: while $i < 10
while (i < 10):
# TSIM: $tb = $tbPrefix . $i
@ -108,10 +108,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -123,7 +123,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($rowNum)')
tdSql.checkRows(rowNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
@ -131,7 +131,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
@ -139,7 +139,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
@ -147,7 +147,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
@ -155,7 +155,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -167,7 +167,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m
tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' %
@ -179,7 +179,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > 100000 and ts < 100000
tdLog.info('select * from %s where ts > 100000 and ts < 100000' % (tb))
tdSql.query(
@ -189,7 +189,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' %
@ -201,7 +201,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
tdLog.info(
@ -214,7 +214,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -225,7 +225,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($totalNum)')
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
@ -234,7 +234,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
@ -242,7 +242,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
@ -250,7 +250,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -262,7 +262,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -273,7 +273,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -281,7 +281,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -289,7 +289,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -297,7 +297,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -305,7 +305,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -313,7 +313,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -321,7 +321,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -329,7 +329,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -342,7 +342,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1
tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' %
@ -354,7 +354,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
tdSql.query(
@ -364,7 +364,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' %
@ -376,7 +376,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' %
@ -388,7 +388,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
@ -400,7 +400,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol <> 0
tdLog.info(
@ -413,7 +413,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
tdLog.info(
@ -426,7 +426,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -444,7 +444,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -462,7 +462,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -480,7 +480,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -498,7 +498,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -517,7 +517,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -536,7 +536,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step12
@ -556,7 +556,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -570,7 +570,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -82,10 +82,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM: while $i < 10
while (i < 10):
# TSIM: $tb = $tbPrefix . $i
@ -108,10 +108,10 @@ class TDTestCase:
(tb, ms, x))
# TSIM: $x = $x + 1
x = x + 1
#TSIM: endw
# TSIM: endw
# TSIM: $i = $i + 1
i = i + 1
#TSIM: endw
# TSIM: endw
# TSIM:
# TSIM: print =============== step2
tdLog.info('=============== step2')
@ -123,7 +123,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($rowNum)')
tdSql.checkRows(rowNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
@ -131,7 +131,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
@ -139,7 +139,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
@ -147,7 +147,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
@ -155,7 +155,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -167,7 +167,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m
tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' %
@ -179,7 +179,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > 100000 and ts < 100000
tdLog.info('select * from %s where ts > 100000 and ts < 100000' % (tb))
tdSql.query(
@ -189,7 +189,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' %
@ -201,7 +201,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
tdLog.info(
@ -214,7 +214,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step3
tdLog.info('=============== step3')
@ -225,7 +225,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow($totalNum)')
tdSql.checkRows(totalNum)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
@ -234,7 +234,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
@ -242,7 +242,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
@ -250,7 +250,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m
tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' %
@ -262,7 +262,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step4
tdLog.info('=============== step4')
@ -273,7 +273,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -281,7 +281,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -289,7 +289,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -297,7 +297,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 1
tdLog.info('select * from %s where tgcol = 1' % (mt))
tdSql.query('select * from %s where tgcol = 1' % (mt))
@ -305,7 +305,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 1
tdLog.info('select * from %s where tgcol <> 1' % (mt))
tdSql.query('select * from %s where tgcol <> 1' % (mt))
@ -313,7 +313,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol = 0
tdLog.info('select * from %s where tgcol = 0' % (mt))
tdSql.query('select * from %s where tgcol = 0' % (mt))
@ -321,7 +321,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where tgcol <> 0
tdLog.info('select * from %s where tgcol <> 0' % (mt))
tdSql.query('select * from %s where tgcol <> 0' % (mt))
@ -329,7 +329,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(100)')
tdSql.checkRows(100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
@ -342,7 +342,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1
tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' %
@ -354,7 +354,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
tdSql.query(
@ -364,7 +364,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' %
@ -376,7 +376,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' %
@ -388,7 +388,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0
tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
@ -400,7 +400,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and
# tgcol <> 0
tdLog.info(
@ -413,7 +413,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
tdLog.info(
@ -426,7 +426,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step6
tdLog.info('=============== step6')
@ -444,7 +444,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 200)')
tdSql.checkData(0, 0, 200)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step7
tdLog.info('=============== step7')
@ -462,7 +462,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step8
tdLog.info('=============== step8')
@ -480,7 +480,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 50)')
tdSql.checkData(0, 0, 50)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step9
tdLog.info('=============== step9')
@ -498,7 +498,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step10
tdLog.info('=============== step10')
@ -517,7 +517,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 100)')
tdSql.checkData(0, 0, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== step11
tdLog.info('=============== step11')
@ -536,7 +536,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 0, 25)')
tdSql.checkData(0, 0, 25)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM:
# TSIM: print =============== step12
@ -556,7 +556,7 @@ class TDTestCase:
tdLog.info('tdSql.checkData(0, 1, 100)')
tdSql.checkData(0, 1, 100)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: print =============== clear
tdLog.info('=============== clear')
@ -570,7 +570,7 @@ class TDTestCase:
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
#TSIM: endi
# TSIM: endi
# TSIM:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

View File

@ -99,6 +99,19 @@ class TDDnode:
def setValgrind(self, value):
self.valgrind = value
def getDataSize(self):
totalSize = 0
if (self.deployed == 1):
for dirpath, dirnames, filenames in os.walk(self.dataDir):
for f in filenames:
fp = os.path.join(dirpath, f)
if not os.path.islink(fp):
totalSize = totalSize + os.path.getsize(fp)
return totalSize
def deploy(self):
self.logDir = "%s/pysim/dnode%d/log" % (self.path, self.index)
self.dataDir = "%s/pysim/dnode%d/data" % (self.path, self.index)
@ -384,6 +397,10 @@ class TDDnodes:
self.check(index)
self.dnodes[index - 1].stop()
def getDataSize(self, index):
self.check(index)
return self.dnodes[index - 1].getDataSize()
def forcestop(self, index):
self.check(index)
self.dnodes[index - 1].forcestop()

View File

@ -36,6 +36,7 @@ if $data01 != 2 then
return -1
endi
if $data02 != tb2 then
print expect tb2, actual: $data02
return -1
endi
if $data03 != tb2 then

View File

@ -96,6 +96,7 @@ echo "second ${HOSTNAME}:7200" >> $TAOS_CFG
echo "serverPort ${NODE}" >> $TAOS_CFG
echo "dataDir $DATA_DIR" >> $TAOS_CFG
echo "logDir $LOG_DIR" >> $TAOS_CFG
echo "debugFlag 135" >> $TAOS_CFG
echo "dDebugFlag 135" >> $TAOS_CFG
echo "mDebugFlag 135" >> $TAOS_CFG
echo "sdbDebugFlag 135" >> $TAOS_CFG

View File

@ -0,0 +1,64 @@
#!/bin/sh
# if [ $# != 2 || $# != 3 ]; then
# echo "argument list need input : "
# echo " -s start/stop"
# exit 1
# fi
EXEC_OPTON=
while getopts "n:s:u:x:ct" arg
do
case $arg in
n)
NODE_NAME=$OPTARG
;;
s)
EXEC_OPTON=$OPTARG
;;
c)
CLEAR_OPTION="clear"
;;
t)
SHELL_OPTION="true"
;;
u)
USERS=$OPTARG
;;
x)
SIGNAL=$OPTARG
;;
?)
echo "unkown argument"
;;
esac
done
SCRIPT_DIR=`dirname $0`
cd $SCRIPT_DIR/../
SCRIPT_DIR=`pwd`
cd ../../
TAOS_DIR=`pwd`
BUILD_DIR=$TAOS_DIR/../debug/build
SIM_DIR=$TAOS_DIR/sim
NODE_DIR=$SIM_DIR/arbitrator
EXE_DIR=$BUILD_DIR/bin
LOG_DIR=$NODE_DIR/log
echo "------------ $EXEC_OPTON tarbitrator"
if [ "$EXEC_OPTON" = "start" ]; then
echo "------------ log path: $LOG_DIR"
nohup $EXE_DIR/tarbitrator -p 8000 -d 135 -g $LOG_DIR > /dev/null 2>&1 &
else
#relative path
PID=`ps -ef|grep tarbitrator | grep -v grep | awk '{print $2}'`
if [ -n "$PID" ]; then
sudo kill -9 $PID
sudo pkill -9 tarbitrator
fi
fi

View File

@ -13,3 +13,12 @@ while [ -n "$PID" ]; do
fuser -k -n tcp 6030
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
done
PID=`ps -ef|grep -w tarbitrator | grep -v grep | awk '{print $2}'`
while [ -n "$PID" ]; do
echo kill -9 $PID
pkill -9 tarbitrator
fuser -k -n tcp 6040
PID=`ps -ef|grep -w tarbitrator | grep -v grep | awk '{print $2}'`
done

View File

@ -62,6 +62,11 @@ CFG_DIR=$PRG_DIR/cfg
LOG_DIR=$PRG_DIR/log
DATA_DIR=$PRG_DIR/data
ARBITRATOR_PRG_DIR=$SIM_DIR/arbitrator
ARBITRATOR_LOG_DIR=$ARBITRATOR_PRG_DIR/log
chmod -R 777 $PRG_DIR
echo "------------------------------------------------------------------------"
echo "Start TDengine Testing Case ..."
@ -72,9 +77,12 @@ echo "CFG_DIR : $CFG_DIR"
rm -rf $LOG_DIR
rm -rf $CFG_DIR
rm -rf $ARBITRATOR_LOG_DIR
mkdir -p $PRG_DIR
mkdir -p $LOG_DIR
mkdir -p $CFG_DIR
mkdir -p $ARBITRATOR_LOG_DIR
TAOS_CFG=$PRG_DIR/cfg/taos.cfg
touch -f $TAOS_CFG

View File

@ -0,0 +1,100 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode2 -c walLevel -v 1
system sh/cfg.sh -n dnode3 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
system sh/cfg.sh -n dnode3 -c balanceInterval -v 10
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator
print ============== step0: start tarbitrator
system sh/exec_tarbitrator.sh -s start
print ============== step1: replica is 1, and start 1 dnode
system sh/exec_up.sh -n dnode1 -s start
sleep 3000
sql connect
$db = replica_db1
sql create database $db replica 1 maxTables 4
sql use $db
# create table , insert data
$stb = repl_stb
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
$rowNum = 10
$tblNum = 12
$ts0 = 1420041600000
$ts = $ts0
$delta = 1
$i = 0
while $i < $tblNum
$tb = tb . $i
sql create table $tb using $stb tags( $i )
$x = 0
while $x < $rowNum
$xs = $x * $delta
$ts = $ts0 + $xs
sql insert into $tb values ( $ts , $x )
$x = $x + 1
endw
$i = $i + 1
endw
print ============== step2: add 1 new dnode, expect balanced
system sh/exec_up.sh -n dnode2 -s start
sql create dnode $hostname2
# expect after balanced, 2 vondes in dnode1, 1 vonde in dnode2
$x = 0
show2:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
if $data2_1 != 2 then
goto show2
endi
if $data2_2 != 1 then
goto show2
endi
print ============== step4: stop dnode1, and wait dnode2 master
system sh/exec_up.sh -n dnode1 -s stop
$x = 0
loop_wait:
$x = $x + 1
sleep 2000
if $x == 10 then
print ERROR: after dnode1 stop, dnode2 didn't become a master!
return -1
endi
sql show mnodes
$dnodeRole = $data2_1
print dnodeRole ==> $dnodeRole
if $dnodeRole != master then
goto loop_wait
endi

View File

@ -36,12 +36,17 @@ void simLogSql(char *sql) {
fflush(fp);
}
char *simParseArbitratorName(char *varName);
char *simParseHostName(char *varName);
char *simGetVariable(SScript *script, char *varName, int varLen) {
if (strncmp(varName, "hostname", 8) == 0) {
return simParseHostName(varName);
}
if (strncmp(varName, "arbitrator", 10) == 0) {
return simParseArbitratorName(varName);
}
if (strncmp(varName, "error", varLen) == 0) return script->error;
if (strncmp(varName, "rows", varLen) == 0) return script->rows;

View File

@ -29,6 +29,12 @@ int simDebugFlag = 135;
void simCloseTaosdConnect(SScript *script);
char simHostName[128];
char *simParseArbitratorName(char *varName) {
static char hostName[140];
sprintf(hostName, "%s:%d", simHostName, 8000);
return hostName;
}
char *simParseHostName(char *varName) {
static char hostName[140];