Repository navigation
*: harden schema rendering and test connections - #29
Merged
Merged
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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.
Schema metadata could change the structure of emitted SQL, connection logs exposed passwords, and both CLI entry points changed server-global SQL mode. The integration binary also replaced a hardcoded database without an opt-in.
This change quotes identifiers in AST and string builders, omits optimizer hints containing a comment terminator, and binds the schema filter used for introspection. Connection settings now use
mysql.NewConnectordirectly, so special database names cannot become DSN parameters. SQL mode is configured for every physical session, including worker connections and reconnects, withoutSUPERor a globalSET.The public SQL generation signatures and support for valid special identifiers are preserved. Password files and
SQLSMITH_PASSWORDare supported; passwords are omitted from connection logs. Empty-password instances require-allow-empty-password, remote plaintext test networks require-allow-insecure-transport, and the integration binary requires-clearand consistently honors-db. TLS verifies the CA and hostname. README includes migration examples.Also fixes schema row cleanup, CLI generator/reload synchronization, table reservation enforcement, the empty stable-function catalog, batch literal rendering, and two integration failures found during validation (empty UPDATE assignments and inverted new-table collision checks). CI uses read-only token permissions, pinned actions, no persisted checkout credentials, and a generated schema-scoped database account.
Validation:
334484cbefore changes.go test -race ./...passed against disposable MySQL 5.7.24, MySQL 8.4.8, and TiDB 8.5.7 (standalone unistore), using schema-scoped users.-clearguard, preservation of an unrelatedtestdatabase sentinel, unchanged global SQL mode, and absence of the test password in logs.go vet ./...andgit diff --checkpassed.SQLSmithremains a mutable library object: external callers must synchronize shared instances and direct access to exported schema maps. This change synchronizes the CLI's shared instance; it does not promise safe execution of arbitrary caller-constructed malformed ASTs. No dependency versions were changed.