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

Numeric: fix scale check for bqnumeric #1723

Merged
merged 3 commits into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions flow/datatypes/numeric.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ func (BigQueryNumericCompatibility) MaxPrecision() int16 {
}

func (BigQueryNumericCompatibility) MaxScale() int16 {
return 37
return 20
}

func (BigQueryNumericCompatibility) DefaultPrecisionAndScale() (int16, int16) {
return PeerDBBigQueryPrecision, PeerDBBigQueryScale
}

func (BigQueryNumericCompatibility) IsValidPrevisionAndScale(precision, scale int16) bool {
return precision > 0 && precision <= 38 && scale < precision
return precision > 0 && precision <= 38 && scale <= 20 && scale < precision
}

type DefaultNumericCompatibility struct{}
Expand Down
Loading