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

SNOW-755844: Pointer datatype *time.Time returns <nil> value #761

Merged
merged 1 commit into from
Mar 21, 2023

Conversation

sfc-gh-ext-simba-jl
Copy link
Collaborator

@sfc-gh-ext-simba-jl sfc-gh-ext-simba-jl commented Mar 21, 2023

Issue: https://github.com/snowflakedb/snowflake-sdks-drivers-issues-teamwork/issues/246

Starting with gosnowflake 1.6.13, the use of a pointer *time.Time type in user-defined structures used to perform updates/inserts has silently stopped working, and nil value is used instead of the value it points to.
This PR fixes the regression introduced by PR #642. All array binding insertion using []interface{} will now be wrapped in the interfaceArrayBinding struct, instead of assuming them as the reflect.Slice and reflect.Struct types.

type interfaceArrayBinding struct {
	hasTimezone       bool
	tzType            timezoneType
	timezoneTypeArray interface{}
}

Checklist

  • Code compiles correctly
  • Run make fmt to fix inconsistent formats
  • Run make lint to get lint errors and fix all of them
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary

Sorry, something went wrong.

… user-defined struct to perform updates/inserts
@sfc-gh-ext-simba-jl sfc-gh-ext-simba-jl force-pushed the SNOW-755844-time-ptr-return-nil branch from ecac65a to f2a6775 Compare March 21, 2023 05:19
@sfc-gh-ext-simba-jl sfc-gh-ext-simba-jl marked this pull request as ready for review March 21, 2023 05:48
@sfc-gh-ext-simba-jl sfc-gh-ext-simba-jl requested a review from a team as a code owner March 21, 2023 05:48
@sfc-gh-ext-simba-jl sfc-gh-ext-simba-jl changed the title Fixed regression regarding to the use of a pointer *time.Time type in… SNOW-755844: Pointer datatype *time.Time returns <nil> value Mar 21, 2023
Copy link
Collaborator

@sfc-gh-igarish sfc-gh-igarish left a comment

Choose a reason for hiding this comment

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

LGTM

@sfc-gh-ext-simba-jl sfc-gh-ext-simba-jl merged commit 976d9cd into master Mar 21, 2023
@sfc-gh-ext-simba-jl sfc-gh-ext-simba-jl deleted the SNOW-755844-time-ptr-return-nil branch March 21, 2023 17:11
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants