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

Fix SQL corresponding type for Java long #479

Closed
wants to merge 1 commit into from
Closed

Fix SQL corresponding type for Java long #479

wants to merge 1 commit into from

Conversation

pgentile
Copy link

@pgentile pgentile commented Aug 16, 2022

Pull Request Checklist

Fixes

Fixes #478

Purpose

Fixes ParameterMetaData for Long type. Long should be represented by the SQL BIGINT type.

Background Context

I saw this behavior because it broke an optimized query.

References

None

@@ -121,7 +121,7 @@ object ParameterMetaData extends JavaTimeParameterMetaData {
/** Numeric (big integer) parameter meta data */
implicit object BigIntParameterMetaData extends ParameterMetaData[BigInt] {
val sqlType = "NUMERIC"
val jdbcType = Types.BIGINT
val jdbcType = Types.NUMERIC
Copy link
Member

Choose a reason for hiding this comment

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

That's specific to Pg, so must not be defined there

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

I've removed the change. The problem I have noticed occurs only with long types.

@@ -121,7 +121,7 @@ object ParameterMetaData extends JavaTimeParameterMetaData {
/** Numeric (big integer) parameter meta data */
implicit object BigIntParameterMetaData extends ParameterMetaData[BigInt] {
val sqlType = "NUMERIC"
val jdbcType = Types.BIGINT
val jdbcType = Types.NUMERIC
Copy link
Member

Choose a reason for hiding this comment

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

@pgentile pgentile changed the title Fix corresponding types for BigInt and Long Fix SQL corresponding type for Java long Aug 16, 2022
@@ -130,13 +130,13 @@ object ParameterMetaData extends JavaTimeParameterMetaData {
}

implicit object LongParameterMetaData extends ParameterMetaData[Long] {
val sqlType = BigIntParameterMetaData.sqlType
val jdbcType = BigIntParameterMetaData.jdbcType
val sqlType = "BIGINT"
Copy link
Member

Choose a reason for hiding this comment

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

Same, specific to PG, so should not happen there

@pgentile pgentile closed this by deleting the head repository Feb 22, 2023
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.

Invalid SQL type computed for Java array prepared statement parameters
2 participants