提交 1710eb5b 编写于 作者: S shenglian zhou

implement concat_ws that follow mysql

上级 116a4c7e
...@@ -1180,28 +1180,27 @@ void vectorConcatWs(int16_t functionId, tExprOperandInfo* pInputs, int32_t numIn ...@@ -1180,28 +1180,27 @@ void vectorConcatWs(int16_t functionId, tExprOperandInfo* pInputs, int32_t numIn
outputData = pOutput->data + i * pOutput->bytes; outputData = pOutput->data + i * pOutput->bytes;
bool hasNullInputs = false; if (isNull(inputData[0], pInputs[0].type)) {
for (int j = 0; j < numInputs; ++j) { setNull(outputData, pOutput->type, pOutput->bytes);
if (isNull(inputData[j], pInputs[j].type)) { continue;
hasNullInputs = true;
setNull(outputData, pOutput->type, pOutput->bytes);
}
} }
if (!hasNullInputs) { int16_t dataLen = 0;
int16_t dataLen = 0; for (int j = 1; j < numInputs; ++j) {
for (int j = 1; j < numInputs; ++j) { if (isNull(inputData[j], pInputs[j].type)) {
memcpy(((char*)varDataVal(outputData))+dataLen, varDataVal(inputData[j]), varDataLen(inputData[j])); continue;
dataLen += varDataLen(inputData[j]); }
if (j < numInputs - 1) { memcpy(((char*)varDataVal(outputData))+dataLen, varDataVal(inputData[j]), varDataLen(inputData[j]));
memcpy(((char*)varDataVal(outputData))+dataLen, varDataVal(inputData[0]), varDataLen(inputData[0])); dataLen += varDataLen(inputData[j]);
dataLen += varDataLen(inputData[0]); if (j < numInputs - 1) {
} memcpy(((char*)varDataVal(outputData))+dataLen, varDataVal(inputData[0]), varDataLen(inputData[0]));
dataLen += varDataLen(inputData[0]);
} }
varDataSetLen(outputData, dataLen);
} }
varDataSetLen(outputData, dataLen);
} }
free(inputData); free(inputData);
} }
......
...@@ -230,6 +230,7 @@ sql_error select cos(c1) from $stb state_window(f1) ...@@ -230,6 +230,7 @@ sql_error select cos(c1) from $stb state_window(f1)
sql_error select pow(c2,2) from $stb interval(1s) sliding(500a) sql_error select pow(c2,2) from $stb interval(1s) sliding(500a)
sql_error select pow(c2,2) from $stb state_window(f1) sql_error select pow(c2,2) from $stb state_window(f1)
sql_error select tan(f1) from $stb from d.st slimit 1 sql_error select tan(f1) from $stb from d.st slimit 1
sql_error select f1+2, tbname from $stb group by tbname
print =============== clear print =============== clear
sql drop database $db sql drop database $db
sql show databases sql show databases
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册