From b0ff31e1a276c131960205364beff44d91fe70a4 Mon Sep 17 00:00:00 2001 From: freemine Date: Sun, 18 Oct 2020 14:18:15 +0800 Subject: [PATCH] remove obsolete code --- src/CMakeLists.txt | 2 +- src/connector/odbc/src/todbc.c | 24 ++---------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f619edd221..b2c6e70f68 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,5 +21,5 @@ ADD_SUBDIRECTORY(wal) ADD_SUBDIRECTORY(cq) ADD_SUBDIRECTORY(dnode) ADD_SUBDIRECTORY(connector/odbc) -ADD_SUBDIRECTORY(connector/jdbc) +#ADD_SUBDIRECTORY(connector/jdbc) diff --git a/src/connector/odbc/src/todbc.c b/src/connector/odbc/src/todbc.c index 518c98b41f..46d10fd980 100644 --- a/src/connector/odbc/src/todbc.c +++ b/src/connector/odbc/src/todbc.c @@ -1771,7 +1771,7 @@ static SQLRETURN do_bind_batch(sql_t *sql, int idx_row, TAOS_BIND *binds) return SQL_SUCCESS; } -static SQLRETURN do_execute(sql_t *sql, TAOS_BIND *x_binds) +static SQLRETURN do_execute(sql_t *sql) { int tr = TSDB_CODE_SUCCESS; if (sql->n_rows==0) sql->n_rows = 1; @@ -1836,27 +1836,7 @@ static SQLRETURN doSQLExecute(SQLHSTMT StatementHandle) sql->row = NULL; } - TAOS_BIND *binds = NULL; - if (sql->n_params>0) { - binds = (TAOS_BIND*)calloc(sql->n_params, sizeof(*binds)); - if (!binds) { - SET_ERROR(sql, "HY001", TSDB_CODE_ODBC_OOM, ""); - return SQL_ERROR; - } - } - - SQLRETURN r = do_execute(sql, binds); - - if (binds) { - for (int i = 0; in_params; ++i) { - TAOS_BIND *bind = binds + i; - if (bind->allocated) { - free(bind->u.nchar); - bind->u.nchar = NULL; - } - } - free(binds); - } + SQLRETURN r = do_execute(sql); return r; } -- GitLab