提交 bb34d835 编写于 作者: H Haojun Liao

[td-225] fix compiler error.

上级 d016001b
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <qast.h>
#include <sys/time.h> #include <sys/time.h>
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>
#include "qast.h"
#include "taosmsg.h" #include "taosmsg.h"
#include "qast.h"
#include "tsdb.h" #include "tsdb.h"
#include "tskiplist.h" #include "tskiplist.h"
...@@ -24,8 +23,6 @@ static void initSchema_binary(SSchema *schema, int32_t numOfCols); ...@@ -24,8 +23,6 @@ static void initSchema_binary(SSchema *schema, int32_t numOfCols);
static SSkipList *createSkipList(SSchema *pSchema, int32_t numOfTags); static SSkipList *createSkipList(SSchema *pSchema, int32_t numOfTags);
static SSkipList *createSkipList_binary(SSchema *pSchema, int32_t numOfTags); static SSkipList *createSkipList_binary(SSchema *pSchema, int32_t numOfTags);
static void testQueryStr(SSchema *schema, int32_t numOfCols, char *sql, SSkipList *pSkipList, ResultObj *expectedVal);
static void dropMeter(SSkipList *pSkipList); static void dropMeter(SSkipList *pSkipList);
static void Right2LeftTest(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList); static void Right2LeftTest(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList);
...@@ -239,44 +236,45 @@ static void initSchema(SSchema *schema, int32_t numOfCols) { ...@@ -239,44 +236,45 @@ static void initSchema(SSchema *schema, int32_t numOfCols) {
// return pSkipList; // return pSkipList;
//} //}
static void testQueryStr(SSchema *schema, int32_t numOfCols, char *sql, SSkipList *pSkipList, ResultObj *pResult) { //static void testQueryStr(SSchema *schema, int32_t numOfCols, char *sql, SSkipList *pSkipList, ResultObj *pResult) {
tExprNode *pExpr = NULL; // tExprNode *pExpr = NULL;
tSQLBinaryExprFromString(&pExpr, schema, numOfCols, sql, strlen(sql)); // tSQLBinaryExprFromString(&pExpr, schema, numOfCols, sql, strlen(sql));
//
char str[512] = {0}; // char str[512] = {0};
int32_t len = 0; // int32_t len = 0;
if (pExpr == NULL) { // if (pExpr == NULL) {
printf("-----error in parse syntax:%s\n\n", sql); // printf("-----error in parse syntax:%s\n\n", sql);
assert(pResult == NULL); // assert(pResult == NULL);
return; // return;
} // }
//
tSQLBinaryExprToString(pExpr, str, &len); // tSQLBinaryExprToString(pExpr, str, &len);
printf("expr is: %s\n", str); // printf("expr is: %s\n", str);
//
SArray *result = NULL; // SArray *result = NULL;
// tExprTreeTraverse(pExpr, pSkipList, result, SSkipListNodeFilterCallback, &result); // // tExprTreeTraverse(pExpr, pSkipList, result, SSkipListNodeFilterCallback, &result);
// printf("the result is:%lld\n", result.num); // // printf("the result is:%lld\n", result.num);
// // //
// bool findResult = false; // // bool findResult = false;
// for (int32_t i = 0; i < result.num; ++i) { // // for (int32_t i = 0; i < result.num; ++i) {
// STabObj *pm = (STabObj *)result.pRes[i]; // // STabObj *pm = (STabObj *)result.pRes[i];
// printf("meterid:%s,\t", pm->meterId); // // printf("meterid:%s,\t", pm->meterId);
// // //
// for (int32_t j = 0; j < pResult->numOfResult; ++j) { // // for (int32_t j = 0; j < pResult->numOfResult; ++j) {
// if (strcmp(pm->meterId, pResult->resultName[j]) == 0) { // // if (strcmp(pm->meterId, pResult->resultName[j]) == 0) {
// findResult = true; // // findResult = true;
// break; // // break;
// } // // }
// } // // }
// assert(findResult == true); // // assert(findResult == true);
// findResult = false; // // findResult = false;
// } // // }
//
printf("\n\n"); // printf("\n\n");
tExprTreeDestroy(&pExpr, NULL); // tExprTreeDestroy(&pExpr, NULL);
} //}
#if 0
static void Left2RightTest(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList) { static void Left2RightTest(SSchema *schema, int32_t numOfCols, SSkipList *pSkipList) {
char str[256] = {0}; char str[256] = {0};
...@@ -633,3 +631,4 @@ void exprSerializeTest2() { ...@@ -633,3 +631,4 @@ void exprSerializeTest2() {
TEST(testCase, astTest) { TEST(testCase, astTest) {
// exprSerializeTest2(); // exprSerializeTest2();
} }
#endif
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册