Skip to content
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

VReplication: Handle comment statement type in vstreamer #7092

Merged
merged 1 commit into from Dec 1, 2020

Conversation

rohit-nayak-ps
Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps commented Dec 1, 2020

Closes #7089

VStreamer was treating StmtComment as an unsupported statement. This PR sends an OTHER event for comments.

Signed-off-by: Rohit Nayak rohit@planetscale.com

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@sougou sougou merged commit 9599ce5 into vitessio:master Dec 1, 2020
@sougou sougou deleted the rn-vstreamer-comment branch December 1, 2020 15:44
@deepthi
Copy link
Member

deepthi commented Dec 1, 2020

This seems like the obvious fix, but I'm puzzled as to why the error message said statement type UNKNOWN. If Preview is returning the right statement type, it should have been statement type COMMENT.

@rohit-nayak-ps
Copy link
Contributor Author

This seems like the obvious fix, but I'm puzzled as to why the error message said statement type UNKNOWN. If Preview is returning the right statement type, it should have been statement type COMMENT.

Yeah, I had the same confusion and started by adding a specific test for that comment in analyzer thinking it was a problem with the parser. I then found that the reason for the UNKNOWN type is that the comment is not an '''iStatement''': it never makes it to the AST. So a String (or %v) rendering of that StatementType ends up being UNKNOWN, though the Preview does actually return StmtComment. At least that was my interpretation and I didn't dig deeper since the simple fix worked!

@askdba askdba added this to the v9.0 milestone Dec 10, 2020
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.

vstreamer cannot handle mysql comment
5 participants