Skip to content

Conversation

@yuluo-yx
Copy link
Contributor

Closes #4565

Copilot AI review requested due to automatic review settings January 16, 2026 15:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces automatic escaping of special characters (backslash, percent, and underscore) in all WhereLike and WhereNotLike methods across the database ORM layer to prevent SQL injection and unintended wildcard behavior in LIKE queries.

Changes:

  • Added EscapeLikeString function to escape special characters (\, %, _) in LIKE operations
  • Updated all WhereLike and WhereNotLike methods to automatically escape input strings
  • Modified both regular Where and WhereOr variants, including their prefix versions

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
database/gdb/gdb_func.go Added EscapeLikeString function with documentation for escaping LIKE special characters
database/gdb/gdb_model_builder_where.go Updated WhereLike and WhereNotLike to use automatic escaping
database/gdb/gdb_model_builder_where_prefix.go Updated WherePrefixLike and WherePrefixNotLike to use automatic escaping
database/gdb/gdb_model_builder_whereor.go Updated WhereOrLike and WhereOrNotLike to use automatic escaping
database/gdb/gdb_model_builder_whereor_prefix.go Updated WhereOrPrefixLike and WhereOrPrefixNotLike to use automatic escaping

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…l characters in the WhereLike method.

Signed-off-by: yuluo-yx <[email protected]>
@yuluo-yx yuluo-yx force-pushed the 0116-yuluo/feat-whereLike branch from 85b7593 to 921f241 Compare January 17, 2026 13:15
Copilot AI review requested due to automatic review settings January 17, 2026 13:43
Signed-off-by: yuluo-yx <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: yuluo-yx <[email protected]>
@yuluo-yx yuluo-yx force-pushed the 0116-yuluo/feat-whereLike branch from b773c75 to 2348697 Compare January 17, 2026 14:02
@gqcn gqcn added feature missing unit testing cases Used in PR, the associated unit testing cases should be committed. labels Jan 21, 2026
@gqcn gqcn changed the title feat(database/gdb): Improved automatic escaping of special characters in WhereLike method feat(database/gdb): improved automatic escaping of special characters in WhereLike method Jan 21, 2026
Signed-off-by: yuluo-yx <[email protected]>
Copilot AI review requested due to automatic review settings January 22, 2026 12:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature missing unit testing cases Used in PR, the associated unit testing cases should be committed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

增强 WhereLike 方法对特殊字符的自动转义支持

2 participants