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

sql: fix literal reparse issue with timestamps #68336

Merged
merged 1 commit into from
Aug 3, 2021

Conversation

e-mbrown
Copy link
Contributor

@e-mbrown e-mbrown commented Aug 2, 2021

Related to: #60722

There were reparse issues in multiple test when timestamps
were replaced with underscores. Making the underscore characters
strings solved the issue.

Release note: None

@e-mbrown e-mbrown requested a review from rafiss August 2, 2021 17:27
@e-mbrown e-mbrown requested a review from a team as a code owner August 2, 2021 17:27
@e-mbrown e-mbrown requested a review from a team August 2, 2021 17:27
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@e-mbrown e-mbrown force-pushed the eb/timestamp_literals branch 3 times, most recently from 78bd4cc to 39c91eb Compare August 2, 2021 17:58
Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change lgtm! but i just had a request to add a comment

@@ -1626,7 +1626,11 @@ func (node *CastExpr) Format(ctx *FmtCtx) {
if _, ok := node.Expr.(*StrVal); ok {
ctx.FormatTypeReference(node.Type)
ctx.WriteByte(' ')
ctx.FormatNode(node.Expr)
if ctx.HasFlags(FmtHideConstants) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this might need an explanatory comment.

could you add a comment saying that "we need to replace this with a quoted string constant because the grammar requires a string constant rather than an expression for this form of casting in the typed_literal rule"

| const_typename SCONST

There were reparse issues in multiple test when timestamps
were replaced with underscores. Making the underscore characters
strings solved the issue.

Release note: None
@e-mbrown e-mbrown force-pushed the eb/timestamp_literals branch from 39c91eb to 86701b2 Compare August 2, 2021 18:43
Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! i re-triggered the teamcity tests to see if they pass

@e-mbrown
Copy link
Contributor Author

e-mbrown commented Aug 3, 2021

bors r=rafiss

@craig
Copy link
Contributor

craig bot commented Aug 3, 2021

Build succeeded:

@craig craig bot merged commit 6115e79 into cockroachdb:master Aug 3, 2021
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.

3 participants