提交 ebf8d765 编写于 作者: H Hui Li

[support maxSqlLen]

上级 2dbc8048
...@@ -790,7 +790,7 @@ int isCommentLine(char *line) { ...@@ -790,7 +790,7 @@ int isCommentLine(char *line) {
void source_file(TAOS *con, char *fptr) { void source_file(TAOS *con, char *fptr) {
wordexp_t full_path; wordexp_t full_path;
int read_len = 0; int read_len = 0;
char * cmd = calloc(1, MAX_COMMAND_SIZE); char * cmd = calloc(1, tsMaxSQLStringLen+1);
size_t cmd_len = 0; size_t cmd_len = 0;
char * line = NULL; char * line = NULL;
size_t line_len = 0; size_t line_len = 0;
...@@ -822,7 +822,7 @@ void source_file(TAOS *con, char *fptr) { ...@@ -822,7 +822,7 @@ void source_file(TAOS *con, char *fptr) {
} }
while ((read_len = getline(&line, &line_len, f)) != -1) { while ((read_len = getline(&line, &line_len, f)) != -1) {
if (read_len >= MAX_COMMAND_SIZE) continue; if (read_len >= tsMaxSQLStringLen) continue;
line[--read_len] = '\0'; line[--read_len] = '\0';
if (read_len == 0 || isCommentLine(line)) { // line starts with # 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.
先完成此消息的编辑!
想要评论请 注册