fix: validate internal tsfile paths for files only - #18417
Open
luoluoyuyu wants to merge 7 commits into
Open
Conversation
Caideyipi
reviewed
Aug 7, 2026
| private LoadTsFileStatement( | ||
| String filePath, boolean validateSourcePath, boolean validateInternalDataDir) | ||
| throws FileNotFoundException { | ||
| if (filePath == null || filePath.isEmpty()) { |
Collaborator
There was a problem hiding this comment.
[P1] Table Model 的 LOAD 路径没有经过这里的空路径校验。
关系型解析器 AstBuilder.visitLoadTsFileStatement() 会直接构造 LoadTsFile;该类的构造函数只检查 null,随后执行 processTsFile(new File(filePath), ...)。因此关系型语法 LOAD '' 仍会把空字符串解析成进程当前工作目录,可能递归扫描并加载其中的 .tsfile(至少也不会返回本 PR 新增的“LOAD TSFILE path cannot be empty”错误)。RelationalSql.g4 的 STRING 规则允许空字符串。
请把校验抽成字符串级 helper,在 LoadTsFileStatement 和 LoadTsFile 两个入口复用,并补充 Tree/Table 两种 dialect 的 LOAD '' 回归测试。
jt2594838
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR has:
for an unfamiliar reader.
for code coverage.
Key changed/added classes (or packages if there are too many classes) in this PR