-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ticdc/owner: Fix ddl special comment syntax error (#3845) #4415
ticdc/owner: Fix ddl special comment syntax error (#3845) #4415
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
…efactor # Conflicts: # cdc/processor/pipeline/sink.go
…efactor # Conflicts: # cdc/processor/pipeline/sink.go
…3845-to-release-5.1 # Conflicts: # go.sum
…3845-to-release-5.1 # Conflicts: # go.sum
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-unit-test |
Codecov Report
@@ Coverage Diff @@
## release-5.1 #4415 +/- ##
===================================================
+ Coverage 62.1198% 62.2209% +0.1010%
===================================================
Files 161 161
Lines 16869 16885 +16
===================================================
+ Hits 10479 10506 +27
+ Misses 5491 5475 -16
- Partials 899 904 +5 |
"github.com/pingcap/tidb/parser" | ||
"github.com/pingcap/tidb/parser/format" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use pingcap/parser?
/hold Since pingcap/parser does not support |
This is an automated cherry-pick of #3845
What problem does this PR solve?
close https://github.com/pingcap/ticdc/issues/3755
What is changed and how it works?
not use regex to parse and add special TiDB comments, If a DDL already has special comment like
/*!90000 SHARD_ROW_ID_BITS=4 PRE_SPLIT_REGIONS=3 */
, it wil translate that DDL to/*!90000 /*T! SHARD_ROW_ID_BITS=4 PRE_SPLIT_REGIONS=3 */ */
, TiDB will throw a syntax error.this PR use the TiDB SQL parser to parse the SQL and the Restore it with
format.RestoreStringSingleQuotes|format.RestoreNameBackQuotes|format.RestoreKeyWordUppercase|format.RestoreTiDBSpecialComment
flagCheck List
Tests
Code changes
Side effects
Related changes
Release note