提交 6d79a5f5 编写于 作者: A Alex Duan

fix(query): save row count with int16_t smaller

上级 df5b08c0
...@@ -85,7 +85,7 @@ struct SSchema; ...@@ -85,7 +85,7 @@ struct SSchema;
typedef struct { typedef struct {
int16_t type; int16_t type;
int16_t bytes; int16_t bytes;
int16_t numOfRows; int32_t numOfRows;
char* data; char* data;
} tExprOperandInfo; } tExprOperandInfo;
......
...@@ -668,55 +668,56 @@ void exprTreeExprNodeTraverse(tExprNode *pExpr, int32_t numOfRows, tExprOperandI ...@@ -668,55 +668,56 @@ void exprTreeExprNodeTraverse(tExprNode *pExpr, int32_t numOfRows, tExprOperandI
pl = ltmp; pl = ltmp;
pt = transl; pt = transl;
int32_t i;
switch (left.type) { switch (left.type) {
case TSDB_DATA_TYPE_TINYINT: case TSDB_DATA_TYPE_TINYINT:
for (int16_t i = 0; i < left.numOfRows; i++) { for (i = 0; i < left.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((int8_t *) pl + i)); *((int64_t *) pt + i) = (int64_t)(*((int8_t *) pl + i));
} }
break; break;
case TSDB_DATA_TYPE_SMALLINT: case TSDB_DATA_TYPE_SMALLINT:
for (int16_t i = 0; i < left.numOfRows; i++) { for (i = 0; i < left.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((int16_t *) pl + i)); *((int64_t *) pt + i) = (int64_t)(*((int16_t *) pl + i));
} }
break; break;
case TSDB_DATA_TYPE_INT: case TSDB_DATA_TYPE_INT:
for (int16_t i = 0; i < left.numOfRows; i++) { for (i = 0; i < left.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((int32_t *) pl + i)); *((int64_t *) pt + i) = (int64_t)(*((int32_t *) pl + i));
} }
break; break;
case TSDB_DATA_TYPE_BIGINT: case TSDB_DATA_TYPE_BIGINT:
for (int16_t i = 0; i < left.numOfRows; i++) { for (i = 0; i < left.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((int64_t *) pl + i)); *((int64_t *) pt + i) = (int64_t)(*((int64_t *) pl + i));
} }
break; break;
case TSDB_DATA_TYPE_UTINYINT: case TSDB_DATA_TYPE_UTINYINT:
for (int16_t i = 0; i < left.numOfRows; i++) { for (i = 0; i < left.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((uint8_t *) pl + i)); *((int64_t *) pt + i) = (int64_t)(*((uint8_t *) pl + i));
} }
break; break;
case TSDB_DATA_TYPE_USMALLINT: case TSDB_DATA_TYPE_USMALLINT:
for (int16_t i = 0; i < left.numOfRows; i++) { for (i = 0; i < left.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((uint16_t *) pl + i)); *((int64_t *) pt + i) = (int64_t)(*((uint16_t *) pl + i));
} }
break; break;
case TSDB_DATA_TYPE_UINT: case TSDB_DATA_TYPE_UINT:
for (int16_t i = 0; i < left.numOfRows; i++) { for (i = 0; i < left.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((uint32_t *) pl + i)); *((int64_t *) pt + i) = (int64_t)(*((uint32_t *) pl + i));
} }
break; break;
case TSDB_DATA_TYPE_UBIGINT: case TSDB_DATA_TYPE_UBIGINT:
for (int16_t i = 0; i < left.numOfRows; i++) { for (i = 0; i < left.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((uint64_t *) pl + i)); *((int64_t *) pt + i) = (int64_t)(*((uint64_t *) pl + i));
} }
break; break;
case TSDB_DATA_TYPE_FLOAT: case TSDB_DATA_TYPE_FLOAT:
for (int16_t i = 0; i < left.numOfRows; i++) { for (i = 0; i < left.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((float *) pl + i)); *((int64_t *) pt + i) = (int64_t)(*((float *) pl + i));
} }
break; break;
case TSDB_DATA_TYPE_DOUBLE: case TSDB_DATA_TYPE_DOUBLE:
for (int16_t i = 0; i < left.numOfRows; i++) { for (i = 0; i < left.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((double *) pl + i)); *((int64_t *) pt + i) = (int64_t)(*((double *) pl + i));
} }
break; break;
...@@ -766,55 +767,56 @@ void exprTreeExprNodeTraverse(tExprNode *pExpr, int32_t numOfRows, tExprOperandI ...@@ -766,55 +767,56 @@ void exprTreeExprNodeTraverse(tExprNode *pExpr, int32_t numOfRows, tExprOperandI
pr = rtmp; pr = rtmp;
pt = transr; pt = transr;
int32_t i;
switch (right.type) { switch (right.type) {
case TSDB_DATA_TYPE_TINYINT: case TSDB_DATA_TYPE_TINYINT:
for (int16_t i = 0; i < right.numOfRows; i++) { for (i = 0; i < right.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((int8_t *) pr + i)); *((int64_t *) pt + i) = (int64_t)(*((int8_t *) pr + i));
} }
break; break;
case TSDB_DATA_TYPE_SMALLINT: case TSDB_DATA_TYPE_SMALLINT:
for (int16_t i = 0; i < right.numOfRows; i++) { for (i = 0; i < right.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((int16_t *) pr + i)); *((int64_t *) pt + i) = (int64_t)(*((int16_t *) pr + i));
} }
break; break;
case TSDB_DATA_TYPE_INT: case TSDB_DATA_TYPE_INT:
for (int16_t i = 0; i < right.numOfRows; i++) { for (i = 0; i < right.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((int32_t *) pr + i)); *((int64_t *) pt + i) = (int64_t)(*((int32_t *) pr + i));
} }
break; break;
case TSDB_DATA_TYPE_BIGINT: case TSDB_DATA_TYPE_BIGINT:
for (int16_t i = 0; i < right.numOfRows; i++) { for (i = 0; i < right.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((int64_t *) pr + i)); *((int64_t *) pt + i) = (int64_t)(*((int64_t *) pr + i));
} }
break; break;
case TSDB_DATA_TYPE_UTINYINT: case TSDB_DATA_TYPE_UTINYINT:
for (int16_t i = 0; i < right.numOfRows; i++) { for (i = 0; i < right.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((uint8_t *) pr + i)); *((int64_t *) pt + i) = (int64_t)(*((uint8_t *) pr + i));
} }
break; break;
case TSDB_DATA_TYPE_USMALLINT: case TSDB_DATA_TYPE_USMALLINT:
for (int16_t i = 0; i < right.numOfRows; i++) { for (i = 0; i < right.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((uint16_t *) pr + i)); *((int64_t *) pt + i) = (int64_t)(*((uint16_t *) pr + i));
} }
break; break;
case TSDB_DATA_TYPE_UINT: case TSDB_DATA_TYPE_UINT:
for (int16_t i = 0; i < right.numOfRows; i++) { for (i = 0; i < right.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((uint32_t *) pr + i)); *((int64_t *) pt + i) = (int64_t)(*((uint32_t *) pr + i));
} }
break; break;
case TSDB_DATA_TYPE_UBIGINT: case TSDB_DATA_TYPE_UBIGINT:
for (int16_t i = 0; i < right.numOfRows; i++) { for (i = 0; i < right.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((uint64_t *) pr + i)); *((int64_t *) pt + i) = (int64_t)(*((uint64_t *) pr + i));
} }
break; break;
case TSDB_DATA_TYPE_FLOAT: case TSDB_DATA_TYPE_FLOAT:
for (int16_t i = 0; i < right.numOfRows; i++) { for (i = 0; i < right.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((float *) pr + i)); *((int64_t *) pt + i) = (int64_t)(*((float *) pr + i));
} }
break; break;
case TSDB_DATA_TYPE_DOUBLE: case TSDB_DATA_TYPE_DOUBLE:
for (int16_t i = 0; i < right.numOfRows; i++) { for (i = 0; i < right.numOfRows; i++) {
*((int64_t *) pt + i) = (int64_t)(*((double *) pr + i)); *((int64_t *) pt + i) = (int64_t)(*((double *) pr + i));
} }
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册