未验证 提交 a86a1691 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #2642 from taosdata/feature/pyconn

fix the shellSourceFile to set the max sql length to the value in the configuration files
......@@ -136,7 +136,7 @@ static void shellGetDirectoryFileList(char *inputDir)
static void shellSourceFile(TAOS *con, char *fptr) {
wordexp_t full_path;
int read_len = 0;
char * cmd = malloc(MAX_COMMAND_SIZE);
char * cmd = malloc(tsMaxSQLStringLen);
size_t cmd_len = 0;
char * line = NULL;
size_t line_len = 0;
......@@ -185,7 +185,7 @@ static void shellSourceFile(TAOS *con, char *fptr) {
int lineNo = 0;
while ((read_len = getline(&line, &line_len, f)) != -1) {
++lineNo;
if (read_len >= MAX_COMMAND_SIZE) continue;
if (read_len >= tsMaxSQLStringLen) continue;
line[--read_len] = '\0';
if (read_len == 0 || isCommentLine(line)) { // line starts with #
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册