Skip to content

parser: require explicit COMPLETE refresh subtype#61

Open
windtalker wants to merge 1 commit intomv_testfrom
mv_complete_mode_required
Open

parser: require explicit COMPLETE refresh subtype#61
windtalker wants to merge 1 commit intomv_testfrom
mv_complete_mode_required

Conversation

@windtalker
Copy link
Copy Markdown
Owner

What problem does this PR solve?

Issue Number: N/A

Problem Summary:

REFRESH MATERIALIZED VIEW ... COMPLETE currently accepts an omitted subtype and implicitly falls back to COMPLETE DELTA APPLY. This change makes COMPLETE refresh require an explicit subtype.

What changed and how does it work?

  • require COMPLETE IN PLACE, COMPLETE OUT OF PLACE, or COMPLETE DELTA APPLY in the parser grammar
  • remove the old AST default complete subtype sentinel and make valid complete subtype values start from 1
  • treat zero-value COMPLETE subtype as unspecified/invalid in AST restore and mode resolution
  • update parser and AST tests to reject bare COMPLETE
  • regenerate pkg/parser/parser.go

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Test commands:

cd /Users/feixu/dev/pingcap/tidb/pkg/parser && make parser
cd /Users/feixu/dev/pingcap/tidb/pkg/parser && make fmt
cd /Users/feixu/dev/pingcap/tidb/pkg/parser && GOCACHE=/tmp/tidb-parser-gocache go test ./ast -run 'TestRefreshMaterializedViewStmt|TestRefreshMaterializedViewImplementStmt' -count=1
cd /Users/feixu/dev/pingcap/tidb/pkg/parser && GOCACHE=/tmp/tidb-parser-gocache go test . -run 'TestParser' -count=1

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Disallow `REFRESH MATERIALIZED VIEW ... COMPLETE` without an explicit subtype; users must now specify `IN PLACE`, `OUT OF PLACE`, or `DELTA APPLY`.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant