planTestUtil.cpp 15.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/*
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
 *
 * This program is free software: you can use, redistribute, and/or modify
 * it under the terms of the GNU Affero General Public License, version 3
 * or later ("AGPL"), as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#include "planTestUtil.h"
X
Xiaoyu Wang 已提交
17

wafwerar's avatar
wafwerar 已提交
18
#include <getopt.h>
19 20

#include <algorithm>
X
Xiaoyu Wang 已提交
21
#include <array>
22 23

#include "cmdnodes.h"
X
Xiaoyu Wang 已提交
24
#include "mockCatalogService.h"
25 26
#include "parser.h"
#include "planInt.h"
27
#include "tglobal.h"
28 29 30 31

using namespace std;
using namespace testing;

X
Xiaoyu Wang 已提交
32 33 34 35 36 37 38 39
#define DO_WITH_THROW(func, ...)                                                                                   \
  do {                                                                                                             \
    int32_t code__ = func(__VA_ARGS__);                                                                            \
    if (TSDB_CODE_SUCCESS != code__) {                                                                             \
      throw runtime_error("sql:[" + stmtEnv_.sql_ + "] " #func " code:" + to_string(code__) +                      \
                          ", strerror:" + string(tstrerror(code__)) + ", msg:" + string(stmtEnv_.msgBuf_.data())); \
    }                                                                                                              \
  } while (0);
40

X
Xiaoyu Wang 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53
enum DumpModule {
  DUMP_MODULE_NOTHING = 1,
  DUMP_MODULE_PARSER,
  DUMP_MODULE_LOGIC,
  DUMP_MODULE_OPTIMIZED,
  DUMP_MODULE_SPLIT,
  DUMP_MODULE_SCALED,
  DUMP_MODULE_PHYSICAL,
  DUMP_MODULE_SUBPLAN,
  DUMP_MODULE_ALL
};

DumpModule g_dumpModule = DUMP_MODULE_NOTHING;
54
int32_t    g_skipSql = 0;
55
int32_t    g_limitSql = 0;
56
int32_t    g_logLevel = 131;
57
int32_t    g_queryPolicy = QUERY_POLICY_VNODE;
X
Xiaoyu Wang 已提交
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

void setDumpModule(const char* pModule) {
  if (NULL == pModule) {
    g_dumpModule = DUMP_MODULE_ALL;
  } else if (0 == strncasecmp(pModule, "parser", strlen(pModule))) {
    g_dumpModule = DUMP_MODULE_PARSER;
  } else if (0 == strncasecmp(pModule, "logic", strlen(pModule))) {
    g_dumpModule = DUMP_MODULE_LOGIC;
  } else if (0 == strncasecmp(pModule, "optimized", strlen(pModule))) {
    g_dumpModule = DUMP_MODULE_OPTIMIZED;
  } else if (0 == strncasecmp(pModule, "split", strlen(pModule))) {
    g_dumpModule = DUMP_MODULE_SPLIT;
  } else if (0 == strncasecmp(pModule, "scaled", strlen(pModule))) {
    g_dumpModule = DUMP_MODULE_SCALED;
  } else if (0 == strncasecmp(pModule, "physical", strlen(pModule))) {
    g_dumpModule = DUMP_MODULE_PHYSICAL;
  } else if (0 == strncasecmp(pModule, "subplan", strlen(pModule))) {
    g_dumpModule = DUMP_MODULE_SUBPLAN;
  } else if (0 == strncasecmp(pModule, "all", strlen(pModule))) {
    g_dumpModule = DUMP_MODULE_PHYSICAL;
  }
}
X
Xiaoyu Wang 已提交
80

wafwerar's avatar
wafwerar 已提交
81
void setSkipSqlNum(const char* pNum) { g_skipSql = stoi(pNum); }
82
void setLimitSqlNum(const char* pNum) { g_limitSql = stoi(pNum); }
83
void setLogLevel(const char* pLogLevel) { g_logLevel = stoi(pLogLevel); }
84
void setQueryPolicy(const char* pQueryPolicy) { g_queryPolicy = stoi(pQueryPolicy); }
85 86 87

int32_t getLogLevel() { return g_logLevel; }

88
class PlannerTestBaseImpl {
X
Xiaoyu Wang 已提交
89
 public:
90
  PlannerTestBaseImpl() : sqlNo_(0), sqlNum_(0) {}
91

X
Xiaoyu Wang 已提交
92 93 94
  void useDb(const string& user, const string& db) {
    caseEnv_.acctId_ = 0;
    caseEnv_.user_ = user;
95
    caseEnv_.db_ = db;
96 97
    caseEnv_.numOfSkipSql_ = g_skipSql;
    caseEnv_.numOfLimitSql_ = g_limitSql;
98 99 100
  }

  void run(const string& sql) {
101
    ++sqlNo_;
102 103 104 105 106
    if (caseEnv_.numOfSkipSql_ > 0) {
      --(caseEnv_.numOfSkipSql_);
      return;
    }
    if (caseEnv_.numOfLimitSql_ > 0 && caseEnv_.numOfLimitSql_ == sqlNum_) {
107 108
      return;
    }
109
    ++sqlNum_;
110

111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    switch (g_queryPolicy) {
      case QUERY_POLICY_VNODE:
      case QUERY_POLICY_HYBRID:
      case QUERY_POLICY_QNODE:
        runImpl(sql, g_queryPolicy);
        break;
      default:
        runImpl(sql, QUERY_POLICY_VNODE);
        runImpl(sql, QUERY_POLICY_HYBRID);
        runImpl(sql, QUERY_POLICY_QNODE);
        break;
    }
  }

  void runImpl(const string& sql, int32_t queryPolicy) {
126
    reset();
127
    tsQueryPolicy = queryPolicy;
128
    try {
129 130 131
      unique_ptr<SQuery*, void (*)(SQuery**)> query((SQuery**)taosMemoryCalloc(1, sizeof(SQuery*)), _destroyQuery);
      doParseSql(sql, query.get());
      SQuery* pQuery = *(query.get());
132 133 134 135

      SPlanContext cxt = {0};
      setPlanContext(pQuery, &cxt);

X
Xiaoyu Wang 已提交
136 137
      SLogicSubplan* pLogicSubplan = nullptr;
      doCreateLogicPlan(&cxt, &pLogicSubplan);
X
Xiaoyu Wang 已提交
138 139
      unique_ptr<SLogicSubplan, void (*)(SLogicSubplan*)> logicSubplan(pLogicSubplan,
                                                                       (void (*)(SLogicSubplan*))nodesDestroyNode);
140

X
Xiaoyu Wang 已提交
141
      doOptimizeLogicPlan(&cxt, pLogicSubplan);
142

X
Xiaoyu Wang 已提交
143
      doSplitLogicPlan(&cxt, pLogicSubplan);
144 145 146

      SQueryLogicPlan* pLogicPlan = nullptr;
      doScaleOutLogicPlan(&cxt, pLogicSubplan, &pLogicPlan);
X
Xiaoyu Wang 已提交
147 148
      unique_ptr<SQueryLogicPlan, void (*)(SQueryLogicPlan*)> logicPlan(pLogicPlan,
                                                                        (void (*)(SQueryLogicPlan*))nodesDestroyNode);
149 150

      SQueryPlan* pPlan = nullptr;
X
Xiaoyu Wang 已提交
151
      doCreatePhysiPlan(&cxt, pLogicPlan, &pPlan);
X
Xiaoyu Wang 已提交
152
      unique_ptr<SQueryPlan, void (*)(SQueryPlan*)> plan(pPlan, (void (*)(SQueryPlan*))nodesDestroyNode);
X
Xiaoyu Wang 已提交
153

X
Xiaoyu Wang 已提交
154
      dump(g_dumpModule);
155
    } catch (...) {
X
Xiaoyu Wang 已提交
156
      dump(DUMP_MODULE_ALL);
157 158 159 160
      throw;
    }
  }

161
  void prepare(const string& sql) {
162
    if (caseEnv_.numOfSkipSql_ > 0) {
163 164 165
      return;
    }

166 167 168 169 170 171 172 173 174 175
    reset();
    try {
      doParseSql(sql, &stmtEnv_.pQuery_, true);
    } catch (...) {
      dump(DUMP_MODULE_ALL);
      throw;
    }
  }

  void bindParams(TAOS_MULTI_BIND* pParams, int32_t colIdx) {
176
    if (caseEnv_.numOfSkipSql_ > 0) {
177 178 179
      return;
    }

180 181
    try {
      doBindParams(stmtEnv_.pQuery_, pParams, colIdx);
182 183 184 185 186 187 188
    } catch (...) {
      dump(DUMP_MODULE_ALL);
      throw;
    }
  }

  void exec() {
189 190
    if (caseEnv_.numOfSkipSql_ > 0) {
      --(caseEnv_.numOfSkipSql_);
191 192 193
      return;
    }

194 195
    try {
      doParseBoundSql(stmtEnv_.pQuery_);
196 197 198 199

      SPlanContext cxt = {0};
      setPlanContext(stmtEnv_.pQuery_, &cxt);

X
Xiaoyu Wang 已提交
200 201
      SLogicSubplan* pLogicSubplan = nullptr;
      doCreateLogicPlan(&cxt, &pLogicSubplan);
202 203
      unique_ptr<SLogicSubplan, void (*)(SLogicSubplan*)> logicSubplan(pLogicSubplan,
                                                                       (void (*)(SLogicSubplan*))nodesDestroyNode);
204

X
Xiaoyu Wang 已提交
205
      doOptimizeLogicPlan(&cxt, pLogicSubplan);
206

X
Xiaoyu Wang 已提交
207
      doSplitLogicPlan(&cxt, pLogicSubplan);
208 209 210

      SQueryLogicPlan* pLogicPlan = nullptr;
      doScaleOutLogicPlan(&cxt, pLogicSubplan, &pLogicPlan);
211 212
      unique_ptr<SQueryLogicPlan, void (*)(SQueryLogicPlan*)> logicPlan(pLogicPlan,
                                                                        (void (*)(SQueryLogicPlan*))nodesDestroyNode);
213 214 215

      SQueryPlan* pPlan = nullptr;
      doCreatePhysiPlan(&cxt, pLogicPlan, &pPlan);
216
      unique_ptr<SQueryPlan, void (*)(SQueryPlan*)> plan(pPlan, (void (*)(SQueryPlan*))nodesDestroyNode);
217 218 219 220 221 222 223 224

      dump(g_dumpModule);
    } catch (...) {
      dump(DUMP_MODULE_ALL);
      throw;
    }
  }

X
Xiaoyu Wang 已提交
225
 private:
226
  struct caseEnv {
X
Xiaoyu Wang 已提交
227 228
    int32_t acctId_;
    string  user_;
229
    string  db_;
230 231
    int32_t numOfSkipSql_;
    int32_t numOfLimitSql_;
232

233
    caseEnv() : numOfSkipSql_(0) {}
234 235 236
  };

  struct stmtEnv {
X
Xiaoyu Wang 已提交
237
    string            sql_;
238
    array<char, 1024> msgBuf_;
239 240
    SQuery*           pQuery_;

241
    stmtEnv() : pQuery_(nullptr) {}
242
    ~stmtEnv() { qDestroyQuery(pQuery_); }
243 244 245
  };

  struct stmtRes {
X
Xiaoyu Wang 已提交
246
    string         ast_;
247 248
    string         prepareAst_;
    string         boundAst_;
X
Xiaoyu Wang 已提交
249 250 251 252 253
    string         rawLogicPlan_;
    string         optimizedLogicPlan_;
    string         splitLogicPlan_;
    string         scaledLogicPlan_;
    string         physiPlan_;
X
Xiaoyu Wang 已提交
254
    vector<string> physiSubplans_;
255 256
  };

257 258 259 260 261 262 263 264
  static void _destroyQuery(SQuery** pQuery) {
    if (nullptr == pQuery) {
      return;
    }
    qDestroyQuery(*pQuery);
    taosMemoryFree(pQuery);
  }

265 266 267
  void reset() {
    stmtEnv_.sql_.clear();
    stmtEnv_.msgBuf_.fill(0);
268
    qDestroyQuery(stmtEnv_.pQuery_);
269 270

    res_.ast_.clear();
271
    res_.boundAst_.clear();
272 273 274 275 276
    res_.rawLogicPlan_.clear();
    res_.optimizedLogicPlan_.clear();
    res_.splitLogicPlan_.clear();
    res_.scaledLogicPlan_.clear();
    res_.physiPlan_.clear();
277
    res_.physiSubplans_.clear();
278 279
  }

X
Xiaoyu Wang 已提交
280
  void dump(DumpModule module) {
281 282
    cout << "========================================== " << sqlNo_ << " sql : [" << stmtEnv_.sql_ << "]" << endl;

X
Xiaoyu Wang 已提交
283 284 285 286 287
    if (DUMP_MODULE_NOTHING == module) {
      return;
    }

    if (DUMP_MODULE_ALL == module || DUMP_MODULE_PARSER == module) {
288
      if (res_.prepareAst_.empty()) {
X
Xiaoyu Wang 已提交
289
        cout << "+++++++++++++++++++++syntax tree : " << endl;
290 291
        cout << res_.ast_ << endl;
      } else {
X
Xiaoyu Wang 已提交
292
        cout << "+++++++++++++++++++++prepare syntax tree : " << endl;
293
        cout << res_.prepareAst_ << endl;
X
Xiaoyu Wang 已提交
294
        cout << "+++++++++++++++++++++bound syntax tree : " << endl;
295
        cout << res_.boundAst_ << endl;
X
Xiaoyu Wang 已提交
296
        cout << "+++++++++++++++++++++syntax tree : " << endl;
297 298
        cout << res_.ast_ << endl;
      }
X
Xiaoyu Wang 已提交
299 300 301
    }

    if (DUMP_MODULE_ALL == module || DUMP_MODULE_LOGIC == module) {
X
Xiaoyu Wang 已提交
302
      cout << "+++++++++++++++++++++raw logic plan : " << endl;
X
Xiaoyu Wang 已提交
303 304 305 306
      cout << res_.rawLogicPlan_ << endl;
    }

    if (DUMP_MODULE_ALL == module || DUMP_MODULE_OPTIMIZED == module) {
X
Xiaoyu Wang 已提交
307
      cout << "+++++++++++++++++++++optimized logic plan : " << endl;
X
Xiaoyu Wang 已提交
308 309 310 311
      cout << res_.optimizedLogicPlan_ << endl;
    }

    if (DUMP_MODULE_ALL == module || DUMP_MODULE_SPLIT == module) {
X
Xiaoyu Wang 已提交
312
      cout << "+++++++++++++++++++++split logic plan : " << endl;
X
Xiaoyu Wang 已提交
313 314 315 316
      cout << res_.splitLogicPlan_ << endl;
    }

    if (DUMP_MODULE_ALL == module || DUMP_MODULE_SCALED == module) {
X
Xiaoyu Wang 已提交
317
      cout << "+++++++++++++++++++++scaled logic plan : " << endl;
X
Xiaoyu Wang 已提交
318 319 320 321
      cout << res_.scaledLogicPlan_ << endl;
    }

    if (DUMP_MODULE_ALL == module || DUMP_MODULE_PHYSICAL == module) {
X
Xiaoyu Wang 已提交
322
      cout << "+++++++++++++++++++++physical plan : " << endl;
X
Xiaoyu Wang 已提交
323 324 325 326
      cout << res_.physiPlan_ << endl;
    }

    if (DUMP_MODULE_ALL == module || DUMP_MODULE_SUBPLAN == module) {
X
Xiaoyu Wang 已提交
327
      cout << "+++++++++++++++++++++physical subplan : " << endl;
X
Xiaoyu Wang 已提交
328 329 330
      for (const auto& subplan : res_.physiSubplans_) {
        cout << subplan << endl;
      }
X
Xiaoyu Wang 已提交
331
    }
332
  }
X
Xiaoyu Wang 已提交
333

334
  void doParseSql(const string& sql, SQuery** pQuery, bool prepare = false) {
335 336
    stmtEnv_.sql_ = sql;
    transform(stmtEnv_.sql_.begin(), stmtEnv_.sql_.end(), stmtEnv_.sql_.begin(), ::tolower);
X
Xiaoyu Wang 已提交
337

338
    SParseContext cxt = {0};
X
Xiaoyu Wang 已提交
339
    cxt.acctId = caseEnv_.acctId_;
340 341 342 343 344
    cxt.db = caseEnv_.db_.c_str();
    cxt.pSql = stmtEnv_.sql_.c_str();
    cxt.sqlLen = stmtEnv_.sql_.length();
    cxt.pMsg = stmtEnv_.msgBuf_.data();
    cxt.msgLen = stmtEnv_.msgBuf_.max_size();
345
    cxt.svrVer = "3.0.0.0";
346
    cxt.enableSysInfo = true;
X
Xiaoyu Wang 已提交
347 348 349 350
    if (prepare) {
      SStmtCallback stmtCb = {0};
      cxt.pStmtCb = &stmtCb;
    }
X
Xiaoyu Wang 已提交
351

X
Xiaoyu Wang 已提交
352
    DO_WITH_THROW(qParseSql, &cxt, pQuery);
353
    if (prepare) {
354
      res_.prepareAst_ = toString((*pQuery)->pPrepareRoot);
355 356 357 358 359 360 361 362 363 364 365 366 367 368
    } else {
      res_.ast_ = toString((*pQuery)->pRoot);
    }
  }

  void doBindParams(SQuery* pQuery, TAOS_MULTI_BIND* pParams, int32_t colIdx) {
    DO_WITH_THROW(qStmtBindParams, pQuery, pParams, colIdx);
    if (colIdx < 0 || pQuery->placeholderNum == colIdx + 1) {
      res_.boundAst_ = toString(pQuery->pRoot);
    }
  }

  void doParseBoundSql(SQuery* pQuery) {
    SParseContext cxt = {0};
X
Xiaoyu Wang 已提交
369
    cxt.acctId = caseEnv_.acctId_;
370 371 372 373 374
    cxt.db = caseEnv_.db_.c_str();
    cxt.pSql = stmtEnv_.sql_.c_str();
    cxt.sqlLen = stmtEnv_.sql_.length();
    cxt.pMsg = stmtEnv_.msgBuf_.data();
    cxt.msgLen = stmtEnv_.msgBuf_.max_size();
X
Xiaoyu Wang 已提交
375
    cxt.pUser = caseEnv_.user_.c_str();
376 377 378

    DO_WITH_THROW(qStmtParseQuerySql, &cxt, pQuery);
    res_.ast_ = toString(pQuery->pRoot);
379 380
  }

X
Xiaoyu Wang 已提交
381 382 383
  void doCreateLogicPlan(SPlanContext* pCxt, SLogicSubplan** pLogicSubplan) {
    DO_WITH_THROW(createLogicPlan, pCxt, pLogicSubplan);
    res_.rawLogicPlan_ = toString((SNode*)(*pLogicSubplan));
384 385
  }

X
Xiaoyu Wang 已提交
386 387 388
  void doOptimizeLogicPlan(SPlanContext* pCxt, SLogicSubplan* pLogicSubplan) {
    DO_WITH_THROW(optimizeLogicPlan, pCxt, pLogicSubplan);
    res_.optimizedLogicPlan_ = toString((SNode*)pLogicSubplan);
389 390
  }

X
Xiaoyu Wang 已提交
391 392 393
  void doSplitLogicPlan(SPlanContext* pCxt, SLogicSubplan* pLogicSubplan) {
    DO_WITH_THROW(splitLogicPlan, pCxt, pLogicSubplan);
    res_.splitLogicPlan_ = toString((SNode*)(pLogicSubplan));
394 395 396 397 398 399 400
  }

  void doScaleOutLogicPlan(SPlanContext* pCxt, SLogicSubplan* pLogicSubplan, SQueryLogicPlan** pLogicPlan) {
    DO_WITH_THROW(scaleOutLogicPlan, pCxt, pLogicSubplan, pLogicPlan);
    res_.scaledLogicPlan_ = toString((SNode*)(*pLogicPlan));
  }

X
Xiaoyu Wang 已提交
401
  void doCreatePhysiPlan(SPlanContext* pCxt, SQueryLogicPlan* pLogicPlan, SQueryPlan** pPlan) {
X
Xiaoyu Wang 已提交
402 403 404
    unique_ptr<SArray, void (*)(SArray*)> execNodeList((SArray*)taosArrayInit(TARRAY_MIN_SIZE, sizeof(SQueryNodeAddr)),
                                                       (void (*)(SArray*))taosArrayDestroy);
    DO_WITH_THROW(createPhysiPlan, pCxt, pLogicPlan, pPlan, execNodeList.get());
405
    res_.physiPlan_ = toString((SNode*)(*pPlan));
X
Xiaoyu Wang 已提交
406 407 408
    SNode* pNode;
    FOREACH(pNode, (*pPlan)->pSubplans) {
      SNode* pSubplan;
X
Xiaoyu Wang 已提交
409
      FOREACH(pSubplan, ((SNodeListNode*)pNode)->pNodeList) { res_.physiSubplans_.push_back(toString(pSubplan)); }
X
Xiaoyu Wang 已提交
410
    }
411 412 413
  }

  void setPlanContext(SQuery* pQuery, SPlanContext* pCxt) {
414
    pCxt->queryId = 1;
X
Xiaoyu Wang 已提交
415
    pCxt->pUser = caseEnv_.user_.c_str();
416
    if (QUERY_NODE_CREATE_TOPIC_STMT == nodeType(pQuery->pRoot)) {
417 418 419 420 421
      SCreateTopicStmt* pStmt = (SCreateTopicStmt*)pQuery->pRoot;
      pCxt->pAstRoot = pStmt->pQuery;
      pStmt->pQuery = nullptr;
      nodesDestroyNode(pQuery->pRoot);
      pQuery->pRoot = pCxt->pAstRoot;
422 423 424 425
      pCxt->topicQuery = true;
    } else if (QUERY_NODE_CREATE_INDEX_STMT == nodeType(pQuery->pRoot)) {
      SMCreateSmaReq req = {0};
      tDeserializeSMCreateSmaReq(pQuery->pCmdMsg->pMsg, pQuery->pCmdMsg->msgLen, &req);
X
Xiaoyu Wang 已提交
426
      g_mockCatalogService->createSmaIndex(&req);
427
      nodesStringToNode(req.ast, &pCxt->pAstRoot);
428 429 430
      tFreeSMCreateSmaReq(&req);
      nodesDestroyNode(pQuery->pRoot);
      pQuery->pRoot = pCxt->pAstRoot;
431 432 433 434
      pCxt->streamQuery = true;
    } else if (QUERY_NODE_CREATE_STREAM_STMT == nodeType(pQuery->pRoot)) {
      SCreateStreamStmt* pStmt = (SCreateStreamStmt*)pQuery->pRoot;
      pCxt->pAstRoot = pStmt->pQuery;
435
      pStmt->pQuery = nullptr;
436 437 438
      pCxt->streamQuery = true;
      pCxt->triggerType = pStmt->pOptions->triggerType;
      pCxt->watermark = (NULL != pStmt->pOptions->pWatermark ? ((SValueNode*)pStmt->pOptions->pWatermark)->datum.i : 0);
439 440
      nodesDestroyNode(pQuery->pRoot);
      pQuery->pRoot = pCxt->pAstRoot;
441 442 443 444 445 446
    } else {
      pCxt->pAstRoot = pQuery->pRoot;
    }
  }

  string toString(const SNode* pRoot) {
X
Xiaoyu Wang 已提交
447
    char*   pStr = NULL;
448 449 450 451 452 453 454 455 456 457
    int32_t len = 0;
    DO_WITH_THROW(nodesNodeToString, pRoot, false, &pStr, &len)
    string str(pStr);
    taosMemoryFreeClear(pStr);
    return str;
  }

  caseEnv caseEnv_;
  stmtEnv stmtEnv_;
  stmtRes res_;
458
  int32_t sqlNo_;
459
  int32_t sqlNum_;
460 461
};

X
Xiaoyu Wang 已提交
462
PlannerTestBase::PlannerTestBase() : impl_(new PlannerTestBaseImpl()) {}
463

X
Xiaoyu Wang 已提交
464
PlannerTestBase::~PlannerTestBase() {}
465

X
Xiaoyu Wang 已提交
466
void PlannerTestBase::useDb(const std::string& user, const std::string& db) { impl_->useDb(user, db); }
467

X
Xiaoyu Wang 已提交
468
void PlannerTestBase::run(const std::string& sql) { return impl_->run(sql); }
469 470 471 472 473 474 475 476

void PlannerTestBase::prepare(const std::string& sql) { return impl_->prepare(sql); }

void PlannerTestBase::bindParams(TAOS_MULTI_BIND* pParams, int32_t colIdx) {
  return impl_->bindParams(pParams, colIdx);
}

void PlannerTestBase::exec() { return impl_->exec(); }