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: allow setting parameter size to the same as the current value #7401

Merged
merged 1 commit into from
Oct 28, 2021

Conversation

olavloite
Copy link
Contributor

Some frameworks (NHibernate) will automatically set the parameter size to either the default
value (zero) or to a value that is copied from another parameter. This fails for parameters
that are not of type String or Bytes for Spanner, although there is no reason to fail in that
case, as the actual state of the parameter does not change to an invalid state. This change
makes setting the size of a parameter to the same value as the current value a no-op.

Some frameworks (NHibernate) will automatically set the parameter size to either the default
value (zero) or to a value that is copied from another parameter. This fails for parameters
that are not of type String or Bytes for Spanner, although there is no reason to fail in that
case, as the actual state of the parameter does not change to an invalid state. This change
makes setting the size of a parameter to the same value as the current value a no-op.
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 27, 2021
@olavloite olavloite marked this pull request as ready for review October 27, 2021 16:58
@olavloite olavloite requested a review from a team as a code owner October 27, 2021 16:58
Copy link
Collaborator

@jskeet jskeet left a comment

Choose a reason for hiding this comment

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

LGTM - will wait for others to have a look.

Copy link
Contributor

@amanda-tarafa amanda-tarafa left a comment

Choose a reason for hiding this comment

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

LGTM

@olavloite olavloite merged commit 9bc116d into master Oct 28, 2021
@olavloite olavloite deleted the spanner-parameter-size branch October 28, 2021 07:56
jskeet added a commit to jskeet/google-cloud-dotnet that referenced this pull request Dec 1, 2021
Changes in Google.Cloud.Spanner.Data version 3.13.0:

- [Commit 02b16d7](googleapis@02b16d7): fix: clone each SpannerParameter when cloning a parameter collection
- [Commit c653720](googleapis@c653720): feat: add support for DataReader.GetBytes ([issue 7395](googleapis#7395))
- [Commit 9bc116d](googleapis@9bc116d): fix: allow setting parameter size to the same as the current value ([issue 7401](googleapis#7401))
- [Commit 0666123](googleapis@0666123): feat: Spanner Read API

Packages in this release:
- Release Google.Cloud.Spanner.Admin.Database.V1 version 3.13.0
- Release Google.Cloud.Spanner.Admin.Instance.V1 version 3.13.0
- Release Google.Cloud.Spanner.Common.V1 version 3.13.0
- Release Google.Cloud.Spanner.Data version 3.13.0
- Release Google.Cloud.Spanner.V1 version 3.13.0
jskeet added a commit that referenced this pull request Dec 1, 2021
Changes in Google.Cloud.Spanner.Data version 3.13.0:

- [Commit 02b16d7](02b16d7): fix: clone each SpannerParameter when cloning a parameter collection
- [Commit c653720](c653720): feat: add support for DataReader.GetBytes ([issue 7395](#7395))
- [Commit 9bc116d](9bc116d): fix: allow setting parameter size to the same as the current value ([issue 7401](#7401))
- [Commit 0666123](0666123): feat: Spanner Read API

Packages in this release:
- Release Google.Cloud.Spanner.Admin.Database.V1 version 3.13.0
- Release Google.Cloud.Spanner.Admin.Instance.V1 version 3.13.0
- Release Google.Cloud.Spanner.Common.V1 version 3.13.0
- Release Google.Cloud.Spanner.Data version 3.13.0
- Release Google.Cloud.Spanner.V1 version 3.13.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants