fix the issue #466
This commit is contained in:
parent
1ddd7336f9
commit
89769b8d38
|
@ -48,7 +48,7 @@ static int32_t getToStringLength(char *pData, int32_t length, int32_t type) {
|
|||
break;
|
||||
case TSDB_DATA_TYPE_TIMESTAMP:
|
||||
case TSDB_DATA_TYPE_BIGINT:
|
||||
len = sprintf(buf, "%ld", *(int64_t *)pData);
|
||||
len = sprintf(buf, "%lld", *(int64_t *)pData);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_BOOL:
|
||||
len = MAX_BOOL_TYPE_LENGTH;
|
||||
|
@ -198,7 +198,7 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) {
|
|||
sprintf(target, "%d", *(int32_t *)pTagValue);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_BIGINT:
|
||||
sprintf(target, "%ld", *(int64_t *)pTagValue);
|
||||
sprintf(target, "%lld", *(int64_t *)pTagValue);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_BOOL: {
|
||||
char *val = (*((int8_t *)pTagValue) == 0) ? "false" : "true";
|
||||
|
|
|
@ -76,7 +76,7 @@ void tscSaveSlowQuery(SSqlObj *pSql) {
|
|||
tscTrace("%p query time:%ld sql:%s", pSql, pSql->res.useconds, pSql->sqlstr);
|
||||
|
||||
char *sql = malloc(200);
|
||||
int len = snprintf(sql, 200, "insert into sys.slowquery values(now, '%s', %ld, %ld, '", pSql->pTscObj->user,
|
||||
int len = snprintf(sql, 200, "insert into sys.slowquery values(now, '%s', %lld, %lld, '", pSql->pTscObj->user,
|
||||
pSql->stime, pSql->res.useconds);
|
||||
int sqlLen = snprintf(sql + len, TSDB_SHOW_SQL_LEN, "%s", pSql->sqlstr);
|
||||
if (sqlLen > TSDB_SHOW_SQL_LEN - 1) {
|
||||
|
|
|
@ -665,7 +665,7 @@ int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields)
|
|||
break;
|
||||
|
||||
case TSDB_DATA_TYPE_BIGINT:
|
||||
len += sprintf(str + len, "%ld ", *((int64_t *)row[i]));
|
||||
len += sprintf(str + len, "%lld ", *((int64_t *)row[i]));
|
||||
break;
|
||||
|
||||
case TSDB_DATA_TYPE_FLOAT:
|
||||
|
@ -684,7 +684,7 @@ int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields)
|
|||
break;
|
||||
|
||||
case TSDB_DATA_TYPE_TIMESTAMP:
|
||||
len += sprintf(str + len, "%ld ", *((int64_t *)row[i]));
|
||||
len += sprintf(str + len, "%lld ", *((int64_t *)row[i]));
|
||||
break;
|
||||
|
||||
case TSDB_DATA_TYPE_BOOL:
|
||||
|
|
|
@ -106,7 +106,7 @@ TAOS_ROW taos_consume(TAOS_SUB *tsub) {
|
|||
|
||||
pSub->stime = taosGetTimestampMs();
|
||||
|
||||
sprintf(qstr, "select * from %s where _c0 > %ld order by _c0 asc", pSub->name, pSub->lastKey);
|
||||
sprintf(qstr, "select * from %s where _c0 > %lld order by _c0 asc", pSub->name, pSub->lastKey);
|
||||
if (taos_query(pSub->taos, qstr)) {
|
||||
tscTrace("failed to select, reason:%s", taos_errstr(pSub->taos));
|
||||
return NULL;
|
||||
|
|
|
@ -449,9 +449,9 @@ void tsInitGlobalConfig() {
|
|||
tsInitConfigOption(cfg++, "shellActivityTimer", &tsShellActivityTimer, TSDB_CFG_VTYPE_INT,
|
||||
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT, 1, 120, 0, TSDB_CFG_UTYPE_SECOND);
|
||||
tsInitConfigOption(cfg++, "meterMetaKeepTimer", &tsMeterMetaKeepTimer, TSDB_CFG_VTYPE_INT,
|
||||
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT, 1, 36000, 0, TSDB_CFG_UTYPE_SECOND);
|
||||
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT, 1, 8640000, 0, TSDB_CFG_UTYPE_SECOND);
|
||||
tsInitConfigOption(cfg++, "metricMetaKeepTimer", &tsMetricMetaKeepTimer, TSDB_CFG_VTYPE_INT,
|
||||
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT, 1, 36000, 0, TSDB_CFG_UTYPE_SECOND);
|
||||
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT, 1, 8640000, 0, TSDB_CFG_UTYPE_SECOND);
|
||||
|
||||
// mgmt configs
|
||||
tsInitConfigOption(cfg++, "maxUsers", &tsMaxUsers, TSDB_CFG_VTYPE_INT,
|
||||
|
|
|
@ -713,7 +713,7 @@ void tSkipListPrint(tSkipList *pSkipList, int16_t nlevel) {
|
|||
case TSDB_DATA_TYPE_SMALLINT:
|
||||
case TSDB_DATA_TYPE_TINYINT:
|
||||
case TSDB_DATA_TYPE_BIGINT:
|
||||
fprintf(stdout, "%d: %ld \n", id++, p->key.i64Key);
|
||||
fprintf(stdout, "%d: %lld \n", id++, p->key.i64Key);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_BINARY:
|
||||
fprintf(stdout, "%d: %s \n", id++, p->key.pz);
|
||||
|
|
|
@ -225,7 +225,7 @@ int32_t tVariantToString(tVariant *pVar, char *dst) {
|
|||
return sprintf(dst, "%d", (int32_t)pVar->i64Key);
|
||||
|
||||
case TSDB_DATA_TYPE_BIGINT:
|
||||
return sprintf(dst, "%ld", pVar->i64Key);
|
||||
return sprintf(dst, "%lld", pVar->i64Key);
|
||||
|
||||
case TSDB_DATA_TYPE_FLOAT:
|
||||
case TSDB_DATA_TYPE_DOUBLE:
|
||||
|
@ -385,7 +385,7 @@ static int32_t toBinary(tVariant *pVariant, char **pDest, int32_t *pDestSize) {
|
|||
|
||||
} else {
|
||||
if (pVariant->nType >= TSDB_DATA_TYPE_TINYINT && pVariant->nType <= TSDB_DATA_TYPE_BIGINT) {
|
||||
sprintf(pBuf == NULL ? *pDest : pBuf, "%ld", pVariant->i64Key);
|
||||
sprintf(pBuf == NULL ? *pDest : pBuf, "%lld", pVariant->i64Key);
|
||||
} else if (pVariant->nType == TSDB_DATA_TYPE_DOUBLE || pVariant->nType == TSDB_DATA_TYPE_FLOAT) {
|
||||
sprintf(pBuf == NULL ? *pDest : pBuf, "%lf", pVariant->dKey);
|
||||
} else if (pVariant->nType == TSDB_DATA_TYPE_BOOL) {
|
||||
|
@ -407,7 +407,7 @@ static int32_t toNchar(tVariant *pVariant, char **pDest, int32_t *pDestSize) {
|
|||
int32_t nLen = 0;
|
||||
|
||||
if (pVariant->nType >= TSDB_DATA_TYPE_TINYINT && pVariant->nType <= TSDB_DATA_TYPE_BIGINT) {
|
||||
nLen = sprintf(pDst, "%ld", pVariant->i64Key);
|
||||
nLen = sprintf(pDst, "%lld", pVariant->i64Key);
|
||||
} else if (pVariant->nType == TSDB_DATA_TYPE_DOUBLE || pVariant->nType == TSDB_DATA_TYPE_FLOAT) {
|
||||
nLen = sprintf(pDst, "%lf", pVariant->dKey);
|
||||
} else if (pVariant->nType == TSDB_DATA_TYPE_BINARY) {
|
||||
|
|
Loading…
Reference in New Issue