fix(plugins): view quoting, SQL injection, pagination, and misc SQL fixes#1926
Open
HandSonic wants to merge 6 commits into
Open
fix(plugins): view quoting, SQL injection, pagination, and misc SQL fixes#1926HandSonic wants to merge 6 commits into
HandSonic wants to merge 6 commits into
Conversation
…ent SQL - View name was quoted with backticks (MySQL syntax) instead of double quotes - Comment SQL was missing DOT separator between schema and view name, producing "schema""view" instead of "schema"."view"
View name was quoted with backticks (MySQL syntax) instead of square brackets (SQL Server syntax).
View comment SQL was missing DOT between schema and view name identifiers, producing "SCOTT""MY_VIEW" instead of "SCOTT"."MY_VIEW".
tableName was concatenated directly into SQL without escaping. Table names
containing single quotes (e.g. O'Brien) would break SQL syntax or allow
injection. Now escapes single quotes with replace("'", "''").
When offset==0 (first page), the outer SELECT * FROM (...) wrapper was skipped, leaking CAHT2DB_AUTO_ROW_ID into the result set. Now both wrappers are always applied for consistent column schema across pages.
- Arrays.asList() was empty, making TIMESTAMP precision block dead code.
Now uses Arrays.asList('TIMESTAMP') to enable the code path.
- RENAME_COLUMN_SCRIPT parameters now use square bracket quoting for
names with spaces or reserved words.
- COLUMN_MODIFY_COMMENT_SCRIPT now ends with 'go\n' (with trailing
newline) so the batch separator is recognized when concatenated.
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.
Summary
Fixes 6 verified bugs across PostgreSQL, SQL Server, and Oracle database plugins.
Fixes included:
replace("'", "''")Arrays.asList()→Arrays.asList("TIMESTAMP")), GO separator trailing newline, rename script bracket quoting