You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
for _, spec := range stmt.Specs {
- // Use the last defined table character set
if spec.Tp == ast.AlterTableOption {
for _, option := range spec.Options {
if option.Tp == ast.TableOptionCharset {
tableCharset = option.StrValue
- break+ // 不退出循环,确保最后出现的字符集生效
}
}
}
}
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies that the early break prevents processing all charset options, potentially ignoring later overrides, and recommends removing it to honor the comment about using the last defined charset.
for _, spec := range stmt.Specs {
- // Use the last defined table character set
if spec.Tp == ast.AlterTableOption {
for _, option := range spec.Options {
if option.Tp == ast.TableOptionCharset {
tableCharset = option.StrValue
- break+ // 不退出循环,确保最后出现的字符集生效
}
}
}
}
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies that the early break prevents processing all charset options, potentially ignoring later overrides, and recommends removing it to honor the comment about using the last defined charset.
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.
User description
关联的 issue
fix: https://github.com/actiontech/sqle-ee/issues/2405
描述你的变更
修复MySQL规则:建议列与表使用同一个字符集
确认项(pr提交后操作)
Tip
请在指定复审人之前,确认并完成以下事项,完成后✅
not_compatibleneed_update_docDescription
使用表字符集与列字符集比较替换原有检查逻辑
对 CREATE/ALTER TABLE 语句进行一致性校验
校验过程中自动获取表的默认字符集
更新测试用例确保多种字符集情况正确处理
Diagram Walkthrough
File Walkthrough
rule_00075.go
更新字符集一致性校验逻辑sqle/driver/mysql/rule/ai/rule_00075.go
rule_00075_test.go
更新测试用例以验证新字符集校验逻辑sqle/driver/mysql/rule_00075_test.go