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

Report non-decimal integer literals #2217

Merged
merged 12 commits into from
Jan 23, 2025

Conversation

priyanshi-yb
Copy link
Contributor

@priyanshi-yb priyanshi-yb commented Jan 21, 2025

Describe the changes in this pull request

Fixes #1982
Report the non-decimal integer literals wherever possible in DDL, DML and PLPGSQL.

Describe if there are any user-facing changes

New Feature - Non-decimal integer literal

How was this pull request tested?

Added new unit and end-to-end tests

Does your PR have changes that can cause upgrade issues?

Component Breaking changes?
MetaDB No
Name registry json No
Data File Descriptor Json No
Export Snapshot Status Json No
Import Data State No
Export Status Json No
Data .sql files of tables No
Export and import data queue No
Schema Dump No
AssessmentDB No
Sizing DB No
Migration Assessment Report Json No
Callhome Json No
YugabyteD Tables No
TargetDB Metadata Tables No

@priyanshi-yb priyanshi-yb requested review from sanyamsinghal and makalaaneesh and removed request for sanyamsinghal January 22, 2025 14:09
@priyanshi-yb priyanshi-yb marked this pull request as ready for review January 22, 2025 14:10
return err
}
/*
Caveats can't report this issue for cases like -
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's also add a comment explaining where this is useful then - i guess only plpgsql objects?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah majorly plpgsql in normal cases, will add a comment


*/
switch {
case aConstNode.GetFval() != nil:
Copy link
Collaborator

Choose a reason for hiding this comment

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

pls add a comment explaining what fval is. (I'm assuming that it means FloatVal)
Why aren't we checking IVal(Integer value)? Why would these be represented as floats, not integers 🤔

Copy link
Contributor Author

@priyanshi-yb priyanshi-yb Jan 23, 2025

Choose a reason for hiding this comment

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

yes it's a float val, I am also not sure why this non-decimal integers are coming in fval and not ival but I have only seen cases where ival has decimal integers only.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comments, will understand the internals why this is happening

assert.Equal(t, 1, len(issues))
cmp.Equal(issues[0], expectedIssue)
}
sqlsWithoutIssues := []string{
Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks for adding these negative tests. very useful 👍

Copy link
Collaborator

@makalaaneesh makalaaneesh left a comment

Choose a reason for hiding this comment

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

LGTM

@priyanshi-yb priyanshi-yb merged commit 7a68e5e into main Jan 23, 2025
68 checks passed
@priyanshi-yb priyanshi-yb deleted the priyanshi/non-decimal-integer-literals branch January 23, 2025 11:58
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.

Report non-decimal integer literals as unsupported
2 participants