Title: fix: walk the expressions of ALTER TABLE and ALTER DOMAIN actions by tanjiroK-coder · Pull Request #2950 · JSQLParser/JSqlParser · GitHub
Open Graph Title: fix: walk the expressions of ALTER TABLE and ALTER DOMAIN actions by tanjiroK-coder · Pull Request #2950 · JSQLParser/JSqlParser
X Title: fix: walk the expressions of ALTER TABLE and ALTER DOMAIN actions by tanjiroK-coder · Pull Request #2950 · JSQLParser/JSqlParser
Description: StatementFeatureVisitor.visit(Alter) classifies each AlterExpression by its AlterOperation (the #2894 cases) and then returns without calling super, so the DEFAULT, CHECK, USING, generated-column and partition expressions that StatementVisitorAdapter.visit(Alter) walks through TableDefinitionTraversal never reach the pure-function check; visit(AlterDomain) returns before the adapter walks the domain constraint in the same way. PostgreSQL evaluates ALTER COLUMN .. TYPE .. USING, a volatile ADD COLUMN .. DEFAULT, ADD CONSTRAINT .. CHECK and ALTER DOMAIN .. ADD CONSTRAINT .. CHECK against every row already stored while the statement runs, so ALTER TABLE t ALTER COLUMN a TYPE int USING purge_audit(a) came back as certain=[MODIFIES_SCHEMA] with mayModifyData() == false and no unresolved reference and passed the read-only guard in usage.rst, while the same call in CREATE TABLE x (a INT DEFAULT purge_audit()) or SELECT purge_audit() leaves MODIFIES_DATA possible with unresolved=[purge_audit]. I found it while probing which statement positions keep a function out of the purity check, after the SET / DECLARE (#2935) and SHOW filter (#2947) cases. Both overrides now end with super.visit(..) after their classification, the way visit(CreateTable) already does; a plain ALTER TABLE t ADD COLUMN c INT or RENAME still reports certain=[MODIFIES_SCHEMA] only, and a SET DEFAULT call is reported as possible like a CREATE TABLE default, an over-report on a statement that already modifies the schema. The new alterExpressionIsChecked cases fail before (4 failures) and pass after; spotlessCheck, Checkstyle, PMD and SpotBugs pass, and the only ./gradlew test failures locally (16672 tests) are the same 33 Mockito inline-mock-maker init errors and 2 ParserKeywordsUtilsTest AccessDeniedExceptions as on master, both environment problems on this machine.
Open Graph Description: StatementFeatureVisitor.visit(Alter) classifies each AlterExpression by its AlterOperation (the #2894 cases) and then returns without calling super, so the DEFAULT, CHECK, USING, generated-column a...
X Description: StatementFeatureVisitor.visit(Alter) classifies each AlterExpression by its AlterOperation (the #2894 cases) and then returns without calling super, so the DEFAULT, CHECK, USING, generated-column a...
Opengraph URL: https://github.com/JSQLParser/JSqlParser/pull/2950
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a6b5c7b5-8f79-1b65-e64d-0c074bc9fc56 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BAE0:14CE41:4F99CE:6F1FAA:6B044343 |
| html-safe-nonce | 63107d7611f9ad3df36e1e12a024a86a917054a9a4f62ea6fd0cb6e6b485a3eb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUUwOjE0Q0U0MTo0Rjk5Q0U6NkYxRkFBOjZCMDQ0MzQzIiwidmlzaXRvcl9pZCI6IjU4MjI0NjgzMjc4MDg5NzU2ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a88061513e7ec04c8b763881d352450a7fc87cb92769b999debe47a3f5fd615b |
| hovercard-subject-tag | pull_request:5425746369 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/JSQLParser/JSqlParser/pull/2950/files |
| twitter:image | https://avatars.githubusercontent.com/u/294423647?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/294423647?s=400&v=4 |
| og:image:alt | StatementFeatureVisitor.visit(Alter) classifies each AlterExpression by its AlterOperation (the #2894 cases) and then returns without calling super, so the DEFAULT, CHECK, USING, generated-column a... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/JSQLParser/JSqlParser git https://github.com/JSQLParser/JSqlParser.git |
| octolytics-dimension-user_id | 4643847 |
| octolytics-dimension-user_login | JSQLParser |
| octolytics-dimension-repository_id | 1944709 |
| octolytics-dimension-repository_nwo | JSQLParser/JSqlParser |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1944709 |
| octolytics-dimension-repository_network_root_nwo | JSQLParser/JSqlParser |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 06dc448a76fe4751ac1db26524aefa3aa3e889a8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width