From b9888eafb9368693acc0a53a99bd08a515a539e2 Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Sat, 14 Mar 2020 18:18:25 +0800 Subject: [PATCH] refactor:move function to other files --- src/client/inc/tscSQLParser.h | 31 ------------------------------- src/client/inc/tsclient.h | 2 +- src/client/src/tscAsync.c | 1 - src/client/src/tscPrepare.c | 1 - src/client/src/tscSQLParser.c | 1 - src/client/src/tscServer.c | 3 +-- src/client/src/tscSql.c | 1 - src/client/src/tscStream.c | 1 - src/query/inc/sql.y | 1 - 9 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 src/client/inc/tscSQLParser.h diff --git a/src/client/inc/tscSQLParser.h b/src/client/inc/tscSQLParser.h deleted file mode 100644 index 0341b7ed03..0000000000 --- a/src/client/inc/tscSQLParser.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * 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 . - */ - -#ifndef TDENGINE_TSQL_H -#define TDENGINE_TSQL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "tsclient.h" - -int32_t tscToSQLCmd(struct SSqlObj* pSql, struct SSqlInfo* pInfo); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 0823e6175f..bf85629c86 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -26,7 +26,6 @@ extern "C" { #include "tglobalcfg.h" #include "tlog.h" #include "tscCache.h" -#include "tscSQLParser.h" #include "taosdef.h" #include "tsqlfunction.h" #include "tutil.h" @@ -444,6 +443,7 @@ char *tscGetErrorMsgPayload(SSqlCmd *pCmd); int32_t tscInvalidSQLErrMsg(char *msg, const char *additionalInfo, const char *sql); void tscQueueAsyncFreeResult(SSqlObj *pSql); +int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo); extern void * pVnodeConn; extern void * pTscMgmtConn; diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index f1630ef294..77fe942100 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -22,7 +22,6 @@ #include "tscUtil.h" #include "tsclient.h" #include "tsocket.h" -#include "tscSQLParser.h" #include "tutil.h" #include "tnote.h" #include "tsched.h" diff --git a/src/client/src/tscPrepare.c b/src/client/src/tscPrepare.c index cb991691f5..a20d7cad1c 100644 --- a/src/client/src/tscPrepare.c +++ b/src/client/src/tscPrepare.c @@ -15,7 +15,6 @@ #include "taos.h" #include "tsclient.h" -#include "tscSQLParser.h" #include "tscUtil.h" #include "ttimer.h" #include "taosmsg.h" diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 4f4b557051..d4dfba4779 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -24,7 +24,6 @@ #include "ttime.h" #include "tast.h" -#include "tscSQLParser.h" #include "tscUtil.h" #include "tschemautil.h" #include "tsclient.h" diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 18161833f8..ed905a8d54 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -18,7 +18,6 @@ #include "trpc.h" #include "tscJoinProcess.h" #include "tscProfile.h" -#include "tscSQLParser.h" #include "tscSecondaryMerge.h" #include "tscUtil.h" #include "tschemautil.h" @@ -620,7 +619,7 @@ int tscProcessSql(SSqlObj *pSql) { } return pSql->res.code; - } else if (pSql->fp == launchMultivnodeInsert) { // multi-vnodes insertion + } else if (pSql->fp == (void(*)())launchMultivnodeInsert) { // multi-vnodes insertion launchMultivnodeInsert(pSql); return pSql->res.code; } diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index eb09231578..7f385cd635 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -21,7 +21,6 @@ #include "trpc.h" #include "tscJoinProcess.h" #include "tscProfile.h" -#include "tscSQLParser.h" #include "tscSecondaryMerge.h" #include "tscUtil.h" #include "tsclient.h" diff --git a/src/client/src/tscStream.c b/src/client/src/tscStream.c index 5fd0adf5b1..d3ceb5ee84 100644 --- a/src/client/src/tscStream.c +++ b/src/client/src/tscStream.c @@ -15,7 +15,6 @@ #include "os.h" #include "tlog.h" -#include "tscSQLParser.h" #include "ttime.h" #include "ttimer.h" #include "tutil.h" diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y index 2b7e0b628c..585aa8a9cf 100644 --- a/src/query/inc/sql.y +++ b/src/query/inc/sql.y @@ -26,7 +26,6 @@ #include #include #include -#include "tscSQLParser.h" #include "tutil.h" } -- GitLab