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

fix(query): V24 save row count with int16_t smaller

上级 7fbc1fc8
...@@ -72,7 +72,7 @@ struct SSchema; ...@@ -72,7 +72,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;
......
...@@ -627,55 +627,56 @@ void exprTreeExprNodeTraverse(tExprNode *pExpr, int32_t numOfRows, tExprOperandI ...@@ -627,55 +627,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;
...@@ -725,55 +726,56 @@ void exprTreeExprNodeTraverse(tExprNode *pExpr, int32_t numOfRows, tExprOperandI ...@@ -725,55 +726,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.
先完成此消息的编辑!
想要评论请 注册